Compare commits

..

27 Commits

Author SHA1 Message Date
Karl-Philipp Wulfert
3a65d4ba2f 0.26.0 2019-08-19 12:10:21 +02:00
Wieland Schöbl
88f579e09b feat: add pluginRequestTimeout field to backend config 2019-08-14 10:38:53 +02:00
Rainer Killinger
be2bfb4017 build: update dependencies 2019-08-05 11:28:47 +02:00
Rainer Killinger
bad15dc872 fix: complete german translations 2019-08-05 11:10:14 +02:00
Rainer Killinger
8b090af3ed refactor: add exercise category 2019-08-05 11:09:10 +02:00
Karl-Philipp Wulfert
747497699d docs: update changelog 2019-07-25 15:47:00 +02:00
Karl-Philipp Wulfert
80a102cb6a 0.25.0 2019-07-25 15:46:59 +02:00
Karl-Philipp Wulfert
234cb57070 docs: add missing contributor 2019-07-25 15:45:34 +02:00
Karl-Philipp Wulfert
d4a8ef6a9c fix: correct package job 2019-07-25 15:44:47 +02:00
Karl-Philipp Wulfert
689dc99414 build: update dependencies 2019-07-25 15:36:44 +02:00
Karl-Philipp Wulfert
27d97c4c95 docs: update changelog 2019-07-23 11:20:15 +02:00
Karl-Philipp Wulfert
e71dace32f 0.24.0 2019-07-23 11:20:14 +02:00
Roman Klopsch
180c966891 docs: apply changes mentioned in discussion 2019-07-23 09:27:18 +02:00
Roman Klopsch
65730d603a refactor: apply changes mentioned in discussion 2019-07-23 09:27:17 +02:00
Roman Klopsch
7fbe1620ee refactor: rename receivingOrganizations field 2019-07-23 09:27:17 +02:00
Roman Klopsch
d781dd6de5 feat: add new field receivingOrganisations to message 2019-07-23 09:27:17 +02:00
Karl-Philipp Wulfert
86f3f8dfae docs: update changelog 2019-07-15 11:42:27 +02:00
Karl-Philipp Wulfert
34fe32b404 0.23.1 2019-07-15 11:42:26 +02:00
Michel Jonathan Schmitz
f262a6b8fa fix: use correct generic for the distance filter 2019-07-15 11:04:41 +02:00
Karl-Philipp Wulfert
e1d4b2bc9d feat: add type maps from routes to requests and responses
Fixes #80
2019-07-04 14:56:48 +02:00
Jovan Krunić
c3a9606f9d docs: update changelog 2019-07-03 15:30:38 +02:00
Jovan Krunić
dd56d97945 0.23.0 2019-07-03 15:30:33 +02:00
Jovan Krunić
43851d2d35 feat: support 404 (resource not found) error on plugin register route 2019-07-03 15:13:38 +02:00
Karl-Philipp Wulfert
b6272e9229 test: update NYC configuration 2019-06-28 12:42:45 +02:00
Karl-Philipp Wulfert
13dae1fb06 build: update dependencies 2019-06-28 12:38:28 +02:00
Karl-Philipp Wulfert
c18e3c15f1 feat: add mapping type from response to request and vice versa
Fixes #80
2019-06-28 12:36:52 +02:00
Karl-Philipp Wulfert
54d44f1acb docs: update changelog 2019-06-28 11:32:37 +02:00
11 changed files with 630 additions and 253 deletions

View File

@@ -12,6 +12,7 @@ stages:
- build
- test
- deploy
- publish
build:
tags:
@@ -55,7 +56,7 @@ package:
- build
tags:
- secrecy
stage: deploy
stage: publish
script:
- echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > ~/.npmrc
- npm publish

View File

