mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-05 04:53:02 +00:00
@@ -29,40 +29,27 @@ import {
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export type SCPluginRegisterRequest = AddPlugin | RemovePlugin;
|
||||
interface AddPlugin {
|
||||
export type SCPluginRegisterRequest = SCPluginAdd | SCPluginRemove;
|
||||
|
||||
/**
|
||||
* Plugin request for adding a plugin registration to the backend
|
||||
*/
|
||||
export interface SCPluginAdd {
|
||||
/**
|
||||
* The desired action, so whether the plugin should be added or removed
|
||||
*/
|
||||
action: 'add';
|
||||
|
||||
/**
|
||||
* The address of the plugin
|
||||
* Plugin information needed for its registration
|
||||
*/
|
||||
address: string;
|
||||
|
||||
/**
|
||||
* The name of the plugin
|
||||
* Just for debugging purposes, to more easily identify conflicts.
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* How the requests of the plugin looks like, a JSON schema for validation
|
||||
*/
|
||||
pluginRequestSchema: Schema;
|
||||
|
||||
/**
|
||||
* How the responses of the plugin looks like, a JSON schema for validation
|
||||
*/
|
||||
pluginResponseSchema: Schema;
|
||||
|
||||
/**
|
||||
* The desired route, for example /feedback.
|
||||
*/
|
||||
route: string;
|
||||
plugin: SCPluginMetaData;
|
||||
}
|
||||
interface RemovePlugin {
|
||||
|
||||
/**
|
||||
* Plugin request for removing a plugin registration from the backend
|
||||
*/
|
||||
export interface SCPluginRemove {
|
||||
/**
|
||||
* The desired action, so whether the plugin should be added or removed
|
||||
*/
|
||||
@@ -74,6 +61,36 @@ interface RemovePlugin {
|
||||
route: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin meta data - contains needed information for a plugin registration
|
||||
*/
|
||||
export interface SCPluginMetaData {
|
||||
/**
|
||||
* The address of the plugin, to which the backend routes the requests
|
||||
*/
|
||||
address: string;
|
||||
|
||||
/**
|
||||
* The name of the plugin (for debugging purposes, to more easily identify conflicts)
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* How the requests of the plugin looks like, a JSON schema for validation
|
||||
*/
|
||||
requestSchema: Schema;
|
||||
|
||||
/**
|
||||
* How the responses of the plugin looks like, a JSON schema for validation
|
||||
*/
|
||||
responseSchema: Schema;
|
||||
|
||||
/**
|
||||
* The desired route, for example /feedback.
|
||||
*/
|
||||
route: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Route to register plugins
|
||||
*/
|
||||
@@ -85,7 +102,6 @@ export class SCPluginRegisterRoute extends SCAbstractRoute {
|
||||
SCMethodNotAllowedErrorResponse,
|
||||
SCParametersNotAcceptable,
|
||||
SCPluginAlreadyRegisteredErrorResponse,
|
||||
SCPluginRouteAlreadyRegisteredErrorResponse,
|
||||
SCPluginRegisteringFailedErrorResponse,
|
||||
SCPluginRouteAlreadyRegisteredErrorResponse,
|
||||
SCRequestBodyTooLargeErrorResponse,
|
||||
|
||||
Reference in New Issue
Block a user