mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-04-22 06:09:14 +00:00
feat: use tag @validatable to mark schema types
This commit is contained in:
@@ -16,6 +16,8 @@ import {ValidationError} from 'jsonschema';
|
||||
|
||||
/**
|
||||
* A generic error that can be returned by the backend if somethings fails during the processing of a request
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCErrorResponse extends Error {
|
||||
/**
|
||||
@@ -126,11 +128,11 @@ export class SCNotFoundErrorResponse extends SCError {
|
||||
}
|
||||
|
||||
/**
|
||||
* An error that is returned, when an internal server error occured
|
||||
* An error that is returned, when an internal server error occurred
|
||||
*/
|
||||
export class SCInternalServerErrorResponse extends SCError {
|
||||
/**
|
||||
* Internal error that occured. If the stack is disabled this error is not set for security reasons
|
||||
* Internal error that occurred. If the stack is disabled this error is not set for security reasons
|
||||
*/
|
||||
additionalData?: Error;
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ import {SCAbstractRoute} from '../../../Route';
|
||||
|
||||
/**
|
||||
* Index request
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCIndexRequest {
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ import {SCBackendConfiguration} from '../../../types/config/Backend';
|
||||
|
||||
/**
|
||||
* A response to an index request
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCIndexResponse {
|
||||
app: SCAppConfiguration;
|
||||
|
||||
@@ -17,6 +17,8 @@ import {SCAbstractRoute} from '../../../../Route';
|
||||
|
||||
/**
|
||||
* Request to update an existing thing
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export type SCThingUpdateRequest = SCThings;
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
*/
|
||||
/**
|
||||
* Response for an entity update request
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCThingUpdateResponse {
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import {SCUuid} from '../../../types/UUID';
|
||||
|
||||
/**
|
||||
* Request to check the availability of books
|
||||
* @validatable
|
||||
*/
|
||||
export type SCBookAvailabilityRequest = SCBookAvailabilityRequestByIsbn | SCBookAvailabilityRequestByUuid;
|
||||
|
||||
|
||||
@@ -16,5 +16,6 @@ import {SCAcademicPriceGroup, SCThingThatCanBeOfferedOffer} from '../../../base/
|
||||
|
||||
/**
|
||||
* List of availabilities of a book
|
||||
* @validatable
|
||||
*/
|
||||
export type SCBookAvailabilityResponse = Array<SCThingThatCanBeOfferedOffer<SCAcademicPriceGroup>>;
|
||||
|
||||
@@ -20,6 +20,8 @@ import {SCISO8601Date} from '../../../types/Time';
|
||||
* A bulk request
|
||||
*
|
||||
* Parameters to be sent to request a new bulk.
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCBulkRequest extends SCBulkParameters {
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ import {SCBulkParameters} from './BulkRequest';
|
||||
|
||||
/**
|
||||
* Requested Bulk from backend
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCBulkResponse extends SCBulkParameters {
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,7 @@ import {SCAbstractRoute} from '../../../../Route';
|
||||
|
||||
/**
|
||||
* Request to add a thing to a bulk
|
||||
* @validatable
|
||||
*/
|
||||
export type SCBulkAddRequest = SCThings;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
/**
|
||||
* Response to a request to add a thing to a bulk
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCBulkAddResponse {
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import {SCAbstractRoute} from '../../../../Route';
|
||||
|
||||
/**
|
||||
* Request to change the bulk state to done (close the bulk process)
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCBulkDoneRequest {
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
/**
|
||||
* Response to a request to change the state of a bulk to done
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCBulkDoneResponse {
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ import {SCMessage} from '../../../things/Message';
|
||||
|
||||
/**
|
||||
* User feedback
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCFeedbackRequest extends SCMessage {
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
*/
|
||||
/**
|
||||
* A response to a feedback request
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCFeedbackResponse {
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ import {SCSearchQuery} from './SearchRequest';
|
||||
* This is a map of [[SCSearchRequest]]s indexed by name.
|
||||
*
|
||||
* **CAUTION: This is limited to an amount of queries. Currently this limit is 5.**
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCMultiSearchRequest {
|
||||
[k: string]: SCSearchQuery;
|
||||
|
||||
@@ -18,6 +18,8 @@ import {SCSearchResult} from './SearchResponse';
|
||||
* A multi search response
|
||||
*
|
||||
* This is a map of [[SCSearchResponse]]s indexed by name
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCMultiSearchResponse {
|
||||
[k: string]: SCSearchResult;
|
||||
|
||||
@@ -18,6 +18,8 @@ import {SCSearchSort} from '../../../types/sorts/Abstract';
|
||||
|
||||
/**
|
||||
* A search request
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCSearchRequest extends SCSearchQuery {
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ import {SCThings, SCThingsField} from '../../../Classes';
|
||||
|
||||
/**
|
||||
* A search response
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCSearchResponse extends SCSearchResult {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user