mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-28 17:12:49 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fae7395cf0 | ||
|
|
0745b1af72 | ||
|
|
a2b2cefe8e | ||
|
|
04b21a7c5d |
@@ -1,3 +1,12 @@
|
||||
# [0.52.0](https://gitlab.com/openstapps/core/compare/v0.51.0...v0.52.0) (2021-09-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add about config ([aa294c4](https://gitlab.com/openstapps/core/commit/aa294c4e29e9191bef6d79487b0b321fbc34f6fb))
|
||||
|
||||
|
||||
|
||||
# [0.51.0](https://gitlab.com/openstapps/core/compare/v0.50.0...v0.51.0) (2021-09-10)
|
||||
|
||||
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openstapps/core",
|
||||
"version": "0.52.0",
|
||||
"version": "0.53.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openstapps/core",
|
||||
"version": "0.52.0",
|
||||
"version": "0.53.0",
|
||||
"description": "StAppsCore - Generalized model of data",
|
||||
"keywords": [
|
||||
"Model",
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {BAD_GATEWAY} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCError} from '../error';
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ export class SCInternalServerErrorResponse extends SCError {
|
||||
* and the internal server error should be displayed to the client
|
||||
*/
|
||||
constructor(err?: Error, stack = false) {
|
||||
super('InternalServerError', 'Internal server error', BAD_GATEWAY, stack);
|
||||
super('InternalServerError', 'Internal server error', StatusCodes.BAD_GATEWAY, stack);
|
||||
|
||||
if (stack) {
|
||||
this.additionalData = err;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {METHOD_NOT_ALLOWED} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCError} from '../error';
|
||||
|
||||
/**
|
||||
@@ -27,6 +27,6 @@ export class SCMethodNotAllowedErrorResponse extends SCError {
|
||||
* @param stack Set to true if a stack trace should be created
|
||||
*/
|
||||
constructor(stack?: boolean) {
|
||||
super('MethodNotAllowedError', 'HTTP method is not allowed on this route', METHOD_NOT_ALLOWED, stack);
|
||||
super('MethodNotAllowedError', 'HTTP method is not allowed on this route', StatusCodes.METHOD_NOT_ALLOWED, stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {NOT_FOUND} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCError} from '../error';
|
||||
|
||||
/**
|
||||
@@ -27,6 +27,6 @@ export class SCNotFoundErrorResponse extends SCError {
|
||||
* @param stack Set to true if a stack trace should be created
|
||||
*/
|
||||
constructor(stack?: boolean) {
|
||||
super('NotFoundError', 'Resource not found', NOT_FOUND, stack);
|
||||
super('NotFoundError', 'Resource not found', StatusCodes.NOT_FOUND, stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {NOT_ACCEPTABLE} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCError} from '../error';
|
||||
|
||||
/**
|
||||
@@ -29,6 +29,6 @@ export class SCParametersNotAcceptable extends SCError {
|
||||
* @param stack Set to true if a stack trace should be created
|
||||
*/
|
||||
constructor(message: string, stack?: boolean) {
|
||||
super('ParametersNotAcceptable', message, NOT_ACCEPTABLE, stack);
|
||||
super('ParametersNotAcceptable', message, StatusCodes.NOT_ACCEPTABLE, stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {CONFLICT} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCError} from '../error';
|
||||
import {SCPluginMetaData} from '../routes/plugin-register';
|
||||
|
||||
@@ -38,7 +38,7 @@ export class SCPluginAlreadyRegisteredErrorResponse extends SCError {
|
||||
* @param stack Set to true if a stack trace should be created
|
||||
*/
|
||||
constructor(message: string, plugin: SCPluginMetaData, stack = false) {
|
||||
super('SCPluginAlreadyRegisteredError', message, CONFLICT, stack);
|
||||
super('SCPluginAlreadyRegisteredError', message, StatusCodes.CONFLICT, stack);
|
||||
if (stack) {
|
||||
this.additionalData = plugin;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {INTERNAL_SERVER_ERROR} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCError} from '../error';
|
||||
|
||||
/**
|
||||
@@ -28,6 +28,6 @@ export class SCPluginRegisteringFailedErrorResponse extends SCError {
|
||||
* @param stack Set to true if a stack trace should be created
|
||||
*/
|
||||
constructor(message: string, stack?: boolean) {
|
||||
super('PluginRegisteringFailedError', message, INTERNAL_SERVER_ERROR, stack);
|
||||
super('PluginRegisteringFailedError', message, StatusCodes.INTERNAL_SERVER_ERROR, stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {REQUEST_TOO_LONG} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCError} from '../error';
|
||||
|
||||
/**
|
||||
@@ -27,6 +27,6 @@ export class SCRequestBodyTooLargeErrorResponse extends SCError {
|
||||
* @param stack Set to true if a stack trace should be created
|
||||
*/
|
||||
constructor(stack?: boolean) {
|
||||
super('RequestBodyTooLargeError', 'The request body is too large.', REQUEST_TOO_LONG, stack);
|
||||
super('RequestBodyTooLargeError', 'The request body is too large.', StatusCodes.REQUEST_TOO_LONG, stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
* 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 {BAD_REQUEST} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCError} from '../error';
|
||||
|
||||
/**
|
||||
* An error that is returned whenever there is a syntax error
|
||||
*
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export class SCSyntaxErrorResponse extends SCError {
|
||||
@@ -28,6 +28,6 @@ export class SCSyntaxErrorResponse extends SCError {
|
||||
* @param stack Set to true if a stack trace should be created
|
||||
*/
|
||||
constructor(message: string, stack?: boolean) {
|
||||
super('SyntaxError', message, BAD_REQUEST, stack);
|
||||
super('SyntaxError', message, StatusCodes.BAD_REQUEST, stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
* 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 {TOO_MANY_REQUESTS} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCError} from '../error';
|
||||
|
||||
/**
|
||||
* An error that is returned, when to many request are submitted at once
|
||||
*
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export class SCTooManyRequestsErrorResponse extends SCError {
|
||||
@@ -30,7 +30,7 @@ export class SCTooManyRequestsErrorResponse extends SCError {
|
||||
super(
|
||||
'TooManyRequestsError',
|
||||
'Too many requests. You can not submit more than 5 queries an once',
|
||||
TOO_MANY_REQUESTS,
|
||||
StatusCodes.TOO_MANY_REQUESTS,
|
||||
stack,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {UNSUPPORTED_MEDIA_TYPE} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCError} from '../error';
|
||||
|
||||
/**
|
||||
@@ -27,6 +27,6 @@ export class SCUnsupportedMediaTypeErrorResponse extends SCError {
|
||||
* @param stack Set to true if a stack trace should be created
|
||||
*/
|
||||
constructor(stack?: boolean) {
|
||||
super('UnsupportedMediaTypeError', 'Unsupported media type', UNSUPPORTED_MEDIA_TYPE, stack);
|
||||
super('UnsupportedMediaTypeError', 'Unsupported media type', StatusCodes.UNSUPPORTED_MEDIA_TYPE, stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {ValidationError} from '@openstapps/core-tools/lib/types/validator';
|
||||
import {BAD_REQUEST} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCError} from '../error';
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ export class SCValidationErrorResponse extends SCError {
|
||||
* @param stack Set to true if a stack trace should be created
|
||||
*/
|
||||
constructor(errors: ValidationError[], stack?: boolean) {
|
||||
super('ValidationError', 'Validation of request failed', BAD_REQUEST, stack);
|
||||
super('ValidationError', 'Validation of request failed', StatusCodes.BAD_REQUEST, stack);
|
||||
this.additionalData = errors;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {OK} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCUuid} from '../../general/uuid';
|
||||
import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '../../things/abstract/thing-that-can-be-offered';
|
||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||
@@ -88,7 +88,7 @@ export class SCBookAvailabilityRoute extends SCAbstractRoute {
|
||||
this.method = SCRouteHttpVerbs.POST;
|
||||
this.requestBodyName = 'SCBookAvailabilityRequest';
|
||||
this.responseBodyName = 'SCBookAvailabilityResponse';
|
||||
this.statusCodeSuccess = OK;
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/bookAvailability';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {CREATED} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCThings} from '../../meta';
|
||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||
@@ -59,7 +59,7 @@ export class SCBulkAddRoute extends SCAbstractRoute {
|
||||
};
|
||||
this.requestBodyName = 'SCBulkAddRequest';
|
||||
this.responseBodyName = 'SCBulkAddResponse';
|
||||
this.statusCodeSuccess = CREATED;
|
||||
this.statusCodeSuccess = StatusCodes.CREATED;
|
||||
this.urlFragment = '/bulk/:UID';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {NO_CONTENT} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||
import {SCNotFoundErrorResponse} from '../errors/not-found';
|
||||
@@ -59,7 +59,7 @@ export class SCBulkDoneRoute extends SCAbstractRoute {
|
||||
};
|
||||
this.requestBodyName = 'SCBulkDoneRequest';
|
||||
this.responseBodyName = 'SCBulkDoneResponse';
|
||||
this.statusCodeSuccess = NO_CONTENT;
|
||||
this.statusCodeSuccess = StatusCodes.NO_CONTENT;
|
||||
this.urlFragment = '/bulk/:UID/done';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {OK} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCISO8601Date} from '../../general/time';
|
||||
import {SCUuid} from '../../general/uuid';
|
||||
import {SCThingType} from '../../things/abstract/thing';
|
||||
@@ -98,7 +98,7 @@ export class SCBulkRoute extends SCAbstractRoute {
|
||||
this.method = SCRouteHttpVerbs.POST;
|
||||
this.requestBodyName = 'SCBulkRequest';
|
||||
this.responseBodyName = 'SCBulkResponse';
|
||||
this.statusCodeSuccess = OK;
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/bulk';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {NO_CONTENT} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCMessage} from '../../things/message';
|
||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||
@@ -59,7 +59,7 @@ export class SCFeedbackRoute extends SCAbstractRoute {
|
||||
this.method = SCRouteHttpVerbs.POST;
|
||||
this.requestBodyName = 'SCFeedbackRequest';
|
||||
this.responseBodyName = 'SCFeedbackResponse';
|
||||
this.statusCodeSuccess = NO_CONTENT;
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/feedback';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {OK} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCAppConfiguration} from '../../config/app';
|
||||
import {SCBackendConfiguration} from '../../config/backend';
|
||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||
@@ -65,7 +65,7 @@ export class SCIndexRoute extends SCAbstractRoute {
|
||||
this.method = SCRouteHttpVerbs.POST;
|
||||
this.requestBodyName = 'SCIndexRequest';
|
||||
this.responseBodyName = 'SCIndexResponse';
|
||||
this.statusCodeSuccess = OK;
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {OK} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {JSONSchema7} from 'json-schema';
|
||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||
@@ -122,7 +122,7 @@ export class SCPluginRegisterRoute extends SCAbstractRoute {
|
||||
this.method = SCRouteHttpVerbs.POST;
|
||||
this.requestBodyName = 'SCPluginRegisterRequest';
|
||||
this.responseBodyName = 'SCPluginRegisterResponse';
|
||||
this.statusCodeSuccess = OK;
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/plugin/register';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {OK} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCMap} from '../../general/map';
|
||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||
@@ -63,7 +63,7 @@ export class SCMultiSearchRoute extends SCAbstractRoute {
|
||||
this.method = SCRouteHttpVerbs.POST;
|
||||
this.requestBodyName = 'SCMultiSearchRequest';
|
||||
this.responseBodyName = 'SCMultiSearchResponse';
|
||||
this.statusCodeSuccess = OK;
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/search/multi';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {OK} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||
import {SCRequestBodyTooLargeErrorResponse} from '../errors/request-body-too-large';
|
||||
@@ -56,7 +56,7 @@ export class SCSearchRoute extends SCAbstractRoute {
|
||||
this.method = SCRouteHttpVerbs.POST;
|
||||
this.requestBodyName = 'SCSearchRequest';
|
||||
this.responseBodyName = 'SCSearchResponse';
|
||||
this.statusCodeSuccess = OK;
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/search';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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 {OK} from 'http-status-codes';
|
||||
import {StatusCodes} from 'http-status-codes';
|
||||
import {SCThings} from '../../meta';
|
||||
import {SCInternalServerErrorResponse} from '../errors/internal-server-error';
|
||||
import {SCMethodNotAllowedErrorResponse} from '../errors/method-not-allowed';
|
||||
@@ -60,7 +60,7 @@ export class SCThingUpdateRoute extends SCAbstractRoute {
|
||||
};
|
||||
this.requestBodyName = 'SCThingUpdateRequest';
|
||||
this.responseBodyName = 'SCThingUpdateResponse';
|
||||
this.statusCodeSuccess = OK;
|
||||
this.statusCodeSuccess = StatusCodes.OK;
|
||||
this.urlFragment = '/:TYPE/:UID';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user