@twin.org/api-models 0.0.2-next.9 → 0.0.3-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/factories/authenticationGeneratorFactory.js +9 -0
- package/dist/es/factories/authenticationGeneratorFactory.js.map +1 -0
- package/dist/es/factories/mimeTypeProcessorFactory.js +9 -0
- package/dist/es/factories/mimeTypeProcessorFactory.js.map +1 -0
- package/dist/es/factories/restRouteProcessorFactory.js +9 -0
- package/dist/es/factories/restRouteProcessorFactory.js.map +1 -0
- package/dist/es/factories/socketRouteProcessorFactory.js +9 -0
- package/dist/es/factories/socketRouteProcessorFactory.js.map +1 -0
- package/dist/es/helpers/httpErrorHelper.js +66 -0
- package/dist/es/helpers/httpErrorHelper.js.map +1 -0
- package/dist/es/helpers/httpParameterHelper.js +41 -0
- package/dist/es/helpers/httpParameterHelper.js.map +1 -0
- package/dist/es/index.js +61 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/api/IServerFavIconResponse.js +2 -0
- package/dist/es/models/api/IServerFavIconResponse.js.map +1 -0
- package/dist/es/models/api/IServerHealthResponse.js +2 -0
- package/dist/es/models/api/IServerHealthResponse.js.map +1 -0
- package/dist/es/models/api/IServerInfoResponse.js +2 -0
- package/dist/es/models/api/IServerInfoResponse.js.map +1 -0
- package/dist/es/models/api/IServerLivezResponse.js +2 -0
- package/dist/es/models/api/IServerLivezResponse.js.map +1 -0
- package/dist/es/models/api/IServerRootResponse.js +2 -0
- package/dist/es/models/api/IServerRootResponse.js.map +1 -0
- package/dist/es/models/api/IServerSpecResponse.js +2 -0
- package/dist/es/models/api/IServerSpecResponse.js.map +1 -0
- package/dist/es/models/client/IAuthenticationGenerator.js +2 -0
- package/dist/es/models/client/IAuthenticationGenerator.js.map +1 -0
- package/dist/es/models/config/IBaseRestClientConfig.js +2 -0
- package/dist/es/models/config/IBaseRestClientConfig.js.map +1 -0
- package/dist/es/models/config/IBaseSocketClientConfig.js +2 -0
- package/dist/es/models/config/IBaseSocketClientConfig.js.map +1 -0
- package/dist/es/models/protocol/IHttpRequest.js +2 -0
- package/dist/es/models/protocol/IHttpRequest.js.map +1 -0
- package/dist/es/models/protocol/IHttpRequestContext.js +2 -0
- package/dist/es/models/protocol/IHttpRequestContext.js.map +1 -0
- package/dist/es/models/protocol/IHttpRequestPathParams.js +4 -0
- package/dist/es/models/protocol/IHttpRequestPathParams.js.map +1 -0
- package/dist/es/models/protocol/IHttpRequestQuery.js +4 -0
- package/dist/es/models/protocol/IHttpRequestQuery.js.map +1 -0
- package/dist/es/models/protocol/IHttpResponse.js +2 -0
- package/dist/es/models/protocol/IHttpResponse.js.map +1 -0
- package/dist/es/models/protocol/IHttpServerRequest.js +2 -0
- package/dist/es/models/protocol/IHttpServerRequest.js.map +1 -0
- package/dist/es/models/protocol/ISocketRequestContext.js +2 -0
- package/dist/es/models/protocol/ISocketRequestContext.js.map +1 -0
- package/dist/es/models/protocol/ISocketServerRequest.js +2 -0
- package/dist/es/models/protocol/ISocketServerRequest.js.map +1 -0
- package/dist/es/models/requests/INoContentRequest.js +2 -0
- package/dist/es/models/requests/INoContentRequest.js.map +1 -0
- package/dist/es/models/responses/errors/IBadRequestResponse.js +2 -0
- package/dist/es/models/responses/errors/IBadRequestResponse.js.map +1 -0
- package/dist/es/models/responses/errors/IConflictResponse.js +2 -0
- package/dist/es/models/responses/errors/IConflictResponse.js.map +1 -0
- package/dist/es/models/responses/errors/IForbiddenResponse.js +2 -0
- package/dist/es/models/responses/errors/IForbiddenResponse.js.map +1 -0
- package/dist/es/models/responses/errors/IInternalServerErrorResponse.js +2 -0
- package/dist/es/models/responses/errors/IInternalServerErrorResponse.js.map +1 -0
- package/dist/es/models/responses/errors/INotFoundResponse.js +2 -0
- package/dist/es/models/responses/errors/INotFoundResponse.js.map +1 -0
- package/dist/es/models/responses/errors/IUnauthorizedResponse.js +2 -0
- package/dist/es/models/responses/errors/IUnauthorizedResponse.js.map +1 -0
- package/dist/es/models/responses/errors/IUnprocessableEntityResponse.js +2 -0
- package/dist/es/models/responses/errors/IUnprocessableEntityResponse.js.map +1 -0
- package/dist/es/models/responses/success/IAcceptedResponse.js +2 -0
- package/dist/es/models/responses/success/IAcceptedResponse.js.map +1 -0
- package/dist/es/models/responses/success/ICreatedResponse.js +2 -0
- package/dist/es/models/responses/success/ICreatedResponse.js.map +1 -0
- package/dist/es/models/responses/success/INoContentResponse.js +2 -0
- package/dist/es/models/responses/success/INoContentResponse.js.map +1 -0
- package/dist/es/models/responses/success/IOkResponse.js +2 -0
- package/dist/es/models/responses/success/IOkResponse.js.map +1 -0
- package/dist/es/models/routes/IBaseRoute.js +4 -0
- package/dist/es/models/routes/IBaseRoute.js.map +1 -0
- package/dist/es/models/routes/IBaseRouteEntryPoint.js +2 -0
- package/dist/es/models/routes/IBaseRouteEntryPoint.js.map +1 -0
- package/dist/es/models/routes/IRestRoute.js +2 -0
- package/dist/es/models/routes/IRestRoute.js.map +1 -0
- package/dist/es/models/routes/IRestRouteEntryPoint.js +2 -0
- package/dist/es/models/routes/IRestRouteEntryPoint.js.map +1 -0
- package/dist/es/models/routes/IRestRouteExample.js +4 -0
- package/dist/es/models/routes/IRestRouteExample.js.map +1 -0
- package/dist/es/models/routes/IRestRouteRequestExample.js +2 -0
- package/dist/es/models/routes/IRestRouteRequestExample.js.map +1 -0
- package/dist/es/models/routes/IRestRouteResponseAttachmentOptions.js +4 -0
- package/dist/es/models/routes/IRestRouteResponseAttachmentOptions.js.map +1 -0
- package/dist/es/models/routes/IRestRouteResponseExample.js +2 -0
- package/dist/es/models/routes/IRestRouteResponseExample.js.map +1 -0
- package/dist/es/models/routes/IRestRouteResponseOptions.js +2 -0
- package/dist/es/models/routes/IRestRouteResponseOptions.js.map +1 -0
- package/dist/es/models/routes/ISocketRoute.js +2 -0
- package/dist/es/models/routes/ISocketRoute.js.map +1 -0
- package/dist/es/models/routes/ISocketRouteEntryPoint.js +2 -0
- package/dist/es/models/routes/ISocketRouteEntryPoint.js.map +1 -0
- package/dist/es/models/routes/ITag.js +4 -0
- package/dist/es/models/routes/ITag.js.map +1 -0
- package/dist/es/models/server/IBaseRouteProcessor.js +2 -0
- package/dist/es/models/server/IBaseRouteProcessor.js.map +1 -0
- package/dist/es/models/server/IMimeTypeProcessor.js +2 -0
- package/dist/es/models/server/IMimeTypeProcessor.js.map +1 -0
- package/dist/es/models/server/IRestRouteProcessor.js +2 -0
- package/dist/es/models/server/IRestRouteProcessor.js.map +1 -0
- package/dist/es/models/server/ISocketRouteProcessor.js +2 -0
- package/dist/es/models/server/ISocketRouteProcessor.js.map +1 -0
- package/dist/es/models/server/IWebServer.js +2 -0
- package/dist/es/models/server/IWebServer.js.map +1 -0
- package/dist/es/models/server/IWebServerOptions.js +2 -0
- package/dist/es/models/server/IWebServerOptions.js.map +1 -0
- package/dist/es/models/services/IHealthComponentInfo.js +2 -0
- package/dist/es/models/services/IHealthComponentInfo.js.map +1 -0
- package/dist/es/models/services/IHealthInfo.js +2 -0
- package/dist/es/models/services/IHealthInfo.js.map +1 -0
- package/dist/es/models/services/IInformationComponent.js +2 -0
- package/dist/es/models/services/IInformationComponent.js.map +1 -0
- package/dist/es/models/services/IServerInfo.js +4 -0
- package/dist/es/models/services/IServerInfo.js.map +1 -0
- package/dist/es/models/services/healthStatus.js +21 -0
- package/dist/es/models/services/healthStatus.js.map +1 -0
- package/dist/types/factories/authenticationGeneratorFactory.d.ts +6 -0
- package/dist/types/factories/mimeTypeProcessorFactory.d.ts +1 -1
- package/dist/types/factories/restRouteProcessorFactory.d.ts +1 -1
- package/dist/types/factories/socketRouteProcessorFactory.d.ts +1 -1
- package/dist/types/helpers/httpErrorHelper.d.ts +1 -1
- package/dist/types/index.d.ts +58 -55
- package/dist/types/models/api/IServerHealthResponse.d.ts +1 -1
- package/dist/types/models/api/IServerInfoResponse.d.ts +1 -1
- package/dist/types/models/api/IServerLivezResponse.d.ts +16 -0
- package/dist/types/models/api/IServerRootResponse.d.ts +7 -0
- package/dist/types/models/client/IAuthenticationGenerator.d.ts +14 -0
- package/dist/types/models/protocol/IHttpRequest.d.ts +2 -2
- package/dist/types/models/protocol/IHttpRequestContext.d.ts +2 -3
- package/dist/types/models/protocol/IHttpRequestPathParams.d.ts +1 -1
- package/dist/types/models/protocol/IHttpRequestQuery.d.ts +1 -1
- package/dist/types/models/protocol/IHttpServerRequest.d.ts +1 -1
- package/dist/types/models/protocol/ISocketRequestContext.d.ts +1 -1
- package/dist/types/models/protocol/ISocketServerRequest.d.ts +1 -1
- package/dist/types/models/requests/INoContentRequest.d.ts +1 -1
- package/dist/types/models/routes/IBaseRoute.d.ts +15 -1
- package/dist/types/models/routes/IBaseRouteEntryPoint.d.ts +1 -1
- package/dist/types/models/routes/IRestRoute.d.ts +7 -7
- package/dist/types/models/routes/IRestRouteEntryPoint.d.ts +2 -2
- package/dist/types/models/routes/IRestRouteRequestExample.d.ts +1 -1
- package/dist/types/models/routes/IRestRouteResponseExample.d.ts +1 -1
- package/dist/types/models/routes/IRestRouteResponseOptions.d.ts +1 -1
- package/dist/types/models/routes/ISocketRoute.d.ts +4 -4
- package/dist/types/models/routes/ISocketRouteEntryPoint.d.ts +2 -2
- package/dist/types/models/server/IBaseRouteProcessor.d.ts +15 -8
- package/dist/types/models/server/IRestRouteProcessor.d.ts +5 -7
- package/dist/types/models/server/ISocketRouteProcessor.d.ts +5 -7
- package/dist/types/models/server/IWebServer.d.ts +5 -5
- package/dist/types/models/services/IHealthComponentInfo.d.ts +18 -0
- package/dist/types/models/services/IHealthInfo.d.ts +3 -15
- package/dist/types/models/services/IInformationComponent.d.ts +12 -5
- package/docs/changelog.md +141 -0
- package/docs/reference/classes/HttpParameterHelper.md +8 -8
- package/docs/reference/index.md +4 -1
- package/docs/reference/interfaces/IAuthenticationGenerator.md +35 -0
- package/docs/reference/interfaces/IBaseRoute.md +29 -1
- package/docs/reference/interfaces/IBaseRouteProcessor.md +26 -10
- package/docs/reference/interfaces/IHealthComponentInfo.md +27 -0
- package/docs/reference/interfaces/IHealthInfo.md +1 -19
- package/docs/reference/interfaces/IHttpRequestContext.md +0 -28
- package/docs/reference/interfaces/IHttpRequestPathParams.md +1 -1
- package/docs/reference/interfaces/IHttpRequestQuery.md +1 -1
- package/docs/reference/interfaces/IInformationComponent.md +30 -4
- package/docs/reference/interfaces/IRestRoute.md +41 -1
- package/docs/reference/interfaces/IRestRouteProcessor.md +32 -18
- package/docs/reference/interfaces/IServerLivezResponse.md +23 -0
- package/docs/reference/interfaces/IServerRootResponse.md +12 -0
- package/docs/reference/interfaces/ISocketRequestContext.md +0 -24
- package/docs/reference/interfaces/ISocketRoute.md +41 -1
- package/docs/reference/interfaces/ISocketRouteProcessor.md +34 -20
- package/docs/reference/variables/AuthenticationGeneratorFactory.md +5 -0
- package/locales/en.json +1 -9
- package/package.json +23 -8
- package/dist/cjs/index.cjs +0 -154
- package/dist/esm/index.mjs +0 -147
- package/dist/types/models/protocol/IHttpRequestIdentity.d.ts +0 -13
- package/docs/reference/interfaces/IHttpRequestIdentity.md +0 -23
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { IBaseRoute } from "./IBaseRoute";
|
|
2
|
-
import type { IHttpRequest } from "../protocol/IHttpRequest";
|
|
3
|
-
import type { IHttpResponse } from "../protocol/IHttpResponse";
|
|
4
|
-
import type { ISocketRequestContext } from "../protocol/ISocketRequestContext";
|
|
1
|
+
import type { IBaseRoute } from "./IBaseRoute.js";
|
|
2
|
+
import type { IHttpRequest } from "../protocol/IHttpRequest.js";
|
|
3
|
+
import type { IHttpResponse } from "../protocol/IHttpResponse.js";
|
|
4
|
+
import type { ISocketRequestContext } from "../protocol/ISocketRequestContext.js";
|
|
5
5
|
/**
|
|
6
6
|
* Interface which defines a socket route.
|
|
7
7
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IBaseRouteEntryPoint } from "./IBaseRouteEntryPoint";
|
|
2
|
-
import type { ISocketRoute } from "./ISocketRoute";
|
|
1
|
+
import type { IBaseRouteEntryPoint } from "./IBaseRouteEntryPoint.js";
|
|
2
|
+
import type { ISocketRoute } from "./ISocketRoute.js";
|
|
3
3
|
/**
|
|
4
4
|
* Route entry points are used for exposing the socket routes from a package.
|
|
5
5
|
*/
|
|
@@ -1,23 +1,30 @@
|
|
|
1
|
+
import type { IContextIds } from "@twin.org/context";
|
|
1
2
|
import type { IComponent } from "@twin.org/core";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type { IBaseRoute } from "../routes/IBaseRoute";
|
|
3
|
+
import type { IHttpResponse } from "../protocol/IHttpResponse.js";
|
|
4
|
+
import type { IHttpServerRequest } from "../protocol/IHttpServerRequest.js";
|
|
5
|
+
import type { IBaseRoute } from "../routes/IBaseRoute.js";
|
|
6
6
|
/**
|
|
7
7
|
* The definition for a base processor for handling REST routes.
|
|
8
8
|
*/
|
|
9
9
|
export interface IBaseRouteProcessor<T = IBaseRoute, R = IHttpServerRequest> extends IComponent {
|
|
10
|
+
/**
|
|
11
|
+
* Features supported by this processor.
|
|
12
|
+
* If a route has any of these features listed, this processor will be run for that route.
|
|
13
|
+
* If this is not implemented, the processor will run for all routes.
|
|
14
|
+
* @returns The features supported by this processor.
|
|
15
|
+
*/
|
|
16
|
+
features?(): string[];
|
|
10
17
|
/**
|
|
11
18
|
* Pre process the REST request for the specified route.
|
|
12
19
|
* @param request The request to handle.
|
|
13
20
|
* @param response The response data to send if any.
|
|
14
21
|
* @param route The route being requested, if a matching one was found.
|
|
15
|
-
* @param
|
|
22
|
+
* @param contextIds The context IDs of the request.
|
|
16
23
|
* @param processorState The state handed through the processors.
|
|
17
24
|
* @param loggingComponentType The logging component type for the request.
|
|
18
25
|
* @returns Promise that resolves when the request is processed.
|
|
19
26
|
*/
|
|
20
|
-
pre?(request: R, response: IHttpResponse, route: T | undefined,
|
|
27
|
+
pre?(request: R, response: IHttpResponse, route: T | undefined, contextIds: IContextIds, processorState: {
|
|
21
28
|
[id: string]: unknown;
|
|
22
29
|
}, loggingComponentType?: string): Promise<void>;
|
|
23
30
|
/**
|
|
@@ -25,12 +32,12 @@ export interface IBaseRouteProcessor<T = IBaseRoute, R = IHttpServerRequest> ext
|
|
|
25
32
|
* @param request The request to handle.
|
|
26
33
|
* @param response The response data to send if any.
|
|
27
34
|
* @param route The route being requested, if a matching one was found.
|
|
28
|
-
* @param
|
|
35
|
+
* @param contextIds The context IDs of the request.
|
|
29
36
|
* @param processorState The state handed through the processors.
|
|
30
37
|
* @param loggingComponentType The logging component type for the request.
|
|
31
38
|
* @returns Promise that resolves when the request is processed.
|
|
32
39
|
*/
|
|
33
|
-
post?(request: R, response: IHttpResponse, route: T | undefined,
|
|
40
|
+
post?(request: R, response: IHttpResponse, route: T | undefined, contextIds: IContextIds, processorState: {
|
|
34
41
|
[id: string]: unknown;
|
|
35
42
|
}, loggingComponentType?: string): Promise<void>;
|
|
36
43
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { IBaseRouteProcessor } from "./IBaseRouteProcessor";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type { IRestRoute } from "../routes/IRestRoute";
|
|
1
|
+
import type { IBaseRouteProcessor } from "./IBaseRouteProcessor.js";
|
|
2
|
+
import type { IHttpResponse } from "../protocol/IHttpResponse.js";
|
|
3
|
+
import type { IHttpServerRequest } from "../protocol/IHttpServerRequest.js";
|
|
4
|
+
import type { IRestRoute } from "../routes/IRestRoute.js";
|
|
6
5
|
/**
|
|
7
6
|
* The definition for a processor for handling REST routes.
|
|
8
7
|
*/
|
|
@@ -12,12 +11,11 @@ export interface IRestRouteProcessor extends IBaseRouteProcessor<IRestRoute> {
|
|
|
12
11
|
* @param request The request to handle.
|
|
13
12
|
* @param response The response data to send if any.
|
|
14
13
|
* @param route The route being requested, if a matching one was found.
|
|
15
|
-
* @param requestIdentity The identity context for the request.
|
|
16
14
|
* @param processorState The state handed through the processors.
|
|
17
15
|
* @param loggingComponentType The logging component type for the request.
|
|
18
16
|
* @returns Promise that resolves when the request is processed.
|
|
19
17
|
*/
|
|
20
|
-
process?(request: IHttpServerRequest, response: IHttpResponse, route: IRestRoute | undefined,
|
|
18
|
+
process?(request: IHttpServerRequest, response: IHttpResponse, route: IRestRoute | undefined, processorState: {
|
|
21
19
|
[id: string]: unknown;
|
|
22
20
|
}, loggingComponentType?: string): Promise<void>;
|
|
23
21
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { IBaseRouteProcessor } from "./IBaseRouteProcessor";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type { ISocketRoute } from "../routes/ISocketRoute";
|
|
1
|
+
import type { IBaseRouteProcessor } from "./IBaseRouteProcessor.js";
|
|
2
|
+
import type { IHttpResponse } from "../protocol/IHttpResponse.js";
|
|
3
|
+
import type { ISocketServerRequest } from "../protocol/ISocketServerRequest.js";
|
|
4
|
+
import type { ISocketRoute } from "../routes/ISocketRoute.js";
|
|
6
5
|
/**
|
|
7
6
|
* The definition for a processor for handling socket routes.
|
|
8
7
|
*/
|
|
@@ -28,13 +27,12 @@ export interface ISocketRouteProcessor extends IBaseRouteProcessor<ISocketRoute,
|
|
|
28
27
|
* @param request The server request object containing the socket id and other parameters.
|
|
29
28
|
* @param response The response data to send if any.
|
|
30
29
|
* @param route The route being requested, if a matching one was found.
|
|
31
|
-
* @param requestIdentity The identity context for the request.
|
|
32
30
|
* @param processorState The state handed through the processors.
|
|
33
31
|
* @param responseEmitter The function to emit a response.
|
|
34
32
|
* @param loggingComponentType The logging component type for the request.
|
|
35
33
|
* @returns Promise that resolves when the request is processed.
|
|
36
34
|
*/
|
|
37
|
-
process?(request: ISocketServerRequest, response: IHttpResponse, route: ISocketRoute | undefined,
|
|
35
|
+
process?(request: ISocketServerRequest, response: IHttpResponse, route: ISocketRoute | undefined, processorState: {
|
|
38
36
|
[id: string]: unknown;
|
|
39
37
|
}, responseEmitter: (topic: string, response: IHttpResponse) => Promise<void>, loggingComponentType?: string): Promise<void>;
|
|
40
38
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IRestRouteProcessor } from "./IRestRouteProcessor";
|
|
2
|
-
import type { ISocketRouteProcessor } from "./ISocketRouteProcessor";
|
|
3
|
-
import type { IWebServerOptions } from "./IWebServerOptions";
|
|
4
|
-
import type { IRestRoute } from "../routes/IRestRoute";
|
|
5
|
-
import type { ISocketRoute } from "../routes/ISocketRoute";
|
|
1
|
+
import type { IRestRouteProcessor } from "./IRestRouteProcessor.js";
|
|
2
|
+
import type { ISocketRouteProcessor } from "./ISocketRouteProcessor.js";
|
|
3
|
+
import type { IWebServerOptions } from "./IWebServerOptions.js";
|
|
4
|
+
import type { IRestRoute } from "../routes/IRestRoute.js";
|
|
5
|
+
import type { ISocketRoute } from "../routes/ISocketRoute.js";
|
|
6
6
|
/**
|
|
7
7
|
* Interface describing a web server.
|
|
8
8
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HealthStatus } from "./healthStatus.js";
|
|
2
|
+
/**
|
|
3
|
+
* The health component information.
|
|
4
|
+
*/
|
|
5
|
+
export interface IHealthComponentInfo {
|
|
6
|
+
/**
|
|
7
|
+
* The name of the component.
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* The status of the component.
|
|
12
|
+
*/
|
|
13
|
+
status: HealthStatus;
|
|
14
|
+
/**
|
|
15
|
+
* The details for the status.
|
|
16
|
+
*/
|
|
17
|
+
details?: string;
|
|
18
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { HealthStatus } from "./healthStatus";
|
|
1
|
+
import type { HealthStatus } from "./healthStatus.js";
|
|
2
|
+
import type { IHealthComponentInfo } from "./IHealthComponentInfo.js";
|
|
2
3
|
/**
|
|
3
4
|
* The status of the server.
|
|
4
5
|
*/
|
|
@@ -10,18 +11,5 @@ export interface IHealthInfo {
|
|
|
10
11
|
/**
|
|
11
12
|
* The status of the components.
|
|
12
13
|
*/
|
|
13
|
-
components?:
|
|
14
|
-
/**
|
|
15
|
-
* The name of the component.
|
|
16
|
-
*/
|
|
17
|
-
name: string;
|
|
18
|
-
/**
|
|
19
|
-
* The status of the component.
|
|
20
|
-
*/
|
|
21
|
-
status: HealthStatus;
|
|
22
|
-
/**
|
|
23
|
-
* The details for the status.
|
|
24
|
-
*/
|
|
25
|
-
details?: string;
|
|
26
|
-
}[];
|
|
14
|
+
components?: IHealthComponentInfo[];
|
|
27
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IComponent } from "@twin.org/core";
|
|
2
|
-
import type { HealthStatus } from "./healthStatus";
|
|
3
|
-
import type { IHealthInfo } from "./IHealthInfo";
|
|
4
|
-
import type { IServerInfo } from "./IServerInfo";
|
|
2
|
+
import type { HealthStatus } from "./healthStatus.js";
|
|
3
|
+
import type { IHealthInfo } from "./IHealthInfo.js";
|
|
4
|
+
import type { IServerInfo } from "./IServerInfo.js";
|
|
5
5
|
/**
|
|
6
6
|
* The information component for the server.
|
|
7
7
|
*/
|
|
@@ -26,6 +26,11 @@ export interface IInformationComponent extends IComponent {
|
|
|
26
26
|
* @returns The OpenAPI spec.
|
|
27
27
|
*/
|
|
28
28
|
spec(): Promise<unknown>;
|
|
29
|
+
/**
|
|
30
|
+
* Is the server live.
|
|
31
|
+
* @returns True if the server is live.
|
|
32
|
+
*/
|
|
33
|
+
livez(): Promise<boolean>;
|
|
29
34
|
/**
|
|
30
35
|
* Get the server health.
|
|
31
36
|
* @returns The service health.
|
|
@@ -36,13 +41,15 @@ export interface IInformationComponent extends IComponent {
|
|
|
36
41
|
* @param name The component name.
|
|
37
42
|
* @param status The status of the component.
|
|
38
43
|
* @param details The details for the status.
|
|
44
|
+
* @param tenantId The tenant id, optional if the health status is not tenant specific.
|
|
39
45
|
* @returns Nothing.
|
|
40
46
|
*/
|
|
41
|
-
setComponentHealth(name: string, status: HealthStatus, details?: string): Promise<void>;
|
|
47
|
+
setComponentHealth(name: string, status: HealthStatus, details?: string, tenantId?: string): Promise<void>;
|
|
42
48
|
/**
|
|
43
49
|
* Remove the status of a component.
|
|
44
50
|
* @param name The component name.
|
|
51
|
+
* @param tenantId The tenant id, optional if the health status is not tenant specific.
|
|
45
52
|
* @returns Nothing.
|
|
46
53
|
*/
|
|
47
|
-
removeComponentHealth(name: string): Promise<void>;
|
|
54
|
+
removeComponentHealth(name: string, tenantId?: string): Promise<void>;
|
|
48
55
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,146 @@
|
|
|
1
1
|
# @twin.org/api-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.10](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.9...api-models-v0.0.3-next.10) (2026-01-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **api-models:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
## [0.0.3-next.9](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.8...api-models-v0.0.3-next.9) (2026-01-05)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add authentication generators and process features option ([a67edf1](https://github.com/twinfoundation/api/commit/a67edf1df212bd8ab94a40cddf5338551155696f))
|
|
16
|
+
* add context id features ([#42](https://github.com/twinfoundation/api/issues/42)) ([0186055](https://github.com/twinfoundation/api/commit/0186055c48afde842a4254b4df9ac9249c40fe40))
|
|
17
|
+
* add livez endpoint ([#57](https://github.com/twinfoundation/api/issues/57)) ([ef007db](https://github.com/twinfoundation/api/commit/ef007db8201736dd3053211f849ffd03baaa485e))
|
|
18
|
+
* add logging component type to request contexts ([210de1b](https://github.com/twinfoundation/api/commit/210de1b9e1c91079b59a2b90ddd57569668d647d))
|
|
19
|
+
* add root, favicon routes ([71da1c3](https://github.com/twinfoundation/api/commit/71da1c3a93c349588aff7084d1d8d6a29a277da8))
|
|
20
|
+
* add socket id, connect and disconnect ([20b0d0e](https://github.com/twinfoundation/api/commit/20b0d0ec279cab46141fee09de2c4a7087cdce16))
|
|
21
|
+
* add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
|
|
22
|
+
* decodeURIComponent for query and path params ([ead68a2](https://github.com/twinfoundation/api/commit/ead68a257425c10dd912497f7edd473c469ca132))
|
|
23
|
+
* eslint migration to flat config ([0dd5820](https://github.com/twinfoundation/api/commit/0dd5820e3af97350fd08b8d226f4a6c1a9246805))
|
|
24
|
+
* update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
|
|
25
|
+
* update framework core ([d8eebf2](https://github.com/twinfoundation/api/commit/d8eebf267fa2a0abaa84e58590496e9d20490cfa))
|
|
26
|
+
* update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
|
|
27
|
+
* use new includeStackTrace flag for toJsonObject ([6452b15](https://github.com/twinfoundation/api/commit/6452b153af786eee14b21152420f8a2578b70593))
|
|
28
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
29
|
+
* validationError mapped to http status badrequest ([adc5eb1](https://github.com/twinfoundation/api/commit/adc5eb11d987abb0ab9f7e0dc8e1fdae207e436e))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* error handling make sure primary error takes precedence ([84b61f2](https://github.com/twinfoundation/api/commit/84b61f27fe5e4919c0c9f9a1edc8ff46dc45c1f7))
|
|
35
|
+
|
|
36
|
+
## [0.0.3-next.8](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.7...api-models-v0.0.3-next.8) (2025-12-17)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Miscellaneous Chores
|
|
40
|
+
|
|
41
|
+
* **api-models:** Synchronize repo versions
|
|
42
|
+
|
|
43
|
+
## [0.0.3-next.7](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.6...api-models-v0.0.3-next.7) (2025-11-26)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Bug Fixes
|
|
47
|
+
|
|
48
|
+
* error handling make sure primary error takes precedence ([84b61f2](https://github.com/twinfoundation/api/commit/84b61f27fe5e4919c0c9f9a1edc8ff46dc45c1f7))
|
|
49
|
+
|
|
50
|
+
## [0.0.3-next.6](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.5...api-models-v0.0.3-next.6) (2025-11-20)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Miscellaneous Chores
|
|
54
|
+
|
|
55
|
+
* **api-models:** Synchronize repo versions
|
|
56
|
+
|
|
57
|
+
## [0.0.3-next.5](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.4...api-models-v0.0.3-next.5) (2025-11-14)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Features
|
|
61
|
+
|
|
62
|
+
* decodeURIComponent for query and path params ([ead68a2](https://github.com/twinfoundation/api/commit/ead68a257425c10dd912497f7edd473c469ca132))
|
|
63
|
+
|
|
64
|
+
## [0.0.3-next.4](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.3...api-models-v0.0.3-next.4) (2025-11-14)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
### Features
|
|
68
|
+
|
|
69
|
+
* add authentication generators and process features option ([a67edf1](https://github.com/twinfoundation/api/commit/a67edf1df212bd8ab94a40cddf5338551155696f))
|
|
70
|
+
* add context id features ([#42](https://github.com/twinfoundation/api/issues/42)) ([0186055](https://github.com/twinfoundation/api/commit/0186055c48afde842a4254b4df9ac9249c40fe40))
|
|
71
|
+
* add logging component type to request contexts ([210de1b](https://github.com/twinfoundation/api/commit/210de1b9e1c91079b59a2b90ddd57569668d647d))
|
|
72
|
+
* add root, favicon routes ([71da1c3](https://github.com/twinfoundation/api/commit/71da1c3a93c349588aff7084d1d8d6a29a277da8))
|
|
73
|
+
* add socket id, connect and disconnect ([20b0d0e](https://github.com/twinfoundation/api/commit/20b0d0ec279cab46141fee09de2c4a7087cdce16))
|
|
74
|
+
* add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
|
|
75
|
+
* eslint migration to flat config ([0dd5820](https://github.com/twinfoundation/api/commit/0dd5820e3af97350fd08b8d226f4a6c1a9246805))
|
|
76
|
+
* update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
|
|
77
|
+
* update framework core ([d8eebf2](https://github.com/twinfoundation/api/commit/d8eebf267fa2a0abaa84e58590496e9d20490cfa))
|
|
78
|
+
* update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
|
|
79
|
+
* use new includeStackTrace flag for toJsonObject ([6452b15](https://github.com/twinfoundation/api/commit/6452b153af786eee14b21152420f8a2578b70593))
|
|
80
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
81
|
+
* validationError mapped to http status badrequest ([adc5eb1](https://github.com/twinfoundation/api/commit/adc5eb11d987abb0ab9f7e0dc8e1fdae207e436e))
|
|
82
|
+
|
|
83
|
+
## [0.0.3-next.3](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.2...api-models-v0.0.3-next.3) (2025-11-14)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### Miscellaneous Chores
|
|
87
|
+
|
|
88
|
+
* **api-models:** Synchronize repo versions
|
|
89
|
+
|
|
90
|
+
## [0.0.3-next.2](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.1...api-models-v0.0.3-next.2) (2025-11-12)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Miscellaneous Chores
|
|
94
|
+
|
|
95
|
+
* **api-models:** Synchronize repo versions
|
|
96
|
+
|
|
97
|
+
## [0.0.3-next.1](https://github.com/twinfoundation/api/compare/api-models-v0.0.3-next.0...api-models-v0.0.3-next.1) (2025-11-10)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
### Features
|
|
101
|
+
|
|
102
|
+
* add authentication generators and process features option ([a67edf1](https://github.com/twinfoundation/api/commit/a67edf1df212bd8ab94a40cddf5338551155696f))
|
|
103
|
+
* add context id features ([#42](https://github.com/twinfoundation/api/issues/42)) ([0186055](https://github.com/twinfoundation/api/commit/0186055c48afde842a4254b4df9ac9249c40fe40))
|
|
104
|
+
* add logging component type to request contexts ([210de1b](https://github.com/twinfoundation/api/commit/210de1b9e1c91079b59a2b90ddd57569668d647d))
|
|
105
|
+
* add root, favicon routes ([71da1c3](https://github.com/twinfoundation/api/commit/71da1c3a93c349588aff7084d1d8d6a29a277da8))
|
|
106
|
+
* add socket id, connect and disconnect ([20b0d0e](https://github.com/twinfoundation/api/commit/20b0d0ec279cab46141fee09de2c4a7087cdce16))
|
|
107
|
+
* add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
|
|
108
|
+
* eslint migration to flat config ([0dd5820](https://github.com/twinfoundation/api/commit/0dd5820e3af97350fd08b8d226f4a6c1a9246805))
|
|
109
|
+
* update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
|
|
110
|
+
* update framework core ([d8eebf2](https://github.com/twinfoundation/api/commit/d8eebf267fa2a0abaa84e58590496e9d20490cfa))
|
|
111
|
+
* update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
|
|
112
|
+
* use new includeStackTrace flag for toJsonObject ([6452b15](https://github.com/twinfoundation/api/commit/6452b153af786eee14b21152420f8a2578b70593))
|
|
113
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
114
|
+
* validationError mapped to http status badrequest ([adc5eb1](https://github.com/twinfoundation/api/commit/adc5eb11d987abb0ab9f7e0dc8e1fdae207e436e))
|
|
115
|
+
|
|
116
|
+
## [0.0.2-next.13](https://github.com/twinfoundation/api/compare/api-models-v0.0.2-next.12...api-models-v0.0.2-next.13) (2025-10-09)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
### Miscellaneous Chores
|
|
120
|
+
|
|
121
|
+
* **api-models:** Synchronize repo versions
|
|
122
|
+
|
|
123
|
+
## [0.0.2-next.12](https://github.com/twinfoundation/api/compare/api-models-v0.0.2-next.11...api-models-v0.0.2-next.12) (2025-10-09)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### Features
|
|
127
|
+
|
|
128
|
+
* add validate-locales ([cdba610](https://github.com/twinfoundation/api/commit/cdba610a0acb5022d2e3ce729732e6646a297e5e))
|
|
129
|
+
|
|
130
|
+
## [0.0.2-next.11](https://github.com/twinfoundation/api/compare/api-models-v0.0.2-next.10...api-models-v0.0.2-next.11) (2025-09-29)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
### Features
|
|
134
|
+
|
|
135
|
+
* update IComponent signatures ([915ce37](https://github.com/twinfoundation/api/commit/915ce37712326ab4aa6869c350eabaa4622e8430))
|
|
136
|
+
|
|
137
|
+
## [0.0.2-next.10](https://github.com/twinfoundation/api/compare/api-models-v0.0.2-next.9...api-models-v0.0.2-next.10) (2025-09-23)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Features
|
|
141
|
+
|
|
142
|
+
* add authentication generators and process features option ([a67edf1](https://github.com/twinfoundation/api/commit/a67edf1df212bd8ab94a40cddf5338551155696f))
|
|
143
|
+
|
|
3
144
|
## [0.0.2-next.9](https://github.com/twinfoundation/api/compare/api-models-v0.0.2-next.8...api-models-v0.0.2-next.9) (2025-08-29)
|
|
4
145
|
|
|
5
146
|
|
|
@@ -16,7 +16,7 @@ Class to help with handling http parameters.
|
|
|
16
16
|
|
|
17
17
|
### arrayFromString()
|
|
18
18
|
|
|
19
|
-
> `static` **arrayFromString**\<`T`\>(`values?`): `
|
|
19
|
+
> `static` **arrayFromString**\<`T`\>(`values?`): `T`[] \| `undefined`
|
|
20
20
|
|
|
21
21
|
Convert list query to array.
|
|
22
22
|
|
|
@@ -36,7 +36,7 @@ The values query string.
|
|
|
36
36
|
|
|
37
37
|
#### Returns
|
|
38
38
|
|
|
39
|
-
`
|
|
39
|
+
`T`[] \| `undefined`
|
|
40
40
|
|
|
41
41
|
The array of values.
|
|
42
42
|
|
|
@@ -44,7 +44,7 @@ The array of values.
|
|
|
44
44
|
|
|
45
45
|
### arrayToString()
|
|
46
46
|
|
|
47
|
-
> `static` **arrayToString**\<`T`\>(`values?`): `
|
|
47
|
+
> `static` **arrayToString**\<`T`\>(`values?`): `string` \| `undefined`
|
|
48
48
|
|
|
49
49
|
Convert array of values to query string.
|
|
50
50
|
|
|
@@ -64,7 +64,7 @@ The values to combine string.
|
|
|
64
64
|
|
|
65
65
|
#### Returns
|
|
66
66
|
|
|
67
|
-
`
|
|
67
|
+
`string` \| `undefined`
|
|
68
68
|
|
|
69
69
|
The combined.
|
|
70
70
|
|
|
@@ -72,7 +72,7 @@ The combined.
|
|
|
72
72
|
|
|
73
73
|
### objectFromString()
|
|
74
74
|
|
|
75
|
-
> `static` **objectFromString**\<`T`\>(`value?`): `
|
|
75
|
+
> `static` **objectFromString**\<`T`\>(`value?`): `T` \| `undefined`
|
|
76
76
|
|
|
77
77
|
Convert object string to object.
|
|
78
78
|
|
|
@@ -92,7 +92,7 @@ The value query string.
|
|
|
92
92
|
|
|
93
93
|
#### Returns
|
|
94
94
|
|
|
95
|
-
`
|
|
95
|
+
`T` \| `undefined`
|
|
96
96
|
|
|
97
97
|
The object.
|
|
98
98
|
|
|
@@ -100,7 +100,7 @@ The object.
|
|
|
100
100
|
|
|
101
101
|
### objectToString()
|
|
102
102
|
|
|
103
|
-
> `static` **objectToString**\<`T`\>(`value?`): `
|
|
103
|
+
> `static` **objectToString**\<`T`\>(`value?`): `string` \| `undefined`
|
|
104
104
|
|
|
105
105
|
Convert object to query string.
|
|
106
106
|
|
|
@@ -120,6 +120,6 @@ The value to convert to a string.
|
|
|
120
120
|
|
|
121
121
|
#### Returns
|
|
122
122
|
|
|
123
|
-
`
|
|
123
|
+
`string` \| `undefined`
|
|
124
124
|
|
|
125
125
|
The converted object.
|
package/docs/reference/index.md
CHANGED
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
- [IServerFavIconResponse](interfaces/IServerFavIconResponse.md)
|
|
11
11
|
- [IServerHealthResponse](interfaces/IServerHealthResponse.md)
|
|
12
12
|
- [IServerInfoResponse](interfaces/IServerInfoResponse.md)
|
|
13
|
+
- [IServerLivezResponse](interfaces/IServerLivezResponse.md)
|
|
13
14
|
- [IServerRootResponse](interfaces/IServerRootResponse.md)
|
|
14
15
|
- [IServerSpecResponse](interfaces/IServerSpecResponse.md)
|
|
16
|
+
- [IAuthenticationGenerator](interfaces/IAuthenticationGenerator.md)
|
|
15
17
|
- [IBaseRestClientConfig](interfaces/IBaseRestClientConfig.md)
|
|
16
18
|
- [IBaseSocketClientConfig](interfaces/IBaseSocketClientConfig.md)
|
|
17
19
|
- [IHttpRequest](interfaces/IHttpRequest.md)
|
|
18
20
|
- [IHttpRequestContext](interfaces/IHttpRequestContext.md)
|
|
19
|
-
- [IHttpRequestIdentity](interfaces/IHttpRequestIdentity.md)
|
|
20
21
|
- [IHttpRequestPathParams](interfaces/IHttpRequestPathParams.md)
|
|
21
22
|
- [IHttpRequestQuery](interfaces/IHttpRequestQuery.md)
|
|
22
23
|
- [IHttpResponse](interfaces/IHttpResponse.md)
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
- [ISocketRouteProcessor](interfaces/ISocketRouteProcessor.md)
|
|
52
53
|
- [IWebServer](interfaces/IWebServer.md)
|
|
53
54
|
- [IWebServerOptions](interfaces/IWebServerOptions.md)
|
|
55
|
+
- [IHealthComponentInfo](interfaces/IHealthComponentInfo.md)
|
|
54
56
|
- [IHealthInfo](interfaces/IHealthInfo.md)
|
|
55
57
|
- [IInformationComponent](interfaces/IInformationComponent.md)
|
|
56
58
|
- [IServerInfo](interfaces/IServerInfo.md)
|
|
@@ -63,6 +65,7 @@
|
|
|
63
65
|
|
|
64
66
|
## Variables
|
|
65
67
|
|
|
68
|
+
- [AuthenticationGeneratorFactory](variables/AuthenticationGeneratorFactory.md)
|
|
66
69
|
- [MimeTypeProcessorFactory](variables/MimeTypeProcessorFactory.md)
|
|
67
70
|
- [RestRouteProcessorFactory](variables/RestRouteProcessorFactory.md)
|
|
68
71
|
- [SocketRouteProcessorFactory](variables/SocketRouteProcessorFactory.md)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Interface: IAuthenticationGenerator
|
|
2
|
+
|
|
3
|
+
Definition for the authentication generator component.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `IComponent`
|
|
8
|
+
|
|
9
|
+
## Methods
|
|
10
|
+
|
|
11
|
+
### addAuthentication()
|
|
12
|
+
|
|
13
|
+
> **addAuthentication**(`requestHeaders`, `authData?`): `Promise`\<`void`\>
|
|
14
|
+
|
|
15
|
+
Adds authentication information to the request headers.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### requestHeaders
|
|
20
|
+
|
|
21
|
+
`IHttpHeaders`
|
|
22
|
+
|
|
23
|
+
The request headers to add authentication information to.
|
|
24
|
+
|
|
25
|
+
##### authData?
|
|
26
|
+
|
|
27
|
+
`unknown`
|
|
28
|
+
|
|
29
|
+
Optional authentication data passed from the request.
|
|
30
|
+
|
|
31
|
+
#### Returns
|
|
32
|
+
|
|
33
|
+
`Promise`\<`void`\>
|
|
34
|
+
|
|
35
|
+
A promise that resolves when the authentication information has been added.
|
|
@@ -29,4 +29,32 @@ The path to use for routing.
|
|
|
29
29
|
|
|
30
30
|
> `optional` **skipAuth**: `boolean`
|
|
31
31
|
|
|
32
|
-
Skips the authentication for this route.
|
|
32
|
+
Skips the authentication requirement for this route.
|
|
33
|
+
|
|
34
|
+
***
|
|
35
|
+
|
|
36
|
+
### skipTenant?
|
|
37
|
+
|
|
38
|
+
> `optional` **skipTenant**: `boolean`
|
|
39
|
+
|
|
40
|
+
Skips the tenant requirement for this route.
|
|
41
|
+
|
|
42
|
+
***
|
|
43
|
+
|
|
44
|
+
### processorFeatures?
|
|
45
|
+
|
|
46
|
+
> `optional` **processorFeatures**: `string`[]
|
|
47
|
+
|
|
48
|
+
The features supported by additional processors to run for this route.
|
|
49
|
+
|
|
50
|
+
***
|
|
51
|
+
|
|
52
|
+
### processorData?
|
|
53
|
+
|
|
54
|
+
> `optional` **processorData**: `object`
|
|
55
|
+
|
|
56
|
+
The data for additional processors to run for this route.
|
|
57
|
+
|
|
58
|
+
#### Index Signature
|
|
59
|
+
|
|
60
|
+
\[`key`: `string`\]: `unknown`
|
|
@@ -23,9 +23,25 @@ The definition for a base processor for handling REST routes.
|
|
|
23
23
|
|
|
24
24
|
## Methods
|
|
25
25
|
|
|
26
|
+
### features()?
|
|
27
|
+
|
|
28
|
+
> `optional` **features**(): `string`[]
|
|
29
|
+
|
|
30
|
+
Features supported by this processor.
|
|
31
|
+
If a route has any of these features listed, this processor will be run for that route.
|
|
32
|
+
If this is not implemented, the processor will run for all routes.
|
|
33
|
+
|
|
34
|
+
#### Returns
|
|
35
|
+
|
|
36
|
+
`string`[]
|
|
37
|
+
|
|
38
|
+
The features supported by this processor.
|
|
39
|
+
|
|
40
|
+
***
|
|
41
|
+
|
|
26
42
|
### pre()?
|
|
27
43
|
|
|
28
|
-
> `optional` **pre**(`request`, `response`, `route`, `
|
|
44
|
+
> `optional` **pre**(`request`, `response`, `route`, `contextIds`, `processorState`, `loggingComponentType?`): `Promise`\<`void`\>
|
|
29
45
|
|
|
30
46
|
Pre process the REST request for the specified route.
|
|
31
47
|
|
|
@@ -47,13 +63,13 @@ The response data to send if any.
|
|
|
47
63
|
|
|
48
64
|
The route being requested, if a matching one was found.
|
|
49
65
|
|
|
50
|
-
`
|
|
66
|
+
`T` | `undefined`
|
|
51
67
|
|
|
52
|
-
#####
|
|
68
|
+
##### contextIds
|
|
53
69
|
|
|
54
|
-
|
|
70
|
+
`IContextIds`
|
|
55
71
|
|
|
56
|
-
The
|
|
72
|
+
The context IDs of the request.
|
|
57
73
|
|
|
58
74
|
##### processorState
|
|
59
75
|
|
|
@@ -75,7 +91,7 @@ Promise that resolves when the request is processed.
|
|
|
75
91
|
|
|
76
92
|
### post()?
|
|
77
93
|
|
|
78
|
-
> `optional` **post**(`request`, `response`, `route`, `
|
|
94
|
+
> `optional` **post**(`request`, `response`, `route`, `contextIds`, `processorState`, `loggingComponentType?`): `Promise`\<`void`\>
|
|
79
95
|
|
|
80
96
|
Post process the REST request for the specified route.
|
|
81
97
|
|
|
@@ -97,13 +113,13 @@ The response data to send if any.
|
|
|
97
113
|
|
|
98
114
|
The route being requested, if a matching one was found.
|
|
99
115
|
|
|
100
|
-
`
|
|
116
|
+
`T` | `undefined`
|
|
101
117
|
|
|
102
|
-
#####
|
|
118
|
+
##### contextIds
|
|
103
119
|
|
|
104
|
-
|
|
120
|
+
`IContextIds`
|
|
105
121
|
|
|
106
|
-
The
|
|
122
|
+
The context IDs of the request.
|
|
107
123
|
|
|
108
124
|
##### processorState
|
|
109
125
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Interface: IHealthComponentInfo
|
|
2
|
+
|
|
3
|
+
The health component information.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### name
|
|
8
|
+
|
|
9
|
+
> **name**: `string`
|
|
10
|
+
|
|
11
|
+
The name of the component.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### status
|
|
16
|
+
|
|
17
|
+
> **status**: [`HealthStatus`](../type-aliases/HealthStatus.md)
|
|
18
|
+
|
|
19
|
+
The status of the component.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### details?
|
|
24
|
+
|
|
25
|
+
> `optional` **details**: `string`
|
|
26
|
+
|
|
27
|
+
The details for the status.
|