@eclipse-emfcloud/modelserver-plugin-ext
Advanced tools
Comparing version 0.2.0-next.c2cb14b.38 to 0.2.0-next.c976fe5.48
@@ -12,2 +12,3 @@ /******************************************************************************** | ||
import { ModelServerCommand } from '@eclipse-emfcloud/modelserver-client'; | ||
import * as URI from 'urijs'; | ||
import { Transaction } from './executor'; | ||
@@ -39,4 +40,4 @@ import { MaybePromise } from './util'; | ||
*/ | ||
getCommands(modelUri: string, customCommand: ModelServerCommand): MaybePromise<ModelServerCommand | Transaction>; | ||
getCommands(modelUri: URI, customCommand: ModelServerCommand): MaybePromise<ModelServerCommand | Transaction>; | ||
} | ||
//# sourceMappingURL=command-provider.d.ts.map |
@@ -13,2 +13,3 @@ /******************************************************************************** | ||
import { Operation } from 'fast-json-patch'; | ||
import * as URI from 'urijs'; | ||
/** | ||
@@ -29,3 +30,3 @@ * Protocol of a context in which commands may be executed and JSON patches applied. | ||
*/ | ||
execute(modelUri: string, command: ModelServerCommand): Promise<ModelUpdateResult>; | ||
execute(modelUri: URI, command: ModelServerCommand): Promise<ModelUpdateResult>; | ||
/** | ||
@@ -32,0 +33,0 @@ * Apply a JSON patch to the model. |
@@ -145,3 +145,3 @@ /******************************************************************************** | ||
*/ | ||
getModelURI(): string; | ||
getModelURI(): URI; | ||
/** | ||
@@ -148,0 +148,0 @@ * Query whether the transaction is currently open. |
@@ -14,4 +14,18 @@ /******************************************************************************** | ||
export declare const RouteProvider: unique symbol; | ||
export interface RoutingOptions { | ||
/** | ||
* An optional identifier for the router that middleware providers can | ||
* filter on to determine whether and/or what middlewares to add to it. | ||
*/ | ||
routerId?: string; | ||
/** | ||
* An optional indication of whether the route is also implemented in the | ||
* upstream Java server and so needs the `next()` delegation eventually | ||
* to forward to it. If omitted it is assumed that the upstream server | ||
* does not implement the route and so this forwarding is not provided. | ||
*/ | ||
forwardToUpstream?: boolean; | ||
} | ||
/** Protocol for a factory of Express routers. */ | ||
export declare type RouterFactory = (route: string) => Router; | ||
export declare type RouterFactory = (route: string, options?: RoutingOptions) => Router; | ||
/** | ||
@@ -35,3 +49,5 @@ * A provider of custom routing in the _Express_ `app`. | ||
/** | ||
* Obtain middleware handlers to install in the given _Express_ `router`. | ||
* Obtain middleware handlers to install in the given _Express_ `router` _before_ its core route handlers. | ||
* These middlewares will be invoked before the main handling of each request, with the opportunity | ||
* to decorate or modify that request. | ||
* | ||
@@ -41,7 +57,20 @@ * @param router the router in which the provided middlewares are to be installed | ||
* to be installed in all routes of the `router` | ||
* @param routerId for a router that was created with an identifier, provides that for application-specific filtering | ||
* | ||
* @returns the middlewares to install in the `route` | ||
*/ | ||
getMiddlewares(router: IRouter, route?: string): RequestHandler[]; | ||
getMiddlewares?(router: IRouter, route?: string, routerId?: string): RequestHandler[]; | ||
/** | ||
* Obtain middleware handlers to install in the given _Express_ `router` _after_ its core route handlers. | ||
* These middlewares will be invoked after the main handling of each request. | ||
* | ||
* @param router the router in which the provided middlewares are to be installed | ||
* @param route the route in which to install the provided middlewares. If not provided, the middlewares are | ||
* to be installed in all routes of the `router` | ||
* @param routerId for a router that was created with an identifier, provides that for application-specific filtering | ||
* | ||
* @returns the middlewares to install in the `route` | ||
*/ | ||
getAfterMiddlewares?(router: IRouter, route?: string, routerId?: string): RequestHandler[]; | ||
} | ||
//# sourceMappingURL=route-provider.d.ts.map |
@@ -12,2 +12,3 @@ /******************************************************************************** | ||
import { Operation } from 'fast-json-patch'; | ||
import * as URI from 'urijs'; | ||
import { Transaction } from './executor'; | ||
@@ -36,3 +37,3 @@ import { MaybePromise } from './util'; | ||
*/ | ||
canTrigger(modelURI: string, patch: Operation[]): boolean; | ||
canTrigger(modelURI: URI, patch: Operation[]): boolean; | ||
/** | ||
@@ -49,4 +50,4 @@ * Obtain follow-up edits triggered by the given `patch`. These may either be | ||
*/ | ||
getTriggers(modelURI: string, modelDelta: Operation[]): MaybePromise<Operation[] | Transaction>; | ||
getTriggers(modelURI: URI, modelDelta: Operation[]): MaybePromise<Operation[] | Transaction>; | ||
} | ||
//# sourceMappingURL=trigger-provider.d.ts.map |
@@ -12,2 +12,3 @@ /******************************************************************************** | ||
import { Diagnostic, ModelServerObjectV2 } from '@eclipse-emfcloud/modelserver-client'; | ||
import * as URI from 'urijs'; | ||
import { MaybePromise } from './util'; | ||
@@ -27,3 +28,3 @@ /** | ||
*/ | ||
canValidate(model: ModelServerObjectV2, modelURI: string): boolean; | ||
canValidate(model: ModelServerObjectV2, modelURI: URI): boolean; | ||
/** | ||
@@ -36,4 +37,4 @@ * Validate the given `model`. | ||
*/ | ||
validate(model: ModelServerObjectV2, modelURI: string): MaybePromise<Diagnostic>; | ||
validate(model: ModelServerObjectV2, modelURI: URI): MaybePromise<Diagnostic>; | ||
} | ||
//# sourceMappingURL=validation-provider.d.ts.map |
{ | ||
"name": "@eclipse-emfcloud/modelserver-plugin-ext", | ||
"version": "0.2.0-next.c2cb14b.38+c2cb14b", | ||
"version": "0.2.0-next.c976fe5.48+c976fe5", | ||
"description": "Plug-in extension framework for the Model Server.", | ||
@@ -33,2 +33,3 @@ "license": "(EPL-2.0 OR MIT)", | ||
"inversify": "^5.1.1", | ||
"urijs": "^1.19.11", | ||
"winston": "^3.3.3" | ||
@@ -38,2 +39,3 @@ }, | ||
"@types/reflect-metadata": "^0.1.0", | ||
"@types/urijs": "^1.19.19", | ||
"@types/winston": "^2.4.4", | ||
@@ -56,3 +58,3 @@ "eslint-config-prettier": "^8.3.0", | ||
}, | ||
"gitHead": "c2cb14bfbb3ed4dc725e02d95069829ace3b9a3e" | ||
"gitHead": "c976fe5a966c1edbfa7787a36d12087b8193471a" | ||
} |
@@ -13,2 +13,3 @@ /******************************************************************************** | ||
import { ModelServerCommand } from '@eclipse-emfcloud/modelserver-client'; | ||
import * as URI from 'urijs'; | ||
@@ -43,3 +44,3 @@ import { Transaction } from './executor'; | ||
*/ | ||
getCommands(modelUri: string, customCommand: ModelServerCommand): MaybePromise<ModelServerCommand | Transaction>; | ||
getCommands(modelUri: URI, customCommand: ModelServerCommand): MaybePromise<ModelServerCommand | Transaction>; | ||
} |
@@ -14,2 +14,3 @@ /******************************************************************************** | ||
import { Operation } from 'fast-json-patch'; | ||
import * as URI from 'urijs'; | ||
@@ -31,3 +32,3 @@ /** | ||
*/ | ||
execute(modelUri: string, command: ModelServerCommand): Promise<ModelUpdateResult>; | ||
execute(modelUri: URI, command: ModelServerCommand): Promise<ModelUpdateResult>; | ||
@@ -34,0 +35,0 @@ /** |
@@ -162,3 +162,3 @@ /******************************************************************************** | ||
*/ | ||
getModelURI(): string; | ||
getModelURI(): URI; | ||
@@ -165,0 +165,0 @@ /** |
@@ -16,4 +16,19 @@ /******************************************************************************** | ||
export interface RoutingOptions { | ||
/** | ||
* An optional identifier for the router that middleware providers can | ||
* filter on to determine whether and/or what middlewares to add to it. | ||
*/ | ||
routerId?: string; | ||
/** | ||
* An optional indication of whether the route is also implemented in the | ||
* upstream Java server and so needs the `next()` delegation eventually | ||
* to forward to it. If omitted it is assumed that the upstream server | ||
* does not implement the route and so this forwarding is not provided. | ||
*/ | ||
forwardToUpstream?: boolean; | ||
} | ||
/** Protocol for a factory of Express routers. */ | ||
export type RouterFactory = (route: string) => Router; | ||
export type RouterFactory = (route: string, options?: RoutingOptions) => Router; | ||
@@ -40,3 +55,5 @@ /** | ||
/** | ||
* Obtain middleware handlers to install in the given _Express_ `router`. | ||
* Obtain middleware handlers to install in the given _Express_ `router` _before_ its core route handlers. | ||
* These middlewares will be invoked before the main handling of each request, with the opportunity | ||
* to decorate or modify that request. | ||
* | ||
@@ -46,6 +63,20 @@ * @param router the router in which the provided middlewares are to be installed | ||
* to be installed in all routes of the `router` | ||
* @param routerId for a router that was created with an identifier, provides that for application-specific filtering | ||
* | ||
* @returns the middlewares to install in the `route` | ||
*/ | ||
getMiddlewares(router: IRouter, route?: string): RequestHandler[]; | ||
getMiddlewares?(router: IRouter, route?: string, routerId?: string): RequestHandler[]; | ||
/** | ||
* Obtain middleware handlers to install in the given _Express_ `router` _after_ its core route handlers. | ||
* These middlewares will be invoked after the main handling of each request. | ||
* | ||
* @param router the router in which the provided middlewares are to be installed | ||
* @param route the route in which to install the provided middlewares. If not provided, the middlewares are | ||
* to be installed in all routes of the `router` | ||
* @param routerId for a router that was created with an identifier, provides that for application-specific filtering | ||
* | ||
* @returns the middlewares to install in the `route` | ||
*/ | ||
getAfterMiddlewares?(router: IRouter, route?: string, routerId?: string): RequestHandler[]; | ||
} |
@@ -13,2 +13,3 @@ /******************************************************************************** | ||
import { Operation } from 'fast-json-patch'; | ||
import * as URI from 'urijs'; | ||
@@ -39,3 +40,3 @@ import { Transaction } from './executor'; | ||
*/ | ||
canTrigger(modelURI: string, patch: Operation[]): boolean; | ||
canTrigger(modelURI: URI, patch: Operation[]): boolean; | ||
@@ -53,3 +54,3 @@ /** | ||
*/ | ||
getTriggers(modelURI: string, modelDelta: Operation[]): MaybePromise<Operation[] | Transaction>; | ||
getTriggers(modelURI: URI, modelDelta: Operation[]): MaybePromise<Operation[] | Transaction>; | ||
} |
@@ -13,5 +13,5 @@ /******************************************************************************** | ||
import { Diagnostic, ModelServerObjectV2 } from '@eclipse-emfcloud/modelserver-client'; | ||
import * as URI from 'urijs'; | ||
import { MaybePromise } from './util'; | ||
/** | ||
@@ -30,3 +30,3 @@ * Protocol for a provider of custom validation rules that may be registered by a _Model Server_ plug-in. | ||
*/ | ||
canValidate(model: ModelServerObjectV2, modelURI: string): boolean; | ||
canValidate(model: ModelServerObjectV2, modelURI: URI): boolean; | ||
@@ -40,3 +40,3 @@ /** | ||
*/ | ||
validate(model: ModelServerObjectV2, modelURI: string): MaybePromise<Diagnostic>; | ||
validate(model: ModelServerObjectV2, modelURI: URI): MaybePromise<Diagnostic>; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
91475
1331
6
7
+ Addedurijs@^1.19.11