@gtsc/api-models
Advanced tools
Comparing version 0.0.3-next.64 to 0.0.3-next.65
@@ -10,2 +10,14 @@ import type { IService, IServiceRequestContext } from "@gtsc/services"; | ||
/** | ||
* Pre process the REST request for the specified route. | ||
* @param request The request to handle. | ||
* @param response The response data to send if any. | ||
* @param route The route being requested, if a matching one was found. | ||
* @param requestContext The context for the request. | ||
* @param state The state for the request. | ||
* @returns Promise that resolves when the request is processed. | ||
*/ | ||
pre?(request: IHttpServerRequest, response: IHttpResponse, route: IRestRoute | undefined, requestContext: IServiceRequestContext, state: { | ||
[id: string]: unknown; | ||
}): Promise<void>; | ||
/** | ||
* Process the REST request for the specified route. | ||
@@ -19,5 +31,17 @@ * @param request The request to handle. | ||
*/ | ||
process(request: IHttpServerRequest, response: IHttpResponse, route: IRestRoute | undefined, requestContext: IServiceRequestContext, state: { | ||
process?(request: IHttpServerRequest, response: IHttpResponse, route: IRestRoute | undefined, requestContext: IServiceRequestContext, state: { | ||
[id: string]: unknown; | ||
}): Promise<void>; | ||
/** | ||
* Post process the REST request for the specified route. | ||
* @param request The request to handle. | ||
* @param response The response data to send if any. | ||
* @param route The route being requested, if a matching one was found. | ||
* @param requestContext The context for the request. | ||
* @param state The state for the request. | ||
* @returns Promise that resolves when the request is processed. | ||
*/ | ||
post?(request: IHttpServerRequest, response: IHttpResponse, route: IRestRoute | undefined, requestContext: IServiceRequestContext, state: { | ||
[id: string]: unknown; | ||
}): Promise<void>; | ||
} |
@@ -103,6 +103,42 @@ # Interface: IHttpRestRouteProcessor | ||
### process() | ||
### pre()? | ||
> **process**(`request`, `response`, `route`, `requestContext`, `state`): `Promise`\<`void`\> | ||
> `optional` **pre**(`request`, `response`, `route`, `requestContext`, `state`): `Promise`\<`void`\> | ||
Pre process the REST request for the specified route. | ||
#### Parameters | ||
• **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\> | ||
The request to handle. | ||
• **response**: [`IHttpResponse`](IHttpResponse.md)\<`any`\> | ||
The response data to send if any. | ||
• **route**: `undefined` \| [`IRestRoute`](IRestRoute.md)\<`any`, `any`\> | ||
The route being requested, if a matching one was found. | ||
• **requestContext**: `IServiceRequestContext` | ||
The context for the request. | ||
• **state** | ||
The state for the request. | ||
#### Returns | ||
`Promise`\<`void`\> | ||
Promise that resolves when the request is processed. | ||
*** | ||
### process()? | ||
> `optional` **process**(`request`, `response`, `route`, `requestContext`, `state`): `Promise`\<`void`\> | ||
Process the REST request for the specified route. | ||
@@ -137,1 +173,37 @@ | ||
Promise that resolves when the request is processed. | ||
*** | ||
### post()? | ||
> `optional` **post**(`request`, `response`, `route`, `requestContext`, `state`): `Promise`\<`void`\> | ||
Post process the REST request for the specified route. | ||
#### Parameters | ||
• **request**: [`IHttpServerRequest`](IHttpServerRequest.md)\<`any`\> | ||
The request to handle. | ||
• **response**: [`IHttpResponse`](IHttpResponse.md)\<`any`\> | ||
The response data to send if any. | ||
• **route**: `undefined` \| [`IRestRoute`](IRestRoute.md)\<`any`, `any`\> | ||
The route being requested, if a matching one was found. | ||
• **requestContext**: `IServiceRequestContext` | ||
The context for the request. | ||
• **state** | ||
The state for the request. | ||
#### Returns | ||
`Promise`\<`void`\> | ||
Promise that resolves when the request is processed. |
{ | ||
"name": "@gtsc/api-models", | ||
"version": "0.0.3-next.64", | ||
"version": "0.0.3-next.65", | ||
"description": "Contains models and classes for use with APIs", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
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
65745
904