mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-25 23:56:17 +00:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a65d4ba2f | ||
|
|
88f579e09b | ||
|
|
be2bfb4017 | ||
|
|
bad15dc872 | ||
|
|
8b090af3ed | ||
|
|
747497699d | ||
|
|
80a102cb6a | ||
|
|
234cb57070 | ||
|
|
d4a8ef6a9c | ||
|
|
689dc99414 | ||
|
|
27d97c4c95 | ||
|
|
e71dace32f | ||
|
|
180c966891 | ||
|
|
65730d603a | ||
|
|
7fbe1620ee | ||
|
|
d781dd6de5 | ||
|
|
86f3f8dfae | ||
|
|
34fe32b404 | ||
|
|
f262a6b8fa | ||
|
|
e1d4b2bc9d | ||
|
|
c3a9606f9d | ||
|
|
dd56d97945 | ||
|
|
43851d2d35 | ||
|
|
b6272e9229 | ||
|
|
13dae1fb06 | ||
|
|
c18e3c15f1 | ||
|
|
54d44f1acb |
@@ -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
|
||||
|
||||
46
CHANGELOG.md
46
CHANGELOG.md
@@ -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
676
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
46
package.json
46
package.json
@@ -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,
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user