Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gtsc/api-models

Package Overview
Dependencies
Maintainers
2
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gtsc/api-models - npm Package Compare versions

Comparing version 0.0.3-next.64 to 0.0.3-next.65

26

dist/types/models/server/IHttpRestRouteProcessor.d.ts

@@ -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.

2

package.json
{
"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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc