mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-04 20:42:52 +00:00
refactor: move core to monorepo
This commit is contained in:
53
packages/core/test/compat.spec.ts
Normal file
53
packages/core/test/compat.spec.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2021 StApps
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {lightweightProjectFromPath} from '@openstapps/core-tools/lib/easy-ast/easy-ast';
|
||||
import {LightweightProject} from '@openstapps/core-tools/lib/easy-ast/types/lightweight-project';
|
||||
import {expect} from 'chai';
|
||||
import {reduce} from 'lodash';
|
||||
|
||||
process.on('unhandledRejection', err => {
|
||||
throw err;
|
||||
});
|
||||
|
||||
describe('Mapping Compatibility', () => {
|
||||
let project: LightweightProject;
|
||||
|
||||
before(function () {
|
||||
this.timeout(15000);
|
||||
this.slow(10000);
|
||||
|
||||
project = lightweightProjectFromPath('src');
|
||||
});
|
||||
|
||||
it('non-exported definitions should not have duplicate names across files', () => {
|
||||
reduce(
|
||||
project,
|
||||
(result, file) =>
|
||||
reduce(
|
||||
file,
|
||||
(result2, _, key) => {
|
||||
expect(result2[key]).to.be.undefined;
|
||||
return {
|
||||
[key]: true,
|
||||
...result2,
|
||||
};
|
||||
},
|
||||
result,
|
||||
),
|
||||
{} as Record<string, boolean>,
|
||||
);
|
||||
});
|
||||
});
|
||||
154
packages/core/test/features.spec.ts
Normal file
154
packages/core/test/features.spec.ts
Normal file
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* 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 {
|
||||
isLightweightClass,
|
||||
isLightweightEnum,
|
||||
isUnionType,
|
||||
} from '@openstapps/core-tools/lib/easy-ast/ast-util';
|
||||
import {LightweightAliasDefinition} from '@openstapps/core-tools/lib/easy-ast/types/lightweight-alias-definition';
|
||||
import {LightweightProjectWithIndex} from '@openstapps/core-tools/lib/easy-ast/types/lightweight-project';
|
||||
import {LightweightType} from '@openstapps/core-tools/lib/easy-ast/types/lightweight-type';
|
||||
import {LightweightClassDefinition} from '@openstapps/core-tools/src/easy-ast/types/lightweight-class-definition';
|
||||
import {LightweightDefinition} from '@openstapps/core-tools/src/easy-ast/types/lightweight-definition';
|
||||
import {LightweightProperty} from '@openstapps/core-tools/src/easy-ast/types/lightweight-property';
|
||||
import {expect} from 'chai';
|
||||
import {assign, chain, clone, flatMap, isNil, reduce, reject, some} from 'lodash';
|
||||
|
||||
process.on('unhandledRejection', err => {
|
||||
throw err;
|
||||
});
|
||||
|
||||
describe('Features', () => {
|
||||
let project: LightweightProjectWithIndex;
|
||||
let thingNames: string[];
|
||||
let things: LightweightClassDefinition[];
|
||||
let thingsWithoutReferences: LightweightClassDefinition[];
|
||||
|
||||
before(function () {
|
||||
this.timeout(15000);
|
||||
this.slow(10000);
|
||||
|
||||
project = new LightweightProjectWithIndex('src');
|
||||
|
||||
const thingsReflection = project.definitions['SCIndexableThings'] as LightweightAliasDefinition;
|
||||
expect(isLightweightEnum(thingsReflection)).to.be.true;
|
||||
expect(isUnionType(thingsReflection.type!)).to.be.true;
|
||||
|
||||
thingsReflection.type!.specificationTypes!.push({
|
||||
flags: 524_288,
|
||||
referenceName: 'SCDiff',
|
||||
});
|
||||
|
||||
expect(
|
||||
thingsReflection.type?.specificationTypes?.every(it => typeof it.referenceName !== 'undefined'),
|
||||
).to.be.true;
|
||||
thingNames = thingsReflection.type?.specificationTypes?.map(type => type.referenceName!) ?? [];
|
||||
things = thingNames.map(it => project.definitions[it]).filter(isLightweightClass);
|
||||
thingsWithoutReferences = thingNames
|
||||
.map(it => project.definitions[`${it}WithoutReferences`])
|
||||
.filter(isLightweightClass);
|
||||
});
|
||||
|
||||
const inheritedProperties = function (
|
||||
classLike: LightweightClassDefinition,
|
||||
): Record<string, LightweightProperty> | undefined {
|
||||
return reduce(
|
||||
[...(classLike.implementedDefinitions ?? []), ...(classLike.extendedDefinitions ?? [])],
|
||||
(obj, extension) => {
|
||||
const object = project.definitions[extension.referenceName ?? ''];
|
||||
|
||||
return assign(obj, isLightweightClass(object) ? inheritedProperties(object) : obj);
|
||||
},
|
||||
clone(classLike.properties),
|
||||
);
|
||||
};
|
||||
|
||||
it('should have an origin', () => {
|
||||
for (const thing of things) {
|
||||
expect(inheritedProperties(thing)?.['origin']).not.to.be.undefined;
|
||||
}
|
||||
});
|
||||
|
||||
it('should not have duplicate names', () => {
|
||||
reduce(
|
||||
project.files,
|
||||
(fileResult, file) =>
|
||||
reduce(
|
||||
file,
|
||||
(definitionResult, definition: LightweightDefinition) => {
|
||||
expect(definitionResult[definition.name]).to.be.undefined;
|
||||
definitionResult[definition.name] = true; // something that's not undefined
|
||||
|
||||
return definitionResult;
|
||||
},
|
||||
fileResult,
|
||||
),
|
||||
{} as Record<string, true>,
|
||||
);
|
||||
});
|
||||
|
||||
it('should not have properties referencing SCThing', () => {
|
||||
const allPropertyReferenceNames: (property: LightweightProperty) => string[] = property =>
|
||||
reject(
|
||||
[property.type.referenceName!, ...flatMap(property.properties, allPropertyReferenceNames)],
|
||||
isNil,
|
||||
);
|
||||
|
||||
const typeHasSCThingReferences: (type?: LightweightType) => boolean = type =>
|
||||
type?.referenceName
|
||||
? hasSCThingReferences(project.definitions[type.referenceName])
|
||||
: some(type?.specificationTypes, typeHasSCThingReferences);
|
||||
|
||||
const hasSCThingReferences: (definition?: LightweightDefinition) => boolean = definition =>
|
||||
isLightweightClass(definition)
|
||||
? chain(inheritedProperties(definition))
|
||||
.flatMap(it => flatMap(it.properties, allPropertyReferenceNames))
|
||||
.map(it => project.definitions[it] as LightweightDefinition)
|
||||
.some(it => it.name === 'SCThing' || hasSCThingReferences(it))
|
||||
.value()
|
||||
: definition
|
||||
? typeHasSCThingReferences(definition.type)
|
||||
: false;
|
||||
|
||||
for (const thing of things) {
|
||||
expect(hasSCThingReferences(thing)).to.be.false;
|
||||
}
|
||||
});
|
||||
|
||||
function extendsSCThing(definition?: LightweightDefinition): boolean {
|
||||
return isLightweightClass(definition)
|
||||
? chain([
|
||||
...((definition as LightweightClassDefinition).extendedDefinitions ?? []),
|
||||
...((definition as LightweightClassDefinition).implementedDefinitions ?? []),
|
||||
])
|
||||
.map(it => it.referenceName)
|
||||
.reject(isNil)
|
||||
.some(it => it === 'SCThing' || extendsSCThing(project.definitions[it!]))
|
||||
.value()
|
||||
: false;
|
||||
}
|
||||
|
||||
it('should extend SCThing if it is an SCThing', () => {
|
||||
for (const thing of things) {
|
||||
expect(extendsSCThing(thing)).to.be.true;
|
||||
}
|
||||
});
|
||||
|
||||
it('should not extend SCThing if it is an SCThingWithoutReferences', () => {
|
||||
for (const thingWithoutReferences of thingsWithoutReferences) {
|
||||
expect(extendsSCThing(thingWithoutReferences)).to.be.false;
|
||||
}
|
||||
});
|
||||
});
|
||||
137
packages/core/test/guards.spec.ts
Normal file
137
packages/core/test/guards.spec.ts
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright (C) 2018, 2019 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 {slow, suite, test, timeout} from '@testdeck/mocha';
|
||||
import {expect} from 'chai';
|
||||
import {
|
||||
isBulkResponse,
|
||||
isMultiSearchResponse,
|
||||
isSearchResponse,
|
||||
isThing,
|
||||
isThingWithTranslations,
|
||||
} from '../src/guards';
|
||||
import {SCBulkResponse} from '../src/protocol/routes/bulk-request';
|
||||
import {SCSearchResponse} from '../src/protocol/routes/search';
|
||||
import {SCMultiSearchResponse} from '../src/protocol/routes/search-multi';
|
||||
import {SCThingOriginType, SCThingType} from '../src/things/abstract/thing';
|
||||
import {SCDish} from '../src/things/dish';
|
||||
|
||||
@suite(timeout(10000), slow(5000))
|
||||
export class GuardsSpec {
|
||||
static bulkResponse: SCBulkResponse = {
|
||||
expiration: '2009-06-30T18:30:00+02:00 ',
|
||||
source: 'bar',
|
||||
state: 'done',
|
||||
type: SCThingType.Dish,
|
||||
uid: 'foo',
|
||||
};
|
||||
|
||||
static dishWithTranslation: SCDish = {
|
||||
categories: ['appetizer'],
|
||||
name: 'foo',
|
||||
origin: {
|
||||
created: '',
|
||||
type: SCThingOriginType.User,
|
||||
},
|
||||
translations: {
|
||||
de: {
|
||||
name: 'Foo',
|
||||
},
|
||||
},
|
||||
type: SCThingType.Dish,
|
||||
uid: 'bar',
|
||||
};
|
||||
|
||||
static notADish = {
|
||||
categories: ['appetizer'],
|
||||
name: 'foo',
|
||||
origin: {
|
||||
created: '',
|
||||
type: SCThingOriginType.User,
|
||||
},
|
||||
type: 'foobar',
|
||||
uid: 'bar',
|
||||
};
|
||||
|
||||
static searchResponse: SCSearchResponse = {
|
||||
data: [GuardsSpec.dishWithTranslation],
|
||||
facets: [
|
||||
{
|
||||
buckets: [
|
||||
{
|
||||
count: 1,
|
||||
key: 'key',
|
||||
},
|
||||
],
|
||||
field: 'field',
|
||||
},
|
||||
],
|
||||
pagination: {
|
||||
count: 1,
|
||||
offset: 0,
|
||||
total: 1,
|
||||
},
|
||||
stats: {
|
||||
time: 1,
|
||||
},
|
||||
};
|
||||
|
||||
@test
|
||||
public isBulkResponse() {
|
||||
expect(isBulkResponse(null)).to.be.equal(false);
|
||||
expect(isBulkResponse(GuardsSpec.dishWithTranslation)).to.be.equal(false);
|
||||
expect(isBulkResponse(GuardsSpec.bulkResponse)).to.be.equal(true);
|
||||
}
|
||||
|
||||
@test
|
||||
public isMultiSearchResponse() {
|
||||
const multiSearchResponse: SCMultiSearchResponse = {
|
||||
foo: GuardsSpec.searchResponse,
|
||||
};
|
||||
expect(isMultiSearchResponse(multiSearchResponse)).to.be.equal(true);
|
||||
const notAMultiSearchResponse = {...multiSearchResponse, ...{bar: 'baz'}};
|
||||
expect(isMultiSearchResponse(notAMultiSearchResponse)).to.be.equal(false);
|
||||
delete multiSearchResponse.foo;
|
||||
expect(isMultiSearchResponse(multiSearchResponse)).to.be.equal(false);
|
||||
}
|
||||
|
||||
@test
|
||||
public isSearchResponse() {
|
||||
const notASearchResponse = {...GuardsSpec.searchResponse};
|
||||
// @ts-ignore
|
||||
delete notASearchResponse.pagination;
|
||||
expect(isSearchResponse(notASearchResponse)).to.be.equal(false);
|
||||
// @ts-ignore
|
||||
delete notASearchResponse.data;
|
||||
expect(isSearchResponse(notASearchResponse)).to.be.equal(false);
|
||||
expect(isSearchResponse(null)).to.be.equal(false);
|
||||
expect(isSearchResponse(GuardsSpec.searchResponse)).to.be.equal(true);
|
||||
}
|
||||
|
||||
@test
|
||||
public isThing() {
|
||||
expect(isThing('foo')).to.be.equal(false);
|
||||
expect(isThing({type: 'foo'})).to.be.equal(false);
|
||||
expect(isThing(GuardsSpec.notADish)).to.be.equal(false);
|
||||
expect(isThing(GuardsSpec.dishWithTranslation)).to.be.equal(true);
|
||||
}
|
||||
|
||||
@test
|
||||
public isThingWithTranslations() {
|
||||
const dishWithoutTranslation = {...GuardsSpec.dishWithTranslation};
|
||||
delete dishWithoutTranslation.translations;
|
||||
expect(isThingWithTranslations(dishWithoutTranslation)).to.be.equal(false);
|
||||
expect(isThingWithTranslations(GuardsSpec.dishWithTranslation)).to.be.equal(true);
|
||||
}
|
||||
}
|
||||
34
packages/core/test/resources/Assessment.1.json
Normal file
34
packages/core/test/resources/Assessment.1.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"attempt": 1,
|
||||
"date": "2020-04-01",
|
||||
"ects": 20,
|
||||
"grade": "N/A",
|
||||
"status": "ongoing",
|
||||
"uid": "681a59a1-23c2-5d78-861a-8c86a3abf404",
|
||||
"name": "Introductory courses extreme math",
|
||||
"categories": ["university assessment"],
|
||||
"courseOfStudy": {
|
||||
"academicDegree": "bachelor",
|
||||
"academicDegreewithField": "Bachelor of Arts",
|
||||
"academicDegreewithFieldShort": "B.A.",
|
||||
"mainLanguage": {
|
||||
"code": "de",
|
||||
"name": "german"
|
||||
},
|
||||
"mode": "dual",
|
||||
"name": "Astroturfing",
|
||||
"timeMode": "parttime",
|
||||
"type": "course of study",
|
||||
"uid": "4c6f0a18-343d-5175-9fb1-62d28545c2aa"
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2020-04-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
},
|
||||
"type": "assessment"
|
||||
},
|
||||
"schema": "SCAssessment"
|
||||
}
|
||||
47
packages/core/test/resources/Assessment.2.json
Normal file
47
packages/core/test/resources/Assessment.2.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"attempt": 1,
|
||||
"date": "2020-04-01",
|
||||
"ects": 6,
|
||||
"grade": "very much 1.0",
|
||||
"status": "passed",
|
||||
"uid": "681a59a1-23c2-5d78-861a-8c86a3abf303",
|
||||
"name": "Mathe 9001",
|
||||
"categories": ["university assessment"],
|
||||
"superAssessments": [
|
||||
{
|
||||
"attempt": 1,
|
||||
"date": "2020-04-01",
|
||||
"ects": 20,
|
||||
"grade": "N/A",
|
||||
"status": "ongoing",
|
||||
"uid": "681a59a1-23c2-5d78-861a-8c86a3abf404",
|
||||
"name": "Introductory courses extreme math",
|
||||
"categories": ["university assessment"],
|
||||
"type": "assessment"
|
||||
}
|
||||
],
|
||||
"courseOfStudy": {
|
||||
"academicDegree": "bachelor",
|
||||
"academicDegreewithField": "Bachelor of Arts",
|
||||
"academicDegreewithFieldShort": "B.A.",
|
||||
"mainLanguage": {
|
||||
"code": "de",
|
||||
"name": "german"
|
||||
},
|
||||
"mode": "dual",
|
||||
"name": "Astroturfing",
|
||||
"timeMode": "parttime",
|
||||
"type": "course of study",
|
||||
"uid": "4c6f0a18-343d-5175-9fb1-62d28545c2aa"
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2020-04-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
},
|
||||
"type": "assessment"
|
||||
},
|
||||
"schema": "SCAssessment"
|
||||
}
|
||||
37
packages/core/test/resources/Diff.1.json
Normal file
37
packages/core/test/resources/Diff.1.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "a5acde0d-18c4-5511-9f86-aabf2a530f91",
|
||||
"dateCreated": "2017-02-07T09:26:35.957Z",
|
||||
"name": "changed_testuid",
|
||||
"changes": [
|
||||
{
|
||||
"op": "replace",
|
||||
"path": "/name",
|
||||
"value": "Name Two"
|
||||
}
|
||||
],
|
||||
"action": "changed",
|
||||
"type": "diff",
|
||||
"object": {
|
||||
"uid": "072db1e5-e479-5040-88e0-4a98d731e443",
|
||||
"name": "Name One",
|
||||
"type": "message",
|
||||
"messageBody": "Message",
|
||||
"audiences": ["students"],
|
||||
"categories": ["news"],
|
||||
"sequenceIndex": 1010,
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCDiff"
|
||||
}
|
||||
37
packages/core/test/resources/Diff.2.json
Normal file
37
packages/core/test/resources/Diff.2.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "f71cc2c8-fef2-59ee-af0a-511cc75e7471",
|
||||
"dateCreated": "2017-03-07T09:26:35.957Z",
|
||||
"name": "changed_testuid",
|
||||
"changes": [
|
||||
{
|
||||
"op": "replace",
|
||||
"path": "/name",
|
||||
"value": "bar"
|
||||
}
|
||||
],
|
||||
"action": "changed",
|
||||
"type": "diff",
|
||||
"object": {
|
||||
"uid": "072db1e5-e479-5040-88e0-4a98d731e443",
|
||||
"name": "Name One",
|
||||
"type": "message",
|
||||
"messageBody": "Message",
|
||||
"audiences": ["students"],
|
||||
"categories": ["news"],
|
||||
"sequenceIndex": 1020,
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCDiff"
|
||||
}
|
||||
75
packages/core/test/resources/Favorite.json
Normal file
75
packages/core/test/resources/Favorite.json
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "favorite",
|
||||
"name": "Favorite #1",
|
||||
"uid": "3af3ccaa-f066-5eff-9a3d-a70567f3d70d",
|
||||
"data": {
|
||||
"type": "academic event",
|
||||
"description": "Fortsetzung der Algebra I: Galoistheorie mit Anwendungen, ausgewählte Spezialthemen.",
|
||||
"uid": "681a59a1-23c2-5d78-861a-8c86a3abf2b9",
|
||||
"name": "Algebra II",
|
||||
"categories": ["lecture"],
|
||||
"academicTerms": [
|
||||
{
|
||||
"uid": "aacd5611-b5be-54ce-b39f-c52f7e9a631d",
|
||||
"type": "semester",
|
||||
"name": "Sommersemester 2018",
|
||||
"acronym": "SS 2018",
|
||||
"alternateNames": ["SoSe 2018"],
|
||||
"startDate": "2018-04-01",
|
||||
"endDate": "2018-09-30",
|
||||
"eventsStartDate": "2018-04-09",
|
||||
"eventsEndDate": "2018-07-13"
|
||||
}
|
||||
],
|
||||
"performers": [
|
||||
{
|
||||
"type": "person",
|
||||
"uid": "7f8ce700-2679-51a5-86b5-3dfba85a33ff",
|
||||
"givenName": "Peter",
|
||||
"familyName": "Bürgisser",
|
||||
"gender": "male",
|
||||
"honorificPrefix": "Prof. Dr.",
|
||||
"name": "Peter Bürgisser"
|
||||
}
|
||||
],
|
||||
"majors": [
|
||||
"Mathematik D",
|
||||
"Mathematik L2",
|
||||
"Mathematik StRGym",
|
||||
"Mathematik StRBeruf",
|
||||
"Mathematik BSc",
|
||||
"Mathematik MSc"
|
||||
],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote",
|
||||
"maintainer": {
|
||||
"type": "organization",
|
||||
"name": "tubIT",
|
||||
"uid": "25f76840-db89-5da2-a8a2-75992f637613"
|
||||
},
|
||||
"modified": "2018-09-01T10:00:00Z",
|
||||
"originalId": "foo bar",
|
||||
"responsibleEntity": {
|
||||
"type": "person",
|
||||
"uid": "7f8ce700-2679-51a5-86b5-3dfba85a33ff",
|
||||
"givenName": "Peter",
|
||||
"familyName": "Bürgisser",
|
||||
"gender": "male",
|
||||
"honorificPrefix": "Prof. Dr.",
|
||||
"name": "Peter Bürgisser"
|
||||
}
|
||||
}
|
||||
},
|
||||
"origin": {
|
||||
"created": "2018-09-11T12:30:00Z",
|
||||
"deleted": false,
|
||||
"type": "user",
|
||||
"updated": "2018-12-11T12:30:00Z"
|
||||
}
|
||||
},
|
||||
"schema": "SCFavorite"
|
||||
}
|
||||
66
packages/core/test/resources/PluginRegisterRequest.1.json
Normal file
66
packages/core/test/resources/PluginRegisterRequest.1.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"action": "add",
|
||||
"plugin": {
|
||||
"address": "http://foo.com:1234",
|
||||
"name": "Foo Plugin",
|
||||
"requestSchema": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"SCFooPluginRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"query": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["query"],
|
||||
"additionalProperties": false,
|
||||
"description": "User query"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"query": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["query"],
|
||||
"additionalProperties": false,
|
||||
"description": "User query",
|
||||
"$id": "https://core.stapps.tu-berlin.de/v0.18.0/lib/schema/SCFooPluginRequest.json"
|
||||
},
|
||||
"responseSchema": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"SCFooPluginResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"result": {
|
||||
"type": "array",
|
||||
"items": {}
|
||||
}
|
||||
},
|
||||
"required": ["result"],
|
||||
"additionalProperties": false,
|
||||
"description": "A response to a query"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"result": {
|
||||
"type": "array",
|
||||
"items": {}
|
||||
}
|
||||
},
|
||||
"required": ["result"],
|
||||
"additionalProperties": false,
|
||||
"description": "A response to a query",
|
||||
"$id": "https://core.stapps.tu-berlin.de/v0.18.0/lib/schema/SCFooPluginResponse.json"
|
||||
},
|
||||
"route": "/foo"
|
||||
}
|
||||
},
|
||||
"schema": "SCPluginRegisterRequest"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"action": "remove",
|
||||
"route": "/foo"
|
||||
},
|
||||
"schema": "SCPluginRegisterRequest"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"success": true
|
||||
},
|
||||
"schema": "SCPluginRegisterResponse"
|
||||
}
|
||||
38
packages/core/test/resources/SearchRequest.1.json
Normal file
38
packages/core/test/resources/SearchRequest.1.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"query": "*",
|
||||
"context": "default",
|
||||
"filter": {
|
||||
"arguments": {
|
||||
"filters": [
|
||||
{
|
||||
"arguments": {
|
||||
"field": "type",
|
||||
"value": "dish"
|
||||
},
|
||||
"type": "value"
|
||||
},
|
||||
{
|
||||
"arguments": {
|
||||
"field": "categories",
|
||||
"value": "main dish"
|
||||
},
|
||||
"type": "value"
|
||||
},
|
||||
{
|
||||
"arguments": {
|
||||
"scope": "d",
|
||||
"field": "availabilityRange",
|
||||
"time": "2018-01-15T04:13:00+00:00"
|
||||
},
|
||||
"type": "availability"
|
||||
}
|
||||
],
|
||||
"operation": "and"
|
||||
},
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"schema": "SCSearchRequest"
|
||||
}
|
||||
20
packages/core/test/resources/Setting.1.json
Normal file
20
packages/core/test/resources/Setting.1.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"categories": ["privacy"],
|
||||
"description": "This is a Description",
|
||||
"defaultValue": "student",
|
||||
"inputType": "single choice",
|
||||
"values": ["student", "employee", "guest"],
|
||||
"name": "group",
|
||||
"order": 0,
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
},
|
||||
"type": "setting",
|
||||
"uid": "c4ff2b08-be18-528e-9b09-cb8c1d18487b"
|
||||
},
|
||||
"schema": "SCSetting"
|
||||
}
|
||||
20
packages/core/test/resources/Setting.2.json
Normal file
20
packages/core/test/resources/Setting.2.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"categories": ["privacy"],
|
||||
"description": "This is a Description",
|
||||
"defaultValue": [],
|
||||
"inputType": "multiple choice",
|
||||
"values": [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
"name": "numbers",
|
||||
"order": 1,
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
},
|
||||
"type": "setting",
|
||||
"uid": "9f0c362e-0b41-532f-9e8b-a0ac373fbede"
|
||||
},
|
||||
"schema": "SCSetting"
|
||||
}
|
||||
32
packages/core/test/resources/Setting.3.json
Normal file
32
packages/core/test/resources/Setting.3.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"categories": ["profile"],
|
||||
"defaultValue": "en",
|
||||
"description": "The language this app is going to use.",
|
||||
"inputType": "single choice",
|
||||
"name": "language",
|
||||
"order": 0,
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
},
|
||||
"translations": {
|
||||
"de": {
|
||||
"description": "Die Sprache in der die App angezeigt wird.",
|
||||
"name": "Sprache",
|
||||
"values": ["English", "German"]
|
||||
},
|
||||
"en": {
|
||||
"description": "The language this app is going to use.",
|
||||
"name": "Language",
|
||||
"values": ["english", "german"]
|
||||
}
|
||||
},
|
||||
"type": "setting",
|
||||
"values": ["en", "de"],
|
||||
"uid": "184b717a-d020-46f5-995c-03023670cc62"
|
||||
},
|
||||
"schema": "SCSetting"
|
||||
}
|
||||
64
packages/core/test/resources/indexable/AcademicEvent.1.json
Normal file
64
packages/core/test/resources/indexable/AcademicEvent.1.json
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "academic event",
|
||||
"description": "Fortsetzung der Algebra I: Galoistheorie mit Anwendungen, ausgewählte Spezialthemen.",
|
||||
"uid": "681a59a1-23c2-5d78-861a-8c86a3abf2b9",
|
||||
"name": "Algebra II",
|
||||
"categories": ["lecture"],
|
||||
"academicTerms": [
|
||||
{
|
||||
"uid": "aacd5611-b5be-54ce-b39f-c52f7e9a631d",
|
||||
"type": "semester",
|
||||
"name": "Sommersemester 2018",
|
||||
"acronym": "SS 2018",
|
||||
"alternateNames": ["SoSe 2018"],
|
||||
"startDate": "2018-04-01",
|
||||
"endDate": "2018-09-30",
|
||||
"eventsStartDate": "2018-04-09",
|
||||
"eventsEndDate": "2018-07-13"
|
||||
}
|
||||
],
|
||||
"performers": [
|
||||
{
|
||||
"type": "person",
|
||||
"uid": "7f8ce700-2679-51a5-86b5-3dfba85a33ff",
|
||||
"givenName": "Peter",
|
||||
"familyName": "Bürgisser",
|
||||
"gender": "male",
|
||||
"honorificPrefix": "Prof. Dr.",
|
||||
"name": "Peter Bürgisser"
|
||||
}
|
||||
],
|
||||
"majors": [
|
||||
"Mathematik D",
|
||||
"Mathematik L2",
|
||||
"Mathematik StRGym",
|
||||
"Mathematik StRBeruf",
|
||||
"Mathematik BSc",
|
||||
"Mathematik MSc"
|
||||
],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote",
|
||||
"maintainer": {
|
||||
"type": "organization",
|
||||
"name": "tubIT",
|
||||
"uid": "25f76840-db89-5da2-a8a2-75992f637613"
|
||||
},
|
||||
"modified": "2018-09-01T10:00:00Z",
|
||||
"originalId": "foo bar",
|
||||
"responsibleEntity": {
|
||||
"type": "person",
|
||||
"uid": "7f8ce700-2679-51a5-86b5-3dfba85a33ff",
|
||||
"givenName": "Peter",
|
||||
"familyName": "Bürgisser",
|
||||
"gender": "male",
|
||||
"honorificPrefix": "Prof. Dr.",
|
||||
"name": "Peter Bürgisser"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": "SCAcademicEvent"
|
||||
}
|
||||
51
packages/core/test/resources/indexable/AcademicEvent.2.json
Normal file
51
packages/core/test/resources/indexable/AcademicEvent.2.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "academic event",
|
||||
"description": "Grundlagen, algebraische Grundbegriffe, Vektorräume, lineare Abbildungen und Gleichungen, Determinanten",
|
||||
"uid": "b17eb963-42b5-5861-adce-2b7b2607ef0a",
|
||||
"name": "Lineare Algebra I für Mathematiker",
|
||||
"categories": ["lecture"],
|
||||
"academicTerms": [
|
||||
{
|
||||
"uid": "aacd5611-b5be-54ce-b39f-c52f7e9a631d",
|
||||
"type": "semester",
|
||||
"name": "Sommersemester 2018",
|
||||
"acronym": "SS 2018",
|
||||
"alternateNames": ["SoSe 2018"],
|
||||
"startDate": "2018-04-01",
|
||||
"endDate": "2018-09-30",
|
||||
"eventsStartDate": "2018-04-09",
|
||||
"eventsEndDate": "2018-07-13"
|
||||
}
|
||||
],
|
||||
"performers": [
|
||||
{
|
||||
"type": "person",
|
||||
"uid": "fc8b10cf-10c0-5b92-b16e-92ff734676da",
|
||||
"givenName": "Jörg",
|
||||
"familyName": "Liesen",
|
||||
"gender": "male",
|
||||
"honorificPrefix": "Prof. Dr.",
|
||||
"name": "Jörg Liesen"
|
||||
}
|
||||
],
|
||||
"catalogs": [
|
||||
{
|
||||
"uid": "5a1f4f51-2498-5af1-91cb-c939673cc69c",
|
||||
"type": "catalog",
|
||||
"level": 3,
|
||||
"description": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
|
||||
"categories": ["university events"],
|
||||
"name": "Mathematik: Lehrveranstaltungen für andere Fachrichtungen (Service)"
|
||||
}
|
||||
],
|
||||
"majors": ["Wirtschaftsmathematik BSc", "Technomathematik BSc", "Mathematik BSc"],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCAcademicEvent"
|
||||
}
|
||||
72
packages/core/test/resources/indexable/AcademicEvent.3.json
Normal file
72
packages/core/test/resources/indexable/AcademicEvent.3.json
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "academic event",
|
||||
"description": "Die Übung hat 2 SWS und wird auf 2 Gruppen verteilt.",
|
||||
"uid": "7e2b64b0-925d-5f63-b464-a6e3e9492411",
|
||||
"name": "Algebra II",
|
||||
"categories": ["tutorial"],
|
||||
"academicTerms": [
|
||||
{
|
||||
"uid": "aacd5611-b5be-54ce-b39f-c52f7e9a631d",
|
||||
"type": "semester",
|
||||
"name": "Sommersemester 2018",
|
||||
"acronym": "SS 2018",
|
||||
"alternateNames": ["SoSe 2018"],
|
||||
"startDate": "2018-04-01",
|
||||
"endDate": "2018-09-30",
|
||||
"eventsStartDate": "2018-04-09",
|
||||
"eventsEndDate": "2018-07-13"
|
||||
}
|
||||
],
|
||||
"performers": [
|
||||
{
|
||||
"type": "person",
|
||||
"uid": "97be73c0-5319-579a-a393-c4eeeacae58b",
|
||||
"givenName": "Paul",
|
||||
"familyName": "Breiding",
|
||||
"gender": "male",
|
||||
"name": "Paul Breiding"
|
||||
},
|
||||
{
|
||||
"type": "person",
|
||||
"uid": "0db9b55a-4c27-5faf-9bf0-4b564be45a08",
|
||||
"givenName": "Pierre",
|
||||
"familyName": "Lairez",
|
||||
"gender": "male",
|
||||
"name": "Pierre Lairez"
|
||||
}
|
||||
],
|
||||
"catalogs": [
|
||||
{
|
||||
"uid": "6c259ad8-99af-5ea2-8aae-a3c9027d26e2",
|
||||
"type": "catalog",
|
||||
"level": 3,
|
||||
"categories": ["university events"],
|
||||
"name": "Mathematik: Grundstudiums-Veranstaltungen (Diplom, Bachelor)"
|
||||
},
|
||||
{
|
||||
"uid": "5a1f4f51-2498-5af1-91cb-c939673cc69c",
|
||||
"type": "catalog",
|
||||
"level": 3,
|
||||
"description": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
|
||||
"categories": ["university events"],
|
||||
"name": "Mathematik: Lehrveranstaltungen für andere Fachrichtungen (Service)"
|
||||
}
|
||||
],
|
||||
"majors": [
|
||||
"Mathematik D",
|
||||
"Mathematik L2",
|
||||
"Mathematik StRGym",
|
||||
"Mathematik StRBeruf",
|
||||
"Mathematik BSc",
|
||||
"Mathematik MSc"
|
||||
],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCAcademicEvent"
|
||||
}
|
||||
24
packages/core/test/resources/indexable/Article.1.json
Normal file
24
packages/core/test/resources/indexable/Article.1.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "8d8bd89c-8429-5f81-b754-15a5be55e593",
|
||||
"type": "article",
|
||||
"categories": ["unipedia"],
|
||||
"sameAs": "https://www.mydesk.tu-berlin.de/wiki/abk%C3%BCrzungen",
|
||||
"name": "Abkürzungen",
|
||||
"keywords": ["Abkürzungen", "Studium"],
|
||||
"articleBody": "Siehe [c.t.](#/b-tu/data/detail/Article/tub-unipedia-384edcfd026dab697ff9f8adda0d19a6959d4e29) (lat. cum tempore)\n\n### S\n\n**SWS** ist eine Semesterwochenstunde. Ein SWS beträgt 45 MInuten.",
|
||||
"translations": {
|
||||
"en": {
|
||||
"name": "Abbreviations",
|
||||
"keywords": ["Abbreviations", "Studies"]
|
||||
}
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCArticle"
|
||||
}
|
||||
32
packages/core/test/resources/indexable/Article.2.json
Normal file
32
packages/core/test/resources/indexable/Article.2.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "4f772b29-0b28-53a4-a8b9-206d9b425962",
|
||||
"type": "article",
|
||||
"categories": ["unipedia"],
|
||||
"sameAs": "https://www.mydesk.tu-berlin.de/wiki/ag_ziethen",
|
||||
"name": "AG Ziethen",
|
||||
"keywords": [
|
||||
"Bologna",
|
||||
"Change Agent",
|
||||
"Hochschulpolitik",
|
||||
"Lehre",
|
||||
"Manifest",
|
||||
"Mitarbeiten",
|
||||
"Mitmachen",
|
||||
"Mitwirken",
|
||||
"Prüfungen",
|
||||
"Reform",
|
||||
"Regelungen",
|
||||
"Studium",
|
||||
"Verändern"
|
||||
],
|
||||
"articleBody": "Die AG Ziethen ist seit Ende 2012 eine Arbeitsgruppe für alle Angehörigen (Studierende und Mitarbeiter_innen) der TUB. Alle Interessierten dürfen, können und sollen sehr gerne mitarbeiten um das Thema Lehre an der TU Berlin zu stärken. Ziel ist ein Kulturwandel und Perspektivwechsel und der Überschrift: \"Shift from teaching to learning!\". Die AG Ziethen gehört zur Programmlinie TU inspire, gefördert im Rahmen des Qualitätspakts Lehre des Bundesministeriums für Bildung und Forschung.\n\nDie Arbeitsgruppe ist auf einem ersten Treffen Anfang Dezember 2012 im Schloß Ziethen in Groß Ziethen (daher der Name) entstanden und hat einzelne Gruppen zu speziellen Themen gebildet (siehe [Maßnahmen und Initiaven](http://www.tu-berlin.de/qualitaet/ag_ziethen/massnahmen_und_initiativen/)). Wichtigstes Ergebnis ist aber das [Ziethener Manifest](http://www.tu-berlin.de/qualitaet/ag_ziethen/ziethener_manifest/), das einen Kulturwandel in der Lehre unterstützen soll.\n\nDas Mitwirken, Mitarbeiten, Mitmachen bei den einzelnen Themen ist unbedingt erwünscht! \nEine Übersicht zu den aktuellen Gruppen gibt es unter anderem auf der zentralen [ISIS-Seite](https://www.isis.tu-berlin.de/2.0/course/view.php?id=1065) zur AG Ziethen.\n\n##### Links\n\n* [AG Ziehten zur allgemeinen Information](http://www.tu-berlin.de/qualitaet/ag_ziethen/)\n* [ISIS-Seite zum Mitmachen](https://www.isis.tu-berlin.de/2.0/course/view.php?id=1065)",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCArticle"
|
||||
}
|
||||
34
packages/core/test/resources/indexable/Article.3.json
Normal file
34
packages/core/test/resources/indexable/Article.3.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "article",
|
||||
"uid": "d541eda5-1542-59b2-969e-7dbbee0bd2a8",
|
||||
"name": "Mozart und Frankfurt am Main : drei Generationen Mozart in Frankfurt am Main",
|
||||
"description": "Ill.",
|
||||
"categories": ["article"],
|
||||
"authors": [
|
||||
{
|
||||
"type": "person",
|
||||
"uid": "56d46c9b-8ede-52ae-a40f-6800cff577e5",
|
||||
"name": "Greve, Clemens"
|
||||
}
|
||||
],
|
||||
"firstPublished": "2008",
|
||||
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB198305427",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "HeBIS HDS",
|
||||
"originalId": "HEB198305427",
|
||||
"type": "remote",
|
||||
"url": "https://ubffm.hds.hebis.de"
|
||||
},
|
||||
"isPartOf": {
|
||||
"uid": "bc5e5399-a24c-5c01-9c1b-0c8b83272087",
|
||||
"name": "Archiv für Frankfurts Geschichte und Kunst",
|
||||
"type": "periodical",
|
||||
"categories": []
|
||||
},
|
||||
"reference": "Band 71 (2008), Seite 27-40"
|
||||
},
|
||||
"schema": "SCArticle"
|
||||
}
|
||||
34
packages/core/test/resources/indexable/Article.4.json
Normal file
34
packages/core/test/resources/indexable/Article.4.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "article",
|
||||
"uid": "554a4a89-df73-5197-ac85-c8a5a3a9c5b0",
|
||||
"name": "Ursula Janik : [Markthändlerin]",
|
||||
"description": "Ill.",
|
||||
"categories": ["article"],
|
||||
"authors": [
|
||||
{
|
||||
"type": "person",
|
||||
"uid": "c6e44e1f-f76c-53f8-a18f-47fa54ae0e90",
|
||||
"name": "Fröhlich, Ute B."
|
||||
}
|
||||
],
|
||||
"firstPublished": "2002",
|
||||
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB107025590",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "HeBIS HDS",
|
||||
"originalId": "HEB107025590",
|
||||
"type": "remote",
|
||||
"url": "https://ubffm.hds.hebis.de"
|
||||
},
|
||||
"isPartOf": {
|
||||
"uid": "f84c1851-042e-542f-ba7a-158b32dfb82f",
|
||||
"name": "Frankfurter Allgemeine. R, Rhein-Main-Zeitung",
|
||||
"type": "periodical",
|
||||
"categories": []
|
||||
},
|
||||
"reference": "Heft 190 (17. 8 2002), Seite 62"
|
||||
},
|
||||
"schema": "SCArticle"
|
||||
}
|
||||
36
packages/core/test/resources/indexable/Book.1.json
Normal file
36
packages/core/test/resources/indexable/Book.1.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "book",
|
||||
"uid": "a0520263-29ae-5357-a3ce-ba1902d121e0",
|
||||
"name": "Kundenorientierung durch Quality Function Deployment: Systematisches Entwickeln von Produkten und Dienstleistungen",
|
||||
"authors": [
|
||||
{
|
||||
"type": "person",
|
||||
"uid": "10dfe386-71b4-554a-beb1-2d38561e42f8",
|
||||
"name": "Jutta Saatweber",
|
||||
"givenName": "Jutta",
|
||||
"familyName": "Saatweber"
|
||||
}
|
||||
],
|
||||
"datePublished": "2007-08-01",
|
||||
"publishers": [
|
||||
{
|
||||
"type": "organization",
|
||||
"uid": "28df2bb9-c854-5898-b9d5-1abbd3524804",
|
||||
"name": "Symposion Publishing"
|
||||
}
|
||||
],
|
||||
"inLanguage": "de",
|
||||
"edition": "2., überarb. u. erw. Aufl.",
|
||||
"ISBNs": ["3936608776"],
|
||||
"numberOfPages": 537,
|
||||
"categories": ["book"],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCBook"
|
||||
}
|
||||
26
packages/core/test/resources/indexable/Book.2.json
Normal file
26
packages/core/test/resources/indexable/Book.2.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "book",
|
||||
"uid": "db47f7f4-7699-5a37-afcc-24beaa998d36",
|
||||
"name": "Minimal Book",
|
||||
"categories": ["ebook"],
|
||||
"authors": [
|
||||
{
|
||||
"type": "person",
|
||||
"uid": "10dfe386-71b4-554a-beb1-2d38561e42f8",
|
||||
"name": "Jutta Saatweber",
|
||||
"givenName": "Jutta",
|
||||
"familyName": "Saatweber"
|
||||
}
|
||||
],
|
||||
"datePublished": "2007-08-01",
|
||||
"ISBNs": ["3936608776"],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCBook"
|
||||
}
|
||||
37
packages/core/test/resources/indexable/Book.3.json
Normal file
37
packages/core/test/resources/indexable/Book.3.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "book",
|
||||
"uid": "188cb2bd-724d-543d-97ac-9aa1dda68cb7",
|
||||
"name": "Frauen im Ingenieurberuf : FIB ; 1. Gesamtdeutsches Symposium VDI-FIB 17. - 18. November 1990, Bad Homburg ; 1. überregionales Treffen VDI-FIB 11. - 12. November 1989, Düsseldorf",
|
||||
"description": "47 S. : Ill., Kt.",
|
||||
"categories": ["book"],
|
||||
"authors": [
|
||||
{
|
||||
"uid": "a276588c-ecee-5d2e-8b9c-73cb902bc165",
|
||||
"name": "Saatweber, Jutta (Hrsg.)",
|
||||
"type": "person"
|
||||
}
|
||||
],
|
||||
"firstPublished": "[ca. 1991]",
|
||||
"lastPublished": "2000 Q1",
|
||||
"publications": [
|
||||
{
|
||||
"uid": "603a6574-8910-588a-9e83-cd26e6988c74",
|
||||
"type": "publication event",
|
||||
"locations": ["Frankfurt/M"],
|
||||
"publisher": "VDI",
|
||||
"name": "VDI"
|
||||
}
|
||||
],
|
||||
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB022992618",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "HeBIS HDS",
|
||||
"originalId": "HEB022992618",
|
||||
"type": "remote",
|
||||
"url": "https://ubffm.hds.hebis.de"
|
||||
}
|
||||
},
|
||||
"schema": "SCBook"
|
||||
}
|
||||
37
packages/core/test/resources/indexable/Book.4.json
Normal file
37
packages/core/test/resources/indexable/Book.4.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "book",
|
||||
"uid": "f6ee5744-a441-595d-9dae-a9f579c0660f",
|
||||
"name": "Kant",
|
||||
"description": "176 S.",
|
||||
"categories": ["book"],
|
||||
"authors": [
|
||||
{
|
||||
"uid": "7e198ecf-966a-5f99-8a45-266243583023",
|
||||
"name": "Thouard, Denis",
|
||||
"type": "person"
|
||||
}
|
||||
],
|
||||
"firstPublished": "2001",
|
||||
"publications": [
|
||||
{
|
||||
"uid": "6333427c-0725-5398-9a04-11604680dae3",
|
||||
"type": "publication event",
|
||||
"locations": ["Paris"],
|
||||
"publisher": "Belles Lettres",
|
||||
"name": "Belles Lettres"
|
||||
}
|
||||
],
|
||||
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB102248788",
|
||||
"ISBNs": ["2251760385"],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "HeBIS HDS",
|
||||
"originalId": "HEB102248788",
|
||||
"type": "remote",
|
||||
"url": "https://ubffm.hds.hebis.de"
|
||||
}
|
||||
},
|
||||
"schema": "SCBook"
|
||||
}
|
||||
68
packages/core/test/resources/indexable/Building.1.json
Normal file
68
packages/core/test/resources/indexable/Building.1.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [13.32577, 52.51398]
|
||||
},
|
||||
"polygon": {
|
||||
"type": "Polygon",
|
||||
"coordinates": [
|
||||
[
|
||||
[13.3259988, 52.5141108],
|
||||
[13.3259718, 52.5143107],
|
||||
[13.3262958, 52.5143236],
|
||||
[13.3263291, 52.5143052],
|
||||
[13.3263688, 52.5140098],
|
||||
[13.3264324, 52.5139643],
|
||||
[13.3264849, 52.5139415],
|
||||
[13.3265148, 52.5139004],
|
||||
[13.3265336, 52.5138571],
|
||||
[13.3265411, 52.5137933],
|
||||
[13.3265336, 52.5137546],
|
||||
[13.3264961, 52.5137044],
|
||||
[13.3264399, 52.5136725],
|
||||
[13.3263875, 52.5136497],
|
||||
[13.3263351, 52.5136429],
|
||||
[13.3263613, 52.5134286],
|
||||
[13.3262564, 52.5133603],
|
||||
[13.3260767, 52.5133671],
|
||||
[13.3259418, 52.5134286],
|
||||
[13.3258744, 52.5135061],
|
||||
[13.3258444, 52.5135677],
|
||||
[13.3261366, 52.5135836],
|
||||
[13.3261066, 52.513807],
|
||||
[13.3260579, 52.5138047],
|
||||
[13.3260317, 52.5139096],
|
||||
[13.3254137, 52.5138708],
|
||||
[13.3254287, 52.5137819],
|
||||
[13.3250879, 52.513766],
|
||||
[13.3250018, 52.5142697],
|
||||
[13.3253613, 52.5142902],
|
||||
[13.3253838, 52.5140747],
|
||||
[13.3259988, 52.5141108]
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"type": "building",
|
||||
"name": "Mathematikgebäude",
|
||||
"alternateNames": ["MA"],
|
||||
"uid": "edfaba58-254f-5da0-82d6-3b46a76c48ce",
|
||||
"categories": ["education"],
|
||||
"address": {
|
||||
"addressCountry": "Germany",
|
||||
"addressLocality": "Berlin",
|
||||
"addressRegion": "Berlin",
|
||||
"postalCode": "10623",
|
||||
"streetAddress": "Straße des 17. Juni 136"
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCBuilding"
|
||||
}
|
||||
41
packages/core/test/resources/indexable/Catalog.1.json
Normal file
41
packages/core/test/resources/indexable/Catalog.1.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "c8dc1f7f-9e3e-5b1f-8c38-084f46413b87",
|
||||
"type": "catalog",
|
||||
"level": 1,
|
||||
"categories": ["university events"],
|
||||
"name": "Lehrveranstaltungen des Fachbereichs 3 - Gesellschaftswissenschaften",
|
||||
"academicTerm": {
|
||||
"uid": "b621f5b5-dd5d-5730-9e2e-e4ba52011388",
|
||||
"type": "semester",
|
||||
"acronym": "WS 2017/18",
|
||||
"name": "Wintersemester 2017/2018",
|
||||
"alternateNames": ["WiSe 2017/18"],
|
||||
"startDate": "2017-10-01",
|
||||
"endDate": "2018-03-31"
|
||||
},
|
||||
"superCatalog": {
|
||||
"type": "catalog",
|
||||
"level": 0,
|
||||
"categories": ["university events"],
|
||||
"uid": "a7404d36-282d-546e-bfa5-6c7b25ba7838",
|
||||
"name": "Vorlesungsverzeichnis WS 2017/18"
|
||||
},
|
||||
"superCatalogs": [
|
||||
{
|
||||
"type": "catalog",
|
||||
"level": 0,
|
||||
"categories": ["university events"],
|
||||
"uid": "a7404d36-282d-546e-bfa5-6c7b25ba7838",
|
||||
"name": "Vorlesungsverzeichnis WS 2017/18"
|
||||
}
|
||||
],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCCatalog"
|
||||
}
|
||||
56
packages/core/test/resources/indexable/Catalog.2.json
Normal file
56
packages/core/test/resources/indexable/Catalog.2.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "5a8bc725-8658-528f-b515-5f7cd6987169",
|
||||
"type": "catalog",
|
||||
"level": 3,
|
||||
"description": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
|
||||
"categories": ["university events"],
|
||||
"name": "Mathematik: Lehrveranstaltungen für andere Fachrichtungen (Service)",
|
||||
"academicTerm": {
|
||||
"uid": "b621f5b5-dd5d-5730-9e2e-e4ba52011388",
|
||||
"type": "semester",
|
||||
"acronym": "WS 2017/18",
|
||||
"name": "Wintersemester 2017/2018",
|
||||
"alternateNames": ["WiSe 2017/18"],
|
||||
"startDate": "2017-10-01",
|
||||
"endDate": "2018-03-31"
|
||||
},
|
||||
"superCatalog": {
|
||||
"uid": "2fdcccce-1948-5f5a-8938-3711b7e65e8a",
|
||||
"type": "catalog",
|
||||
"level": 2,
|
||||
"categories": ["university events"],
|
||||
"name": "Mathematik"
|
||||
},
|
||||
"superCatalogs": [
|
||||
{
|
||||
"type": "catalog",
|
||||
"level": 0,
|
||||
"categories": ["university events"],
|
||||
"uid": "a7404d36-282d-546e-bfa5-6c7b25ba7838",
|
||||
"name": "Vorlesungsverzeichnis WS 2017"
|
||||
},
|
||||
{
|
||||
"uid": "0718211b-d0c2-50fb-bc78-b968f20fd95b",
|
||||
"type": "catalog",
|
||||
"level": 1,
|
||||
"categories": ["university events"],
|
||||
"name": "Fakultät II Mathematik und Naturwissenschaften"
|
||||
},
|
||||
{
|
||||
"uid": "2fdcccce-1948-5f5a-8938-3711b7e65e8a",
|
||||
"type": "catalog",
|
||||
"level": 2,
|
||||
"categories": ["university events"],
|
||||
"name": "Mathematik"
|
||||
}
|
||||
],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCCatalog"
|
||||
}
|
||||
32
packages/core/test/resources/indexable/ContactPoint.1.json
Normal file
32
packages/core/test/resources/indexable/ContactPoint.1.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "contact point",
|
||||
"name": "Dienstadresse",
|
||||
"areaServed": {
|
||||
"type": "room",
|
||||
"categories": ["education"],
|
||||
"uid": "39c1a574-04ef-5157-9c6f-e271d93eb273",
|
||||
"name": "3.G 121",
|
||||
"alternateNames": ["Dienstzimmer"],
|
||||
"geo": {
|
||||
"point": {
|
||||
"coordinates": [8.66919, 50.12834],
|
||||
"type": "Point"
|
||||
}
|
||||
}
|
||||
},
|
||||
"email": "info@example.com",
|
||||
"faxNumber": "069 / 123450",
|
||||
"officeHours": "Mo, Mi 8:00-13:00",
|
||||
"telephone": "069 / 12345",
|
||||
"url": "https://example.com",
|
||||
"uid": "be34a419-e9e8-5de0-b998-dd1b19e7beef",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCContactPoint"
|
||||
}
|
||||
33
packages/core/test/resources/indexable/CourseOfStudy.1.json
Normal file
33
packages/core/test/resources/indexable/CourseOfStudy.1.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"academicDegree": "bachelor",
|
||||
"academicDegreewithField": "Bachelor of Arts",
|
||||
"academicDegreewithFieldShort": "B.A.",
|
||||
"department": {
|
||||
"name": "Technische Universität Berlin",
|
||||
"type": "organization",
|
||||
"uid": "b0f878fd-8fda-53b8-b065-a8d854c3d0d2"
|
||||
},
|
||||
"mainLanguage": {
|
||||
"code": "de",
|
||||
"name": "german"
|
||||
},
|
||||
"mode": "dual",
|
||||
"name": "Astroturfing",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
},
|
||||
"secretary": {
|
||||
"name": "Technische Universität Berlin",
|
||||
"type": "organization",
|
||||
"uid": "b0f878fd-8fda-53b8-b065-a8d854c3d0d2"
|
||||
},
|
||||
"timeMode": "parttime",
|
||||
"type": "course of study",
|
||||
"uid": "4c6f0a18-343d-5175-9fb1-62d28545c2aa"
|
||||
},
|
||||
"schema": "SCCourseOfStudy"
|
||||
}
|
||||
36
packages/core/test/resources/indexable/DateSeries.1.json
Normal file
36
packages/core/test/resources/indexable/DateSeries.1.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "date series",
|
||||
"uid": "1b421872-1b4c-579b-ba03-688f943d59ad",
|
||||
"name": "Einführung in die Wirtschaftspolitik",
|
||||
"duration": "PT2H",
|
||||
"inPlace": {
|
||||
"type": "room",
|
||||
"categories": ["education"],
|
||||
"uid": "5a4bbced-8e1f-5f29-a1d1-336e455ce7f9",
|
||||
"name": "H 0105",
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [13.32687, 52.51211]
|
||||
}
|
||||
}
|
||||
},
|
||||
"repeatFrequency": "P1W",
|
||||
"dates": ["2016-04-15T17:00:00+00:00"],
|
||||
"event": {
|
||||
"type": "academic event",
|
||||
"uid": "dbb4e5e1-0789-59c1-9970-877430af56b3",
|
||||
"name": "Einführung in die Wirtschaftspolitik",
|
||||
"categories": ["written exam"],
|
||||
"majors": ["Economics BSc", "Wirtschaftsingenieurwesen BSc"]
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCDateSeries"
|
||||
}
|
||||
35
packages/core/test/resources/indexable/DateSeries.2.json
Normal file
35
packages/core/test/resources/indexable/DateSeries.2.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "date series",
|
||||
"uid": "4ce41895-4b54-52db-b86f-7e6920b975c8",
|
||||
"name": "Distributed Algorithms",
|
||||
"duration": "PT4H",
|
||||
"inPlace": {
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [13.3266207, 52.5144409]
|
||||
}
|
||||
},
|
||||
"type": "room",
|
||||
"categories": ["education"],
|
||||
"uid": "b535c86a-777b-54c3-b89a-cad528d0580f",
|
||||
"name": "EMH 225",
|
||||
"floorName": "2"
|
||||
},
|
||||
"dates": ["2016-04-12T11:00:00+00:00"],
|
||||
"event": {
|
||||
"type": "academic event",
|
||||
"uid": "e6fb74d4-c6d9-59bb-930f-e47eb6e39432",
|
||||
"name": "Distributed Algorithms",
|
||||
"categories": ["written exam"]
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCDateSeries"
|
||||
}
|
||||
54
packages/core/test/resources/indexable/DateSeries.3.json
Normal file
54
packages/core/test/resources/indexable/DateSeries.3.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "date series",
|
||||
"uid": "e6462830-187a-50b1-bdb4-8f39e49a88b8",
|
||||
"name": "Dance course for beginners",
|
||||
"duration": "PT8H",
|
||||
"inPlace": {
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [13.3266207, 52.5144409]
|
||||
}
|
||||
},
|
||||
"type": "room",
|
||||
"categories": ["student union"],
|
||||
"uid": "b535c86a-777b-54c3-b89a-cad528d0580f",
|
||||
"name": "EMH 225",
|
||||
"floorName": "2"
|
||||
},
|
||||
"dates": ["2016-04-12T11:00:00+00:00"],
|
||||
"event": {
|
||||
"type": "academic event",
|
||||
"uid": "4f86e8bb-ce73-520b-bfd9-e1ba9f754391",
|
||||
"name": "Dance course for beginners",
|
||||
"categories": ["special"]
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
},
|
||||
"offers": [
|
||||
{
|
||||
"availability": "in stock",
|
||||
"availabilityRange": {
|
||||
"gte": "2017-01-30T00:00:00.000Z",
|
||||
"lte": "2017-01-30T23:59:59.999Z"
|
||||
},
|
||||
"prices": {
|
||||
"default": 6.5,
|
||||
"student": 5,
|
||||
"alumni": 5
|
||||
},
|
||||
"provider": {
|
||||
"name": "Studentenwerk",
|
||||
"type": "organization",
|
||||
"uid": "3b9b3df6-3a7a-58cc-922f-c7335c002634"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"schema": "SCDateSeries"
|
||||
}
|
||||
66
packages/core/test/resources/indexable/Dish.1.json
Normal file
66
packages/core/test/resources/indexable/Dish.1.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "dish",
|
||||
"name": "Pizza mit Geflügelsalami und Champignons",
|
||||
"categories": ["main dish"],
|
||||
"characteristics": [],
|
||||
"additives": [
|
||||
"konserviert",
|
||||
"Antioxidationsmittel",
|
||||
"Farbstoff",
|
||||
"Weizen",
|
||||
"Milch(Laktose; Milcheiweiß)",
|
||||
"Nitritpökelsalz",
|
||||
"Hefe"
|
||||
],
|
||||
"offers": [
|
||||
{
|
||||
"availability": "in stock",
|
||||
"availabilityRange": {
|
||||
"gte": "2017-01-30T00:00:00.000Z",
|
||||
"lte": "2017-01-30T23:59:59.999Z"
|
||||
},
|
||||
"prices": {
|
||||
"default": 4.85,
|
||||
"student": 2.85,
|
||||
"employee": 3.85,
|
||||
"guest": 4.85
|
||||
},
|
||||
"provider": {
|
||||
"name": "Studentenwerk",
|
||||
"type": "organization",
|
||||
"uid": "3b9b3df6-3a7a-58cc-922f-c7335c002634"
|
||||
},
|
||||
"inPlace": {
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [13.32612, 52.50978]
|
||||
}
|
||||
},
|
||||
"type": "building",
|
||||
"categories": ["restaurant"],
|
||||
"openingHours": "Mo-Fr 11:00-14:30",
|
||||
"name": "TU-Mensa",
|
||||
"alternateNames": ["MensaHardenberg"],
|
||||
"uid": "72fbc8a3-ebd1-58f9-9526-ad65cba2e402",
|
||||
"address": {
|
||||
"addressCountry": "Germany",
|
||||
"addressLocality": "Berlin",
|
||||
"addressRegion": "Berlin",
|
||||
"postalCode": "10623",
|
||||
"streetAddress": "Hardenbergstraße 34"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"uid": "c9f32915-8ed5-5960-b850-3f7375a89922",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCDish"
|
||||
}
|
||||
66
packages/core/test/resources/indexable/Dish.2.json
Normal file
66
packages/core/test/resources/indexable/Dish.2.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "dish",
|
||||
"name": "Sahne-Bärlauchsauce",
|
||||
"description": "Nudelauswahl",
|
||||
"categories": ["main dish"],
|
||||
"offers": [
|
||||
{
|
||||
"prices": {
|
||||
"default": 3.45,
|
||||
"student": 2.45,
|
||||
"employee": 3.45
|
||||
},
|
||||
"provider": {
|
||||
"name": "Studentenwerk",
|
||||
"type": "organization",
|
||||
"uid": "3b9b3df6-3a7a-58cc-922f-c7335c002634"
|
||||
},
|
||||
"availability": "in stock",
|
||||
"availabilityRange": {
|
||||
"gte": "2017-01-30T00:00:00.000Z",
|
||||
"lte": "2017-01-30T23:59:59.999Z"
|
||||
},
|
||||
"inPlace": {
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [13.32612, 52.50978]
|
||||
}
|
||||
},
|
||||
"type": "building",
|
||||
"categories": ["restaurant"],
|
||||
"openingHours": "Mo-Fr 11:00-14:30",
|
||||
"name": "TU-Mensa",
|
||||
"alternateNames": ["MensaHardenberg"],
|
||||
"uid": "072db1e5-e479-5040-88e0-4a98d731e443",
|
||||
"address": {
|
||||
"addressCountry": "Germany",
|
||||
"addressLocality": "Berlin",
|
||||
"addressRegion": "Berlin",
|
||||
"postalCode": "10623",
|
||||
"streetAddress": "Hardenbergstraße 34"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"characteristics": [
|
||||
{
|
||||
"name": "bad"
|
||||
},
|
||||
{
|
||||
"name": "vegetarian",
|
||||
"image": "https://backend/res/img/characteristic_small_vegetarian.png"
|
||||
}
|
||||
],
|
||||
"additives": ["Weizen", "Milch(Laktose; Milcheiweiß)"],
|
||||
"uid": "3222631f-82b3-5faf-a8e8-9c10719cc95b",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCDish"
|
||||
}
|
||||
120
packages/core/test/resources/indexable/Dish.3.json
Normal file
120
packages/core/test/resources/indexable/Dish.3.json
Normal file
@@ -0,0 +1,120 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"additives": [
|
||||
"1 = mit Farbstoff",
|
||||
"2 = konserviert",
|
||||
"3 = mit Antioxidationsmittel",
|
||||
"9 = mit Süßungsmittel",
|
||||
"A = Glutenhaltige Getreide",
|
||||
"G = Milch u. Milcherzeugnisse"
|
||||
],
|
||||
"offers": [
|
||||
{
|
||||
"availability": "in stock",
|
||||
"availabilityRange": {
|
||||
"gte": "2017-03-27T00:00:00.000Z",
|
||||
"lte": "2017-03-27T23:59:59.000Z"
|
||||
},
|
||||
"inPlace": {
|
||||
"type": "room",
|
||||
"name": "Cafeteria LEVEL",
|
||||
"categories": ["cafe"],
|
||||
"uid": "e5492c9c-064e-547c-8633-c8fc8955cfcf",
|
||||
"alternateNames": ["Cafeteria LEVEL"],
|
||||
"openingHours": "Mo-Fr 08:30-17:00",
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [8.6285375, 50.1743717]
|
||||
}
|
||||
}
|
||||
},
|
||||
"prices": {
|
||||
"default": 6.5,
|
||||
"student": 4.9,
|
||||
"employee": 6.5
|
||||
},
|
||||
"provider": {
|
||||
"name": "Studentenwerk",
|
||||
"type": "organization",
|
||||
"uid": "3b9b3df6-3a7a-58cc-922f-c7335c002634"
|
||||
}
|
||||
}
|
||||
],
|
||||
"categories": ["main dish"],
|
||||
"characteristics": [
|
||||
{
|
||||
"name": "Rind",
|
||||
"image": "https://backend/res/img/characteristic_small_rind.png"
|
||||
}
|
||||
],
|
||||
"description": "Salsa Burger (1,2,3,9,A,G)",
|
||||
"name": "Salsa Burger",
|
||||
"dishAddOns": [
|
||||
{
|
||||
"characteristics": [
|
||||
{
|
||||
"name": "Vegan",
|
||||
"image": "https://backend/res/img/characteristic_small_vegan.png"
|
||||
}
|
||||
],
|
||||
"description": "Pommes frites",
|
||||
"type": "dish",
|
||||
"uid": "db0caac1-062c-5333-9fcb-cfaf0ff7d799",
|
||||
"nutrition": {
|
||||
"calories": 106,
|
||||
"fatContent": 5.4,
|
||||
"saturatedFatContent": 1.8,
|
||||
"carbohydrateContent": 6.8,
|
||||
"sugarContent": 6.1,
|
||||
"proteinContent": 6.9,
|
||||
"saltContent": 3.7
|
||||
},
|
||||
"additives": ["3 = mit Antioxidationsmittel", "5 = geschwefelt"],
|
||||
"name": "Pommes frites",
|
||||
"categories": ["side dish"]
|
||||
},
|
||||
{
|
||||
"characteristics": [
|
||||
{
|
||||
"name": "Vegan",
|
||||
"image": "https://backend/res/img/characteristic_small_vegan.png"
|
||||
}
|
||||
],
|
||||
"description": "Glasierte Karotten",
|
||||
"type": "dish",
|
||||
"uid": "f702fd43-1551-53b2-b35a-b5916e1cf9a1",
|
||||
"nutrition": {
|
||||
"calories": 106,
|
||||
"fatContent": 5.4,
|
||||
"saturatedFatContent": 1.8,
|
||||
"carbohydrateContent": 6.8,
|
||||
"sugarContent": 6.1,
|
||||
"proteinContent": 6.9,
|
||||
"saltContent": 3.7
|
||||
},
|
||||
"additives": ["F = Soja u. Sojaerzeugnisse"],
|
||||
"name": "Glasierte Karotten",
|
||||
"categories": ["side dish", "salad"]
|
||||
}
|
||||
],
|
||||
"type": "dish",
|
||||
"uid": "1c99689c-c6ec-551f-8ad8-f13c5fa812c2",
|
||||
"nutrition": {
|
||||
"calories": 600,
|
||||
"fatContent": 30.5,
|
||||
"saturatedFatContent": 9.9,
|
||||
"carbohydrateContent": 42.2,
|
||||
"sugarContent": 5.7,
|
||||
"proteinContent": 38.6,
|
||||
"saltContent": 3.5
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCDish"
|
||||
}
|
||||
2694
packages/core/test/resources/indexable/Floor.1.json
Normal file
2694
packages/core/test/resources/indexable/Floor.1.json
Normal file
File diff suppressed because it is too large
Load Diff
6613
packages/core/test/resources/indexable/Floor.2.json
Normal file
6613
packages/core/test/resources/indexable/Floor.2.json
Normal file
File diff suppressed because it is too large
Load Diff
1527
packages/core/test/resources/indexable/Floor.3.json
Normal file
1527
packages/core/test/resources/indexable/Floor.3.json
Normal file
File diff suppressed because it is too large
Load Diff
19
packages/core/test/resources/indexable/Message.1.json
Normal file
19
packages/core/test/resources/indexable/Message.1.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "message",
|
||||
"uid": "4706ef24-b631-5c20-91d1-3c627decca5a",
|
||||
"image": "https://backend/res/img/message_small.png",
|
||||
"name": "Lösung für das Problem des Zurücksetzens der StApps-App gefunden",
|
||||
"messageBody": "Wie bereits berichtet, klagten User über das Löschen ihres Stundenplans beim Update von Version 0.8.0 auf 0.8.1. Wir haben eine Lösung für das Problem gefunden und testen diese ausführlich bis zum Ende dieser Woche. Wenn alles glatt verläuft, dann kommt am Wochenende die fehlerbereinige Version 0.8.2 heraus.\n\n*(25.Okt 2016)*",
|
||||
"audiences": ["students"],
|
||||
"categories": ["news"],
|
||||
"sequenceIndex": 1001,
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCMessage"
|
||||
}
|
||||
19
packages/core/test/resources/indexable/Message.2.json
Normal file
19
packages/core/test/resources/indexable/Message.2.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"errorNames": ["const"],
|
||||
"instance": {
|
||||
"type": "invalid-value-in-schema",
|
||||
"uid": "cdb7059c-a1a2-5229-821d-434c345e2917",
|
||||
"image": "https://backend/res/img/message_small.png",
|
||||
"name": "Lösung für das Problem des Zurücksetzens der StApps-App gefunden",
|
||||
"messageBody": "Wie bereits berichtet, klagten User über das Löschen ihres Stundenplans beim Update von Version 0.8.0 auf 0.8.1. Wir haben eine Lösung für das Problem gefunden und testen diese ausführlich bis zum Ende dieser Woche. Wenn alles glatt verläuft, dann kommt am Wochenende die fehlerbereinige Version 0.8.2 heraus.\n\n*(25.Okt 2016)*",
|
||||
"audiences": ["students"],
|
||||
"categories": ["news"],
|
||||
"sequenceIndex": 1004,
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "foo",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCMessage"
|
||||
}
|
||||
27
packages/core/test/resources/indexable/Message.3.json
Normal file
27
packages/core/test/resources/indexable/Message.3.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"errorNames": ["additionalProperties"],
|
||||
"instance": {
|
||||
"type": "message",
|
||||
"invalid-non-existing-key-in-schema": 1,
|
||||
"uid": "4706ef24-b631-5c20-91d1-3c627deccf5a",
|
||||
"image": "https://backend/res/img/message_small.png",
|
||||
"name": "Lösung für das Problem des Zurücksetzens der StApps-App gefunden",
|
||||
"messageBody": "Wie bereits berichtet, klagten User über das Löschen ihres Stundenplans beim Update von Version 0.8.0 auf 0.8.1. Wir haben eine Lösung für das Problem gefunden und testen diese ausführlich bis zum Ende dieser Woche. Wenn alles glatt verläuft, dann kommt am Wochenende die fehlerbereinige Version 0.8.2 heraus.\n\n*(25.Okt 2016)*",
|
||||
"audiences": ["students"],
|
||||
"categories": ["news"],
|
||||
"audienceOrganizations": [
|
||||
{
|
||||
"name": "TU Berlin",
|
||||
"type": "organization",
|
||||
"uid": "4806ef14-b631-5c20-91d1-3c627decca5a"
|
||||
}
|
||||
],
|
||||
"sequenceIndex": 1005,
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCMessage"
|
||||
}
|
||||
26
packages/core/test/resources/indexable/Message.4.json
Normal file
26
packages/core/test/resources/indexable/Message.4.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"errorNames": ["required"],
|
||||
"instance": {
|
||||
"type": "message",
|
||||
"invalid-non-existing-key-in-schema": 1,
|
||||
"uid": "4706ef24-b631-5c20-91d1-3c627deccfff",
|
||||
"image": "https://backend/res/img/message_small.png",
|
||||
"name": "Lösung für das Problem des Zurücksetzens der StApps-App gefunden",
|
||||
"messageBody": "Wie bereits berichtet, klagten User über das Löschen ihres Stundenplans beim Update von Version 0.8.0 auf 0.8.1. Wir haben eine Lösung für das Problem gefunden und testen diese ausführlich bis zum Ende dieser Woche. Wenn alles glatt verläuft, dann kommt am Wochenende die fehlerbereinige Version 0.8.2 heraus.\n\n*(25.Okt 2016)*",
|
||||
"audiences": ["students"],
|
||||
"audienceOrganizations": [
|
||||
{
|
||||
"name": "TU Berlin",
|
||||
"type": "organization",
|
||||
"uid": "4806ef14-b631-5c20-91d1-3c627decca5a"
|
||||
}
|
||||
],
|
||||
"sequenceIndex": 1005,
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCMessage"
|
||||
}
|
||||
14
packages/core/test/resources/indexable/Organization.1.json
Normal file
14
packages/core/test/resources/indexable/Organization.1.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "organization",
|
||||
"uid": "20e48393-0d2b-5bdc-9d92-5e0dc1e2860e",
|
||||
"name": "Technische Universität Berlin",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCOrganization"
|
||||
}
|
||||
26
packages/core/test/resources/indexable/Organization.2.json
Normal file
26
packages/core/test/resources/indexable/Organization.2.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "organization",
|
||||
"uid": "20e48393-0d2b-5bdc-9d92-5e0dc1e2860f",
|
||||
"contactPoints": [
|
||||
{
|
||||
"type": "contact point",
|
||||
"name": "Dienstadresse",
|
||||
"email": "info@example.com",
|
||||
"faxNumber": "069 / 123450",
|
||||
"officeHours": "Mo, Mi 8:00-13:00",
|
||||
"telephone": "069 / 12345",
|
||||
"url": "https://example.com",
|
||||
"uid": "be34a419-e9e8-5de0-b998-dd1b19e7beef"
|
||||
}
|
||||
],
|
||||
"name": "Technische Universität Berlin",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCOrganization"
|
||||
}
|
||||
29
packages/core/test/resources/indexable/Periodical.1.json
Normal file
29
packages/core/test/resources/indexable/Periodical.1.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "periodical",
|
||||
"uid": "d921479e-4d35-5cd1-b64a-939cbe40a5b0",
|
||||
"name": "London magazine : a review of literature and the arts",
|
||||
"categories": ["journal"],
|
||||
"firstPublished": "1954",
|
||||
"publications": [
|
||||
{
|
||||
"uid": "603a6574-8910-588a-9e83-cd26e6988c74",
|
||||
"type": "publication event",
|
||||
"locations": ["London"],
|
||||
"publisher": "London Magazine",
|
||||
"name": "London Magazine"
|
||||
}
|
||||
],
|
||||
"ISSNs": ["0024-6085"],
|
||||
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB046847146",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "HeBIS HDS",
|
||||
"originalId": "HEB046847146",
|
||||
"type": "remote",
|
||||
"url": "https://ubffm.hds.hebis.de"
|
||||
}
|
||||
},
|
||||
"schema": "SCPeriodical"
|
||||
}
|
||||
28
packages/core/test/resources/indexable/Periodical.2.json
Normal file
28
packages/core/test/resources/indexable/Periodical.2.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "periodical",
|
||||
"uid": "c8d7a4f7-88ac-5da3-86c7-32b93d16f00a",
|
||||
"name": "[Frankfurter Allgemeine / R F A Z FAZ Republik Heroes], Frankfurter Allgemeine : Zeitung für Deutschland, R. Rhein-Main-Zeitung : Zeitung für Frankfurt",
|
||||
"categories": ["journal"],
|
||||
"firstPublished": "1988",
|
||||
"publications": [
|
||||
{
|
||||
"uid": "64829217-9eea-532f-8730-7e609efffbca",
|
||||
"type": "publication event",
|
||||
"locations": ["Frankfurt, M."],
|
||||
"publisher": "Frankfurter Allg. Zeitung",
|
||||
"name": "Frankfurter Allg. Zeitung"
|
||||
}
|
||||
],
|
||||
"sameAs": "https://ubffm.hds.hebis.de/Record/HEB048624853",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "HeBIS HDS",
|
||||
"originalId": "HEB048624853",
|
||||
"type": "remote",
|
||||
"url": "https://ubffm.hds.hebis.de"
|
||||
}
|
||||
},
|
||||
"schema": "SCPeriodical"
|
||||
}
|
||||
18
packages/core/test/resources/indexable/Person.1.json
Normal file
18
packages/core/test/resources/indexable/Person.1.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "person",
|
||||
"uid": "97044080-fdf3-5ec0-8734-c412ac2dde03",
|
||||
"givenName": "Michael",
|
||||
"familyName": "Joswig",
|
||||
"gender": "male",
|
||||
"honorificPrefix": "Prof. Dr.",
|
||||
"name": "Michael Joswig",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCPerson"
|
||||
}
|
||||
18
packages/core/test/resources/indexable/Person.2.json
Normal file
18
packages/core/test/resources/indexable/Person.2.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "person",
|
||||
"uid": "eb516021-3b37-5358-baef-345a0e10da5b",
|
||||
"givenName": "Michael",
|
||||
"familyName": "Gradzielski",
|
||||
"gender": "male",
|
||||
"honorificPrefix": "Prof. Dr.",
|
||||
"name": "Michael Gradzielski",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCPerson"
|
||||
}
|
||||
37
packages/core/test/resources/indexable/Person.3.json
Normal file
37
packages/core/test/resources/indexable/Person.3.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "person",
|
||||
"familyName": "Mustermann",
|
||||
"givenName": "Erika",
|
||||
"honorificPrefix": "Univ.-Prof'in Dr.",
|
||||
"gender": "female",
|
||||
"jobTitles": [
|
||||
"Direktor/in, Akademie für Bildungsforschung und Lehrerbildung",
|
||||
"Professorinnen und Professoren, Politikwissenschaft mit dem Schwerpunkt Internationale Institutionen und Friedensprozesse",
|
||||
"Vizepräsidentinnen und Vizepräsidenten, Leitung der Universität (Präsidium)",
|
||||
"Senat",
|
||||
"Leitung, Projektkoordination - Abteilung Lehre und Qualitätssicherung"
|
||||
],
|
||||
"name": "Univ.-Prof'in Dr. Erika Mustermann",
|
||||
"uid": "be34a419-e9e8-5de0-b998-dd1b19e7f451",
|
||||
"workLocations": [
|
||||
{
|
||||
"type": "contact point",
|
||||
"name": "Dienstadresse",
|
||||
"email": "info@example.com",
|
||||
"faxNumber": "069 / 123450",
|
||||
"officeHours": "Mo, Mi 8:00-13:00",
|
||||
"telephone": "069 / 12345",
|
||||
"url": "https://example.com",
|
||||
"uid": "be34a419-e9e8-5de0-b998-dd1b19e7beef"
|
||||
}
|
||||
],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCPerson"
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "f5fe4d13-d56a-5770-b16e-78782841bf02",
|
||||
"name": "Validierer (UB)",
|
||||
"type": "point of interest",
|
||||
"categories": ["validator"],
|
||||
"description": "EG Eingangsbereich",
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [8.653079867363, 50.120368286434]
|
||||
}
|
||||
},
|
||||
"inPlace": {
|
||||
"name": "UB",
|
||||
"address": {
|
||||
"addressCountry": "Deutschland",
|
||||
"addressLocality": "Frankfurt am Main",
|
||||
"addressRegion": "Hessen",
|
||||
"postalCode": "60325",
|
||||
"streetAddress": "Bockenheimer Landstr. 134-138"
|
||||
},
|
||||
"geo": {
|
||||
"point": {
|
||||
"coordinates": [8.65302, 50.12036],
|
||||
"type": "Point"
|
||||
},
|
||||
"polygon": {
|
||||
"coordinates": [
|
||||
[
|
||||
[8.6524924635887, 50.120309814205],
|
||||
[8.6525192856789, 50.120423319054],
|
||||
[8.6526641249657, 50.120426758591],
|
||||
[8.6526963114738, 50.120547142219],
|
||||
[8.6526480317116, 50.120554021274],
|
||||
[8.6527070403099, 50.120839501198],
|
||||
[8.65344196558, 50.120777590034],
|
||||
[8.6533936858177, 50.120498988804],
|
||||
[8.6533454060554, 50.120498988804],
|
||||
[8.6533239483833, 50.120375165515],
|
||||
[8.6534956097603, 50.12035796781],
|
||||
[8.6534580588341, 50.120241023257],
|
||||
[8.6524924635887, 50.120309814205]
|
||||
]
|
||||
],
|
||||
"type": "Polygon"
|
||||
}
|
||||
},
|
||||
"categories": ["library"],
|
||||
"type": "building",
|
||||
"uid": "65596790-a217-5d70-888e-16aa17bfda0a"
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCPointOfInterest"
|
||||
}
|
||||
108
packages/core/test/resources/indexable/PointOfInterest.2.json
Normal file
108
packages/core/test/resources/indexable/PointOfInterest.2.json
Normal file
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "5a5ca30a-1494-5707-9692-ff902e104c12",
|
||||
"name": "Drucker 1 (IG)",
|
||||
"type": "point of interest",
|
||||
"categories": ["printer"],
|
||||
"description": "Raum 124 (Q1) (Bibliothek BzG, EG), 1x KM Farb-Drucker",
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [8.6657989025116, 50.125455096926]
|
||||
}
|
||||
},
|
||||
"inPlace": {
|
||||
"name": "IG-Farben-Haus",
|
||||
"address": {
|
||||
"addressCountry": "Deutschland",
|
||||
"addressLocality": "Frankfurt am Main",
|
||||
"addressRegion": "Hessen",
|
||||
"postalCode": "60323",
|
||||
"streetAddress": "Norbert-Wollheim-Platz 1"
|
||||
},
|
||||
"geo": {
|
||||
"point": {
|
||||
"coordinates": [8.66754, 50.12539],
|
||||
"type": "Point"
|
||||
},
|
||||
"polygon": {
|
||||
"coordinates": [
|
||||
[
|
||||
[8.6657291650772, 50.125584925616],
|
||||
[8.6659651994705, 50.125568589575],
|
||||
[8.6659370362759, 50.125409527832],
|
||||
[8.6663648486137, 50.125404369064],
|
||||
[8.6663661897182, 50.125483470114],
|
||||
[8.6665780842304, 50.125483470114],
|
||||
[8.6665780842304, 50.125404369064],
|
||||
[8.6670058965683, 50.125416406189],
|
||||
[8.6669830977917, 50.125504964942],
|
||||
[8.6671829223633, 50.125527319552],
|
||||
[8.6671949923038, 50.125484329907],
|
||||
[8.6672767996788, 50.125493787632],
|
||||
[8.6672674119473, 50.125550533945],
|
||||
[8.6672835052013, 50.125590084365],
|
||||
[8.6673210561275, 50.125612438936],
|
||||
[8.6673800647259, 50.125631354334],
|
||||
[8.6674457788467, 50.12562705538],
|
||||
[8.667494058609, 50.125610719354],
|
||||
[8.6675289273262, 50.125578047284],
|
||||
[8.6675503849983, 50.12552645976],
|
||||
[8.6676281690598, 50.125540216438],
|
||||
[8.6676093935966, 50.125587504991],
|
||||
[8.6677998304367, 50.125621036845],
|
||||
[8.6678387224674, 50.125534197892],
|
||||
[8.6682437360287, 50.125637372868],
|
||||
[8.6681927740574, 50.125707015851],
|
||||
[8.6683765053749, 50.125763761911],
|
||||
[8.6684314906597, 50.125691539641],
|
||||
[8.6688230931759, 50.125829105775],
|
||||
[8.6686930060387, 50.125961512804],
|
||||
[8.6688874661922, 50.126038893366],
|
||||
[8.6690349876881, 50.125889290834],
|
||||
[8.6690711975098, 50.125852320021],
|
||||
[8.6692562699318, 50.125660587207],
|
||||
[8.6690685153007, 50.125582346242],
|
||||
[8.6689116060734, 50.125738828044],
|
||||
[8.6685039103031, 50.125591803948],
|
||||
[8.6686179041862, 50.125439620635],
|
||||
[8.6684314906597, 50.125383733986],
|
||||
[8.6683201789856, 50.125530758722],
|
||||
[8.6678843200207, 50.125420705161],
|
||||
[8.6679527163506, 50.125253904751],
|
||||
[8.6677622795105, 50.125222092235],
|
||||
[8.6677542328835, 50.125234989203],
|
||||
[8.6677099764347, 50.125231550012],
|
||||
[8.6677341163158, 50.125143850553],
|
||||
[8.6674189567566, 50.125101720364],
|
||||
[8.6673907935619, 50.125191139497],
|
||||
[8.6672754585743, 50.125179102316],
|
||||
[8.6672808229923, 50.125161906337],
|
||||
[8.6670783162117, 50.125139551556],
|
||||
[8.667034059763, 50.125310651347],
|
||||
[8.6665807664394, 50.125294315213],
|
||||
[8.6665767431259, 50.125107738964],
|
||||
[8.6663635075092, 50.125106019364],
|
||||
[8.6663635075092, 50.125293455416],
|
||||
[8.6659182608128, 50.125301193586],
|
||||
[8.6658847332001, 50.125124934962],
|
||||
[8.6656500399113, 50.125142130954],
|
||||
[8.6657291650772, 50.125584925616]
|
||||
]
|
||||
],
|
||||
"type": "Polygon"
|
||||
}
|
||||
},
|
||||
"type": "building",
|
||||
"categories": ["education"],
|
||||
"uid": "a825451c-cbc4-544a-9d96-9de0b635fdbd"
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCPointOfInterest"
|
||||
}
|
||||
29
packages/core/test/resources/indexable/Room.1.json
Normal file
29
packages/core/test/resources/indexable/Room.1.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [13.32615, 52.51345]
|
||||
}
|
||||
},
|
||||
"type": "room",
|
||||
"categories": ["cafe"],
|
||||
"uid": "b7206fb5-bd77-5572-928f-16aa70910f64",
|
||||
"alternateNames": ["MA Mathe Cafeteria"],
|
||||
"name": "Mathe Cafeteria",
|
||||
"address": {
|
||||
"addressCountry": "Germany",
|
||||
"addressLocality": "Berlin",
|
||||
"addressRegion": "Berlin",
|
||||
"postalCode": "10623",
|
||||
"streetAddress": "Straße des 17. Juni 136"
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCRoom"
|
||||
}
|
||||
23
packages/core/test/resources/indexable/Room.2.json
Normal file
23
packages/core/test/resources/indexable/Room.2.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [13.3306966, 52.5104675]
|
||||
}
|
||||
},
|
||||
"type": "room",
|
||||
"categories": ["library"],
|
||||
"uid": "6e5abbff-d995-507b-982b-e0d094da6606",
|
||||
"alternateNames": ["BIB"],
|
||||
"name": "Universitätsbibliothek",
|
||||
"floorName": "0",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCRoom"
|
||||
}
|
||||
82
packages/core/test/resources/indexable/Room.3.json
Normal file
82
packages/core/test/resources/indexable/Room.3.json
Normal file
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [13.3262843, 52.5135435]
|
||||
}
|
||||
},
|
||||
"description": "loses Mobiliar im Foyer",
|
||||
"type": "room",
|
||||
"categories": ["learn"],
|
||||
"uid": "d33fa478-7e5d-5197-9f0e-091f7f8105df",
|
||||
"name": "MA Foyer",
|
||||
"inPlace": {
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [13.32577, 52.51398]
|
||||
},
|
||||
"polygon": {
|
||||
"type": "Polygon",
|
||||
"coordinates": [
|
||||
[
|
||||
[13.3259988, 52.5141108],
|
||||
[13.3259718, 52.5143107],
|
||||
[13.3262958, 52.5143236],
|
||||
[13.3263291, 52.5143052],
|
||||
[13.3263688, 52.5140098],
|
||||
[13.3264324, 52.5139643],
|
||||
[13.3264849, 52.5139415],
|
||||
[13.3265148, 52.5139004],
|
||||
[13.3265336, 52.5138571],
|
||||
[13.3265411, 52.5137933],
|
||||
[13.3265336, 52.5137546],
|
||||
[13.3264961, 52.5137044],
|
||||
[13.3264399, 52.5136725],
|
||||
[13.3263875, 52.5136497],
|
||||
[13.3263351, 52.5136429],
|
||||
[13.3263613, 52.5134286],
|
||||
[13.3262564, 52.5133603],
|
||||
[13.3260767, 52.5133671],
|
||||
[13.3259418, 52.5134286],
|
||||
[13.3258744, 52.5135061],
|
||||
[13.3258444, 52.5135677],
|
||||
[13.3261366, 52.5135836],
|
||||
[13.3261066, 52.513807],
|
||||
[13.3260579, 52.5138047],
|
||||
[13.3260317, 52.5139096],
|
||||
[13.3254137, 52.5138708],
|
||||
[13.3254287, 52.5137819],
|
||||
[13.3250879, 52.513766],
|
||||
[13.3250018, 52.5142697],
|
||||
[13.3253613, 52.5142902],
|
||||
[13.3253838, 52.5140747],
|
||||
[13.3259988, 52.5141108]
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"type": "building",
|
||||
"categories": ["education"],
|
||||
"name": "Mathematikgebäude",
|
||||
"alternateNames": ["MA"],
|
||||
"uid": "edfaba58-254f-5da0-82d6-3b46a76c48ce",
|
||||
"address": {
|
||||
"addressCountry": "Germany",
|
||||
"addressLocality": "Berlin",
|
||||
"addressRegion": "Berlin",
|
||||
"postalCode": "10623",
|
||||
"streetAddress": "Straße des 17. Juni 136"
|
||||
}
|
||||
},
|
||||
"floorName": "0",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCRoom"
|
||||
}
|
||||
53
packages/core/test/resources/indexable/Room.4.json
Normal file
53
packages/core/test/resources/indexable/Room.4.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "ea9db087-240b-5b10-a65b-9684d88a3e4e",
|
||||
"name": "Poolraum (HoF)",
|
||||
"type": "room",
|
||||
"categories": ["computer", "learn"],
|
||||
"description": "1. OG, Raum 1.29, 18 Plätze, rollstuhlgerecht, Montag bis Freitag von 8:00 bis 20:00 Uhr",
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [8.6654716730118, 50.127288142239]
|
||||
}
|
||||
},
|
||||
"inPlace": {
|
||||
"name": "HoF",
|
||||
"address": {
|
||||
"addressCountry": "Deutschland",
|
||||
"addressLocality": "Frankfurt am Main",
|
||||
"addressRegion": "Hessen",
|
||||
"postalCode": "60323",
|
||||
"streetAddress": "Theodor-W.-Adorno-Platz 3"
|
||||
},
|
||||
"geo": {
|
||||
"point": {
|
||||
"coordinates": [8.66521, 50.12715],
|
||||
"type": "Point"
|
||||
},
|
||||
"polygon": {
|
||||
"coordinates": [
|
||||
[
|
||||
[8.6646019667387, 50.127282983673],
|
||||
[8.6655273288488, 50.127413667164],
|
||||
[8.6656533926725, 50.127055146471],
|
||||
[8.6647307127714, 50.126922742467],
|
||||
[8.6646019667387, 50.127282983673]
|
||||
]
|
||||
],
|
||||
"type": "Polygon"
|
||||
}
|
||||
},
|
||||
"categories": ["education"],
|
||||
"type": "building",
|
||||
"uid": "583b4bd4-d7b7-5736-b2df-87e05c41d97a"
|
||||
},
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCRoom"
|
||||
}
|
||||
18
packages/core/test/resources/indexable/Semester.1.json
Normal file
18
packages/core/test/resources/indexable/Semester.1.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "622b950b-a29c-593b-9059-aece622228a0",
|
||||
"type": "semester",
|
||||
"name": "Wintersemester 2017/2018",
|
||||
"acronym": "WS 2017/18",
|
||||
"alternateNames": ["WiSe 2017/18"],
|
||||
"startDate": "2017-10-01",
|
||||
"endDate": "2018-03-31",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCSemester"
|
||||
}
|
||||
20
packages/core/test/resources/indexable/Semester.2.json
Normal file
20
packages/core/test/resources/indexable/Semester.2.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "7cebbc3e-0a21-5371-ab0d-f7ba12f53dbd",
|
||||
"type": "semester",
|
||||
"name": "Sommersemester 2018",
|
||||
"acronym": "SoSe 2018",
|
||||
"alternateNames": ["Sommer 2018"],
|
||||
"startDate": "2018-04-01",
|
||||
"endDate": "2018-09-30",
|
||||
"eventsStartDate": "2018-04-09",
|
||||
"eventsEndDate": "2018-07-13",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCSemester"
|
||||
}
|
||||
32
packages/core/test/resources/indexable/Ticket.json
Normal file
32
packages/core/test/resources/indexable/Ticket.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "ticket",
|
||||
"name": "Ticket",
|
||||
"uid": "34fc6cd9-5bd1-5779-a75d-a25d01ad4dae",
|
||||
"currentTicketNumber": "250",
|
||||
"approxWaitingTime": "PT43S",
|
||||
"inPlace": {
|
||||
"geo": {
|
||||
"point": {
|
||||
"type": "Point",
|
||||
"coordinates": [13.3255622, 52.5118668]
|
||||
}
|
||||
},
|
||||
"type": "room",
|
||||
"categories": ["office"],
|
||||
"openingHours": "Mo-Fr 09:30-12:30; Tu 13:00-16:00; We off",
|
||||
"uid": "7257a1d7-47ac-4acc-a8cc-3f9ac6442e5d",
|
||||
"alternateNames": ["H 0010"],
|
||||
"name": "Prüfungsamt - Team 2",
|
||||
"floorName": "0"
|
||||
},
|
||||
"serviceType": "Prüfungsamt",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCTicket"
|
||||
}
|
||||
105
packages/core/test/resources/indexable/Tour.1.json
Normal file
105
packages/core/test/resources/indexable/Tour.1.json
Normal file
@@ -0,0 +1,105 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "4f1c1810-1a9f-52cb-bfe9-65dcab5e889a",
|
||||
"type": "tour",
|
||||
"name": "Stundenplan erstellen",
|
||||
"description": "Veranstaltung suchen und zum Stundenplan hinzufügen",
|
||||
"steps": [
|
||||
{
|
||||
"type": "location",
|
||||
"location": "#/b-tu/main"
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "ion-nav-bar div[nav-bar=\"active\"] div.buttons-left",
|
||||
"text": "Öffne das Menü.",
|
||||
"resolved": {
|
||||
"menu": "open-left"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "#stapps-main-menu-main-b-tu-search",
|
||||
"text": "Öffne die Suche.",
|
||||
"resolved": {
|
||||
"location": {
|
||||
"is": "#/b-tu/search"
|
||||
}
|
||||
},
|
||||
"position": "bottom"
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "ion-header-bar label",
|
||||
"text": "Such' nach einer Veranstaltung indem du beispielsweise den Titel einer Veranstaltung eingibst."
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "ion-nav-bar div[nav-bar=\"active\"] div.buttons-right",
|
||||
"text": "Öffne die Filter.",
|
||||
"resolved": {
|
||||
"menu": "open-right"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": ".stapps-context-menu-selectable-lists",
|
||||
"text": "Filtere um eine Veranstaltung zu finden...",
|
||||
"position": "top"
|
||||
},
|
||||
{
|
||||
"type": "menu",
|
||||
"side": "right",
|
||||
"action": "close"
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": ".stapps-search-results .stapps-data-list-remote-items",
|
||||
"text": "Klicke auf eine Veranstaltung...",
|
||||
"resolved": {
|
||||
"location": {
|
||||
"match": "#/b-tu/data/detail/Event"
|
||||
}
|
||||
},
|
||||
"position": "top"
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "ion-view[nav-view=\"active\"] stapps-event-date-in-course stapps-event-date-toggle",
|
||||
"text": "Füge die Veranstaltung zu deinem Stundenplan hinzu."
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "ion-nav-bar div[nav-bar=\"active\"] div.buttons-left",
|
||||
"text": "Öffne das Menü erneut.",
|
||||
"resolved": {
|
||||
"menu": "open-left"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "#stapps-main-menu-personal-b-tu-events",
|
||||
"text": "Öffne deinen Stundenplan.",
|
||||
"resolved": {
|
||||
"location": {
|
||||
"is": "#/b-tu/events"
|
||||
}
|
||||
},
|
||||
"position": "right"
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": ".stapps-timetable-clocks",
|
||||
"text": "Dies ist dein Stundenplan. Die Veranstaltung wird dir nun hier angezeigt.",
|
||||
"position": "right"
|
||||
}
|
||||
],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCTour"
|
||||
}
|
||||
132
packages/core/test/resources/indexable/Tour.2.json
Normal file
132
packages/core/test/resources/indexable/Tour.2.json
Normal file
@@ -0,0 +1,132 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"uid": "665d834d-594a-5d72-be94-ff2892a6003c",
|
||||
"type": "tour",
|
||||
"name": "Favorisierte Essensorte",
|
||||
"description": "Essensorte favorisieren, um ihre Speisepläne als Widget auf der Startseite zu sehen",
|
||||
"init": "injector.get('stappsHomeChosenWidgets').remove('stappsEatAndDrinkWidgets.dishesInFavoritedPlaces');",
|
||||
"steps": [
|
||||
{
|
||||
"type": "location",
|
||||
"location": "#/b-tu/main"
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "ion-nav-bar div[nav-bar=\"active\"] div.buttons-right .ion-ios-unlocked-outline",
|
||||
"text": "Wechsle in den Bearbeitungsmodus.",
|
||||
"resolved": {
|
||||
"event": "stappsMenu.toggleEditMode"
|
||||
},
|
||||
"canFail": true,
|
||||
"tries": 2
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": ["#stapps-home-add-widgets", "#stapps-home-personalize"],
|
||||
"text": "Öffne die Widget-Auswahl.",
|
||||
"resolved": {
|
||||
"element": "ion-modal-view.active"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "#stapps-home-widgets-add-stapps-eat-and-drink-widgets-dishes-in-favorited-places",
|
||||
"text": "Füge das Widget \"Gerichte in favorisierten Orten\" zu deiner Startseite hinzu.",
|
||||
"resolved": {
|
||||
"event": "stappsHomeChosenWidgets.addedWidget"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "ion-nav-bar div[nav-bar=\"active\"] div.buttons-right .ion-ios-locked",
|
||||
"text": "Speichere deine Änderungen.",
|
||||
"resolved": {
|
||||
"event": "stappsMenu.toggleEditMode"
|
||||
},
|
||||
"canFail": true,
|
||||
"tries": 1
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "#stapps-home-widgets-stapps-eat-and-drink-widgets-dishes-in-favorited-places",
|
||||
"text": "Das ist das Widget, dass dir die Speisepläne deiner favorisierten Essensorte anzeigt. Klicke auf \"Essensorte\", um zur Übersicht der Essensorte zu gelangen.",
|
||||
"resolved": {
|
||||
"location": {
|
||||
"is": "#/b-tu/places?types=FoodEstablishment"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "#b-tu-places-types-food-establishment-place-m-a-mathe-cafeteria h2",
|
||||
"text": "Wähle die \"Mathe Cafeteria\" aus, um sie zu favorisieren.",
|
||||
"resolved": {
|
||||
"location": {
|
||||
"is": "#/b-tu/map?place=MA%20Mathe%20Cafeteria"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "ion-nav-bar div[nav-bar=\"active\"] div.buttons-right stapps-favorite",
|
||||
"text": "Favorisiere die Mathe-Cafeteria, über den Favoritenstern. Sobald du sie favorisiert hast, wird er gelb.",
|
||||
"resolved": {
|
||||
"event": "stappsFavorites.addedFavorite"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "ion-nav-bar div[nav-bar=\"active\"] div.buttons-left",
|
||||
"text": "Öffne das Menü, um zur Startseite zurückzukehren.",
|
||||
"resolved": {
|
||||
"menu": "open-left"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "ion-side-menu.menu-left header",
|
||||
"text": "Klicke auf das TU-Logo oder \"StApps\", um zur Startseite zurückzukehren.",
|
||||
"resolved": {
|
||||
"location": {
|
||||
"is": "#/b-tu/main"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "#stapps-home-widgets-stapps-eat-and-drink-widgets-dishes-in-favorited-places",
|
||||
"text": "Das Widget zeigt dir nun mindestens den Speiseplan der Mathe Cafeteria an."
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "ion-nav-bar div[nav-bar=\"active\"] div.buttons-left",
|
||||
"text": "Öffne das Menü ein letztes Mal.",
|
||||
"resolved": {
|
||||
"menu": "open-left"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "#stapps-main-menu-personal-b-tu-favorites",
|
||||
"text": "Öffne deine Favoriten.",
|
||||
"resolved": {
|
||||
"location": {
|
||||
"is": "#/b-tu/favorites"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "tooltip",
|
||||
"element": "#b-tu-favorites-favorite-favorite-m-a-mathe-cafeteria",
|
||||
"text": "Hier siehst du nun auch die Mathe Cafeteria in der Liste deiner Favoriten."
|
||||
}
|
||||
],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCTour"
|
||||
}
|
||||
15
packages/core/test/resources/indexable/Video.1.json
Normal file
15
packages/core/test/resources/indexable/Video.1.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "video",
|
||||
"uid": "e274cc82-f51c-566b-b8da-85763ff375e8",
|
||||
"sameAs": "https://vimeo.com/1084537",
|
||||
"name": "Big Buck Bunny",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCVideo"
|
||||
}
|
||||
46
packages/core/test/resources/indexable/Video.2.json
Normal file
46
packages/core/test/resources/indexable/Video.2.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "video",
|
||||
"uid": "2def52c8-f901-5b30-96fc-ba570a038508",
|
||||
"sameAs": "https://vimeo.com/1084537",
|
||||
"name": "Big Buck Bunny",
|
||||
"sources": [
|
||||
{
|
||||
"url": "https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
|
||||
"mimeType": "video/mp4",
|
||||
"height": 240,
|
||||
"width": 320
|
||||
},
|
||||
{
|
||||
"url": "https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_stereo.ogg",
|
||||
"mimeType": "video/ogg",
|
||||
"height": 1080,
|
||||
"width": 1920
|
||||
},
|
||||
{
|
||||
"url": "https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_stereo.ogg",
|
||||
"mimeType": "video/ogg",
|
||||
"height": 480,
|
||||
"width": 854
|
||||
}
|
||||
],
|
||||
"duration": "PT9M57S",
|
||||
"thumbnails": ["https://peach.blender.org/wp-content/uploads/bbb-splash.png?x11217"],
|
||||
"actors": [
|
||||
{
|
||||
"type": "person",
|
||||
"uid": "540862f3-ea30-5b8f-8678-56b4dc217642",
|
||||
"name": "Big Buck Bunny",
|
||||
"givenName": "Big Buck",
|
||||
"familyName": "Bunny"
|
||||
}
|
||||
],
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCVideo"
|
||||
}
|
||||
81
packages/core/test/routes.spec.ts
Normal file
81
packages/core/test/routes.spec.ts
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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 {slow, suite, test, timeout} from '@testdeck/mocha';
|
||||
import {expect} from 'chai';
|
||||
import {SCBulkAddRoute} from '../src/protocol/routes/bulk-add';
|
||||
import {SCBulkRoute} from '../src/protocol/routes/bulk-request';
|
||||
import {SCThingUpdateRoute} from '../src/protocol/routes/thing-update';
|
||||
|
||||
@suite(timeout(10000), slow(5000))
|
||||
export class RoutesSpec {
|
||||
@test
|
||||
public bulkAddRouteUrlPath() {
|
||||
const bulkAddRoute = new SCBulkAddRoute();
|
||||
|
||||
expect(
|
||||
bulkAddRoute.getUrlPath({
|
||||
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
|
||||
}),
|
||||
).to.equal('/bulk/540862f3-ea30-5b8f-8678-56b4dc217140');
|
||||
}
|
||||
|
||||
@test
|
||||
public bulkRouteUrlPath() {
|
||||
const bulkRoute = new SCBulkRoute();
|
||||
|
||||
expect(bulkRoute.getUrlPath()).to.equal('/bulk');
|
||||
}
|
||||
|
||||
@test
|
||||
public thingUpdateRouteUrlPath() {
|
||||
const thingUpdateRoute = new SCThingUpdateRoute();
|
||||
|
||||
expect(
|
||||
thingUpdateRoute.getUrlPath({
|
||||
TYPE: 'dish',
|
||||
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
|
||||
}),
|
||||
).to.equal('/dish/540862f3-ea30-5b8f-8678-56b4dc217140');
|
||||
}
|
||||
|
||||
@test
|
||||
public tooManyParameters() {
|
||||
const thingUpdateRoute = new SCThingUpdateRoute();
|
||||
|
||||
const fn = () => {
|
||||
thingUpdateRoute.getUrlPath({
|
||||
FOO: 'bar',
|
||||
TYPE: 'dish',
|
||||
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
|
||||
});
|
||||
};
|
||||
|
||||
expect(fn).to.throw('Extraneous parameters provided.');
|
||||
}
|
||||
|
||||
@test
|
||||
public wrongParameters() {
|
||||
const thingUpdateRoute = new SCThingUpdateRoute();
|
||||
|
||||
const fn = () => {
|
||||
thingUpdateRoute.getUrlPath({
|
||||
TYPO: 'dish',
|
||||
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
|
||||
});
|
||||
};
|
||||
|
||||
expect(fn).to.throw("Parameter 'TYPE' not provided.");
|
||||
}
|
||||
}
|
||||
29
packages/core/test/schema.spec.ts
Normal file
29
packages/core/test/schema.spec.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import {validateFiles, writeReport} from '@openstapps/core-tools/lib/validate';
|
||||
import {slow, suite, test, timeout} from '@testdeck/mocha';
|
||||
import {expect} from 'chai';
|
||||
import {mkdirSync} from 'fs';
|
||||
import {join, resolve} from 'path';
|
||||
|
||||
@suite(timeout(15000), slow(10000))
|
||||
export class SchemaSpec {
|
||||
@test
|
||||
async 'validate against test files'() {
|
||||
const errorsPerFile = {
|
||||
...(await validateFiles(resolve('lib', 'schema'), resolve('test', 'resources'))),
|
||||
...(await validateFiles(resolve('lib', 'schema'), resolve('test', 'resources', 'indexable'))),
|
||||
};
|
||||
|
||||
let unexpected = false;
|
||||
Object.keys(errorsPerFile).forEach(file => {
|
||||
unexpected = unexpected || errorsPerFile[file].some(error => !error.expected);
|
||||
});
|
||||
|
||||
mkdirSync('report', {
|
||||
recursive: true,
|
||||
});
|
||||
|
||||
await writeReport(join('report', 'index.html'), errorsPerFile);
|
||||
|
||||
expect(unexpected).to.be.equal(false);
|
||||
}
|
||||
}
|
||||
352
packages/core/test/translator.spec.ts
Normal file
352
packages/core/test/translator.spec.ts
Normal file
@@ -0,0 +1,352 @@
|
||||
/*
|
||||
* Copyright (C) 2019 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 {slow, suite, test, timeout} from '@testdeck/mocha';
|
||||
import {expect} from 'chai';
|
||||
import clone from 'rfdc';
|
||||
import {SCThingOriginType, SCThingRemoteOrigin, SCThingType} from '../src/things/abstract/thing';
|
||||
import {SCBuildingWithoutReferences} from '../src/things/building';
|
||||
import {SCDish, SCDishMeta} from '../src/things/dish';
|
||||
import {SCSetting, SCSettingInputType} from '../src/things/setting';
|
||||
import {SCThingTranslator} from '../src/translator';
|
||||
|
||||
const building: SCBuildingWithoutReferences = {
|
||||
address: {
|
||||
addressCountry: 'base-address.addressCountry',
|
||||
addressLocality: 'base-address.addressLocality',
|
||||
postalCode: 'base-address.postalCode',
|
||||
streetAddress: 'base-address.streetAddress',
|
||||
},
|
||||
categories: ['office', 'education'],
|
||||
floors: ['base-floor0', 'base-floor1'],
|
||||
geo: {
|
||||
point: {
|
||||
coordinates: [12.0, 13.0],
|
||||
type: 'Point',
|
||||
},
|
||||
},
|
||||
name: 'base-space-name',
|
||||
translations: {
|
||||
de: {
|
||||
address: {
|
||||
addressCountry: 'de-address.addressCountry',
|
||||
addressLocality: 'de-address.addressLocality',
|
||||
postalCode: 'de-address.postalCode',
|
||||
streetAddress: 'de-address.streetAddress',
|
||||
},
|
||||
floors: ['de-floor0', 'de-floor1'],
|
||||
name: 'de-space-name',
|
||||
},
|
||||
},
|
||||
type: SCThingType.Building,
|
||||
uid: '540862f3-ea30-5b8f-8678-56b4dc217140',
|
||||
};
|
||||
|
||||
const dish: SCDish = {
|
||||
categories: ['main dish', 'dessert'],
|
||||
characteristics: [{name: 'base-characteristic0'}, {name: 'base-characteristic1'}],
|
||||
name: 'base-dish-name',
|
||||
offers: [
|
||||
{
|
||||
availability: 'in stock',
|
||||
inPlace: building,
|
||||
prices: {
|
||||
default: 23.42,
|
||||
},
|
||||
provider: {
|
||||
name: 'base-provider',
|
||||
type: SCThingType.Organization,
|
||||
uid: '540862f3-ea30-5b8f-8678-56b4dc217141',
|
||||
},
|
||||
},
|
||||
],
|
||||
origin: {
|
||||
indexed: '1970-01-01T00:00:00.000Z',
|
||||
name: 'dish-connector',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
translations: {
|
||||
de: {
|
||||
characteristics: [{name: 'de-characteristic0'}, {name: 'de-characteristic1'}],
|
||||
name: 'de-dish-name',
|
||||
},
|
||||
},
|
||||
type: SCThingType.Dish,
|
||||
uid: '540862f3-ea30-5b8f-8678-56b4dc217140',
|
||||
};
|
||||
|
||||
const setting: SCSetting = {
|
||||
categories: ['profile'],
|
||||
defaultValue: 'student',
|
||||
description: 'base-description',
|
||||
inputType: SCSettingInputType.SingleChoice,
|
||||
name: 'group',
|
||||
order: 1,
|
||||
origin: {
|
||||
indexed: '2018-11-11T14:30:00Z',
|
||||
name: 'Dummy',
|
||||
type: SCThingOriginType.Remote,
|
||||
},
|
||||
type: SCThingType.Setting,
|
||||
uid: '2c97aa36-4aa2-43de-bc5d-a2b2cb3a530e',
|
||||
values: ['student', 'employee', true, 42],
|
||||
};
|
||||
|
||||
const translator = new SCThingTranslator('de');
|
||||
const translatorEN = new SCThingTranslator('en');
|
||||
// this will simulate a translator always utilizing the base language translations
|
||||
const translatorWithFallback = new SCThingTranslator('tt');
|
||||
|
||||
const translatedThingDE = translator.translate(dish);
|
||||
const translatedThingFallback = translatorWithFallback.translate(dish);
|
||||
|
||||
@suite(timeout(10000), slow(5000))
|
||||
export class TranslationSpecInplace {
|
||||
@test
|
||||
public directEnumSingleValue() {
|
||||
expect(translator.translatedAccess(setting).inputType()).to.equal('einfache Auswahl');
|
||||
}
|
||||
|
||||
@test
|
||||
public directStringLiteralType() {
|
||||
expect(translator.translatedAccess(dish).type()).to.equal('Essen');
|
||||
expect(translatedThingDE.type).to.equal('Essen');
|
||||
}
|
||||
|
||||
@test
|
||||
public directStringProperty() {
|
||||
expect(translator.translatedAccess(dish).name()).to.equal('de-dish-name');
|
||||
expect(translatedThingDE.name).to.equal('de-dish-name');
|
||||
}
|
||||
|
||||
@test
|
||||
public directArrayOfString() {
|
||||
expect(translator.translatedAccess(dish).characteristics()).to.deep.equal([
|
||||
{name: 'de-characteristic0'},
|
||||
{name: 'de-characteristic1'},
|
||||
]);
|
||||
expect(translatedThingDE.characteristics).to.deep.equal([
|
||||
{name: 'de-characteristic0'},
|
||||
{name: 'de-characteristic1'},
|
||||
]);
|
||||
}
|
||||
|
||||
@test
|
||||
public directArrayOfStringSubscript() {
|
||||
expect(translator.translatedAccess(dish).characteristics[1]()).to.deep.equal({
|
||||
name: 'de-characteristic1',
|
||||
});
|
||||
expect(translatedThingDE.characteristics![1]).to.deep.equal({name: 'de-characteristic1'});
|
||||
}
|
||||
|
||||
@test
|
||||
public directMetaArrayOfString() {
|
||||
expect(translator.translatedAccess(dish).categories()).to.deep.equal(['Hauptgericht', 'Nachtisch']);
|
||||
expect(translatedThingDE.categories).to.deep.equal(['Hauptgericht', 'Nachtisch']);
|
||||
}
|
||||
|
||||
@test
|
||||
public directMetaArrayOfStringSubscript() {
|
||||
expect(translator.translatedAccess(dish).categories[1]()).to.equal('Nachtisch');
|
||||
expect(translatedThingDE.categories[1]).to.equal('Nachtisch');
|
||||
}
|
||||
|
||||
@test
|
||||
public nestedStringLiteralType() {
|
||||
expect(translator.translatedAccess(dish).offers[0].inPlace.type()).to.equal('Gebäude');
|
||||
expect(translatedThingDE.offers![0].inPlace!.type).to.equal('Gebäude');
|
||||
}
|
||||
|
||||
@test
|
||||
public nestedStringProperty() {
|
||||
expect(translator.translatedAccess(dish).offers[0].inPlace.name()).to.equal('de-space-name');
|
||||
expect(translatedThingDE.offers![0].inPlace!.name).to.equal('de-space-name');
|
||||
}
|
||||
|
||||
@test
|
||||
public nestedMetaArrayOfString() {
|
||||
expect(translator.translatedAccess(dish).offers[0].inPlace.categories()).to.deep.equal([
|
||||
'Büro',
|
||||
'Bildung',
|
||||
]);
|
||||
expect(translatedThingDE.offers![0].inPlace!.categories).to.deep.equal(['Büro', 'Bildung']);
|
||||
}
|
||||
|
||||
@test
|
||||
public nestedMetaArrayOfStringSubscript() {
|
||||
expect(translator.translatedAccess(dish).offers[0].inPlace.categories[1]()).to.equal('Bildung');
|
||||
expect(translatedThingDE.offers![0].inPlace!.categories[1]).to.equal('Bildung');
|
||||
}
|
||||
|
||||
@test
|
||||
public directStringLiteralTypeFallback() {
|
||||
expect(translatorWithFallback.translatedAccess(dish).type()).to.equal('dish');
|
||||
expect(translatedThingFallback.type).to.equal('dish');
|
||||
}
|
||||
|
||||
@test
|
||||
public directStringPropertyFallback() {
|
||||
expect(translatorWithFallback.translatedAccess(dish).name()).to.equal('base-dish-name');
|
||||
expect(translatedThingFallback.name).to.equal('base-dish-name');
|
||||
}
|
||||
|
||||
@test
|
||||
public directArrayOfStringSubscriptFallback() {
|
||||
expect(translatorWithFallback.translatedAccess(dish).characteristics[1]()).to.deep.equal({
|
||||
name: 'base-characteristic1',
|
||||
});
|
||||
expect(translatedThingFallback.characteristics![1]).to.deep.equal({name: 'base-characteristic1'});
|
||||
}
|
||||
|
||||
@test
|
||||
public directMetaArrayOfStringFallback() {
|
||||
expect(translatorWithFallback.translatedAccess(dish).categories()).to.deep.equal([
|
||||
'main dish',
|
||||
'dessert',
|
||||
]);
|
||||
expect(translatedThingFallback.categories).to.deep.equal(['main dish', 'dessert']);
|
||||
}
|
||||
|
||||
@test
|
||||
public directMetaArrayOfStringSubscriptFallback() {
|
||||
expect(translatorWithFallback.translatedAccess(dish).categories[1]()).to.equal('dessert');
|
||||
expect(translatedThingFallback.categories[1]).to.equal('dessert');
|
||||
}
|
||||
|
||||
@test
|
||||
public nestedStringLiteralTypeFallback() {
|
||||
expect(translatorWithFallback.translatedAccess(dish).offers[0].inPlace.type()).to.equal('building');
|
||||
expect(translatedThingFallback.offers![0].inPlace!.type).to.equal('building');
|
||||
}
|
||||
|
||||
@test
|
||||
public nestedStringPropertyFallback() {
|
||||
expect(translatorWithFallback.translatedAccess(dish).offers[0].inPlace.name()).to.equal(
|
||||
'base-space-name',
|
||||
);
|
||||
expect(translatedThingFallback.offers![0].inPlace!.name).to.equal('base-space-name');
|
||||
}
|
||||
|
||||
@test
|
||||
public nestedMetaArrayOfStringFallback() {
|
||||
expect(translatorWithFallback.translatedAccess(dish).offers[0].inPlace.categories()).to.deep.equal([
|
||||
'office',
|
||||
'education',
|
||||
]);
|
||||
expect(translatedThingFallback.offers![0].inPlace!.categories).to.deep.equal(['office', 'education']);
|
||||
}
|
||||
|
||||
@test
|
||||
public nestedMetaArrayOfStringSubscriptFallback() {
|
||||
expect(translatorWithFallback.translatedAccess(dish).offers[0].inPlace.categories[1]()).to.equal(
|
||||
'education',
|
||||
);
|
||||
expect(translatedThingFallback.offers![0].inPlace!.categories[1]).to.equal('education');
|
||||
}
|
||||
|
||||
@test
|
||||
public directStringLiteralTypeUndefined() {
|
||||
const undefinedThing = eval('(x) => undefined;');
|
||||
expect(translator.translatedAccess(undefinedThing())('defaultValue')).to.equal('defaultValue');
|
||||
expect(translator.translatedAccess(dish).name('defaultValue')).to.not.equal('defaultValue');
|
||||
}
|
||||
|
||||
@test
|
||||
public nestedMetaArrayOfStringSubscriptUndefined() {
|
||||
const workingTranslation = eval(
|
||||
"translator.translatedAccess(dish).offers[0].inPlace.categories[1]('printer');",
|
||||
);
|
||||
const defaultValueTranslation = eval(
|
||||
"translator.translatedAccess(dish).offers[0].inPlace.categories[1234]('printer');",
|
||||
);
|
||||
|
||||
expect(defaultValueTranslation).to.equal('printer');
|
||||
expect(workingTranslation).to.not.equal('printer');
|
||||
}
|
||||
|
||||
@test
|
||||
public reaccessWithChangedSourceOmitsLRUCache() {
|
||||
const translatorDE = new SCThingTranslator('de');
|
||||
const dishCopy = clone()(dish);
|
||||
const translatedDish = translatorDE.translatedAccess(dish);
|
||||
const distructivelyTranslatedDish = translatorDE.translate(dish);
|
||||
|
||||
(dishCopy.origin as SCThingRemoteOrigin).name = 'tranlator.spec';
|
||||
expect(translatorDE.translatedAccess(dishCopy)).not.to.deep.equal(translatedDish);
|
||||
expect(translatorDE.translate(dishCopy)).not.to.equal(distructivelyTranslatedDish);
|
||||
}
|
||||
|
||||
@test
|
||||
public changingTranslatorLanguageFlushesItsLRUCache() {
|
||||
const translatorDE = new SCThingTranslator('de');
|
||||
expect(translatorDE.translatedAccess(dish).name()).to.equal('de-dish-name');
|
||||
expect(translatorDE.translate(dish).name).to.equal('de-dish-name');
|
||||
translatorDE.language = 'en';
|
||||
expect(translatorDE.translatedAccess(dish).name()).to.equal('base-dish-name');
|
||||
expect(translatorDE.translate(dish).name).to.equal('base-dish-name');
|
||||
}
|
||||
|
||||
@test
|
||||
public forceTranslatorLRUCacheToOverflow() {
|
||||
const translatorDE = new SCThingTranslator('de');
|
||||
// Make sure to add more elements to the translator cache than the maximum cache capacity. See Translator.ts
|
||||
for (let i = 0; i < 201; i++) {
|
||||
const anotherDish = Object.assign({}, dish);
|
||||
anotherDish.uid = String(i);
|
||||
expect(translatorDE.translatedAccess(anotherDish).name()).to.equal('de-dish-name');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@suite(timeout(10000), slow(5000))
|
||||
export class MetaTranslationSpec {
|
||||
@test
|
||||
public consistencyWithMetaClass() {
|
||||
const dishMetaTranslationsDE = translator.translatedPropertyNames(dish.type);
|
||||
const dishMetaTranslationsEN = translatorEN.translatedPropertyNames(dish.type);
|
||||
expect(dishMetaTranslationsEN).to.not.deep.equal(dishMetaTranslationsDE);
|
||||
expect(dishMetaTranslationsDE).to.deep.equal(new SCDishMeta().fieldTranslations.de);
|
||||
expect(dishMetaTranslationsEN).to.deep.equal(new SCDishMeta().fieldTranslations.en);
|
||||
}
|
||||
|
||||
@test
|
||||
public retrieveTranslatedPropertyValueType() {
|
||||
const dishTypeDE = translator.translatedPropertyValue(dish.type, 'type');
|
||||
const dishTypeEN = translatorEN.translatedPropertyValue(dish.type, 'type', undefined);
|
||||
const dishTypeBASE = translatorWithFallback.translatedPropertyValue(dish.type, 'type');
|
||||
expect(dishTypeDE).to.deep.equal(new SCDishMeta().fieldValueTranslations.de.type);
|
||||
expect(dishTypeEN).to.deep.equal(new SCDishMeta().fieldValueTranslations.en.type);
|
||||
expect(dishTypeBASE).to.deep.equal(new SCDishMeta().fieldValueTranslations.en.type);
|
||||
}
|
||||
|
||||
@test
|
||||
public retrieveTranslatedPropertyValueNested() {
|
||||
const dishTypeDE = translator.translatedPropertyValue(dish.type, 'categories', 'main dish');
|
||||
const dishTypeEN = translatorEN.translatedPropertyValue(dish.type, 'categories', 'main dish');
|
||||
const dishTypeBASE = translatorWithFallback.translatedPropertyValue(dish.type, 'categories', 'main dish');
|
||||
expect(dishTypeDE).to.deep.equal(new SCDishMeta().fieldValueTranslations.de.categories['main dish']);
|
||||
expect(dishTypeEN).to.deep.equal(dish.categories[0]);
|
||||
expect(dishTypeBASE).to.deep.equal(dish.categories[0]);
|
||||
}
|
||||
|
||||
@test
|
||||
public thingWithoutMetaClass() {
|
||||
const dishCopy = clone()(dish);
|
||||
const typeNonExistant = eval("(x) => x + 'typeNonExistant';");
|
||||
// this will assign a non existant SCThingType to dishCopy
|
||||
dishCopy.type = typeNonExistant();
|
||||
const dishMetaTranslationsDE = translator.translatedPropertyNames(dishCopy.type);
|
||||
expect(dishMetaTranslationsDE).to.be.undefined;
|
||||
}
|
||||
}
|
||||
411
packages/core/test/type.spec.ts
Normal file
411
packages/core/test/type.spec.ts
Normal file
@@ -0,0 +1,411 @@
|
||||
/*
|
||||
* Copyright (C) 2019 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 {assert, Has, IsAny, IsNever, NotHas} from 'conditional-type-checks';
|
||||
import {SCThing, SCThingWithoutReferences} from '../src/things/abstract/thing';
|
||||
import {SCAcademicEvent, SCAcademicEventWithoutReferences} from '../src/things/academic-event';
|
||||
import {SCArticle, SCArticleWithoutReferences} from '../src/things/article';
|
||||
import {SCAssessment, SCAssessmentWithoutReferences} from '../src/things/assessment';
|
||||
import {SCBook, SCBookWithoutReferences} from '../src/things/book';
|
||||
import {SCBuilding, SCBuildingWithoutReferences} from '../src/things/building';
|
||||
import {SCCatalog, SCCatalogWithoutReferences} from '../src/things/catalog';
|
||||
import {SCContactPoint, SCContactPointWithoutReferences} from '../src/things/contact-point';
|
||||
import {SCCourseOfStudy, SCCourseOfStudyWithoutReferences} from '../src/things/course-of-study';
|
||||
import {SCDateSeries, SCDateSeriesWithoutReferences} from '../src/things/date-series';
|
||||
import {SCDiff, SCDiffWithoutReferences} from '../src/things/diff';
|
||||
import {SCDish, SCDishWithoutReferences} from '../src/things/dish';
|
||||
import {SCFavorite, SCFavoriteWithoutReferences} from '../src/things/favorite';
|
||||
import {SCFloor, SCFloorWithoutReferences} from '../src/things/floor';
|
||||
import {SCMessage, SCMessageWithoutReferences} from '../src/things/message';
|
||||
import {SCOrganization, SCOrganizationWithoutReferences} from '../src/things/organization';
|
||||
import {SCPeriodical, SCPeriodicalWithoutReferences} from '../src/things/periodical';
|
||||
import {SCPerson, SCPersonWithoutReferences} from '../src/things/person';
|
||||
import {SCPointOfInterest, SCPointOfInterestWithoutReferences} from '../src/things/point-of-interest';
|
||||
import {SCPublicationEvent, SCPublicationEventWithoutReferences} from '../src/things/publication-event';
|
||||
import {SCRoom, SCRoomWithoutReferences} from '../src/things/room';
|
||||
import {SCSemester, SCSemesterWithoutReferences} from '../src/things/semester';
|
||||
import {SCSetting, SCSettingWithoutReferences} from '../src/things/setting';
|
||||
import {SCSportCourse, SCSportCourseWithoutReferences} from '../src/things/sport-course';
|
||||
import {SCStudyModule, SCStudyModuleWithoutReferences} from '../src/things/study-module';
|
||||
import {SCTicket, SCTicketWithoutReferences} from '../src/things/ticket';
|
||||
import {SCToDo, SCToDoWithoutReferences} from '../src/things/todo';
|
||||
import {SCTour, SCTourWithoutReferences} from '../src/things/tour';
|
||||
import {SCVideo, SCVideoWithoutReferences} from '../src/things/video';
|
||||
|
||||
/**
|
||||
* Check if E extends T
|
||||
*/
|
||||
type Extends<E, T> = E extends T ? true : false;
|
||||
|
||||
/**
|
||||
* Get type of array elements up to nesting level 3
|
||||
*/
|
||||
type ElementType<T> = T extends any[]
|
||||
? T[0] extends any[]
|
||||
? T[0][0] extends any[]
|
||||
? T[0][0][0]
|
||||
: T[0][0]
|
||||
: T[0]
|
||||
: T;
|
||||
|
||||
/**
|
||||
* Get types of properties
|
||||
*
|
||||
* - Extracts only the properties which extend object and are not any.
|
||||
* - If type is an array it returns the type of the elements.
|
||||
*/
|
||||
type PropertyTypes<T> = Extract<
|
||||
ElementType<T extends object ? (IsAny<T[keyof T]> extends true ? never : T[keyof T]) : never>,
|
||||
object
|
||||
>;
|
||||
|
||||
/**
|
||||
* Get nested property types
|
||||
*/
|
||||
type PropertyTypesNested<T> = PropertyTypes<T> extends object
|
||||
? PropertyTypes<PropertyTypes<T>>
|
||||
: PropertyTypes<T>;
|
||||
|
||||
/**
|
||||
* Types of properties of SCDiff
|
||||
*/
|
||||
type SCDiffPropertyTypes = PropertyTypesNested<SCDiff>;
|
||||
assert<NotHas<SCDiffPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCDiffPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCDiffPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCDiffPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCDiffWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCDiff, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCAcademicEvent
|
||||
*/
|
||||
type SCAcademicEventPropertyTypes = PropertyTypesNested<SCAcademicEvent>;
|
||||
assert<NotHas<SCAcademicEventPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCAcademicEventPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCAcademicEventPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCAcademicEventPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCAcademicEventWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCAcademicEvent, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCArticle
|
||||
*/
|
||||
type SCArticlePropertyTypes = PropertyTypesNested<SCArticle>;
|
||||
assert<NotHas<SCArticlePropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCArticlePropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCArticlePropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCArticlePropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCArticleWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCArticle, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCAssessment
|
||||
*/
|
||||
type SCAssessmentPropertyTypes = PropertyTypesNested<SCAssessment>;
|
||||
assert<NotHas<SCAssessmentPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCAssessmentPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCAssessmentPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCAssessmentPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCAssessmentWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCAssessment, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCBook
|
||||
*/
|
||||
type SCBookPropertyTypes = PropertyTypesNested<SCBook>;
|
||||
assert<NotHas<SCBookPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCBookPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCBookPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCBookPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCBookWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCBook, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCBuilding
|
||||
*/
|
||||
type SCBuildingPropertyTypes = PropertyTypesNested<SCBuilding>;
|
||||
assert<NotHas<SCBuildingPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCBuildingPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCBuildingPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCBuildingPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCBuildingWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCBuilding, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCContactPoint
|
||||
*/
|
||||
type SCContactPointPropertyTypes = PropertyTypesNested<SCContactPoint>;
|
||||
assert<NotHas<SCContactPointPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCContactPointPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCContactPointPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCContactPointPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCContactPointWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCContactPoint, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCCatalog
|
||||
*/
|
||||
type SCCatalogPropertyTypes = PropertyTypesNested<SCCatalog>;
|
||||
assert<NotHas<SCCatalogPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCCatalogPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCCatalogPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCCatalogPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCCatalogWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCCatalog, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCCourseOfStudy
|
||||
*/
|
||||
type SCCourseOfStudyPropertyTypes = PropertyTypesNested<SCCourseOfStudy>;
|
||||
assert<NotHas<SCCourseOfStudyPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCCourseOfStudyPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCCourseOfStudyPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCCourseOfStudyPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCCourseOfStudyWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCCourseOfStudy, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCDateSeries
|
||||
*/
|
||||
type SCDateSeriesPropertyTypes = PropertyTypesNested<SCDateSeries>;
|
||||
assert<NotHas<SCDateSeriesPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCDateSeriesPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCDateSeriesPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCDateSeriesPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCDateSeriesWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCDateSeries, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCDish
|
||||
*/
|
||||
type SCDishPropertyTypes = PropertyTypesNested<SCDish>;
|
||||
assert<NotHas<SCDishPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCDishPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCDishPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCDishPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCDishWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCDish, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCFavorite
|
||||
*/
|
||||
type SCFavoritePropertyTypes = PropertyTypesNested<SCFavorite>;
|
||||
assert<NotHas<SCFavoritePropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCFavoritePropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCFavoritePropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCFavoritePropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCFavoriteWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCFavorite, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCFloor
|
||||
*/
|
||||
type SCFloorPropertyTypes = PropertyTypesNested<SCFloor>;
|
||||
assert<NotHas<SCFloorPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCFloorPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCFloorPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCFloorPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCFloorWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCFloor, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCMessage
|
||||
*/
|
||||
type SCMessagePropertyTypes = PropertyTypesNested<SCMessage>;
|
||||
assert<NotHas<SCMessagePropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCMessagePropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCMessagePropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCMessagePropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCMessageWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCMessage, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCOrganization
|
||||
*/
|
||||
type SCOrganizationPropertyTypes = PropertyTypesNested<SCOrganization>;
|
||||
assert<NotHas<SCOrganizationPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCOrganizationPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCOrganizationPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCOrganizationPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCOrganizationWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCOrganization, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCPeriodical
|
||||
*/
|
||||
type SCPeriodicalPropertyTypes = PropertyTypesNested<SCPeriodical>;
|
||||
assert<NotHas<SCPeriodicalPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCPeriodicalPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCPeriodicalPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCPeriodicalPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCPeriodicalWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCPeriodical, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCPerson
|
||||
*/
|
||||
type SCPersonPropertyTypes = PropertyTypesNested<SCPerson>;
|
||||
assert<NotHas<SCPersonPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCPersonPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCPersonPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCPersonPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCPersonWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCPerson, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCPointOfInterest
|
||||
*/
|
||||
type SCPointOfInterestPropertyTypes = PropertyTypesNested<SCPointOfInterest>;
|
||||
assert<NotHas<SCPointOfInterestPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCPointOfInterestPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCPointOfInterestPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCPointOfInterestPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCPointOfInterestWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCPointOfInterest, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCPublicationEvent
|
||||
*/
|
||||
type SCPublicationEventPropertyTypes = PropertyTypesNested<SCPublicationEvent>;
|
||||
assert<NotHas<SCPublicationEventPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCPublicationEventPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCPublicationEventPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCPublicationEventPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCPublicationEventWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCPublicationEvent, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCRoom
|
||||
*/
|
||||
type SCRoomPropertyTypes = PropertyTypesNested<SCRoom>;
|
||||
assert<NotHas<SCRoomPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCRoomPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCRoomPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCRoomPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCRoomWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCRoom, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCSemester
|
||||
*/
|
||||
type SCSemesterPropertyTypes = PropertyTypesNested<SCSemester>;
|
||||
assert<NotHas<SCSemesterPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCSemesterPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCSemesterPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCSemesterPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCSemesterWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCSemester, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCSetting
|
||||
*/
|
||||
type SCSettingPropertyTypes = PropertyTypesNested<SCSetting>;
|
||||
assert<NotHas<SCSettingPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCSettingPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCSettingPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCSettingPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCSettingWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCSetting, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCSportCourse
|
||||
*/
|
||||
type SCSportCoursePropertyTypes = PropertyTypesNested<SCSportCourse>;
|
||||
assert<NotHas<SCSportCoursePropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCSportCoursePropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCSportCoursePropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCSportCoursePropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCSportCourseWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCSportCourse, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCStudyModule
|
||||
*/
|
||||
type SCStudyModulePropertyTypes = PropertyTypesNested<SCStudyModule>;
|
||||
assert<NotHas<SCStudyModulePropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCStudyModulePropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCStudyModulePropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCStudyModulePropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCStudyModuleWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCStudyModule, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCTicket
|
||||
*/
|
||||
type SCTicketPropertyTypes = PropertyTypesNested<SCTicket>;
|
||||
assert<NotHas<SCTicketPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCTicketPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCTicketPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCTicketPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCTicketWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCTicket, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCToDo
|
||||
*/
|
||||
type SCToDoPropertyTypes = PropertyTypesNested<SCToDo>;
|
||||
assert<NotHas<SCToDoPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCToDoPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCToDoPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCToDoPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCToDoWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCToDo, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCToDo
|
||||
*/
|
||||
type SCTourPropertyTypes = PropertyTypesNested<SCTour>;
|
||||
assert<NotHas<SCTourPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCTourPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCTourPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCTourPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCTourWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCTour, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCVideo
|
||||
*/
|
||||
type SCVideoPropertyTypes = PropertyTypesNested<SCVideo>;
|
||||
assert<NotHas<SCVideoPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCVideoPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCVideoPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCVideoPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCVideoWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCVideo, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Dummy interface, to check if union types still resolve to any if one of the members is any
|
||||
*/
|
||||
interface Foo {
|
||||
bar: SCPerson;
|
||||
foo: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type that is unfortunately never - blame TypeScript
|
||||
*/
|
||||
type UnfortunatelyNever = PropertyTypesNested<Foo>;
|
||||
assert<IsNever<UnfortunatelyNever>>(true);
|
||||
|
||||
/**
|
||||
* Flat property types
|
||||
*/
|
||||
type FlatPropertyTypes<T> = T[keyof T];
|
||||
|
||||
/**
|
||||
* Type that is unfortunately any - blame TypeScript
|
||||
*/
|
||||
type UnfortunatelyAny = FlatPropertyTypes<Foo>;
|
||||
assert<IsAny<UnfortunatelyAny>>(true);
|
||||
Reference in New Issue
Block a user