@@ -1,3 +1,49 @@
# [0.25.0](https://gitlab.com/openstapps/core/compare/v0.24.0...v0.25.0) (2019-07-25)
### Bug Fixes
* correct package job ([d4a8ef6](https://gitlab.com/openstapps/core/commit/d4a8ef6))
# [0.24.0](https://gitlab.com/openstapps/core/compare/v0.23.1...v0.24.0) (2019-07-23)
### Features
* add new field receivingOrganisations to message ([d781dd6](https://gitlab.com/openstapps/core/commit/d781dd6))
## [0.23.1](https://gitlab.com/openstapps/core/compare/v0.23.0...v0.23.1) (2019-07-15)
### Bug Fixes
* use correct generic for the distance filter ([f262a6b](https://gitlab.com/openstapps/core/commit/f262a6b))
### Features
* add type maps from routes to requests and responses ([e1d4b2b](https://gitlab.com/openstapps/core/commit/e1d4b2b)), closes [#80](https://gitlab.com/openstapps/core/issues/80)
# [0.23.0](https://gitlab.com/openstapps/core/compare/v0.22.0...v0.23.0) (2019-07-03)
### Features
* add mapping type from response to request and vice versa ([c18e3c1](https://gitlab.com/openstapps/core/commit/c18e3c1)), closes [#80](https://gitlab.com/openstapps/core/issues/80)
* support 404 (resource not found) error on plugin register route ([43851d2](https://gitlab.com/openstapps/core/commit/43851d2))
# [0.22.0](https://gitlab.com/openstapps/core/compare/v0.21.0...v0.22.0) (2019-06-28)
# [0.21.0](https://gitlab.com/openstapps/core/compare/v0.20.0...v0.21.0) (2019-06-19)

676
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@openstapps/core",
"version": "0.22.0",
"version": "0.26.0",
"description": "StAppsCore - Generalized model of data",
"keywords": [
"Model",
@@ -38,12 +38,13 @@
"Michel Jonathan Schmitz",
"Rainer Killinger",
"Sebastian Lange",
"Wieland Schöbl"
"Wieland Schöbl",
"Roman Klopsch"
],
"dependencies": {
"@types/geojson": "1.0.6",
"@types/json-patch": "0.0.30",
"@types/node": "10.14.9",
"@types/node": "10.14.14",
"fast-clone": "1.5.13",
"http-status-codes": "1.3.2",
"json-patch": "0.7.0",
@@ -52,47 +53,50 @@
},
"devDependencies": {
"@krlwlfrt/async-pool": "0.1.0",
"@openstapps/configuration": "0.20.0",
"@openstapps/core-tools": "0.6.0",
"@openstapps/logger": "0.3.1",
"@openstapps/configuration": "0.21.1",
"@openstapps/core-tools": "0.8.0",
"@openstapps/logger": "0.4.0",
"@types/chai": "4.1.7",
"@types/rimraf": "2.0.2",
"chai": "4.2.0",
"commander": "2.20.0",
"conditional-type-checks": "1.0.1",
"conventional-changelog-cli": "2.0.21",
"mocha": "6.1.4",
"conventional-changelog-cli": "2.0.23",
"mocha": "6.2.0",
"mocha-typescript": "1.1.17",
"nyc": "14.1.1",
"rimraf": "2.6.3",
"source-map-support": "0.5.12",
"source-map-support": "0.5.13",
"ts-node": "8.3.0",
"tslint": "5.17.0",
"tslint": "5.18.0",
"typedoc": "0.14.2",
"typescript": "3.5.2"
"typescript": "3.5.3"
},
"nyc": {
"check-coverage": true,
"per-file": true,
"lines": 95,
"statements": 95,
"functions": 95,
"all": true,
"branches": 85,
"check-coverage": true,
"exclude": [],
"extension": [
".ts"
],
"functions": 95,
"include": [
"src/protocol/route.ts",
"src/things/abstract/thing.ts",
"src/translator.ts",
"src/guards.ts"
],
"exclude": [],
"extension": [
".ts"
],
"lines": 95,
"per-file": true,
"reporter": [
"html",
"text-summary"
],
"all": true
"require": [
"ts-node/register"
],
"statements": 95
},
"openstappsConfiguration": {
"hasCli": false,

View File

@@ -22,6 +22,13 @@ import {SCMonitoringConfiguration} from './monitoring';
* A backend configuration
*/
export interface SCBackendConfiguration {
/**
* The maximum amount of time (milliseconds) an external program can take to provide a response to the backend
*
* This can be used for example for Plugins.
*/
externalRequestTimeout: number;
/**
* A list of hidden SC types
*

View File

@@ -14,15 +14,19 @@
*/
import {SCMap} from '../general/map';
import {SCErrorResponse} from './error';
import {SCIndexRequest, SCIndexResponse} from './routes';
import {SCBookAvailabilityRequest, SCBookAvailabilityResponse} from './routes/book-availability';
import {SCBulkAddRequest, SCBulkAddResponse} from './routes/bulk-add';
import {SCBulkDoneRequest, SCBulkDoneResponse} from './routes/bulk-done';
import {SCBulkRequest, SCBulkResponse} from './routes/bulk-request';
import {SCFeedbackRequest, SCFeedbackResponse} from './routes/feedback';
import {SCSearchRequest, SCSearchResponse} from './routes/search';
import {SCMultiSearchRequest, SCMultiSearchResponse} from './routes/search-multi';
import {SCThingUpdateRequest, SCThingUpdateResponse} from './routes/thing-update';
import {SCIndexRequest, SCIndexResponse, SCIndexRoute} from './routes';
import {
SCBookAvailabilityRequest,
SCBookAvailabilityResponse,
SCBookAvailabilityRoute,
} from './routes/book-availability';
import {SCBulkAddRequest, SCBulkAddResponse, SCBulkAddRoute} from './routes/bulk-add';
import {SCBulkDoneRequest, SCBulkDoneResponse, SCBulkDoneRoute} from './routes/bulk-done';
import {SCBulkRequest, SCBulkResponse, SCBulkRoute} from './routes/bulk-request';
import {SCFeedbackRequest, SCFeedbackResponse, SCFeedbackRoute} from './routes/feedback';
import {SCSearchRequest, SCSearchResponse, SCSearchRoute} from './routes/search';
import {SCMultiSearchRequest, SCMultiSearchResponse, SCMultiSearchRoute} from './routes/search-multi';
import {SCThingUpdateRequest, SCThingUpdateResponse, SCThingUpdateRoute} from './routes/thing-update';
/**
* Possible Verbs for HTTP requests
@@ -174,3 +178,63 @@ export type SCResponses =
| SCMultiSearchResponse
| SCSearchResponse
| SCThingUpdateResponse;
/**
* Associated response for a request
*/
export type SCAssociatedResponse<REQUEST> =
REQUEST extends SCBookAvailabilityRequest ? SCBookAvailabilityResponse :
REQUEST extends SCBulkRequest ? SCBulkResponse :
REQUEST extends SCBulkAddRequest ? SCBulkAddResponse :
REQUEST extends SCBulkDoneRequest ? SCBulkDoneResponse :
REQUEST extends SCFeedbackRequest ? SCFeedbackResponse :
REQUEST extends SCIndexRequest ? SCIndexResponse :
REQUEST extends SCMultiSearchRequest ? SCMultiSearchResponse :
REQUEST extends SCSearchRequest ? SCSearchResponse :
REQUEST extends SCThingUpdateRequest ? SCThingUpdateResponse :
never;
/**
* Associated request for a response
*/
export type SCAssociatedRequest<RESPONSE> =
RESPONSE extends SCBookAvailabilityResponse ? SCBookAvailabilityRequest :
RESPONSE extends SCBulkResponse ? SCBulkRequest :
RESPONSE extends SCBulkAddResponse ? SCBulkAddRequest :
RESPONSE extends SCBulkDoneResponse ? SCBulkDoneRequest :
RESPONSE extends SCFeedbackResponse ? SCFeedbackRequest :
RESPONSE extends SCIndexResponse ? SCIndexRequest :
RESPONSE extends SCMultiSearchResponse ? SCMultiSearchRequest :
RESPONSE extends SCSearchResponse ? SCSearchRequest :
RESPONSE extends SCThingUpdateResponse ? SCThingUpdateRequest :
never;
/**
* Associated request for a route
*/
export type SCAssignedRequest<ROUTE extends SCAbstractRoute> =
ROUTE extends SCBookAvailabilityRoute ? SCBookAvailabilityRequest :
ROUTE extends SCBulkRoute ? SCBulkRequest :
ROUTE extends SCBulkAddRoute ? SCBulkAddRequest :
ROUTE extends SCBulkDoneRoute ? SCBulkDoneRequest :
ROUTE extends SCFeedbackRoute ? SCFeedbackRequest :
ROUTE extends SCIndexRoute ? SCIndexRequest :
ROUTE extends SCMultiSearchRoute ? SCMultiSearchRequest :
ROUTE extends SCSearchRoute ? SCSearchRequest :
ROUTE extends SCThingUpdateRoute ? SCThingUpdateRequest :
never;
/**
* Associated response for a route
*/
export type SCAssignedResponse<ROUTE extends SCAbstractRoute> =
ROUTE extends SCBookAvailabilityRoute ? SCBookAvailabilityResponse :
ROUTE extends SCBulkRoute ? SCBulkResponse :
ROUTE extends SCBulkAddRoute ? SCBulkAddResponse :
ROUTE extends SCBulkDoneRoute ? SCBulkDoneResponse :
ROUTE extends SCFeedbackRoute ? SCFeedbackResponse :
ROUTE extends SCIndexRoute ? SCIndexResponse :
ROUTE extends SCMultiSearchRoute ? SCMultiSearchResponse :
ROUTE extends SCSearchRoute ? SCSearchResponse :
ROUTE extends SCThingUpdateRoute ? SCThingUpdateResponse :
never;

View File

@@ -16,6 +16,7 @@ import {OK} from 'http-status-codes';
import {Schema} from 'jsonschema';
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
import {SCNotFoundErrorResponse} from '../errors/not-found';
import {SCParametersNotAcceptable} from '../errors/parameters-not-acceptable';
import {SCPluginAlreadyRegisteredErrorResponse} from '../errors/plugin-already-registered';
import {SCPluginRegisteringFailedErrorResponse} from '../errors/plugin-registering-failed';
@@ -111,6 +112,7 @@ export class SCPluginRegisterRoute extends SCAbstractRoute {
this.errorNames = [
SCInternalServerErrorResponse,
SCMethodNotAllowedErrorResponse,
SCNotFoundErrorResponse,
SCParametersNotAcceptable,
SCPluginAlreadyRegisteredErrorResponse,
SCPluginRegisteringFailedErrorResponse,

View File

@@ -22,7 +22,7 @@ import {SCSearchAbstractFilter, SCSearchAbstractFilterArguments} from '../filter
*
* Filter for documents that are in the given distance of the given location
*/
export interface SCSearchDistanceFilter extends SCSearchAbstractFilter<SCSearchAbstractFilterArguments> {
export interface SCSearchDistanceFilter extends SCSearchAbstractFilter<SCDistanceFilterArguments> {
/**
* @see SCSearchAbstractFilter.type
*/

View File

@@ -92,6 +92,7 @@ export type SCAcademicEventCategories =
| 'course'
| 'practicum introduction'
| 'excursion'
| 'exercise'
| 'special';
/**
@@ -152,7 +153,8 @@ export class SCAcademicEventMeta
'colloquium': 'Kolloquium',
'course': 'Kurs',
'excursion': 'Exkursion',
'integrated course': '',
'exercise': 'Übung',
'integrated course': 'Integrierter Kurs',
'introductory class': 'Einführungsveranstaltung',
'lecture': 'Vorlesung',
'oral exam': 'mündliche Prüfung',

View File

@@ -22,6 +22,7 @@ import {
} from './abstract/creative-work';
import {SCThingMeta, SCThingType} from './abstract/thing';
import {SCThingThatCanBeOfferedTranslatableProperties} from './abstract/thing-that-can-be-offered';
import {SCOrganizationWithoutReferences} from './organization';
/**
* A message without references
@@ -29,7 +30,12 @@ import {SCThingThatCanBeOfferedTranslatableProperties} from './abstract/thing-th
export interface SCMessageWithoutReferences
extends SCCreativeWorkWithoutReferences {
/**
* Audience of the message
* Organizational unit for which the message is intended
*/
audienceOrganizations?: SCOrganizationWithoutReferences[];
/**
* Roles for which the message is intended
*/
audiences: SCMessageAudience[];
@@ -109,6 +115,7 @@ export class SCMessageMeta
de: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
.de,
audienceOrganizations: 'Zielgruppenorganisationen',
audiences: 'Zielgruppen',
dateCreated: 'Erstellungsdatum',
messageBody: 'Nachrichteninhalt',
@@ -116,6 +123,7 @@ export class SCMessageMeta
en: {
...SCCreativeWorkMeta.getInstance<SCCreativeWorkMeta>().fieldTranslations
.en,
audienceOrganizations: 'audience organizations',
audiences: 'audiences',
dateCreated: 'date created',
messageBody: 'message body',

View File

@@ -12,6 +12,11 @@
"audiences": [
"students"
],
"audienceOrganizations": [{
"name": "TU Berlin",
"type": "organization",
"uid": "4806ef14-b631-5c20-91d1-3c627decca5a"
}],
"origin": {
"indexed": "2018-09-11T12:30:00Z",
"name": "Dummy",