@twin.org/engine-server-types 0.0.3-next.2 → 0.0.3-next.21
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/components/authentication.js +22 -19
- package/dist/es/components/authentication.js.map +1 -1
- package/dist/es/components/authenticationAdmin.js +17 -15
- package/dist/es/components/authenticationAdmin.js.map +1 -1
- package/dist/es/components/hosting.js +29 -0
- package/dist/es/components/hosting.js.map +1 -0
- package/dist/es/components/information.js +12 -9
- package/dist/es/components/information.js.map +1 -1
- package/dist/es/components/mimeTypeProcessor.js +7 -7
- package/dist/es/components/mimeTypeProcessor.js.map +1 -1
- package/dist/es/components/restRouteProcessor.js +29 -44
- package/dist/es/components/restRouteProcessor.js.map +1 -1
- package/dist/es/components/socketRouteProcessor.js +26 -41
- package/dist/es/components/socketRouteProcessor.js.map +1 -1
- package/dist/es/index.js +3 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IEngineServerConfig.js.map +1 -1
- package/dist/es/models/config/hostingComponentConfig.js +2 -0
- package/dist/es/models/config/hostingComponentConfig.js.map +1 -0
- package/dist/es/models/config/restRouteProcessorConfig.js.map +1 -1
- package/dist/es/models/config/socketRouteProcessorConfig.js.map +1 -1
- package/dist/es/models/types/hostingComponentType.js +13 -0
- package/dist/es/models/types/hostingComponentType.js.map +1 -0
- package/dist/types/components/authentication.d.ts +3 -7
- package/dist/types/components/authenticationAdmin.d.ts +3 -7
- package/dist/types/components/hosting.d.ts +12 -0
- package/dist/types/components/information.d.ts +3 -7
- package/dist/types/components/mimeTypeProcessor.d.ts +2 -7
- package/dist/types/components/restRouteProcessor.d.ts +2 -7
- package/dist/types/components/socketRouteProcessor.d.ts +2 -7
- package/dist/types/index.d.ts +3 -0
- package/dist/types/models/IEngineServerConfig.d.ts +11 -6
- package/dist/types/models/config/hostingComponentConfig.d.ts +9 -0
- package/dist/types/models/config/restRouteProcessorConfig.d.ts +0 -4
- package/dist/types/models/config/socketRouteProcessorConfig.d.ts +0 -4
- package/dist/types/models/types/hostingComponentType.d.ts +13 -0
- package/docs/changelog.md +312 -0
- package/docs/reference/functions/initialiseAuthenticationAdminComponent.md +2 -2
- package/docs/reference/functions/initialiseAuthenticationComponent.md +2 -2
- package/docs/reference/functions/initialiseHostingComponent.md +31 -0
- package/docs/reference/functions/initialiseInformationComponent.md +2 -2
- package/docs/reference/functions/initialiseMimeTypeProcessorComponent.md +2 -2
- package/docs/reference/functions/initialiseRestRouteProcessorComponent.md +2 -2
- package/docs/reference/functions/initialiseSocketRouteProcessorComponent.md +2 -2
- package/docs/reference/index.md +4 -0
- package/docs/reference/interfaces/IEngineServerConfig.md +12 -6
- package/docs/reference/type-aliases/HostingComponentConfig.md +17 -0
- package/docs/reference/type-aliases/HostingComponentType.md +5 -0
- package/docs/reference/type-aliases/RestRouteProcessorConfig.md +1 -1
- package/docs/reference/type-aliases/SocketRouteProcessorConfig.md +1 -1
- package/docs/reference/variables/HostingComponentType.md +13 -0
- package/package.json +3 -4
package/dist/es/index.js
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
export * from "./components/authentication.js";
|
|
4
4
|
export * from "./components/authenticationAdmin.js";
|
|
5
|
+
export * from "./components/hosting.js";
|
|
5
6
|
export * from "./components/information.js";
|
|
6
7
|
export * from "./components/mimeTypeProcessor.js";
|
|
7
8
|
export * from "./components/restRouteProcessor.js";
|
|
8
9
|
export * from "./components/socketRouteProcessor.js";
|
|
9
10
|
export * from "./models/config/authenticationAdminComponentConfig.js";
|
|
10
11
|
export * from "./models/config/authenticationComponentConfig.js";
|
|
12
|
+
export * from "./models/config/hostingComponentConfig.js";
|
|
11
13
|
export * from "./models/config/informationComponentConfig.js";
|
|
12
14
|
export * from "./models/config/mimeTypeProcessorConfig.js";
|
|
13
15
|
export * from "./models/config/restRouteProcessorConfig.js";
|
|
@@ -15,6 +17,7 @@ export * from "./models/config/socketRouteProcessorConfig.js";
|
|
|
15
17
|
export * from "./models/IEngineServerConfig.js";
|
|
16
18
|
export * from "./models/types/authenticationAdminComponentType.js";
|
|
17
19
|
export * from "./models/types/authenticationComponentType.js";
|
|
20
|
+
export * from "./models/types/hostingComponentType.js";
|
|
18
21
|
export * from "./models/types/informationComponentType.js";
|
|
19
22
|
export * from "./models/types/mimeTypeProcessorType.js";
|
|
20
23
|
export * from "./models/types/restRouteProcessorType.js";
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uDAAuD,CAAC;AACtE,cAAc,kDAAkD,CAAC;AACjE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iCAAiC,CAAC;AAChD,cAAc,oDAAoD,CAAC;AACnE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./components/authentication.js\";\nexport * from \"./components/authenticationAdmin.js\";\nexport * from \"./components/information.js\";\nexport * from \"./components/mimeTypeProcessor.js\";\nexport * from \"./components/restRouteProcessor.js\";\nexport * from \"./components/socketRouteProcessor.js\";\nexport * from \"./models/config/authenticationAdminComponentConfig.js\";\nexport * from \"./models/config/authenticationComponentConfig.js\";\nexport * from \"./models/config/informationComponentConfig.js\";\nexport * from \"./models/config/mimeTypeProcessorConfig.js\";\nexport * from \"./models/config/restRouteProcessorConfig.js\";\nexport * from \"./models/config/socketRouteProcessorConfig.js\";\nexport * from \"./models/IEngineServerConfig.js\";\nexport * from \"./models/types/authenticationAdminComponentType.js\";\nexport * from \"./models/types/authenticationComponentType.js\";\nexport * from \"./models/types/informationComponentType.js\";\nexport * from \"./models/types/mimeTypeProcessorType.js\";\nexport * from \"./models/types/restRouteProcessorType.js\";\nexport * from \"./models/types/socketRouteProcessorType.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uDAAuD,CAAC;AACtE,cAAc,kDAAkD,CAAC;AACjE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iCAAiC,CAAC;AAChD,cAAc,oDAAoD,CAAC;AACnE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wCAAwC,CAAC;AACvD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./components/authentication.js\";\nexport * from \"./components/authenticationAdmin.js\";\nexport * from \"./components/hosting.js\";\nexport * from \"./components/information.js\";\nexport * from \"./components/mimeTypeProcessor.js\";\nexport * from \"./components/restRouteProcessor.js\";\nexport * from \"./components/socketRouteProcessor.js\";\nexport * from \"./models/config/authenticationAdminComponentConfig.js\";\nexport * from \"./models/config/authenticationComponentConfig.js\";\nexport * from \"./models/config/hostingComponentConfig.js\";\nexport * from \"./models/config/informationComponentConfig.js\";\nexport * from \"./models/config/mimeTypeProcessorConfig.js\";\nexport * from \"./models/config/restRouteProcessorConfig.js\";\nexport * from \"./models/config/socketRouteProcessorConfig.js\";\nexport * from \"./models/IEngineServerConfig.js\";\nexport * from \"./models/types/authenticationAdminComponentType.js\";\nexport * from \"./models/types/authenticationComponentType.js\";\nexport * from \"./models/types/hostingComponentType.js\";\nexport * from \"./models/types/informationComponentType.js\";\nexport * from \"./models/types/mimeTypeProcessorType.js\";\nexport * from \"./models/types/restRouteProcessorType.js\";\nexport * from \"./models/types/socketRouteProcessorType.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEngineServerConfig.js","sourceRoot":"","sources":["../../../src/models/IEngineServerConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IWebServerOptions } from \"@twin.org/api-models\";\nimport type { IEngineCoreTypeConfig } from \"@twin.org/engine-models\";\nimport type { IEngineConfig } from \"@twin.org/engine-types\";\nimport type { AuthenticationAdminComponentConfig } from \"./config/authenticationAdminComponentConfig.js\";\nimport type { AuthenticationComponentConfig } from \"./config/authenticationComponentConfig.js\";\nimport type { InformationComponentConfig } from \"./config/informationComponentConfig.js\";\nimport type { MimeTypeProcessorConfig } from \"./config/mimeTypeProcessorConfig.js\";\nimport type { RestRouteProcessorConfig } from \"./config/restRouteProcessorConfig.js\";\nimport type { SocketRouteProcessorConfig } from \"./config/socketRouteProcessorConfig.js\";\n\n/**\n * Extended engine server config with known types.\n */\nexport interface IEngineServerConfig extends IEngineConfig {\n\t/**\n\t * Configuration for the web server.\n\t */\n\tweb?: IWebServerOptions;\n\n\t/**\n\t * The types to initialise in the engine.\n\t */\n\ttypes: IEngineConfig[\"types\"] & {\n\t\t[type: string]: IEngineCoreTypeConfig[] | undefined;\n\n\t\t/**\n\t\t * Information component options which can be overridden by individual components by specifying types other than default
|
|
1
|
+
{"version":3,"file":"IEngineServerConfig.js","sourceRoot":"","sources":["../../../src/models/IEngineServerConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IWebServerOptions } from \"@twin.org/api-models\";\nimport type { IEngineCoreTypeConfig } from \"@twin.org/engine-models\";\nimport type { IEngineConfig } from \"@twin.org/engine-types\";\nimport type { AuthenticationAdminComponentConfig } from \"./config/authenticationAdminComponentConfig.js\";\nimport type { AuthenticationComponentConfig } from \"./config/authenticationComponentConfig.js\";\nimport type { HostingComponentConfig } from \"./config/hostingComponentConfig.js\";\nimport type { InformationComponentConfig } from \"./config/informationComponentConfig.js\";\nimport type { MimeTypeProcessorConfig } from \"./config/mimeTypeProcessorConfig.js\";\nimport type { RestRouteProcessorConfig } from \"./config/restRouteProcessorConfig.js\";\nimport type { SocketRouteProcessorConfig } from \"./config/socketRouteProcessorConfig.js\";\n\n/**\n * Extended engine server config with known types.\n */\nexport interface IEngineServerConfig extends IEngineConfig {\n\t/**\n\t * Configuration for the web server.\n\t */\n\tweb?: IWebServerOptions;\n\n\t/**\n\t * The types to initialise in the engine.\n\t */\n\ttypes: IEngineConfig[\"types\"] & {\n\t\t[type: string]: IEngineCoreTypeConfig[] | undefined;\n\n\t\t/**\n\t\t * Information component options which can be overridden by individual components by specifying types other than default.\n\t\t */\n\t\tinformationComponent?: IEngineCoreTypeConfig<InformationComponentConfig>[];\n\n\t\t/**\n\t\t * Hosting component options which can be overridden by individual components by specifying types other than default.\n\t\t */\n\t\thostingComponent?: IEngineCoreTypeConfig<HostingComponentConfig>[];\n\n\t\t/**\n\t\t * REST route processors options which can be overridden by individual components by specifying types other than default.\n\t\t */\n\t\trestRouteProcessor?: IEngineCoreTypeConfig<RestRouteProcessorConfig>[];\n\n\t\t/**\n\t\t * Socket route processors options which can be overridden by individual components by specifying types other than default.\n\t\t */\n\t\tsocketRouteProcessor?: IEngineCoreTypeConfig<SocketRouteProcessorConfig>[];\n\n\t\t/**\n\t\t * Mime type processors options which can be overridden by individual components by specifying types other than default.\n\t\t */\n\t\tmimeTypeProcessor?: IEngineCoreTypeConfig<MimeTypeProcessorConfig>[];\n\n\t\t/**\n\t\t * Authentication component options which can be overridden by individual components by specifying types other than default.\n\t\t */\n\t\tauthenticationComponent?: IEngineCoreTypeConfig<AuthenticationComponentConfig>[];\n\n\t\t/**\n\t\t * Authentication admin component options which can be overridden by individual components by specifying types other than default.\n\t\t */\n\t\tauthenticationAdminComponent?: IEngineCoreTypeConfig<AuthenticationAdminComponentConfig>[];\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hostingComponentConfig.js","sourceRoot":"","sources":["../../../../src/models/config/hostingComponentConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHostingServiceConstructorOptions } from \"@twin.org/api-service\";\nimport type { HostingComponentType } from \"../types/hostingComponentType.js\";\n\n/**\n * Hosting component config types.\n */\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type HostingComponentConfig = {\n\ttype: typeof HostingComponentType.Service;\n\toptions: IHostingServiceConstructorOptions;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restRouteProcessorConfig.js","sourceRoot":"","sources":["../../../../src/models/config/restRouteProcessorConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthHeaderProcessorConstructorOptions } from \"@twin.org/api-auth-entity-storage-service\";\nimport type {\n\tIContextIdProcessorConstructorOptions,\n\tILoggingProcessorConstructorOptions,\n\tIRestRouteProcessorConstructorOptions,\n\tIStaticContextIdProcessorConstructorOptions\n} from \"@twin.org/api-processors\";\nimport type { ITenantProcessorConstructorOptions } from \"@twin.org/api-tenant-processor\";\nimport type {
|
|
1
|
+
{"version":3,"file":"restRouteProcessorConfig.js","sourceRoot":"","sources":["../../../../src/models/config/restRouteProcessorConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthHeaderProcessorConstructorOptions } from \"@twin.org/api-auth-entity-storage-service\";\nimport type {\n\tIContextIdProcessorConstructorOptions,\n\tILoggingProcessorConstructorOptions,\n\tIRestRouteProcessorConstructorOptions,\n\tIStaticContextIdProcessorConstructorOptions\n} from \"@twin.org/api-processors\";\nimport type { ITenantProcessorConstructorOptions } from \"@twin.org/api-tenant-processor\";\nimport type { RestRouteProcessorType } from \"../types/restRouteProcessorType.js\";\n\n/**\n * REST route processor config types.\n */\nexport type RestRouteProcessorConfig =\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.AuthHeader;\n\t\t\toptions?: IAuthHeaderProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.Logging;\n\t\t\toptions?: ILoggingProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.ContextId;\n\t\t\toptions: IContextIdProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.StaticContextId;\n\t\t\toptions: IStaticContextIdProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.Tenant;\n\t\t\toptions?: ITenantProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof RestRouteProcessorType.RestRoute;\n\t\t\toptions?: IRestRouteProcessorConstructorOptions;\n\t };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socketRouteProcessorConfig.js","sourceRoot":"","sources":["../../../../src/models/config/socketRouteProcessorConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthHeaderProcessorConstructorOptions } from \"@twin.org/api-auth-entity-storage-service\";\nimport type {\n\tIContextIdProcessorConstructorOptions,\n\tILoggingProcessorConstructorOptions,\n\tISocketRouteProcessorConstructorOptions,\n\tIStaticContextIdProcessorConstructorOptions\n} from \"@twin.org/api-processors\";\nimport type { ITenantProcessorConstructorOptions } from \"@twin.org/api-tenant-processor\";\nimport type {
|
|
1
|
+
{"version":3,"file":"socketRouteProcessorConfig.js","sourceRoot":"","sources":["../../../../src/models/config/socketRouteProcessorConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuthHeaderProcessorConstructorOptions } from \"@twin.org/api-auth-entity-storage-service\";\nimport type {\n\tIContextIdProcessorConstructorOptions,\n\tILoggingProcessorConstructorOptions,\n\tISocketRouteProcessorConstructorOptions,\n\tIStaticContextIdProcessorConstructorOptions\n} from \"@twin.org/api-processors\";\nimport type { ITenantProcessorConstructorOptions } from \"@twin.org/api-tenant-processor\";\nimport type { SocketRouteProcessorType } from \"../types/socketRouteProcessorType.js\";\n\n/**\n * Socket route processor config types.\n */\nexport type SocketRouteProcessorConfig =\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.AuthHeader;\n\t\t\toptions?: IAuthHeaderProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.Logging;\n\t\t\toptions?: ILoggingProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.ContextId;\n\t\t\toptions: IContextIdProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.StaticContextId;\n\t\t\toptions: IStaticContextIdProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.Tenant;\n\t\t\toptions?: ITenantProcessorConstructorOptions;\n\t }\n\t| {\n\t\t\ttype: typeof SocketRouteProcessorType.SocketRoute;\n\t\t\toptions?: ISocketRouteProcessorConstructorOptions;\n\t };\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* Hosting component types.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const HostingComponentType = {
|
|
8
|
+
/**
|
|
9
|
+
* Service.
|
|
10
|
+
*/
|
|
11
|
+
Service: "service"
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=hostingComponentType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hostingComponentType.js","sourceRoot":"","sources":["../../../../src/models/types/hostingComponentType.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC;;OAEG;IACH,OAAO,EAAE,SAAS;CACT,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Hosting component types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const HostingComponentType = {\n\t/**\n\t * Service.\n\t */\n\tService: \"service\"\n} as const;\n\n/**\n * Hosting component types.\n */\nexport type HostingComponentType = (typeof HostingComponentType)[keyof typeof HostingComponentType];\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentFactory
|
|
2
|
-
import type { IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
1
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
2
|
+
import type { EngineTypeInitialiserReturn, IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
3
3
|
import type { AuthenticationComponentConfig } from "../models/config/authenticationComponentConfig.js";
|
|
4
4
|
import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
5
5
|
/**
|
|
@@ -9,8 +9,4 @@ import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
|
9
9
|
* @param instanceConfig The instance config.
|
|
10
10
|
* @returns The instance created and the factory for it.
|
|
11
11
|
*/
|
|
12
|
-
export declare function initialiseAuthenticationComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: AuthenticationComponentConfig):
|
|
13
|
-
instanceType?: string;
|
|
14
|
-
factory?: typeof ComponentFactory;
|
|
15
|
-
component?: IComponent;
|
|
16
|
-
}>;
|
|
12
|
+
export declare function initialiseAuthenticationComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: AuthenticationComponentConfig): EngineTypeInitialiserReturn<AuthenticationComponentConfig, typeof ComponentFactory>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentFactory
|
|
2
|
-
import type { IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
1
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
2
|
+
import type { EngineTypeInitialiserReturn, IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
3
3
|
import type { AuthenticationAdminComponentConfig } from "../models/config/authenticationAdminComponentConfig.js";
|
|
4
4
|
import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
5
5
|
/**
|
|
@@ -9,8 +9,4 @@ import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
|
9
9
|
* @param instanceConfig The instance config.
|
|
10
10
|
* @returns The instance created and the factory for it.
|
|
11
11
|
*/
|
|
12
|
-
export declare function initialiseAuthenticationAdminComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: AuthenticationAdminComponentConfig):
|
|
13
|
-
instanceType?: string;
|
|
14
|
-
factory?: typeof ComponentFactory;
|
|
15
|
-
component?: IComponent;
|
|
16
|
-
}>;
|
|
12
|
+
export declare function initialiseAuthenticationAdminComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: AuthenticationAdminComponentConfig): EngineTypeInitialiserReturn<AuthenticationAdminComponentConfig, typeof ComponentFactory>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
2
|
+
import type { EngineTypeInitialiserReturn, IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
3
|
+
import type { HostingComponentConfig } from "../models/config/hostingComponentConfig.js";
|
|
4
|
+
import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
5
|
+
/**
|
|
6
|
+
* Initialise the hosting component.
|
|
7
|
+
* @param engineCore The engine core.
|
|
8
|
+
* @param context The context for the engine.
|
|
9
|
+
* @param instanceConfig The instance config.
|
|
10
|
+
* @returns The instance created and the factory for it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function initialiseHostingComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: HostingComponentConfig): EngineTypeInitialiserReturn<HostingComponentConfig, typeof ComponentFactory>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentFactory
|
|
2
|
-
import type { IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
1
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
2
|
+
import type { EngineTypeInitialiserReturn, IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
3
3
|
import type { InformationComponentConfig } from "../models/config/informationComponentConfig.js";
|
|
4
4
|
import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
5
5
|
/**
|
|
@@ -9,8 +9,4 @@ import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
|
9
9
|
* @param instanceConfig The instance config.
|
|
10
10
|
* @returns The instance created and the factory for it.
|
|
11
11
|
*/
|
|
12
|
-
export declare function initialiseInformationComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: InformationComponentConfig):
|
|
13
|
-
instanceType?: string;
|
|
14
|
-
factory?: typeof ComponentFactory;
|
|
15
|
-
component?: IComponent;
|
|
16
|
-
}>;
|
|
12
|
+
export declare function initialiseInformationComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: InformationComponentConfig): EngineTypeInitialiserReturn<InformationComponentConfig, typeof ComponentFactory>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { MimeTypeProcessorFactory } from "@twin.org/api-models";
|
|
2
|
-
import type {
|
|
3
|
-
import type { IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
2
|
+
import type { EngineTypeInitialiserReturn, IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
4
3
|
import type { MimeTypeProcessorConfig } from "../models/config/mimeTypeProcessorConfig.js";
|
|
5
4
|
import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
6
5
|
/**
|
|
@@ -10,8 +9,4 @@ import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
|
10
9
|
* @param instanceConfig The instance config.
|
|
11
10
|
* @returns The instance created and the factory for it.
|
|
12
11
|
*/
|
|
13
|
-
export declare function initialiseMimeTypeProcessorComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: MimeTypeProcessorConfig):
|
|
14
|
-
instanceType?: string;
|
|
15
|
-
factory?: typeof MimeTypeProcessorFactory;
|
|
16
|
-
component?: IComponent;
|
|
17
|
-
}>;
|
|
12
|
+
export declare function initialiseMimeTypeProcessorComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: MimeTypeProcessorConfig): EngineTypeInitialiserReturn<MimeTypeProcessorConfig, typeof MimeTypeProcessorFactory>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RestRouteProcessorFactory } from "@twin.org/api-models";
|
|
2
|
-
import type {
|
|
3
|
-
import type { IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
2
|
+
import type { EngineTypeInitialiserReturn, IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
4
3
|
import type { RestRouteProcessorConfig } from "../models/config/restRouteProcessorConfig.js";
|
|
5
4
|
import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
6
5
|
/**
|
|
@@ -10,8 +9,4 @@ import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
|
10
9
|
* @param instanceConfig The instance config.
|
|
11
10
|
* @returns The instance created and the factory for it.
|
|
12
11
|
*/
|
|
13
|
-
export declare function initialiseRestRouteProcessorComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: RestRouteProcessorConfig):
|
|
14
|
-
instanceType?: string;
|
|
15
|
-
factory?: typeof RestRouteProcessorFactory;
|
|
16
|
-
component?: IComponent;
|
|
17
|
-
}>;
|
|
12
|
+
export declare function initialiseRestRouteProcessorComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: RestRouteProcessorConfig): EngineTypeInitialiserReturn<RestRouteProcessorConfig, typeof RestRouteProcessorFactory>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SocketRouteProcessorFactory } from "@twin.org/api-models";
|
|
2
|
-
import type {
|
|
3
|
-
import type { IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
2
|
+
import type { EngineTypeInitialiserReturn, IEngineCore, IEngineCoreContext } from "@twin.org/engine-models";
|
|
4
3
|
import type { SocketRouteProcessorConfig } from "../models/config/socketRouteProcessorConfig.js";
|
|
5
4
|
import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
6
5
|
/**
|
|
@@ -10,8 +9,4 @@ import type { IEngineServerConfig } from "../models/IEngineServerConfig.js";
|
|
|
10
9
|
* @param instanceConfig The instance config.
|
|
11
10
|
* @returns The instance created and the factory for it.
|
|
12
11
|
*/
|
|
13
|
-
export declare function initialiseSocketRouteProcessorComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: SocketRouteProcessorConfig):
|
|
14
|
-
instanceType?: string;
|
|
15
|
-
factory?: typeof SocketRouteProcessorFactory;
|
|
16
|
-
component?: IComponent;
|
|
17
|
-
}>;
|
|
12
|
+
export declare function initialiseSocketRouteProcessorComponent(engineCore: IEngineCore<IEngineServerConfig>, context: IEngineCoreContext<IEngineServerConfig>, instanceConfig: SocketRouteProcessorConfig): EngineTypeInitialiserReturn<SocketRouteProcessorConfig, typeof SocketRouteProcessorFactory>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export * from "./components/authentication.js";
|
|
2
2
|
export * from "./components/authenticationAdmin.js";
|
|
3
|
+
export * from "./components/hosting.js";
|
|
3
4
|
export * from "./components/information.js";
|
|
4
5
|
export * from "./components/mimeTypeProcessor.js";
|
|
5
6
|
export * from "./components/restRouteProcessor.js";
|
|
6
7
|
export * from "./components/socketRouteProcessor.js";
|
|
7
8
|
export * from "./models/config/authenticationAdminComponentConfig.js";
|
|
8
9
|
export * from "./models/config/authenticationComponentConfig.js";
|
|
10
|
+
export * from "./models/config/hostingComponentConfig.js";
|
|
9
11
|
export * from "./models/config/informationComponentConfig.js";
|
|
10
12
|
export * from "./models/config/mimeTypeProcessorConfig.js";
|
|
11
13
|
export * from "./models/config/restRouteProcessorConfig.js";
|
|
@@ -13,6 +15,7 @@ export * from "./models/config/socketRouteProcessorConfig.js";
|
|
|
13
15
|
export * from "./models/IEngineServerConfig.js";
|
|
14
16
|
export * from "./models/types/authenticationAdminComponentType.js";
|
|
15
17
|
export * from "./models/types/authenticationComponentType.js";
|
|
18
|
+
export * from "./models/types/hostingComponentType.js";
|
|
16
19
|
export * from "./models/types/informationComponentType.js";
|
|
17
20
|
export * from "./models/types/mimeTypeProcessorType.js";
|
|
18
21
|
export * from "./models/types/restRouteProcessorType.js";
|
|
@@ -3,6 +3,7 @@ import type { IEngineCoreTypeConfig } from "@twin.org/engine-models";
|
|
|
3
3
|
import type { IEngineConfig } from "@twin.org/engine-types";
|
|
4
4
|
import type { AuthenticationAdminComponentConfig } from "./config/authenticationAdminComponentConfig.js";
|
|
5
5
|
import type { AuthenticationComponentConfig } from "./config/authenticationComponentConfig.js";
|
|
6
|
+
import type { HostingComponentConfig } from "./config/hostingComponentConfig.js";
|
|
6
7
|
import type { InformationComponentConfig } from "./config/informationComponentConfig.js";
|
|
7
8
|
import type { MimeTypeProcessorConfig } from "./config/mimeTypeProcessorConfig.js";
|
|
8
9
|
import type { RestRouteProcessorConfig } from "./config/restRouteProcessorConfig.js";
|
|
@@ -21,27 +22,31 @@ export interface IEngineServerConfig extends IEngineConfig {
|
|
|
21
22
|
types: IEngineConfig["types"] & {
|
|
22
23
|
[type: string]: IEngineCoreTypeConfig[] | undefined;
|
|
23
24
|
/**
|
|
24
|
-
* Information component options which can be overridden by individual components by specifying types other than default
|
|
25
|
+
* Information component options which can be overridden by individual components by specifying types other than default.
|
|
25
26
|
*/
|
|
26
27
|
informationComponent?: IEngineCoreTypeConfig<InformationComponentConfig>[];
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* Hosting component options which can be overridden by individual components by specifying types other than default.
|
|
30
|
+
*/
|
|
31
|
+
hostingComponent?: IEngineCoreTypeConfig<HostingComponentConfig>[];
|
|
32
|
+
/**
|
|
33
|
+
* REST route processors options which can be overridden by individual components by specifying types other than default.
|
|
29
34
|
*/
|
|
30
35
|
restRouteProcessor?: IEngineCoreTypeConfig<RestRouteProcessorConfig>[];
|
|
31
36
|
/**
|
|
32
|
-
* Socket route processors options which can be overridden by individual components by specifying types other than default
|
|
37
|
+
* Socket route processors options which can be overridden by individual components by specifying types other than default.
|
|
33
38
|
*/
|
|
34
39
|
socketRouteProcessor?: IEngineCoreTypeConfig<SocketRouteProcessorConfig>[];
|
|
35
40
|
/**
|
|
36
|
-
* Mime type processors options which can be overridden by individual components by specifying types other than default
|
|
41
|
+
* Mime type processors options which can be overridden by individual components by specifying types other than default.
|
|
37
42
|
*/
|
|
38
43
|
mimeTypeProcessor?: IEngineCoreTypeConfig<MimeTypeProcessorConfig>[];
|
|
39
44
|
/**
|
|
40
|
-
* Authentication component options which can be overridden by individual components by specifying types other than default
|
|
45
|
+
* Authentication component options which can be overridden by individual components by specifying types other than default.
|
|
41
46
|
*/
|
|
42
47
|
authenticationComponent?: IEngineCoreTypeConfig<AuthenticationComponentConfig>[];
|
|
43
48
|
/**
|
|
44
|
-
* Authentication admin component options which can be overridden by individual components by specifying types other than default
|
|
49
|
+
* Authentication admin component options which can be overridden by individual components by specifying types other than default.
|
|
45
50
|
*/
|
|
46
51
|
authenticationAdminComponent?: IEngineCoreTypeConfig<AuthenticationAdminComponentConfig>[];
|
|
47
52
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IHostingServiceConstructorOptions } from "@twin.org/api-service";
|
|
2
|
+
import type { HostingComponentType } from "../types/hostingComponentType.js";
|
|
3
|
+
/**
|
|
4
|
+
* Hosting component config types.
|
|
5
|
+
*/
|
|
6
|
+
export type HostingComponentConfig = {
|
|
7
|
+
type: typeof HostingComponentType.Service;
|
|
8
|
+
options: IHostingServiceConstructorOptions;
|
|
9
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { IAuthHeaderProcessorConstructorOptions } from "@twin.org/api-auth-entity-storage-service";
|
|
2
2
|
import type { IContextIdProcessorConstructorOptions, ILoggingProcessorConstructorOptions, IRestRouteProcessorConstructorOptions, IStaticContextIdProcessorConstructorOptions } from "@twin.org/api-processors";
|
|
3
3
|
import type { ITenantProcessorConstructorOptions } from "@twin.org/api-tenant-processor";
|
|
4
|
-
import type { IVerifiableCredentialAuthenticationProcessorConstructorOptions } from "@twin.org/identity-authentication";
|
|
5
4
|
import type { RestRouteProcessorType } from "../types/restRouteProcessorType.js";
|
|
6
5
|
/**
|
|
7
6
|
* REST route processor config types.
|
|
@@ -9,9 +8,6 @@ import type { RestRouteProcessorType } from "../types/restRouteProcessorType.js"
|
|
|
9
8
|
export type RestRouteProcessorConfig = {
|
|
10
9
|
type: typeof RestRouteProcessorType.AuthHeader;
|
|
11
10
|
options?: IAuthHeaderProcessorConstructorOptions;
|
|
12
|
-
} | {
|
|
13
|
-
type: typeof RestRouteProcessorType.AuthVerifiableCredential;
|
|
14
|
-
options?: IVerifiableCredentialAuthenticationProcessorConstructorOptions;
|
|
15
11
|
} | {
|
|
16
12
|
type: typeof RestRouteProcessorType.Logging;
|
|
17
13
|
options?: ILoggingProcessorConstructorOptions;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { IAuthHeaderProcessorConstructorOptions } from "@twin.org/api-auth-entity-storage-service";
|
|
2
2
|
import type { IContextIdProcessorConstructorOptions, ILoggingProcessorConstructorOptions, ISocketRouteProcessorConstructorOptions, IStaticContextIdProcessorConstructorOptions } from "@twin.org/api-processors";
|
|
3
3
|
import type { ITenantProcessorConstructorOptions } from "@twin.org/api-tenant-processor";
|
|
4
|
-
import type { IVerifiableCredentialAuthenticationProcessorConstructorOptions } from "@twin.org/identity-authentication";
|
|
5
4
|
import type { SocketRouteProcessorType } from "../types/socketRouteProcessorType.js";
|
|
6
5
|
/**
|
|
7
6
|
* Socket route processor config types.
|
|
@@ -9,9 +8,6 @@ import type { SocketRouteProcessorType } from "../types/socketRouteProcessorType
|
|
|
9
8
|
export type SocketRouteProcessorConfig = {
|
|
10
9
|
type: typeof SocketRouteProcessorType.AuthHeader;
|
|
11
10
|
options?: IAuthHeaderProcessorConstructorOptions;
|
|
12
|
-
} | {
|
|
13
|
-
type: typeof SocketRouteProcessorType.AuthVerifiableCredential;
|
|
14
|
-
options?: IVerifiableCredentialAuthenticationProcessorConstructorOptions;
|
|
15
11
|
} | {
|
|
16
12
|
type: typeof SocketRouteProcessorType.Logging;
|
|
17
13
|
options?: ILoggingProcessorConstructorOptions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hosting component types.
|
|
3
|
+
*/
|
|
4
|
+
export declare const HostingComponentType: {
|
|
5
|
+
/**
|
|
6
|
+
* Service.
|
|
7
|
+
*/
|
|
8
|
+
readonly Service: "service";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Hosting component types.
|
|
12
|
+
*/
|
|
13
|
+
export type HostingComponentType = (typeof HostingComponentType)[keyof typeof HostingComponentType];
|