@twin.org/api-models 0.0.3-next.3 → 0.0.3-next.30
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/README.md +1 -1
- package/dist/es/errors/forbiddenError.js +23 -0
- package/dist/es/errors/forbiddenError.js.map +1 -0
- package/dist/es/errors/tooManyRequestsError.js +25 -0
- package/dist/es/errors/tooManyRequestsError.js.map +1 -0
- package/dist/es/helpers/httpErrorHelper.js +34 -20
- package/dist/es/helpers/httpErrorHelper.js.map +1 -1
- package/dist/es/helpers/httpUrlHelper.js +105 -0
- package/dist/es/helpers/httpUrlHelper.js.map +1 -0
- package/dist/es/index.js +13 -4
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/api/IServerHealthResponse.js.map +1 -1
- package/dist/es/models/api/IServerLivezResponse.js +2 -0
- package/dist/es/models/api/IServerLivezResponse.js.map +1 -0
- package/dist/es/models/api/IServerReadyzResponse.js +2 -0
- package/dist/es/models/api/IServerReadyzResponse.js.map +1 -0
- package/dist/es/models/api/IServerRootResponse.js +0 -2
- package/dist/es/models/api/IServerRootResponse.js.map +1 -1
- package/dist/es/models/config/IBaseRestClientConfig.js.map +1 -1
- package/dist/es/models/httpContextIdKeys.js +21 -0
- package/dist/es/models/httpContextIdKeys.js.map +1 -0
- package/dist/es/models/protocol/IHttpRequestContext.js.map +1 -1
- package/dist/es/models/protocol/IHttpRequestPathParams.js.map +1 -1
- package/dist/es/models/protocol/IHttpRequestQuery.js.map +1 -1
- package/dist/es/models/protocol/IHttpServerRequest.js.map +1 -1
- package/dist/es/models/responses/errors/IConflictResponse.js.map +1 -1
- package/dist/es/models/responses/errors/INotImplementedResponse.js +2 -0
- package/dist/es/models/responses/errors/INotImplementedResponse.js.map +1 -0
- package/dist/es/models/responses/errors/ITooManyRequestsResponse.js +2 -0
- package/dist/es/models/responses/errors/ITooManyRequestsResponse.js.map +1 -0
- package/dist/es/models/routes/IBaseRoute.js.map +1 -1
- package/dist/es/models/server/IBaseRouteProcessor.js.map +1 -1
- package/dist/es/models/server/IRestRouteProcessor.js.map +1 -1
- package/dist/es/models/server/ISocketRouteProcessor.js.map +1 -1
- package/dist/es/models/server/IWebServer.js.map +1 -1
- package/dist/es/models/services/IHealthComponent.js +2 -0
- package/dist/es/models/services/IHealthComponent.js.map +1 -0
- package/dist/es/models/services/IHostingComponent.js +2 -0
- package/dist/es/models/services/IHostingComponent.js.map +1 -0
- package/dist/es/models/services/IInformationComponent.js.map +1 -1
- package/dist/es/models/services/ITenant.js +4 -0
- package/dist/es/models/services/ITenant.js.map +1 -0
- package/dist/es/models/services/ITenantAdminComponent.js +2 -0
- package/dist/es/models/services/ITenantAdminComponent.js.map +1 -0
- package/dist/es/models/services/IUrlTransformerComponent.js +2 -0
- package/dist/es/models/services/IUrlTransformerComponent.js.map +1 -0
- package/dist/types/errors/forbiddenError.d.ts +20 -0
- package/dist/types/errors/tooManyRequestsError.d.ts +22 -0
- package/dist/types/helpers/httpErrorHelper.d.ts +6 -0
- package/dist/types/helpers/httpUrlHelper.d.ts +55 -0
- package/dist/types/index.d.ts +13 -4
- package/dist/types/models/api/IServerHealthResponse.d.ts +6 -3
- package/dist/types/models/api/IServerLivezResponse.d.ts +16 -0
- package/dist/types/models/api/IServerReadyzResponse.d.ts +16 -0
- package/dist/types/models/api/IServerRootResponse.d.ts +7 -0
- package/dist/types/models/config/IBaseRestClientConfig.d.ts +16 -0
- package/dist/types/models/httpContextIdKeys.d.ts +21 -0
- package/dist/types/models/protocol/IHttpRequestContext.d.ts +4 -0
- 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 +4 -4
- package/dist/types/models/responses/errors/IConflictResponse.d.ts +1 -6
- package/dist/types/models/responses/errors/INotImplementedResponse.d.ts +15 -0
- package/dist/types/models/responses/errors/ITooManyRequestsResponse.d.ts +15 -0
- package/dist/types/models/routes/IBaseRoute.d.ts +9 -1
- package/dist/types/models/server/IBaseRouteProcessor.d.ts +14 -4
- package/dist/types/models/server/IRestRouteProcessor.d.ts +7 -2
- package/dist/types/models/server/IWebServer.d.ts +7 -1
- package/dist/types/models/services/IHealthComponent.d.ts +14 -0
- package/dist/types/models/services/IHostingComponent.d.ts +24 -0
- package/dist/types/models/services/IInformationComponent.d.ts +10 -17
- package/dist/types/models/services/ITenant.d.ts +33 -0
- package/dist/types/models/services/ITenantAdminComponent.d.ts +63 -0
- package/dist/types/models/services/IUrlTransformerComponent.d.ts +66 -0
- package/docs/changelog.md +278 -58
- package/docs/examples.md +200 -1
- package/docs/reference/classes/ForbiddenError.md +55 -0
- package/docs/reference/classes/HttpErrorHelper.md +14 -2
- package/docs/reference/classes/HttpParameterHelper.md +4 -4
- package/docs/reference/classes/HttpUrlHelper.md +197 -0
- package/docs/reference/classes/TooManyRequestsError.md +67 -0
- package/docs/reference/index.md +14 -5
- package/docs/reference/interfaces/IAcceptedResponse.md +2 -2
- package/docs/reference/interfaces/IBadRequestResponse.md +2 -2
- package/docs/reference/interfaces/IBaseRestClientConfig.md +57 -9
- package/docs/reference/interfaces/IBaseRoute.md +25 -9
- package/docs/reference/interfaces/IBaseRouteEntryPoint.md +4 -4
- package/docs/reference/interfaces/IBaseRouteProcessor.md +33 -13
- package/docs/reference/interfaces/IBaseSocketClientConfig.md +7 -7
- package/docs/reference/interfaces/IConflictResponse.md +3 -11
- package/docs/reference/interfaces/ICreatedResponse.md +2 -2
- package/docs/reference/interfaces/IForbiddenResponse.md +2 -2
- package/docs/reference/interfaces/IHealthComponent.md +21 -0
- package/docs/reference/interfaces/IHostingComponent.md +73 -0
- package/docs/reference/interfaces/IHttpRequest.md +8 -8
- package/docs/reference/interfaces/IHttpRequestContext.md +12 -4
- package/docs/reference/interfaces/IHttpRequestPathParams.md +1 -1
- package/docs/reference/interfaces/IHttpRequestQuery.md +1 -1
- package/docs/reference/interfaces/IHttpResponse.md +6 -6
- package/docs/reference/interfaces/IHttpServerRequest.md +14 -14
- package/docs/reference/interfaces/IInformationComponent.md +14 -56
- package/docs/reference/interfaces/IInternalServerErrorResponse.md +2 -2
- package/docs/reference/interfaces/IMimeTypeProcessor.md +2 -2
- package/docs/reference/interfaces/INoContentRequest.md +8 -8
- package/docs/reference/interfaces/INoContentResponse.md +1 -1
- package/docs/reference/interfaces/INotFoundResponse.md +3 -3
- package/docs/reference/interfaces/INotImplementedResponse.md +19 -0
- package/docs/reference/interfaces/IOkResponse.md +1 -1
- package/docs/reference/interfaces/IRestRoute.md +47 -23
- package/docs/reference/interfaces/IRestRouteExample.md +3 -3
- package/docs/reference/interfaces/IRestRouteProcessor.md +49 -19
- package/docs/reference/interfaces/IRestRouteRequestExample.md +4 -4
- package/docs/reference/interfaces/IRestRouteResponseAttachmentOptions.md +6 -6
- package/docs/reference/interfaces/IRestRouteResponseExample.md +4 -4
- package/docs/reference/interfaces/IRestRouteResponseOptions.md +2 -2
- package/docs/reference/interfaces/IServerFavIconResponse.md +7 -7
- package/docs/reference/interfaces/IServerHealthResponse.md +11 -3
- package/docs/reference/interfaces/IServerInfo.md +2 -2
- package/docs/reference/interfaces/IServerInfoResponse.md +1 -1
- package/docs/reference/interfaces/IServerLivezResponse.md +23 -0
- package/docs/reference/interfaces/IServerReadyzResponse.md +23 -0
- package/docs/reference/interfaces/IServerRootResponse.md +13 -1
- package/docs/reference/interfaces/IServerSpecResponse.md +4 -4
- package/docs/reference/interfaces/ISocketRequestContext.md +17 -5
- package/docs/reference/interfaces/ISocketRoute.md +38 -14
- package/docs/reference/interfaces/ISocketRouteProcessor.md +42 -22
- package/docs/reference/interfaces/ISocketServerRequest.md +17 -17
- package/docs/reference/interfaces/ITag.md +2 -2
- package/docs/reference/interfaces/ITenant.md +59 -0
- package/docs/reference/interfaces/ITenantAdminComponent.md +193 -0
- package/docs/reference/interfaces/ITooManyRequestsResponse.md +19 -0
- package/docs/reference/interfaces/IUnauthorizedResponse.md +2 -2
- package/docs/reference/interfaces/IUnprocessableEntityResponse.md +2 -2
- package/docs/reference/interfaces/IUrlTransformerComponent.md +229 -0
- package/docs/reference/interfaces/IWebServer.md +34 -4
- package/docs/reference/interfaces/IWebServerOptions.md +12 -12
- package/docs/reference/type-aliases/HttpContextIdKeys.md +5 -0
- package/docs/reference/variables/HttpContextIdKeys.md +25 -0
- package/package.json +2 -2
- package/dist/es/factories/authenticationGeneratorFactory.js +0 -9
- package/dist/es/factories/authenticationGeneratorFactory.js.map +0 -1
- package/dist/es/models/client/IAuthenticationGenerator.js +0 -2
- package/dist/es/models/client/IAuthenticationGenerator.js.map +0 -1
- package/dist/es/models/services/IHealthInfo.js +0 -2
- package/dist/es/models/services/IHealthInfo.js.map +0 -1
- package/dist/es/models/services/healthStatus.js +0 -21
- package/dist/es/models/services/healthStatus.js.map +0 -1
- package/dist/types/factories/authenticationGeneratorFactory.d.ts +0 -6
- package/dist/types/models/client/IAuthenticationGenerator.d.ts +0 -14
- package/dist/types/models/services/IHealthInfo.d.ts +0 -27
- package/dist/types/models/services/healthStatus.d.ts +0 -21
- package/docs/reference/interfaces/IAuthenticationGenerator.md +0 -35
- package/docs/reference/interfaces/IHealthInfo.md +0 -37
- package/docs/reference/type-aliases/HealthStatus.md +0 -5
- package/docs/reference/variables/AuthenticationGeneratorFactory.md +0 -5
- package/docs/reference/variables/HealthStatus.md +0 -25
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IHostingComponent.js","sourceRoot":"","sources":["../../../../src/models/services/IHostingComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\n\n/**\n * The information about the hosting of the API.\n */\nexport interface IHostingComponent extends IComponent {\n\t/**\n\t * Get the public origin for the hosting.\n\t * @param serverRequestUrl The url of the current server request if there is one.\n\t * @returns The public origin.\n\t */\n\tgetPublicOrigin(serverRequestUrl?: string): Promise<string>;\n\n\t/**\n\t * Get the public origin for the tenant if one exists.\n\t * @param tenantId The tenant identifier.\n\t * @returns The public origin for the tenant.\n\t */\n\tgetTenantOrigin(tenantId: string): Promise<string | undefined>;\n\n\t/**\n\t * Build a public url based on the public origin and the url provided.\n\t * @param url The url to build upon the public origin.\n\t * @returns The full url based on the public origin.\n\t */\n\tbuildPublicUrl(url: string): Promise<string>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IInformationComponent.js","sourceRoot":"","sources":["../../../../src/models/services/IInformationComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type {
|
|
1
|
+
{"version":3,"file":"IInformationComponent.js","sourceRoot":"","sources":["../../../../src/models/services/IInformationComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IServerInfo } from \"./IServerInfo.js\";\n\n/**\n * The information component for the server.\n */\nexport interface IInformationComponent extends IComponent {\n\t/**\n\t * Get the root information.\n\t * @returns The root information.\n\t */\n\troot(): Promise<string>;\n\n\t/**\n\t * Get the server information.\n\t * @returns The service information.\n\t */\n\tinfo(): Promise<IServerInfo>;\n\n\t/**\n\t * Get the favicon.\n\t * @returns The favicon.\n\t */\n\tfavicon(): Promise<Uint8Array | undefined>;\n\n\t/**\n\t * Get the OpenAPI spec.\n\t * @returns The OpenAPI spec.\n\t */\n\tspec(): Promise<unknown>;\n\n\t/**\n\t * Is the server live.\n\t * @returns The livez status of the server.\n\t */\n\tlivez(): Promise<{ status: \"alive\" | \"dead\" }>;\n\n\t/**\n\t * Is the server ready.\n\t * @returns The readyz status of the server.\n\t */\n\treadyz(): Promise<{ status: \"ready\" | \"not ready\" }>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITenant.js","sourceRoot":"","sources":["../../../../src/models/services/ITenant.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Model defining the tenant.\n */\nexport interface ITenant {\n\t/**\n\t * The unique identifier for the tenant.\n\t */\n\tid: string;\n\n\t/**\n\t * The api key for the tenant.\n\t */\n\tapiKey: string;\n\n\t/**\n\t * The label of the tenant.\n\t */\n\tlabel: string;\n\n\t/**\n\t * The date the tenant was created.\n\t */\n\tdateCreated: string;\n\n\t/**\n\t * The date the tenant was modified.\n\t */\n\tdateModified: string;\n\n\t/**\n\t * The public origin available to the public for accessing the API.\n\t */\n\tpublicOrigin?: string;\n\n\t/**\n\t * Indicates whether the tenant is the node tenant.\n\t */\n\tisNodeTenant: boolean;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITenantAdminComponent.js","sourceRoot":"","sources":["../../../../src/models/services/ITenantAdminComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2025 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { ITenant } from \"./ITenant.js\";\n\n/**\n * Configuration for the tenant admin component\n */\nexport interface ITenantAdminComponent extends IComponent {\n\t/**\n\t * Create a tenant.\n\t * @param tenant The tenant to store.\n\t * @returns The tenant id.\n\t */\n\tcreate(\n\t\ttenant: Omit<ITenant, \"id\" | \"dateCreated\" | \"dateModified\"> & { id?: string }\n\t): Promise<string>;\n\n\t/**\n\t * Update a tenant.\n\t * @param tenant The tenant to update.\n\t * @returns Nothing.\n\t */\n\tupdate(tenant: Partial<Omit<ITenant, \"dateCreated\" | \"dateModified\">>): Promise<void>;\n\n\t/**\n\t * Get a tenant by its id.\n\t * @param tenantId The id of the tenant.\n\t * @returns The tenant.\n\t * @throws Error if the tenant is not found.\n\t */\n\tget(tenantId: string): Promise<ITenant>;\n\n\t/**\n\t * Get a tenant by its api key.\n\t * @param apiKey The api key of the tenant.\n\t * @returns The tenant.\n\t * @throws Error if the tenant is not found.\n\t */\n\tgetByApiKey(apiKey: string): Promise<ITenant>;\n\n\t/**\n\t * Get a tenant by its public origin.\n\t * @param publicOrigin The origin of the tenant.\n\t * @returns The tenant.\n\t * @throws Error if the tenant is not found.\n\t */\n\tgetByPublicOrigin(publicOrigin: string): Promise<ITenant>;\n\n\t/**\n\t * Remove a tenant by its id.\n\t * @param tenantId The id of the tenant.\n\t * @returns Nothing.\n\t * @throws Error if the tenant is not found.\n\t */\n\tremove(tenantId: string): Promise<void>;\n\n\t/**\n\t * Query tenants with pagination.\n\t * @param options Optional query options.\n\t * @param options.isNodeTenant Whether to filter for node admin tenants.\n\t * @param cursor The cursor to start from.\n\t * @param limit The maximum number of tenants to return.\n\t * @returns The tenants and the next cursor if more tenants are available.\n\t */\n\tquery(\n\t\toptions?: { isNodeTenant?: boolean },\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{ tenants: ITenant[]; cursor?: string }>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IUrlTransformerComponent.js","sourceRoot":"","sources":["../../../../src/models/services/IUrlTransformerComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IHttpRequestQuery } from \"../protocol/IHttpRequestQuery.js\";\n\n/**\n * The URL transformer component for encrypting and decrypting URL parameters.\n */\nexport interface IUrlTransformerComponent extends IComponent {\n\t/**\n\t * Encrypt a named token value and append it as a query parameter to the given URL.\n\t * The URL param name is resolved from the configured token name dictionary using the id.\n\t * @param url The URL to append the encrypted token to.\n\t * @param id The logical token identifier (e.g. \"tenant\").\n\t * @param value The value to encrypt and add.\n\t * @returns The URL with the encrypted token added as a query parameter.\n\t */\n\taddEncryptedQueryParamToUrl(url: string, id: string, value: string): Promise<string>;\n\n\t/**\n\t * Get a named token value from the query parameters.\n\t * The URL param name is resolved from the configured token name dictionary using the id.\n\t * @param queryParams The HTTP request query containing the parameters.\n\t * @param id The logical token identifier (e.g. \"tenant\").\n\t * @returns The decrypted token value if it exists.\n\t */\n\tgetEncryptedQueryParam(\n\t\tqueryParams: IHttpRequestQuery | undefined,\n\t\tid: string\n\t): Promise<string | undefined>;\n\n\t/**\n\t * Add encrypted key/value pairs to a URL's query string.\n\t * Existing query parameters on the URL are preserved; the provided params are\n\t * merged in and then encrypted before being written back to the URL.\n\t * @param url The base URL to add parameters to.\n\t * @param params The key/value pairs to encrypt and append.\n\t * @returns The URL with the encrypted parameters added.\n\t */\n\taddEncryptedParamsToUrl(url: string, params: IHttpRequestQuery): Promise<string>;\n\n\t/**\n\t * Decrypt specified keys from a query parameter object and return their plain-text values.\n\t * @param queryParams The HTTP request query containing the encrypted parameters.\n\t * @param keys The keys to decrypt.\n\t * @returns A map of the decrypted key/value pairs that were present.\n\t */\n\tgetDecryptedParamsFromQueryParams(\n\t\tqueryParams: IHttpRequestQuery | undefined,\n\t\tkeys: string[]\n\t): Promise<IHttpRequestQuery>;\n\n\t/**\n\t * Encrypt query parameters using the URL transformer's encryption mechanism.\n\t * @param httpRequestQuery The HTTP request query containing the parameters to encrypt.\n\t * @param keys The keys of the parameters to encrypt.\n\t * @returns A promise that resolves when the query parameters have been encrypted.\n\t */\n\tencryptQueryParams(\n\t\thttpRequestQuery: IHttpRequestQuery | undefined,\n\t\tkeys: string[]\n\t): Promise<void>;\n\n\t/**\n\t * Decrypt query parameters using the URL transformer's encryption mechanism.\n\t * @param httpRequestQuery The HTTP request query containing the encrypted values.\n\t * @param keys The keys of the parameters to decrypt.\n\t * @returns A promise that resolves when the query parameters have been decrypted.\n\t */\n\tdecryptQueryParams(\n\t\thttpRequestQuery: IHttpRequestQuery | undefined,\n\t\tkeys: string[]\n\t): Promise<void>;\n\n\t/**\n\t * Encrypt a parameter value.\n\t * @param paramValue The value of the parameter to encrypt.\n\t * @returns A promise that resolves to the encrypted value of the parameter.\n\t */\n\tencryptParam(paramValue: string): Promise<string>;\n\n\t/**\n\t * Decrypt a parameter value.\n\t * @param encryptedValue The encrypted value of the parameter.\n\t * @returns A promise that resolves to the decrypted value of the parameter.\n\t */\n\tdecryptParam(encryptedValue: string): Promise<string>;\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseError } from "@twin.org/core";
|
|
2
|
+
/**
|
|
3
|
+
* Class to handle errors which are triggered by forbidden actions.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ForbiddenError extends BaseError {
|
|
6
|
+
/**
|
|
7
|
+
* Runtime name for the class.
|
|
8
|
+
*/
|
|
9
|
+
static readonly CLASS_NAME: string;
|
|
10
|
+
/**
|
|
11
|
+
* Create a new instance of ForbiddenError.
|
|
12
|
+
* @param source The source of the error.
|
|
13
|
+
* @param message The message as a code.
|
|
14
|
+
* @param properties Any additional information for the error.
|
|
15
|
+
* @param cause The cause of the error if we have wrapped another error.
|
|
16
|
+
*/
|
|
17
|
+
constructor(source: string, message: string, properties?: {
|
|
18
|
+
[id: string]: unknown;
|
|
19
|
+
}, cause?: unknown);
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseError } from "@twin.org/core";
|
|
2
|
+
/**
|
|
3
|
+
* Class to handle errors which are triggered by too many requests.
|
|
4
|
+
*/
|
|
5
|
+
export declare class TooManyRequestsError extends BaseError {
|
|
6
|
+
/**
|
|
7
|
+
* Runtime name for the class.
|
|
8
|
+
*/
|
|
9
|
+
static readonly CLASS_NAME: string;
|
|
10
|
+
/**
|
|
11
|
+
* Create a new instance of TooManyRequestsError.
|
|
12
|
+
* @param source The source of the error.
|
|
13
|
+
* @param message The message as a code.
|
|
14
|
+
* @param requestCount The current request count.
|
|
15
|
+
* @param nextRequestTime The time when the next request can be made, as date ISO string.
|
|
16
|
+
* @param properties Any additional information for the error.
|
|
17
|
+
* @param cause The cause of the error if we have wrapped another error.
|
|
18
|
+
*/
|
|
19
|
+
constructor(source: string, message: string, requestCount: number, nextRequestTime: string, properties?: {
|
|
20
|
+
[id: string]: unknown;
|
|
21
|
+
}, cause?: unknown);
|
|
22
|
+
}
|
|
@@ -5,6 +5,12 @@ import type { IHttpResponse } from "../models/protocol/IHttpResponse.js";
|
|
|
5
5
|
* Class to help with processing http errors.
|
|
6
6
|
*/
|
|
7
7
|
export declare class HttpErrorHelper {
|
|
8
|
+
/**
|
|
9
|
+
* Mapping of error types to status codes.
|
|
10
|
+
*/
|
|
11
|
+
static readonly ERROR_TYPE_MAP: {
|
|
12
|
+
[id: string]: HttpStatusCode;
|
|
13
|
+
};
|
|
8
14
|
/**
|
|
9
15
|
* Process the errors from the routes.
|
|
10
16
|
* @param err The error to process.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Class to help with handling http URLs.
|
|
3
|
+
*/
|
|
4
|
+
export declare class HttpUrlHelper {
|
|
5
|
+
/**
|
|
6
|
+
* Extract the origin from the url which includes protocol,host,port.
|
|
7
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/URL/origin
|
|
8
|
+
* @param url The url to extract the origin from.
|
|
9
|
+
* @returns The extracted origin.
|
|
10
|
+
*/
|
|
11
|
+
static extractOrigin(url: string): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Extract the path from the url.
|
|
14
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname
|
|
15
|
+
* @param url The url to extract the path from.
|
|
16
|
+
* @returns The extracted path.
|
|
17
|
+
*/
|
|
18
|
+
static extractPath(url: string): string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Extract the search from the url.
|
|
21
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/URL/search
|
|
22
|
+
* @param url The url to extract the search from.
|
|
23
|
+
* @returns The extracted search.
|
|
24
|
+
*/
|
|
25
|
+
static extractSearch(url: string): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Extract the path and search from the url.
|
|
28
|
+
* @param url The url to extract the path and search from.
|
|
29
|
+
* @returns The extracted path and search.
|
|
30
|
+
*/
|
|
31
|
+
static extractPathAndSearch(url: string): string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Combine the urls parts.
|
|
34
|
+
* @param origin The origin to combine.
|
|
35
|
+
* @param pathAndSearch The path and search to combine.
|
|
36
|
+
* @returns The combined parts.
|
|
37
|
+
*/
|
|
38
|
+
static combineParts(origin: string, pathAndSearch: string): string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Encode a single URL path segment per RFC 3986 §3.3.
|
|
41
|
+
* Unlike encodeURIComponent, sub-delimiters ($ & + , ; =) and the colon and
|
|
42
|
+
* at-sign characters that are valid unencoded in path segments are preserved.
|
|
43
|
+
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-3.3
|
|
44
|
+
* @param segment The raw path segment value to encode.
|
|
45
|
+
* @returns The percent-encoded path segment.
|
|
46
|
+
*/
|
|
47
|
+
static encodeUriPathSegment(segment: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Replace the origin in the url.
|
|
50
|
+
* @param url The url to replace the origin in.
|
|
51
|
+
* @param newOrigin The new origin to use.
|
|
52
|
+
* @returns The url with the replaced origin.
|
|
53
|
+
*/
|
|
54
|
+
static replaceOrigin(url: string, newOrigin?: string): string;
|
|
55
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./errors/forbiddenError.js";
|
|
2
|
+
export * from "./errors/tooManyRequestsError.js";
|
|
2
3
|
export * from "./factories/mimeTypeProcessorFactory.js";
|
|
3
4
|
export * from "./factories/restRouteProcessorFactory.js";
|
|
4
5
|
export * from "./factories/socketRouteProcessorFactory.js";
|
|
5
6
|
export * from "./helpers/httpErrorHelper.js";
|
|
6
7
|
export * from "./helpers/httpParameterHelper.js";
|
|
8
|
+
export * from "./helpers/httpUrlHelper.js";
|
|
7
9
|
export * from "./models/api/IServerFavIconResponse.js";
|
|
8
10
|
export * from "./models/api/IServerHealthResponse.js";
|
|
9
11
|
export * from "./models/api/IServerInfoResponse.js";
|
|
12
|
+
export * from "./models/api/IServerLivezResponse.js";
|
|
13
|
+
export * from "./models/api/IServerReadyzResponse.js";
|
|
10
14
|
export * from "./models/api/IServerRootResponse.js";
|
|
11
15
|
export * from "./models/api/IServerSpecResponse.js";
|
|
12
|
-
export * from "./models/client/IAuthenticationGenerator.js";
|
|
13
16
|
export * from "./models/config/IBaseRestClientConfig.js";
|
|
14
17
|
export * from "./models/config/IBaseSocketClientConfig.js";
|
|
18
|
+
export * from "./models/httpContextIdKeys.js";
|
|
15
19
|
export * from "./models/protocol/IHttpRequest.js";
|
|
16
20
|
export * from "./models/protocol/IHttpRequestContext.js";
|
|
17
21
|
export * from "./models/protocol/IHttpRequestPathParams.js";
|
|
@@ -26,6 +30,8 @@ export * from "./models/responses/errors/IConflictResponse.js";
|
|
|
26
30
|
export * from "./models/responses/errors/IForbiddenResponse.js";
|
|
27
31
|
export * from "./models/responses/errors/IInternalServerErrorResponse.js";
|
|
28
32
|
export * from "./models/responses/errors/INotFoundResponse.js";
|
|
33
|
+
export * from "./models/responses/errors/INotImplementedResponse.js";
|
|
34
|
+
export * from "./models/responses/errors/ITooManyRequestsResponse.js";
|
|
29
35
|
export * from "./models/responses/errors/IUnauthorizedResponse.js";
|
|
30
36
|
export * from "./models/responses/errors/IUnprocessableEntityResponse.js";
|
|
31
37
|
export * from "./models/responses/success/IAcceptedResponse.js";
|
|
@@ -50,7 +56,10 @@ export * from "./models/server/IRestRouteProcessor.js";
|
|
|
50
56
|
export * from "./models/server/ISocketRouteProcessor.js";
|
|
51
57
|
export * from "./models/server/IWebServer.js";
|
|
52
58
|
export * from "./models/server/IWebServerOptions.js";
|
|
53
|
-
export * from "./models/services/
|
|
54
|
-
export * from "./models/services/
|
|
59
|
+
export * from "./models/services/IHealthComponent.js";
|
|
60
|
+
export * from "./models/services/IHostingComponent.js";
|
|
55
61
|
export * from "./models/services/IInformationComponent.js";
|
|
62
|
+
export * from "./models/services/IUrlTransformerComponent.js";
|
|
56
63
|
export * from "./models/services/IServerInfo.js";
|
|
64
|
+
export * from "./models/services/ITenant.js";
|
|
65
|
+
export * from "./models/services/ITenantAdminComponent.js";
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HealthStatus, IHealth } from "@twin.org/core";
|
|
2
2
|
/**
|
|
3
3
|
* The health of the server.
|
|
4
4
|
*/
|
|
5
5
|
export interface IServerHealthResponse {
|
|
6
6
|
/**
|
|
7
|
-
* The
|
|
7
|
+
* The health for the server.
|
|
8
8
|
*/
|
|
9
|
-
body:
|
|
9
|
+
body: {
|
|
10
|
+
status: HealthStatus;
|
|
11
|
+
components: IHealth[];
|
|
12
|
+
};
|
|
10
13
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
2
|
+
/**
|
|
3
|
+
* The livez of the server.
|
|
4
|
+
*/
|
|
5
|
+
export interface IServerLivezResponse {
|
|
6
|
+
/**
|
|
7
|
+
* The headers for the response.
|
|
8
|
+
*/
|
|
9
|
+
headers: {
|
|
10
|
+
[HeaderTypes.ContentType]: typeof MimeTypes.PlainText;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The livez information for the server.
|
|
14
|
+
*/
|
|
15
|
+
body: "alive" | "dead";
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
2
|
+
/**
|
|
3
|
+
* The readyz of the server.
|
|
4
|
+
*/
|
|
5
|
+
export interface IServerReadyzResponse {
|
|
6
|
+
/**
|
|
7
|
+
* The headers for the response.
|
|
8
|
+
*/
|
|
9
|
+
headers: {
|
|
10
|
+
[HeaderTypes.ContentType]: typeof MimeTypes.PlainText;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The readyz information for the server.
|
|
14
|
+
*/
|
|
15
|
+
body: "ready" | "not ready";
|
|
16
|
+
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
1
2
|
/**
|
|
2
3
|
* The root text for the server.
|
|
3
4
|
*/
|
|
4
5
|
export interface IServerRootResponse {
|
|
6
|
+
/**
|
|
7
|
+
* The headers for the response.
|
|
8
|
+
*/
|
|
9
|
+
headers: {
|
|
10
|
+
[HeaderTypes.ContentType]: typeof MimeTypes.PlainText;
|
|
11
|
+
};
|
|
5
12
|
/**
|
|
6
13
|
* The root text for the server.
|
|
7
14
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IError } from "@twin.org/core";
|
|
1
2
|
import type { IHttpHeaders } from "@twin.org/web";
|
|
2
3
|
/**
|
|
3
4
|
* Definition for the configuration of a rest client.
|
|
@@ -23,4 +24,19 @@ export interface IBaseRestClientConfig {
|
|
|
23
24
|
* Include credentials in the request, defaults to true.
|
|
24
25
|
*/
|
|
25
26
|
includeCredentials?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Hook to provide headers asynchronously.
|
|
29
|
+
* @returns A promise that resolves to the headers.
|
|
30
|
+
*/
|
|
31
|
+
customHeaders?: () => Promise<IHttpHeaders>;
|
|
32
|
+
/**
|
|
33
|
+
* Hook to provide an authorization header value asynchronously.
|
|
34
|
+
* @returns A promise that resolves to the authorization header value.
|
|
35
|
+
*/
|
|
36
|
+
customAuthHeader?: () => Promise<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Hook to handle authorization failures asynchronously.
|
|
39
|
+
* @returns A promise that resolves when the auth failure handling is complete.
|
|
40
|
+
*/
|
|
41
|
+
onAuthFailure?: (err: IError) => Promise<void>;
|
|
26
42
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP definition of some context keys.
|
|
3
|
+
*/
|
|
4
|
+
export declare const HttpContextIdKeys: {
|
|
5
|
+
/**
|
|
6
|
+
* IP address of the client.
|
|
7
|
+
*/
|
|
8
|
+
readonly IpAddress: "ipAddress";
|
|
9
|
+
/**
|
|
10
|
+
* User agent of the client.
|
|
11
|
+
*/
|
|
12
|
+
readonly UserAgent: "userAgent";
|
|
13
|
+
/**
|
|
14
|
+
* Correlation ID of the request.
|
|
15
|
+
*/
|
|
16
|
+
readonly CorrelationId: "correlationId";
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* HTTP definition of some context keys.
|
|
20
|
+
*/
|
|
21
|
+
export type HttpContextIdKeys = (typeof HttpContextIdKeys)[keyof typeof HttpContextIdKeys];
|
|
@@ -5,11 +5,11 @@ import type { IHttpRequest } from "./IHttpRequest.js";
|
|
|
5
5
|
*/
|
|
6
6
|
export interface IHttpServerRequest<T = any> extends IHttpRequest<T> {
|
|
7
7
|
/**
|
|
8
|
-
* The request
|
|
8
|
+
* The request url.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
url: string;
|
|
11
11
|
/**
|
|
12
|
-
* The request
|
|
12
|
+
* The request method.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
method?: HttpMethod;
|
|
15
15
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IError } from "@twin.org/core";
|
|
2
|
+
import type { HttpStatusCode } from "@twin.org/web";
|
|
3
|
+
/**
|
|
4
|
+
* The operation that you tried to perform is not implemented, see the content for more details.
|
|
5
|
+
*/
|
|
6
|
+
export interface INotImplementedResponse {
|
|
7
|
+
/**
|
|
8
|
+
* Response status code.
|
|
9
|
+
*/
|
|
10
|
+
statusCode: typeof HttpStatusCode.notImplemented;
|
|
11
|
+
/**
|
|
12
|
+
* The body which contains the error.
|
|
13
|
+
*/
|
|
14
|
+
body: IError;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IError } from "@twin.org/core";
|
|
2
|
+
import type { HttpStatusCode } from "@twin.org/web";
|
|
3
|
+
/**
|
|
4
|
+
* The request resulted in too many requests, see the content for more details.
|
|
5
|
+
*/
|
|
6
|
+
export interface ITooManyRequestsResponse {
|
|
7
|
+
/**
|
|
8
|
+
* Response status code.
|
|
9
|
+
*/
|
|
10
|
+
statusCode: typeof HttpStatusCode.tooManyRequests;
|
|
11
|
+
/**
|
|
12
|
+
* The body which contains the error.
|
|
13
|
+
*/
|
|
14
|
+
body: IError;
|
|
15
|
+
}
|
|
@@ -11,9 +11,17 @@ export interface IBaseRoute {
|
|
|
11
11
|
*/
|
|
12
12
|
path: string;
|
|
13
13
|
/**
|
|
14
|
-
* Skips the authentication for this route.
|
|
14
|
+
* Skips the authentication requirement for this route.
|
|
15
15
|
*/
|
|
16
16
|
skipAuth?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Skips the tenant requirement for this route.
|
|
19
|
+
*/
|
|
20
|
+
skipTenant?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The user must have one of the specified scopes to access the route.
|
|
23
|
+
*/
|
|
24
|
+
requiredScope?: string[];
|
|
17
25
|
/**
|
|
18
26
|
* The features supported by additional processors to run for this route.
|
|
19
27
|
*/
|
|
@@ -21,12 +21,17 @@ export interface IBaseRouteProcessor<T = IBaseRoute, R = IHttpServerRequest> ext
|
|
|
21
21
|
* @param route The route being requested, if a matching one was found.
|
|
22
22
|
* @param contextIds The context IDs of the request.
|
|
23
23
|
* @param processorState The state handed through the processors.
|
|
24
|
-
* @param
|
|
24
|
+
* @param componentTypes The component types for the request.
|
|
25
|
+
* @param componentTypes.loggingComponentType The logging component type.
|
|
26
|
+
* @param componentTypes.hostingComponentType The hosting component type.
|
|
25
27
|
* @returns Promise that resolves when the request is processed.
|
|
26
28
|
*/
|
|
27
29
|
pre?(request: R, response: IHttpResponse, route: T | undefined, contextIds: IContextIds, processorState: {
|
|
28
30
|
[id: string]: unknown;
|
|
29
|
-
},
|
|
31
|
+
}, componentTypes?: {
|
|
32
|
+
loggingComponentType?: string;
|
|
33
|
+
hostingComponentType?: string;
|
|
34
|
+
}): Promise<void>;
|
|
30
35
|
/**
|
|
31
36
|
* Post process the REST request for the specified route.
|
|
32
37
|
* @param request The request to handle.
|
|
@@ -34,10 +39,15 @@ export interface IBaseRouteProcessor<T = IBaseRoute, R = IHttpServerRequest> ext
|
|
|
34
39
|
* @param route The route being requested, if a matching one was found.
|
|
35
40
|
* @param contextIds The context IDs of the request.
|
|
36
41
|
* @param processorState The state handed through the processors.
|
|
37
|
-
* @param
|
|
42
|
+
* @param componentTypes The component types for the request.
|
|
43
|
+
* @param componentTypes.loggingComponentType The logging component type.
|
|
44
|
+
* @param componentTypes.hostingComponentType The hosting component type.
|
|
38
45
|
* @returns Promise that resolves when the request is processed.
|
|
39
46
|
*/
|
|
40
47
|
post?(request: R, response: IHttpResponse, route: T | undefined, contextIds: IContextIds, processorState: {
|
|
41
48
|
[id: string]: unknown;
|
|
42
|
-
},
|
|
49
|
+
}, componentTypes?: {
|
|
50
|
+
loggingComponentType?: string;
|
|
51
|
+
hostingComponentType?: string;
|
|
52
|
+
}): Promise<void>;
|
|
43
53
|
}
|
|
@@ -12,10 +12,15 @@ export interface IRestRouteProcessor extends IBaseRouteProcessor<IRestRoute> {
|
|
|
12
12
|
* @param response The response data to send if any.
|
|
13
13
|
* @param route The route being requested, if a matching one was found.
|
|
14
14
|
* @param processorState The state handed through the processors.
|
|
15
|
-
* @param
|
|
15
|
+
* @param componentTypes The component types for the request.
|
|
16
|
+
* @param componentTypes.loggingComponentType The logging component type.
|
|
17
|
+
* @param componentTypes.hostingComponentType The hosting component type.
|
|
16
18
|
* @returns Promise that resolves when the request is processed.
|
|
17
19
|
*/
|
|
18
20
|
process?(request: IHttpServerRequest, response: IHttpResponse, route: IRestRoute | undefined, processorState: {
|
|
19
21
|
[id: string]: unknown;
|
|
20
|
-
},
|
|
22
|
+
}, componentTypes?: {
|
|
23
|
+
loggingComponentType?: string;
|
|
24
|
+
hostingComponentType?: string;
|
|
25
|
+
}): Promise<void>;
|
|
21
26
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IComponent, IHealth } from "@twin.org/core";
|
|
1
2
|
import type { IRestRouteProcessor } from "./IRestRouteProcessor.js";
|
|
2
3
|
import type { ISocketRouteProcessor } from "./ISocketRouteProcessor.js";
|
|
3
4
|
import type { IWebServerOptions } from "./IWebServerOptions.js";
|
|
@@ -6,7 +7,7 @@ import type { ISocketRoute } from "../routes/ISocketRoute.js";
|
|
|
6
7
|
/**
|
|
7
8
|
* Interface describing a web server.
|
|
8
9
|
*/
|
|
9
|
-
export interface IWebServer<T> {
|
|
10
|
+
export interface IWebServer<T> extends IComponent {
|
|
10
11
|
/**
|
|
11
12
|
* Get the web server instance.
|
|
12
13
|
* @returns The web server instance.
|
|
@@ -32,4 +33,9 @@ export interface IWebServer<T> {
|
|
|
32
33
|
* @returns Nothing.
|
|
33
34
|
*/
|
|
34
35
|
stop(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the health status of the component.
|
|
38
|
+
* @returns The health status of the component, can return multiple entries for elements within the component.
|
|
39
|
+
*/
|
|
40
|
+
health(): Promise<IHealth[]>;
|
|
35
41
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HealthStatus, IComponent, IHealth } from "@twin.org/core";
|
|
2
|
+
/**
|
|
3
|
+
* The health component for the server.
|
|
4
|
+
*/
|
|
5
|
+
export interface IHealthComponent extends IComponent {
|
|
6
|
+
/**
|
|
7
|
+
* Get the server health.
|
|
8
|
+
* @returns The service health.
|
|
9
|
+
*/
|
|
10
|
+
healthStatus(): Promise<{
|
|
11
|
+
status: HealthStatus;
|
|
12
|
+
components: IHealth[];
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IComponent } from "@twin.org/core";
|
|
2
|
+
/**
|
|
3
|
+
* The information about the hosting of the API.
|
|
4
|
+
*/
|
|
5
|
+
export interface IHostingComponent extends IComponent {
|
|
6
|
+
/**
|
|
7
|
+
* Get the public origin for the hosting.
|
|
8
|
+
* @param serverRequestUrl The url of the current server request if there is one.
|
|
9
|
+
* @returns The public origin.
|
|
10
|
+
*/
|
|
11
|
+
getPublicOrigin(serverRequestUrl?: string): Promise<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Get the public origin for the tenant if one exists.
|
|
14
|
+
* @param tenantId The tenant identifier.
|
|
15
|
+
* @returns The public origin for the tenant.
|
|
16
|
+
*/
|
|
17
|
+
getTenantOrigin(tenantId: string): Promise<string | undefined>;
|
|
18
|
+
/**
|
|
19
|
+
* Build a public url based on the public origin and the url provided.
|
|
20
|
+
* @param url The url to build upon the public origin.
|
|
21
|
+
* @returns The full url based on the public origin.
|
|
22
|
+
*/
|
|
23
|
+
buildPublicUrl(url: string): Promise<string>;
|
|
24
|
+
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { IComponent } from "@twin.org/core";
|
|
2
|
-
import type { HealthStatus } from "./healthStatus.js";
|
|
3
|
-
import type { IHealthInfo } from "./IHealthInfo.js";
|
|
4
2
|
import type { IServerInfo } from "./IServerInfo.js";
|
|
5
3
|
/**
|
|
6
4
|
* The information component for the server.
|
|
@@ -27,22 +25,17 @@ export interface IInformationComponent extends IComponent {
|
|
|
27
25
|
*/
|
|
28
26
|
spec(): Promise<unknown>;
|
|
29
27
|
/**
|
|
30
|
-
*
|
|
31
|
-
* @returns The
|
|
28
|
+
* Is the server live.
|
|
29
|
+
* @returns The livez status of the server.
|
|
32
30
|
*/
|
|
33
|
-
|
|
31
|
+
livez(): Promise<{
|
|
32
|
+
status: "alive" | "dead";
|
|
33
|
+
}>;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @
|
|
37
|
-
* @param status The status of the component.
|
|
38
|
-
* @param details The details for the status.
|
|
39
|
-
* @returns Nothing.
|
|
35
|
+
* Is the server ready.
|
|
36
|
+
* @returns The readyz status of the server.
|
|
40
37
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* @param name The component name.
|
|
45
|
-
* @returns Nothing.
|
|
46
|
-
*/
|
|
47
|
-
removeComponentHealth(name: string): Promise<void>;
|
|
38
|
+
readyz(): Promise<{
|
|
39
|
+
status: "ready" | "not ready";
|
|
40
|
+
}>;
|
|
48
41
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model defining the tenant.
|
|
3
|
+
*/
|
|
4
|
+
export interface ITenant {
|
|
5
|
+
/**
|
|
6
|
+
* The unique identifier for the tenant.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* The api key for the tenant.
|
|
11
|
+
*/
|
|
12
|
+
apiKey: string;
|
|
13
|
+
/**
|
|
14
|
+
* The label of the tenant.
|
|
15
|
+
*/
|
|
16
|
+
label: string;
|
|
17
|
+
/**
|
|
18
|
+
* The date the tenant was created.
|
|
19
|
+
*/
|
|
20
|
+
dateCreated: string;
|
|
21
|
+
/**
|
|
22
|
+
* The date the tenant was modified.
|
|
23
|
+
*/
|
|
24
|
+
dateModified: string;
|
|
25
|
+
/**
|
|
26
|
+
* The public origin available to the public for accessing the API.
|
|
27
|
+
*/
|
|
28
|
+
publicOrigin?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Indicates whether the tenant is the node tenant.
|
|
31
|
+
*/
|
|
32
|
+
isNodeTenant: boolean;
|
|
33
|
+
}
|