mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-03 12:02:53 +00:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7509610145 | ||
|
|
972cdf392d | ||
|
|
4f758f7d0c | ||
|
|
980e899807 | ||
|
|
d1c5bb9595 | ||
|
|
dc9c0f528f | ||
|
|
66d64e0858 | ||
|
|
06339786c2 | ||
|
|
8ed68481fa | ||
|
|
e26042957c | ||
|
|
7553620a5d | ||
|
|
322c001e70 | ||
|
|
830e249ac4 | ||
|
|
8c9df3ea9a | ||
|
|
f85768d32e | ||
|
|
580ace368f | ||
|
|
522be6643a | ||
|
|
8784309ddb | ||
|
|
3d8f996690 | ||
|
|
36a4bfcbbc |
30
CHANGELOG.md
30
CHANGELOG.md
@@ -1,3 +1,33 @@
|
||||
# [0.58.0](https://gitlab.com/openstapps/core/compare/v0.57.0...v0.58.0) (2022-01-18)
|
||||
|
||||
|
||||
|
||||
# [0.57.0](https://gitlab.com/openstapps/core/compare/v0.56.0...v0.57.0) (2022-01-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* extend config to describe auth providers ([7553620](https://gitlab.com/openstapps/core/commit/7553620a5d330ebfb66461afeab700e36bd37165))
|
||||
|
||||
|
||||
|
||||
# [0.56.0](https://gitlab.com/openstapps/core/compare/v0.55.0...v0.56.0) (2021-12-17)
|
||||
|
||||
|
||||
|
||||
# [0.55.0](https://gitlab.com/openstapps/core/compare/v0.54.0...v0.55.0) (2021-12-15)
|
||||
|
||||
|
||||
|
||||
# [0.54.0](https://gitlab.com/openstapps/core/compare/v0.53.0...v0.54.0) (2021-11-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add SCAssessment ([7a2e0f2](https://gitlab.com/openstapps/core/commit/7a2e0f20d1c64ab1deb7ab30bfb4bab4daaabd6d))
|
||||
|
||||
|
||||
|
||||
# [0.53.0](https://gitlab.com/openstapps/core/compare/v0.52.0...v0.53.0) (2021-10-19)
|
||||
|
||||
|
||||
|
||||
2974
package-lock.json
generated
2974
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
36
package.json
36
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openstapps/core",
|
||||
"version": "0.54.0",
|
||||
"version": "0.59.0",
|
||||
"description": "StAppsCore - Generalized model of data",
|
||||
"keywords": [
|
||||
"Model",
|
||||
@@ -45,37 +45,37 @@
|
||||
"Wieland Schöbl"
|
||||
],
|
||||
"dependencies": {
|
||||
"@openstapps/core-tools": "0.25.0",
|
||||
"@openstapps/core-tools": "0.28.0",
|
||||
"@types/geojson": "1.0.6",
|
||||
"@types/json-patch": "0.0.30",
|
||||
"@types/json-schema": "7.0.9",
|
||||
"@types/node": "14.17.9",
|
||||
"@types/node": "14.18.3",
|
||||
"fast-clone": "1.5.13",
|
||||
"fast-deep-equal": "3.1.3",
|
||||
"http-status-codes": "2.1.4",
|
||||
"http-status-codes": "2.2.0",
|
||||
"json-patch": "0.7.0",
|
||||
"json-schema": "0.3.0",
|
||||
"json-schema": "0.4.0",
|
||||
"ts-optchain": "0.1.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openstapps/configuration": "0.27.0",
|
||||
"@openstapps/es-mapping-generator": "0.0.3",
|
||||
"@openstapps/logger": "0.7.0",
|
||||
"@testdeck/mocha": "0.1.2",
|
||||
"@types/lodash": "4.14.172",
|
||||
"@types/chai": "4.2.21",
|
||||
"@types/rimraf": "3.0.1",
|
||||
"@types/mocha": "8.2.3",
|
||||
"@openstapps/configuration": "0.29.0",
|
||||
"@openstapps/es-mapping-generator": "0.0.4",
|
||||
"@openstapps/logger": "0.8.0",
|
||||
"@testdeck/mocha": "0.2.0",
|
||||
"@types/chai": "4.3.0",
|
||||
"@types/lodash": "4.14.178",
|
||||
"@types/mocha": "9.0.0",
|
||||
"@types/rimraf": "3.0.2",
|
||||
"chai": "4.3.4",
|
||||
"conditional-type-checks": "1.0.5",
|
||||
"conventional-changelog-cli": "2.1.1",
|
||||
"conventional-changelog-cli": "2.2.2",
|
||||
"lodash": "4.17.21",
|
||||
"mocha": "8.4.0",
|
||||
"mocha": "9.1.4",
|
||||
"nyc": "15.1.0",
|
||||
"rimraf": "3.0.2",
|
||||
"source-map-support": "0.5.19",
|
||||
"surge": "0.23.0",
|
||||
"ts-node": "9.1.1",
|
||||
"source-map-support": "0.5.21",
|
||||
"surge": "0.23.1",
|
||||
"ts-node": "10.4.0",
|
||||
"tslint": "6.1.3",
|
||||
"typedoc": "0.21.6",
|
||||
"typescript": "4.3.5"
|
||||
|
||||
@@ -17,6 +17,7 @@ import {Polygon} from 'geojson';
|
||||
import {SCTranslations} from '../general/i18n';
|
||||
import {SCMap} from '../general/map';
|
||||
import {SCLanguageSetting, SCSetting, SCUserGroupSetting} from '../things/setting';
|
||||
import {SCFeatureConfiguration} from './feature';
|
||||
|
||||
/**
|
||||
* An app configuration menu item
|
||||
@@ -94,9 +95,9 @@ export interface SCAppConfiguration {
|
||||
campusPolygon: Polygon;
|
||||
|
||||
/**
|
||||
* A list of features to en- or disable
|
||||
* Maps of enabled features (plugins and external services)
|
||||
*/
|
||||
features: SCAppConfigurationFeature;
|
||||
features: SCFeatureConfiguration;
|
||||
|
||||
/**
|
||||
* A URL where images are available
|
||||
@@ -135,16 +136,6 @@ export interface SCAppConfiguration {
|
||||
url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Map of features
|
||||
*/
|
||||
export interface SCAppConfigurationFeature {
|
||||
/**
|
||||
* Whether or not widgets are enabled
|
||||
*/
|
||||
widgets: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* URLs of published apps
|
||||
*/
|
||||
|
||||
106
src/config/authorization.ts
Normal file
106
src/config/authorization.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 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 {SCUserConfiguration} from './user';
|
||||
|
||||
/**
|
||||
* Supported authorization provider types
|
||||
*
|
||||
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-1.3.1
|
||||
* @see https://github.com/gbv/paia
|
||||
*/
|
||||
export type SCAuthorizationProviderType = 'default' | 'paia' ;
|
||||
|
||||
/**
|
||||
* An authorization provider complete configuration
|
||||
*/
|
||||
export interface SCAuthorizationProvider {
|
||||
/**
|
||||
* An authorization provider client configuration
|
||||
*/
|
||||
client: SCAuthorizationProviderClient;
|
||||
|
||||
/**
|
||||
* An authorization provider endpoints configuration
|
||||
*/
|
||||
endpoints: SCAuthorizationProviderEndpoints;
|
||||
}
|
||||
|
||||
/**
|
||||
* An authorization provider client configuration
|
||||
*/
|
||||
export interface SCAuthorizationProviderClient {
|
||||
/**
|
||||
* Client ID
|
||||
*/
|
||||
clientId: string;
|
||||
|
||||
/**
|
||||
* Authorization provider requires PKCE
|
||||
*/
|
||||
pkce: boolean;
|
||||
|
||||
/**
|
||||
* Redirct URL for after finishing authentication
|
||||
*/
|
||||
redirect: string;
|
||||
|
||||
/**
|
||||
* Scopes to request
|
||||
*/
|
||||
scopes: string;
|
||||
|
||||
/**
|
||||
* Main url to reach authorization provider
|
||||
*/
|
||||
url: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* An authorization provider endpoints configuration
|
||||
*/
|
||||
export interface SCAuthorizationProviderEndpoints {
|
||||
/**
|
||||
* URL to start authentication flow
|
||||
*/
|
||||
authorization: string;
|
||||
|
||||
/**
|
||||
* URL to end current session
|
||||
*/
|
||||
endSession?: string;
|
||||
|
||||
/**
|
||||
* Mapping of how to create SCUser from userinfo endpoint response (using JSONPath syntax)
|
||||
*
|
||||
* @see https://www.npmjs.com/package/jsonpath
|
||||
*/
|
||||
mapping: { [key in keyof SCUserConfiguration]: string; };
|
||||
|
||||
/**
|
||||
* URL to revoke a token
|
||||
*/
|
||||
revoke?: string;
|
||||
|
||||
/**
|
||||
* URL to get access Token
|
||||
*/
|
||||
token: string;
|
||||
|
||||
/**
|
||||
* URL to general user info endpoint
|
||||
*/
|
||||
userinfo: string;
|
||||
}
|
||||
49
src/config/feature.ts
Normal file
49
src/config/feature.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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 {SCMap} from '../general/map';
|
||||
import {SCAuthorizationProviderType} from './authorization';
|
||||
|
||||
export interface SCFeatureConfiguration {
|
||||
/**
|
||||
* Map of extern services mapped by their name (statically)
|
||||
*/
|
||||
extern?: SCMap<SCFeatureConfigurationExtern>;
|
||||
|
||||
/**
|
||||
* Map of plugins registered with the backend mapped by their name.
|
||||
*/
|
||||
plugins?: SCMap<SCFeatureConfigurationPlugin>;
|
||||
}
|
||||
|
||||
|
||||
export interface SCFeatureConfigurationPlugin {
|
||||
/**
|
||||
* URL path registered with the backend
|
||||
*/
|
||||
urlPath: string;
|
||||
}
|
||||
|
||||
export interface SCFeatureConfigurationExtern {
|
||||
/**
|
||||
* Key of authorization provider available in SCConfigFile
|
||||
*/
|
||||
authProvider?: SCAuthorizationProviderType;
|
||||
|
||||
/**
|
||||
* URL of extern service
|
||||
*/
|
||||
url: string;
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
import {SCLicensePlate} from '../general/namespaces';
|
||||
import {SCAppConfiguration} from './app';
|
||||
import {SCAuthorizationProvider, SCAuthorizationProviderType} from './authorization';
|
||||
import {SCBackendConfiguration, SCBackendInternalConfiguration} from './backend';
|
||||
|
||||
/**
|
||||
@@ -27,6 +28,11 @@ export interface SCConfigFile {
|
||||
*/
|
||||
app: SCAppConfiguration;
|
||||
|
||||
/**
|
||||
* Configuration for the supported authorization providers
|
||||
*/
|
||||
auth: { [key in SCAuthorizationProviderType]?: SCAuthorizationProvider; };
|
||||
|
||||
/**
|
||||
* Configuration for the backend that is visible to clients
|
||||
*/
|
||||
|
||||
56
src/config/user.ts
Normal file
56
src/config/user.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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 {SCAcademicPriceGroup} from '../things/abstract/thing-that-can-be-offered';
|
||||
|
||||
/**
|
||||
* A user configuration
|
||||
*/
|
||||
export interface SCUserConfiguration {
|
||||
/**
|
||||
* User's e-mail
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* User's family name
|
||||
*/
|
||||
familyName?: string;
|
||||
|
||||
/**
|
||||
* User's given name
|
||||
*/
|
||||
givenName?: string;
|
||||
|
||||
/**
|
||||
* ID given to the user
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* The complete name of the user combining all the parts of the name into one
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* Role assigned to the user
|
||||
*/
|
||||
role: keyof SCAcademicPriceGroup;
|
||||
|
||||
/**
|
||||
* Student ID given to the user
|
||||
*/
|
||||
studentId?: string;
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
/**
|
||||
* An ISO8601 date
|
||||
*
|
||||
* @pattern ^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$
|
||||
* @pattern ^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])(T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])([\.,][0-9]{0,7})?(Z|[+-](?:2[0-3]|[01][0-9])(:?[0-5][0-9])?)?)?$
|
||||
* @see https://gist.github.com/philipashlock/8830168
|
||||
*
|
||||
* @date
|
||||
@@ -37,6 +37,6 @@ export type SCISO8601Duration = string;
|
||||
/**
|
||||
* An ISO8601 time
|
||||
*
|
||||
* @pattern \d{2}:\d{2}(:\d{2})?
|
||||
* @pattern ^(2[0-3]|[01][0-9]):?([0-5][0-9]):?([0-5][0-9])$
|
||||
*/
|
||||
export type SCISO8601Time = string;
|
||||
|
||||
@@ -78,9 +78,9 @@ export interface SCRoute {
|
||||
statusCodeSuccess: number;
|
||||
|
||||
/**
|
||||
* URL fragment of the route
|
||||
* URL path of the route
|
||||
*/
|
||||
urlFragment: string;
|
||||
urlPath: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,16 +112,16 @@ export abstract class SCAbstractRoute implements SCRoute {
|
||||
*/
|
||||
statusCodeSuccess = 200;
|
||||
/**
|
||||
* @see SCRoute.urlFragment
|
||||
* @see SCRoute.urlPath
|
||||
*/
|
||||
urlFragment = '/';
|
||||
urlPath = '/';
|
||||
|
||||
/**
|
||||
* Get "compiled" URL fragment
|
||||
* Get "compiled" URL path
|
||||
*
|
||||
* @param parameters Parameters to compile URL fragment with
|
||||
* @param parameters Parameters to compile URL path with
|
||||
*/
|
||||
public getUrlFragment(parameters: SCMap<string> = {}): string {
|
||||
public getUrlPath(parameters: SCMap<string> = {}): string {
|
||||
let obligatoryParameters: string[] = [];
|
||||
|
||||
if (typeof this.obligatoryParameters === 'object') {
|
||||
@@ -132,7 +132,7 @@ export abstract class SCAbstractRoute implements SCRoute {
|
||||
throw new Error('Extraneous parameters provided.');
|
||||
}
|
||||
|
||||
return this.urlFragment
|
||||
return this.urlPath
|
||||
.split('/')
|
||||
.map((part) => {
|
||||
if (part.indexOf(':') !== 0) {
|
||||
|
||||
@@ -89,6 +89,6 @@ export class SCBookAvailabilityRoute extends SCAbstractRoute {
|
||||
this.requestBodyName = 'SCBookAvailabilityRequest';
|
||||
this.responseBodyName = 'SCBookAvailabilityResponse';
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/bookAvailability';
|
||||
this.urlPath = '/bookAvailability';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,6 @@ export class SCBulkAddRoute extends SCAbstractRoute {
|
||||
this.requestBodyName = 'SCBulkAddRequest';
|
||||
this.responseBodyName = 'SCBulkAddResponse';
|
||||
this.statusCodeSuccess = StatusCodes.CREATED;
|
||||
this.urlFragment = '/bulk/:UID';
|
||||
this.urlPath = '/bulk/:UID';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,6 @@ export class SCBulkDoneRoute extends SCAbstractRoute {
|
||||
this.requestBodyName = 'SCBulkDoneRequest';
|
||||
this.responseBodyName = 'SCBulkDoneResponse';
|
||||
this.statusCodeSuccess = StatusCodes.NO_CONTENT;
|
||||
this.urlFragment = '/bulk/:UID/done';
|
||||
this.urlPath = '/bulk/:UID/done';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,6 +99,6 @@ export class SCBulkRoute extends SCAbstractRoute {
|
||||
this.requestBodyName = 'SCBulkRequest';
|
||||
this.responseBodyName = 'SCBulkResponse';
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/bulk';
|
||||
this.urlPath = '/bulk';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ export class SCFeedbackRoute extends SCAbstractRoute {
|
||||
this.requestBodyName = 'SCFeedbackRequest';
|
||||
this.responseBodyName = 'SCFeedbackResponse';
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/feedback';
|
||||
this.urlPath = '/feedback';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,6 @@ export class SCIndexRoute extends SCAbstractRoute {
|
||||
this.requestBodyName = 'SCIndexRequest';
|
||||
this.responseBodyName = 'SCIndexResponse';
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/';
|
||||
this.urlPath = '/';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,6 +123,6 @@ export class SCPluginRegisterRoute extends SCAbstractRoute {
|
||||
this.requestBodyName = 'SCPluginRegisterRequest';
|
||||
this.responseBodyName = 'SCPluginRegisterResponse';
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/plugin/register';
|
||||
this.urlPath = '/plugin/register';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,6 @@ export class SCMultiSearchRoute extends SCAbstractRoute {
|
||||
this.requestBodyName = 'SCMultiSearchRequest';
|
||||
this.responseBodyName = 'SCMultiSearchResponse';
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/search/multi';
|
||||
this.urlPath = '/search/multi';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,6 @@ export class SCSearchRoute extends SCAbstractRoute {
|
||||
this.requestBodyName = 'SCSearchRequest';
|
||||
this.responseBodyName = 'SCSearchResponse';
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/search';
|
||||
this.urlPath = '/search';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,6 @@ export class SCThingUpdateRoute extends SCAbstractRoute {
|
||||
this.requestBodyName = 'SCThingUpdateRequest';
|
||||
this.responseBodyName = 'SCThingUpdateResponse';
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/:TYPE/:UID';
|
||||
this.urlPath = '/:TYPE/:UID';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ export interface SCThingThatCanBeOfferedOffer<T extends SCPriceGroup>
|
||||
/**
|
||||
* List of prices that are distinct for specific groups
|
||||
*/
|
||||
prices: T;
|
||||
prices?: T;
|
||||
|
||||
/**
|
||||
* Provider of an offer
|
||||
|
||||
@@ -5,13 +5,16 @@
|
||||
"instance": {
|
||||
"type": "message",
|
||||
"invalid-non-existing-key-in-schema": 1,
|
||||
"uid": "4706ef24-b631-5c20-91d1-3c627decca5a",
|
||||
"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",
|
||||
|
||||
28
test/resources/indexable/Message.4.json
Normal file
28
test/resources/indexable/Message.4.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
@@ -21,26 +21,26 @@ import {SCThingUpdateRoute} from '../src/protocol/routes/thing-update';
|
||||
@suite(timeout(10000), slow(5000))
|
||||
export class RoutesSpec {
|
||||
@test
|
||||
public bulkAddRouteUrlFragment() {
|
||||
public bulkAddRouteUrlPath() {
|
||||
const bulkAddRoute = new SCBulkAddRoute();
|
||||
|
||||
expect(bulkAddRoute.getUrlFragment({
|
||||
expect(bulkAddRoute.getUrlPath({
|
||||
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
|
||||
})).to.equal('/bulk/540862f3-ea30-5b8f-8678-56b4dc217140');
|
||||
}
|
||||
|
||||
@test
|
||||
public bulkRouteUrlFragment() {
|
||||
public bulkRouteUrlPath() {
|
||||
const bulkRoute = new SCBulkRoute();
|
||||
|
||||
expect(bulkRoute.getUrlFragment()).to.equal('/bulk');
|
||||
expect(bulkRoute.getUrlPath()).to.equal('/bulk');
|
||||
}
|
||||
|
||||
@test
|
||||
public thingUpdateRouteUrlFragment() {
|
||||
public thingUpdateRouteUrlPath() {
|
||||
const thingUpdateRoute = new SCThingUpdateRoute();
|
||||
|
||||
expect(thingUpdateRoute.getUrlFragment({
|
||||
expect(thingUpdateRoute.getUrlPath({
|
||||
TYPE: 'dish',
|
||||
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
|
||||
})).to.equal('/dish/540862f3-ea30-5b8f-8678-56b4dc217140');
|
||||
@@ -51,7 +51,7 @@ export class RoutesSpec {
|
||||
const thingUpdateRoute = new SCThingUpdateRoute();
|
||||
|
||||
const fn = () => {
|
||||
thingUpdateRoute.getUrlFragment({
|
||||
thingUpdateRoute.getUrlPath({
|
||||
FOO: 'bar',
|
||||
TYPE: 'dish',
|
||||
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
|
||||
@@ -66,7 +66,7 @@ export class RoutesSpec {
|
||||
const thingUpdateRoute = new SCThingUpdateRoute();
|
||||
|
||||
const fn = () => {
|
||||
thingUpdateRoute.getUrlFragment({
|
||||
thingUpdateRoute.getUrlPath({
|
||||
TYPO: 'dish',
|
||||
UID: '540862f3-ea30-5b8f-8678-56b4dc217140',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user