@twin.org/engine-server-types 0.0.3-next.2 → 0.0.3-next.20
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/hosting.js +27 -0
- package/dist/es/components/hosting.js.map +1 -0
- package/dist/es/components/restRouteProcessor.js +0 -11
- package/dist/es/components/restRouteProcessor.js.map +1 -1
- package/dist/es/components/socketRouteProcessor.js +0 -11
- 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/hosting.d.ts +16 -0
- 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 +297 -0
- package/docs/reference/functions/initialiseHostingComponent.md +31 -0
- 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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HostingService } from "@twin.org/api-service";
|
|
2
|
+
import { ComponentFactory } from "@twin.org/core";
|
|
3
|
+
import { HostingComponentType } from "../models/types/hostingComponentType.js";
|
|
4
|
+
/**
|
|
5
|
+
* Initialise the hosting component.
|
|
6
|
+
* @param engineCore The engine core.
|
|
7
|
+
* @param context The context for the engine.
|
|
8
|
+
* @param instanceConfig The instance config.
|
|
9
|
+
* @returns The instance created and the factory for it.
|
|
10
|
+
*/
|
|
11
|
+
export async function initialiseHostingComponent(engineCore, context, instanceConfig) {
|
|
12
|
+
let component;
|
|
13
|
+
let instanceType;
|
|
14
|
+
if (instanceConfig.type === HostingComponentType.Service) {
|
|
15
|
+
component = new HostingService({
|
|
16
|
+
tenantAdminComponentType: engineCore.getRegisteredInstanceTypeOptional("tenantAdminComponent"),
|
|
17
|
+
config: instanceConfig.options.config
|
|
18
|
+
});
|
|
19
|
+
instanceType = "hosting-service";
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
component,
|
|
23
|
+
instanceType,
|
|
24
|
+
factory: ComponentFactory
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=hosting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosting.js","sourceRoot":"","sources":["../../../src/components/hosting.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAKnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC/C,UAA4C,EAC5C,OAAgD,EAChD,cAAsC;IAEtC,IAAI,SAAwC,CAAC;IAC7C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,oBAAoB,CAAC,OAAO,EAAE,CAAC;QAC1D,SAAS,GAAG,IAAI,cAAc,CAAC;YAC9B,wBAAwB,EACvB,UAAU,CAAC,iCAAiC,CAAC,sBAAsB,CAAC;YACrE,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC,MAAM;SACrC,CAAC,CAAC;QACH,YAAY,oBAAkC,CAAC;IAChD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,gBAAgB;KACzB,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHostingComponent } from \"@twin.org/api-models\";\nimport { HostingService } from \"@twin.org/api-service\";\nimport { ComponentFactory, type IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { nameofKebabCase } from \"@twin.org/nameof\";\nimport type { HostingComponentConfig } from \"../models/config/hostingComponentConfig.js\";\nimport type { IEngineServerConfig } from \"../models/IEngineServerConfig.js\";\nimport { HostingComponentType } from \"../models/types/hostingComponentType.js\";\n\n/**\n * Initialise the hosting component.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseHostingComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: HostingComponentConfig\n): Promise<{ instanceType?: string; factory?: typeof ComponentFactory; component?: IComponent }> {\n\tlet component: IHostingComponent | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === HostingComponentType.Service) {\n\t\tcomponent = new HostingService({\n\t\t\ttenantAdminComponentType:\n\t\t\t\tengineCore.getRegisteredInstanceTypeOptional(\"tenantAdminComponent\"),\n\t\t\tconfig: instanceConfig.options.config\n\t\t});\n\t\tinstanceType = nameofKebabCase(HostingService);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: ComponentFactory\n\t};\n}\n"]}
|
|
@@ -6,7 +6,6 @@ import { LoggingProcessor, ContextIdProcessor, RestRouteProcessor, StaticContext
|
|
|
6
6
|
import { initSchema as initSchemaTenantProcessor, TenantProcessor } from "@twin.org/api-tenant-processor";
|
|
7
7
|
import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
|
|
8
8
|
import { initialiseEntityStorageConnector } from "@twin.org/engine-types";
|
|
9
|
-
import { VerifiableCredentialAuthenticationProcessor } from "@twin.org/identity-authentication";
|
|
10
9
|
import { RestRouteProcessorType } from "../models/types/restRouteProcessorType.js";
|
|
11
10
|
/**
|
|
12
11
|
* Initialise the rest route processor.
|
|
@@ -27,16 +26,6 @@ export async function initialiseRestRouteProcessorComponent(engineCore, context,
|
|
|
27
26
|
});
|
|
28
27
|
instanceType = "auth-header-processor";
|
|
29
28
|
}
|
|
30
|
-
else if (instanceConfig.type === RestRouteProcessorType.AuthVerifiableCredential) {
|
|
31
|
-
component = new VerifiableCredentialAuthenticationProcessor({
|
|
32
|
-
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
33
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
34
|
-
config: {
|
|
35
|
-
...instanceConfig.options?.config
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
instanceType = "verifiable-credential-authentication-processor";
|
|
39
|
-
}
|
|
40
29
|
else if (instanceConfig.type === RestRouteProcessorType.Logging) {
|
|
41
30
|
component = new LoggingProcessor({
|
|
42
31
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restRouteProcessor.js","sourceRoot":"","sources":["../../../src/components/restRouteProcessor.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAA4B,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,UAAU,IAAI,yBAAyB,EAEvC,eAAe,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"restRouteProcessor.js","sourceRoot":"","sources":["../../../src/components/restRouteProcessor.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAA4B,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,UAAU,IAAI,yBAAyB,EAEvC,eAAe,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAI1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAEnF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,qCAAqC,CAC1D,UAA4C,EAC5C,OAAgD,EAChD,cAAwC;IAMxC,IAAI,SAA0C,CAAC;IAC/C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAsB,CAAC,UAAU,EAAE,CAAC;QAC/D,SAAS,GAAG,IAAI,mBAAmB,CAAC;YACnC,kBAAkB,EAAE,UAAU,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;YAC1E,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM;aACjC;SACD,CAAC,CAAC;QACH,YAAY,0BAAuC,CAAC;IACrD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAsB,CAAC,OAAO,EAAE,CAAC;QACnE,SAAS,GAAG,IAAI,gBAAgB,CAAC;YAChC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM;aACjC;SACD,CAAC,CAAC;QACH,YAAY,sBAAoC,CAAC;IAClD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAsB,CAAC,SAAS,EAAE,CAAC;QACrE,SAAS,GAAG,IAAI,kBAAkB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC3D,YAAY,yBAAsC,CAAC;IACpD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAsB,CAAC,eAAe,EAAE,CAAC;QAC3E,SAAS,GAAG,IAAI,wBAAwB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACjE,YAAY,gCAA4C,CAAC;IAC1D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAsB,CAAC,SAAS,EAAE,CAAC;QACrE,SAAS,GAAG,IAAI,kBAAkB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC3D,YAAY,yBAAsC,CAAC;IACpD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,sBAAsB,CAAC,MAAM,EAAE,CAAC;QAClE,yBAAyB,EAAE,CAAC;QAC5B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,uBAAuB,YAE/C,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE;YACpE,aAAa,CAAC,IAAI;YAClB,aAAa,CAAC,MAAM;SACpB,CAAC,CACF,CAAC;QAEF,SAAS,GAAG,IAAI,eAAe,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACxD,YAAY,qBAAmC,CAAC;IACjD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,yBAAyB;KAClC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { AuthHeaderProcessor } from \"@twin.org/api-auth-entity-storage-service\";\nimport { RestRouteProcessorFactory, type IBaseRouteProcessor } from \"@twin.org/api-models\";\nimport {\n\tLoggingProcessor,\n\tContextIdProcessor,\n\tRestRouteProcessor,\n\tStaticContextIdProcessor\n} from \"@twin.org/api-processors\";\nimport {\n\tinitSchema as initSchemaTenantProcessor,\n\ttype Tenant,\n\tTenantProcessor\n} from \"@twin.org/api-tenant-processor\";\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { initialiseEntityStorageConnector } from \"@twin.org/engine-types\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport type { RestRouteProcessorConfig } from \"../models/config/restRouteProcessorConfig.js\";\nimport type { IEngineServerConfig } from \"../models/IEngineServerConfig.js\";\nimport { RestRouteProcessorType } from \"../models/types/restRouteProcessorType.js\";\n\n/**\n * Initialise the rest route processor.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseRestRouteProcessorComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: RestRouteProcessorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof RestRouteProcessorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IBaseRouteProcessor | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === RestRouteProcessorType.AuthHeader) {\n\t\tcomponent = new AuthHeaderProcessor({\n\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = nameofKebabCase(AuthHeaderProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.Logging) {\n\t\tcomponent = new LoggingProcessor({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = nameofKebabCase(LoggingProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.ContextId) {\n\t\tcomponent = new ContextIdProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(ContextIdProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.StaticContextId) {\n\t\tcomponent = new StaticContextIdProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(StaticContextIdProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.RestRoute) {\n\t\tcomponent = new RestRouteProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(RestRouteProcessor);\n\t} else if (instanceConfig.type === RestRouteProcessorType.Tenant) {\n\t\tinitSchemaTenantProcessor();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.tenantEntityStorageType,\n\t\t\tnameof<Tenant>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [\n\t\t\t\tContextIdKeys.Node,\n\t\t\t\tContextIdKeys.Tenant\n\t\t\t])\n\t\t);\n\n\t\tcomponent = new TenantProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(TenantProcessor);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: RestRouteProcessorFactory\n\t};\n}\n"]}
|
|
@@ -6,7 +6,6 @@ import { LoggingProcessor, ContextIdProcessor, SocketRouteProcessor, StaticConte
|
|
|
6
6
|
import { initSchema as initSchemaTenantProcessor, TenantProcessor } from "@twin.org/api-tenant-processor";
|
|
7
7
|
import { ContextIdHelper, ContextIdKeys } from "@twin.org/context";
|
|
8
8
|
import { initialiseEntityStorageConnector } from "@twin.org/engine-types";
|
|
9
|
-
import { VerifiableCredentialAuthenticationProcessor } from "@twin.org/identity-authentication";
|
|
10
9
|
import { SocketRouteProcessorType } from "../models/types/socketRouteProcessorType.js";
|
|
11
10
|
/**
|
|
12
11
|
* Initialise the socket route processor.
|
|
@@ -27,16 +26,6 @@ export async function initialiseSocketRouteProcessorComponent(engineCore, contex
|
|
|
27
26
|
});
|
|
28
27
|
instanceType = "auth-header-processor";
|
|
29
28
|
}
|
|
30
|
-
else if (instanceConfig.type === SocketRouteProcessorType.AuthVerifiableCredential) {
|
|
31
|
-
component = new VerifiableCredentialAuthenticationProcessor({
|
|
32
|
-
identityConnectorType: engineCore.getRegisteredInstanceType("identityConnector"),
|
|
33
|
-
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
34
|
-
config: {
|
|
35
|
-
...instanceConfig.options?.config
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
instanceType = "verifiable-credential-authentication-processor";
|
|
39
|
-
}
|
|
40
29
|
else if (instanceConfig.type === SocketRouteProcessorType.Logging) {
|
|
41
30
|
component = new LoggingProcessor({
|
|
42
31
|
loggingComponentType: engineCore.getRegisteredInstanceType("loggingComponent"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socketRouteProcessor.js","sourceRoot":"","sources":["../../../src/components/socketRouteProcessor.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAA4B,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,UAAU,IAAI,yBAAyB,EAEvC,eAAe,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"socketRouteProcessor.js","sourceRoot":"","sources":["../../../src/components/socketRouteProcessor.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAA4B,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,UAAU,IAAI,yBAAyB,EAEvC,eAAe,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAI1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uCAAuC,CAC5D,UAA4C,EAC5C,OAAgD,EAChD,cAA0C;IAM1C,IAAI,SAA0C,CAAC;IAC/C,IAAI,YAAgC,CAAC;IAErC,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,UAAU,EAAE,CAAC;QACjE,SAAS,GAAG,IAAI,mBAAmB,CAAC;YACnC,kBAAkB,EAAE,UAAU,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;YAC1E,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM;aACjC;SACD,CAAC,CAAC;QACH,YAAY,0BAAuC,CAAC;IACrD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,OAAO,EAAE,CAAC;QACrE,SAAS,GAAG,IAAI,gBAAgB,CAAC;YAChC,oBAAoB,EAAE,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC;YAC9E,MAAM,EAAE;gBACP,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM;aACjC;SACD,CAAC,CAAC;QACH,YAAY,sBAAoC,CAAC;IAClD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,SAAS,EAAE,CAAC;QACvE,SAAS,GAAG,IAAI,kBAAkB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC3D,YAAY,yBAAsC,CAAC;IACpD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,eAAe,EAAE,CAAC;QAC7E,SAAS,GAAG,IAAI,wBAAwB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACjE,YAAY,gCAA4C,CAAC;IAC1D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,WAAW,EAAE,CAAC;QACzE,SAAS,GAAG,IAAI,oBAAoB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC7D,YAAY,2BAAwC,CAAC;IACtD,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,wBAAwB,CAAC,MAAM,EAAE,CAAC;QACpE,yBAAyB,EAAE,CAAC;QAC5B,gCAAgC,CAC/B,UAAU,EACV,OAAO,EACP,cAAc,CAAC,OAAO,EAAE,uBAAuB,YAE/C,eAAe,CAAC,qBAAqB,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAC1F,CAAC;QAEF,SAAS,GAAG,IAAI,eAAe,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACxD,YAAY,qBAAmC,CAAC;IACjD,CAAC;IAED,OAAO;QACN,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,2BAA2B;KACpC,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { AuthHeaderProcessor } from \"@twin.org/api-auth-entity-storage-service\";\nimport { SocketRouteProcessorFactory, type IBaseRouteProcessor } from \"@twin.org/api-models\";\nimport {\n\tLoggingProcessor,\n\tContextIdProcessor,\n\tSocketRouteProcessor,\n\tStaticContextIdProcessor\n} from \"@twin.org/api-processors\";\nimport {\n\tinitSchema as initSchemaTenantProcessor,\n\ttype Tenant,\n\tTenantProcessor\n} from \"@twin.org/api-tenant-processor\";\nimport { ContextIdHelper, ContextIdKeys } from \"@twin.org/context\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IEngineCore, IEngineCoreContext } from \"@twin.org/engine-models\";\nimport { initialiseEntityStorageConnector } from \"@twin.org/engine-types\";\nimport { nameof, nameofKebabCase } from \"@twin.org/nameof\";\nimport type { SocketRouteProcessorConfig } from \"../models/config/socketRouteProcessorConfig.js\";\nimport type { IEngineServerConfig } from \"../models/IEngineServerConfig.js\";\nimport { SocketRouteProcessorType } from \"../models/types/socketRouteProcessorType.js\";\n\n/**\n * Initialise the socket route processor.\n * @param engineCore The engine core.\n * @param context The context for the engine.\n * @param instanceConfig The instance config.\n * @returns The instance created and the factory for it.\n */\nexport async function initialiseSocketRouteProcessorComponent(\n\tengineCore: IEngineCore<IEngineServerConfig>,\n\tcontext: IEngineCoreContext<IEngineServerConfig>,\n\tinstanceConfig: SocketRouteProcessorConfig\n): Promise<{\n\tinstanceType?: string;\n\tfactory?: typeof SocketRouteProcessorFactory;\n\tcomponent?: IComponent;\n}> {\n\tlet component: IBaseRouteProcessor | undefined;\n\tlet instanceType: string | undefined;\n\n\tif (instanceConfig.type === SocketRouteProcessorType.AuthHeader) {\n\t\tcomponent = new AuthHeaderProcessor({\n\t\t\tvaultConnectorType: engineCore.getRegisteredInstanceType(\"vaultConnector\"),\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = nameofKebabCase(AuthHeaderProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.Logging) {\n\t\tcomponent = new LoggingProcessor({\n\t\t\tloggingComponentType: engineCore.getRegisteredInstanceType(\"loggingComponent\"),\n\t\t\tconfig: {\n\t\t\t\t...instanceConfig.options?.config\n\t\t\t}\n\t\t});\n\t\tinstanceType = nameofKebabCase(LoggingProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.ContextId) {\n\t\tcomponent = new ContextIdProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(ContextIdProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.StaticContextId) {\n\t\tcomponent = new StaticContextIdProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(StaticContextIdProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.SocketRoute) {\n\t\tcomponent = new SocketRouteProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(SocketRouteProcessor);\n\t} else if (instanceConfig.type === SocketRouteProcessorType.Tenant) {\n\t\tinitSchemaTenantProcessor();\n\t\tinitialiseEntityStorageConnector(\n\t\t\tengineCore,\n\t\t\tcontext,\n\t\t\tinstanceConfig.options?.tenantEntityStorageType,\n\t\t\tnameof<Tenant>(),\n\t\t\tContextIdHelper.pickKeysFromAvailable(engineCore.getContextIdKeys(), [ContextIdKeys.Node])\n\t\t);\n\n\t\tcomponent = new TenantProcessor(instanceConfig.options);\n\t\tinstanceType = nameofKebabCase(TenantProcessor);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tinstanceType,\n\t\tfactory: SocketRouteProcessorFactory\n\t};\n}\n"]}
|
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"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentFactory, type IComponent } from "@twin.org/core";
|
|
2
|
+
import type { 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): Promise<{
|
|
13
|
+
instanceType?: string;
|
|
14
|
+
factory?: typeof ComponentFactory;
|
|
15
|
+
component?: IComponent;
|
|
16
|
+
}>;
|
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];
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,302 @@
|
|
|
1
1
|
# @twin.org/engine-server-types - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.20](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.19...engine-server-types-v0.0.3-next.20) (2026-02-06)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **engine-server-types:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/engine-models bumped from 0.0.3-next.19 to 0.0.3-next.20
|
|
16
|
+
* @twin.org/engine-types bumped from 0.0.3-next.19 to 0.0.3-next.20
|
|
17
|
+
|
|
18
|
+
## [0.0.3-next.19](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.18...engine-server-types-v0.0.3-next.19) (2026-02-05)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Miscellaneous Chores
|
|
22
|
+
|
|
23
|
+
* **engine-server-types:** Synchronize repo versions
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @twin.org/engine-models bumped from 0.0.3-next.18 to 0.0.3-next.19
|
|
31
|
+
* @twin.org/engine-types bumped from 0.0.3-next.18 to 0.0.3-next.19
|
|
32
|
+
|
|
33
|
+
## [0.0.3-next.18](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.17...engine-server-types-v0.0.3-next.18) (2026-02-04)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Miscellaneous Chores
|
|
37
|
+
|
|
38
|
+
* **engine-server-types:** Synchronize repo versions
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Dependencies
|
|
42
|
+
|
|
43
|
+
* The following workspace dependencies were updated
|
|
44
|
+
* dependencies
|
|
45
|
+
* @twin.org/engine-models bumped from 0.0.3-next.17 to 0.0.3-next.18
|
|
46
|
+
* @twin.org/engine-types bumped from 0.0.3-next.17 to 0.0.3-next.18
|
|
47
|
+
|
|
48
|
+
## [0.0.3-next.17](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.16...engine-server-types-v0.0.3-next.17) (2026-02-02)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Miscellaneous Chores
|
|
52
|
+
|
|
53
|
+
* **engine-server-types:** Synchronize repo versions
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Dependencies
|
|
57
|
+
|
|
58
|
+
* The following workspace dependencies were updated
|
|
59
|
+
* dependencies
|
|
60
|
+
* @twin.org/engine-models bumped from 0.0.3-next.16 to 0.0.3-next.17
|
|
61
|
+
* @twin.org/engine-types bumped from 0.0.3-next.16 to 0.0.3-next.17
|
|
62
|
+
|
|
63
|
+
## [0.0.3-next.16](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.15...engine-server-types-v0.0.3-next.16) (2026-01-28)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
* remove dap and darp ([d568c4f](https://github.com/twinfoundation/engine/commit/d568c4fc58a3159378e1d65f93228ae84f34a31d))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Dependencies
|
|
72
|
+
|
|
73
|
+
* The following workspace dependencies were updated
|
|
74
|
+
* dependencies
|
|
75
|
+
* @twin.org/engine-models bumped from 0.0.3-next.15 to 0.0.3-next.16
|
|
76
|
+
* @twin.org/engine-types bumped from 0.0.3-next.15 to 0.0.3-next.16
|
|
77
|
+
|
|
78
|
+
## [0.0.3-next.15](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.14...engine-server-types-v0.0.3-next.15) (2026-01-26)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### Features
|
|
82
|
+
|
|
83
|
+
* add hosting component ([#70](https://github.com/twinfoundation/engine/issues/70)) ([2ab0dec](https://github.com/twinfoundation/engine/commit/2ab0dec8fdb979395c639b73f394a40a0dd7e55a))
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### Dependencies
|
|
87
|
+
|
|
88
|
+
* The following workspace dependencies were updated
|
|
89
|
+
* dependencies
|
|
90
|
+
* @twin.org/engine-models bumped from 0.0.3-next.14 to 0.0.3-next.15
|
|
91
|
+
* @twin.org/engine-types bumped from 0.0.3-next.14 to 0.0.3-next.15
|
|
92
|
+
|
|
93
|
+
## [0.0.3-next.14](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.13...engine-server-types-v0.0.3-next.14) (2026-01-19)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Features
|
|
97
|
+
|
|
98
|
+
* add auth admin component ([201cd06](https://github.com/twinfoundation/engine/commit/201cd061be83afccb5a6b06856ffe7cf8db7d6b3))
|
|
99
|
+
* add context id features ([#51](https://github.com/twinfoundation/engine/issues/51)) ([eaef180](https://github.com/twinfoundation/engine/commit/eaef1807397a907bc7655ef1545a151a710ca2f1))
|
|
100
|
+
* add data space connector ([a824d99](https://github.com/twinfoundation/engine/commit/a824d9931faeaa8115e01f8e7545b802d0e7ac70))
|
|
101
|
+
* add default logging component for web server ([8ad94f0](https://github.com/twinfoundation/engine/commit/8ad94f0d2d9a5241a8854b1e59fb9a55ce310142))
|
|
102
|
+
* add fed cat filters ([a52cbf1](https://github.com/twinfoundation/engine/commit/a52cbf1eaf85e6cad61de9ea9448932fb5ae0f43))
|
|
103
|
+
* add federated catalogue ([1b15dd0](https://github.com/twinfoundation/engine/commit/1b15dd059a11446457651c411a73145fab37f025))
|
|
104
|
+
* add latest rights management components ([2d305c8](https://github.com/twinfoundation/engine/commit/2d305c8c85c77bb4f5694c76422db4a11efc1a40))
|
|
105
|
+
* add mimeTypeProcessors and disableNodeIdentity ([bb7e81e](https://github.com/twinfoundation/engine/commit/bb7e81e2036fe042068a5645ec59b22e20d33aad))
|
|
106
|
+
* add rest clients as components ([c6f956a](https://github.com/twinfoundation/engine/commit/c6f956afe4fc22cd552174539c92a109448dc242))
|
|
107
|
+
* add rights management modules ([e02cadc](https://github.com/twinfoundation/engine/commit/e02cadc840d242fe16a73ab41ba61376c7467e50))
|
|
108
|
+
* add rights management negotiation ([84ef46b](https://github.com/twinfoundation/engine/commit/84ef46bff110611a19512793425c8c873ee2a590))
|
|
109
|
+
* add synchronised storage support ([5142e34](https://github.com/twinfoundation/engine/commit/5142e3488f09195cf9f48a9c6c6d1014231a4c2c))
|
|
110
|
+
* add task scheduler ([0951107](https://github.com/twinfoundation/engine/commit/09511073ad042194a45206303f0ef31d8d6af5db))
|
|
111
|
+
* add trust and rights management plugins ([eea0807](https://github.com/twinfoundation/engine/commit/eea0807601833220bd9fd8605b5e4383fbc0ebae))
|
|
112
|
+
* add validate-locales ([b92ea09](https://github.com/twinfoundation/engine/commit/b92ea09dbcfe35225271a51f24d231f59e2d363e))
|
|
113
|
+
* context id handlers repopulated after engine clone ([9712e32](https://github.com/twinfoundation/engine/commit/9712e328f4607f5b2c82355c394c61bde0ee39bf))
|
|
114
|
+
* eslint migration to flat config ([6b978da](https://github.com/twinfoundation/engine/commit/6b978daf777a615d7758b63c3df57d5a376f6dfb))
|
|
115
|
+
* modifying the engine to run the new services ([#10](https://github.com/twinfoundation/engine/issues/10)) ([6f7141f](https://github.com/twinfoundation/engine/commit/6f7141fe0a6d05c725066b274bcc18b5490e580b))
|
|
116
|
+
* remove additional identity auth components ([409b2e6](https://github.com/twinfoundation/engine/commit/409b2e6a5a543d0795b01916349b39922afb6d88))
|
|
117
|
+
* remove authentication generator components ([#67](https://github.com/twinfoundation/engine/issues/67)) ([62f7984](https://github.com/twinfoundation/engine/commit/62f798468f567fdbf648401aa0dc51cda871c913))
|
|
118
|
+
* simplify config building ([732c871](https://github.com/twinfoundation/engine/commit/732c871c5aca236759168f4bc15aeffd98a330a8))
|
|
119
|
+
* standardised engine logging naming ([0dbf857](https://github.com/twinfoundation/engine/commit/0dbf857587641f86ddf010143519d0e8333489ff))
|
|
120
|
+
* switch to devDeps ([32832ac](https://github.com/twinfoundation/engine/commit/32832acd934e1e5569474281a527c9b118d30732))
|
|
121
|
+
* update dependencies ([97c9f64](https://github.com/twinfoundation/engine/commit/97c9f64b6ef096963bcc5de338a2a9e99bdc1a11))
|
|
122
|
+
* update framework core ([acc0f8d](https://github.com/twinfoundation/engine/commit/acc0f8d455a4b8ec47f1da643139fa0f07775fa6))
|
|
123
|
+
* update rights management and add authentication generators ([f728a1e](https://github.com/twinfoundation/engine/commit/f728a1efea15ada8d10cfbe17cafe7e2b252f527))
|
|
124
|
+
* upgrade framework components ([efd52e8](https://github.com/twinfoundation/engine/commit/efd52e80564fff29c3897bfa09b6305b3a322812))
|
|
125
|
+
* use shared store mechanism ([#2](https://github.com/twinfoundation/engine/issues/2)) ([9eed8d7](https://github.com/twinfoundation/engine/commit/9eed8d7766388479b42f03e2542fe761f2156408))
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
### Dependencies
|
|
129
|
+
|
|
130
|
+
* The following workspace dependencies were updated
|
|
131
|
+
* dependencies
|
|
132
|
+
* @twin.org/engine-models bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
133
|
+
* @twin.org/engine-types bumped from 0.0.3-next.13 to 0.0.3-next.14
|
|
134
|
+
|
|
135
|
+
## [0.0.3-next.13](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.12...engine-server-types-v0.0.3-next.13) (2026-01-19)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Features
|
|
139
|
+
|
|
140
|
+
* remove authentication generator components ([#67](https://github.com/twinfoundation/engine/issues/67)) ([62f7984](https://github.com/twinfoundation/engine/commit/62f798468f567fdbf648401aa0dc51cda871c913))
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### Dependencies
|
|
144
|
+
|
|
145
|
+
* The following workspace dependencies were updated
|
|
146
|
+
* dependencies
|
|
147
|
+
* @twin.org/engine-models bumped from 0.0.3-next.12 to 0.0.3-next.13
|
|
148
|
+
* @twin.org/engine-types bumped from 0.0.3-next.12 to 0.0.3-next.13
|
|
149
|
+
|
|
150
|
+
## [0.0.3-next.12](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.11...engine-server-types-v0.0.3-next.12) (2026-01-19)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
### Miscellaneous Chores
|
|
154
|
+
|
|
155
|
+
* **engine-server-types:** Synchronize repo versions
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
### Dependencies
|
|
159
|
+
|
|
160
|
+
* The following workspace dependencies were updated
|
|
161
|
+
* dependencies
|
|
162
|
+
* @twin.org/engine-models bumped from 0.0.3-next.11 to 0.0.3-next.12
|
|
163
|
+
* @twin.org/engine-types bumped from 0.0.3-next.11 to 0.0.3-next.12
|
|
164
|
+
|
|
165
|
+
## [0.0.3-next.11](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.10...engine-server-types-v0.0.3-next.11) (2026-01-16)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
### Miscellaneous Chores
|
|
169
|
+
|
|
170
|
+
* **engine-server-types:** Synchronize repo versions
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
### Dependencies
|
|
174
|
+
|
|
175
|
+
* The following workspace dependencies were updated
|
|
176
|
+
* dependencies
|
|
177
|
+
* @twin.org/engine-models bumped from 0.0.3-next.10 to 0.0.3-next.11
|
|
178
|
+
* @twin.org/engine-types bumped from 0.0.3-next.10 to 0.0.3-next.11
|
|
179
|
+
|
|
180
|
+
## [0.0.3-next.10](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.9...engine-server-types-v0.0.3-next.10) (2026-01-13)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
### Miscellaneous Chores
|
|
184
|
+
|
|
185
|
+
* **engine-server-types:** Synchronize repo versions
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
### Dependencies
|
|
189
|
+
|
|
190
|
+
* The following workspace dependencies were updated
|
|
191
|
+
* dependencies
|
|
192
|
+
* @twin.org/engine-models bumped from 0.0.3-next.9 to 0.0.3-next.10
|
|
193
|
+
* @twin.org/engine-types bumped from 0.0.3-next.9 to 0.0.3-next.10
|
|
194
|
+
|
|
195
|
+
## [0.0.3-next.9](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.8...engine-server-types-v0.0.3-next.9) (2026-01-07)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
### Miscellaneous Chores
|
|
199
|
+
|
|
200
|
+
* **engine-server-types:** Synchronize repo versions
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
### Dependencies
|
|
204
|
+
|
|
205
|
+
* The following workspace dependencies were updated
|
|
206
|
+
* dependencies
|
|
207
|
+
* @twin.org/engine-models bumped from 0.0.3-next.8 to 0.0.3-next.9
|
|
208
|
+
* @twin.org/engine-types bumped from 0.0.3-next.8 to 0.0.3-next.9
|
|
209
|
+
|
|
210
|
+
## [0.0.3-next.8](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.7...engine-server-types-v0.0.3-next.8) (2026-01-06)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
### Miscellaneous Chores
|
|
214
|
+
|
|
215
|
+
* **engine-server-types:** Synchronize repo versions
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
### Dependencies
|
|
219
|
+
|
|
220
|
+
* The following workspace dependencies were updated
|
|
221
|
+
* dependencies
|
|
222
|
+
* @twin.org/engine-models bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
223
|
+
* @twin.org/engine-types bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
224
|
+
|
|
225
|
+
## [0.0.3-next.7](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.6...engine-server-types-v0.0.3-next.7) (2025-12-04)
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
### Features
|
|
229
|
+
|
|
230
|
+
* add trust and rights management plugins ([eea0807](https://github.com/twinfoundation/engine/commit/eea0807601833220bd9fd8605b5e4383fbc0ebae))
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
### Dependencies
|
|
234
|
+
|
|
235
|
+
* The following workspace dependencies were updated
|
|
236
|
+
* dependencies
|
|
237
|
+
* @twin.org/engine-models bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
238
|
+
* @twin.org/engine-types bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
239
|
+
|
|
240
|
+
## [0.0.3-next.6](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.5...engine-server-types-v0.0.3-next.6) (2025-11-28)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
### Features
|
|
244
|
+
|
|
245
|
+
* add fed cat filters ([a52cbf1](https://github.com/twinfoundation/engine/commit/a52cbf1eaf85e6cad61de9ea9448932fb5ae0f43))
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
### Dependencies
|
|
249
|
+
|
|
250
|
+
* The following workspace dependencies were updated
|
|
251
|
+
* dependencies
|
|
252
|
+
* @twin.org/engine-models bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
253
|
+
* @twin.org/engine-types bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
254
|
+
|
|
255
|
+
## [0.0.3-next.5](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.4...engine-server-types-v0.0.3-next.5) (2025-11-20)
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
### Miscellaneous Chores
|
|
259
|
+
|
|
260
|
+
* **engine-server-types:** Synchronize repo versions
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
### Dependencies
|
|
264
|
+
|
|
265
|
+
* The following workspace dependencies were updated
|
|
266
|
+
* dependencies
|
|
267
|
+
* @twin.org/engine-models bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
268
|
+
* @twin.org/engine-types bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
269
|
+
|
|
270
|
+
## [0.0.3-next.4](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.3...engine-server-types-v0.0.3-next.4) (2025-11-20)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
### Features
|
|
274
|
+
|
|
275
|
+
* context id handlers repopulated after engine clone ([9712e32](https://github.com/twinfoundation/engine/commit/9712e328f4607f5b2c82355c394c61bde0ee39bf))
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
### Dependencies
|
|
279
|
+
|
|
280
|
+
* The following workspace dependencies were updated
|
|
281
|
+
* dependencies
|
|
282
|
+
* @twin.org/engine-models bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
283
|
+
* @twin.org/engine-types bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
284
|
+
|
|
285
|
+
## [0.0.3-next.3](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.2...engine-server-types-v0.0.3-next.3) (2025-11-14)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
### Miscellaneous Chores
|
|
289
|
+
|
|
290
|
+
* **engine-server-types:** Synchronize repo versions
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
### Dependencies
|
|
294
|
+
|
|
295
|
+
* The following workspace dependencies were updated
|
|
296
|
+
* dependencies
|
|
297
|
+
* @twin.org/engine-models bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
298
|
+
* @twin.org/engine-types bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
299
|
+
|
|
3
300
|
## [0.0.3-next.2](https://github.com/twinfoundation/engine/compare/engine-server-types-v0.0.3-next.1...engine-server-types-v0.0.3-next.2) (2025-11-13)
|
|
4
301
|
|
|
5
302
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: initialiseHostingComponent()
|
|
2
|
+
|
|
3
|
+
> **initialiseHostingComponent**(`engineCore`, `context`, `instanceConfig`): `Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IComponent`\>; `component?`: `IComponent`; \}\>
|
|
4
|
+
|
|
5
|
+
Initialise the hosting component.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### engineCore
|
|
10
|
+
|
|
11
|
+
`IEngineCore`\<[`IEngineServerConfig`](../interfaces/IEngineServerConfig.md)\>
|
|
12
|
+
|
|
13
|
+
The engine core.
|
|
14
|
+
|
|
15
|
+
### context
|
|
16
|
+
|
|
17
|
+
`IEngineCoreContext`\<[`IEngineServerConfig`](../interfaces/IEngineServerConfig.md)\>
|
|
18
|
+
|
|
19
|
+
The context for the engine.
|
|
20
|
+
|
|
21
|
+
### instanceConfig
|
|
22
|
+
|
|
23
|
+
[`HostingComponentConfig`](../type-aliases/HostingComponentConfig.md)
|
|
24
|
+
|
|
25
|
+
The instance config.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<\{ `instanceType?`: `string`; `factory?`: `Factory`\<`IComponent`\>; `component?`: `IComponent`; \}\>
|
|
30
|
+
|
|
31
|
+
The instance created and the factory for it.
|
package/docs/reference/index.md
CHANGED
|
@@ -8,12 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
- [AuthenticationAdminComponentConfig](type-aliases/AuthenticationAdminComponentConfig.md)
|
|
10
10
|
- [AuthenticationComponentConfig](type-aliases/AuthenticationComponentConfig.md)
|
|
11
|
+
- [HostingComponentConfig](type-aliases/HostingComponentConfig.md)
|
|
11
12
|
- [InformationComponentConfig](type-aliases/InformationComponentConfig.md)
|
|
12
13
|
- [MimeTypeProcessorConfig](type-aliases/MimeTypeProcessorConfig.md)
|
|
13
14
|
- [RestRouteProcessorConfig](type-aliases/RestRouteProcessorConfig.md)
|
|
14
15
|
- [SocketRouteProcessorConfig](type-aliases/SocketRouteProcessorConfig.md)
|
|
15
16
|
- [AuthenticationAdminComponentType](type-aliases/AuthenticationAdminComponentType.md)
|
|
16
17
|
- [AuthenticationComponentType](type-aliases/AuthenticationComponentType.md)
|
|
18
|
+
- [HostingComponentType](type-aliases/HostingComponentType.md)
|
|
17
19
|
- [InformationComponentType](type-aliases/InformationComponentType.md)
|
|
18
20
|
- [MimeTypeProcessorType](type-aliases/MimeTypeProcessorType.md)
|
|
19
21
|
- [RestRouteProcessorType](type-aliases/RestRouteProcessorType.md)
|
|
@@ -23,6 +25,7 @@
|
|
|
23
25
|
|
|
24
26
|
- [AuthenticationAdminComponentType](variables/AuthenticationAdminComponentType.md)
|
|
25
27
|
- [AuthenticationComponentType](variables/AuthenticationComponentType.md)
|
|
28
|
+
- [HostingComponentType](variables/HostingComponentType.md)
|
|
26
29
|
- [InformationComponentType](variables/InformationComponentType.md)
|
|
27
30
|
- [MimeTypeProcessorType](variables/MimeTypeProcessorType.md)
|
|
28
31
|
- [RestRouteProcessorType](variables/RestRouteProcessorType.md)
|
|
@@ -32,6 +35,7 @@
|
|
|
32
35
|
|
|
33
36
|
- [initialiseAuthenticationComponent](functions/initialiseAuthenticationComponent.md)
|
|
34
37
|
- [initialiseAuthenticationAdminComponent](functions/initialiseAuthenticationAdminComponent.md)
|
|
38
|
+
- [initialiseHostingComponent](functions/initialiseHostingComponent.md)
|
|
35
39
|
- [initialiseInformationComponent](functions/initialiseInformationComponent.md)
|
|
36
40
|
- [initialiseMimeTypeProcessorComponent](functions/initialiseMimeTypeProcessorComponent.md)
|
|
37
41
|
- [initialiseRestRouteProcessorComponent](functions/initialiseRestRouteProcessorComponent.md)
|
|
@@ -28,37 +28,43 @@ The types to initialise in the engine.
|
|
|
28
28
|
|
|
29
29
|
> `optional` **informationComponent**: `IEngineCoreTypeConfig`\<[`InformationComponentConfig`](../type-aliases/InformationComponentConfig.md)\>[]
|
|
30
30
|
|
|
31
|
-
Information component options which can be overridden by individual components by specifying types other than default
|
|
31
|
+
Information component options which can be overridden by individual components by specifying types other than default.
|
|
32
|
+
|
|
33
|
+
##### hostingComponent?
|
|
34
|
+
|
|
35
|
+
> `optional` **hostingComponent**: `IEngineCoreTypeConfig`\<[`HostingComponentConfig`](../type-aliases/HostingComponentConfig.md)\>[]
|
|
36
|
+
|
|
37
|
+
Hosting component options which can be overridden by individual components by specifying types other than default.
|
|
32
38
|
|
|
33
39
|
##### restRouteProcessor?
|
|
34
40
|
|
|
35
41
|
> `optional` **restRouteProcessor**: `IEngineCoreTypeConfig`\<[`RestRouteProcessorConfig`](../type-aliases/RestRouteProcessorConfig.md)\>[]
|
|
36
42
|
|
|
37
|
-
REST route processors options which can be overridden by individual components by specifying types other than default
|
|
43
|
+
REST route processors options which can be overridden by individual components by specifying types other than default.
|
|
38
44
|
|
|
39
45
|
##### socketRouteProcessor?
|
|
40
46
|
|
|
41
47
|
> `optional` **socketRouteProcessor**: `IEngineCoreTypeConfig`\<[`SocketRouteProcessorConfig`](../type-aliases/SocketRouteProcessorConfig.md)\>[]
|
|
42
48
|
|
|
43
|
-
Socket route processors options which can be overridden by individual components by specifying types other than default
|
|
49
|
+
Socket route processors options which can be overridden by individual components by specifying types other than default.
|
|
44
50
|
|
|
45
51
|
##### mimeTypeProcessor?
|
|
46
52
|
|
|
47
53
|
> `optional` **mimeTypeProcessor**: `IEngineCoreTypeConfig`\<[`MimeTypeProcessorConfig`](../type-aliases/MimeTypeProcessorConfig.md)\>[]
|
|
48
54
|
|
|
49
|
-
Mime type processors options which can be overridden by individual components by specifying types other than default
|
|
55
|
+
Mime type processors options which can be overridden by individual components by specifying types other than default.
|
|
50
56
|
|
|
51
57
|
##### authenticationComponent?
|
|
52
58
|
|
|
53
59
|
> `optional` **authenticationComponent**: `IEngineCoreTypeConfig`\<[`AuthenticationComponentConfig`](../type-aliases/AuthenticationComponentConfig.md)\>[]
|
|
54
60
|
|
|
55
|
-
Authentication component options which can be overridden by individual components by specifying types other than default
|
|
61
|
+
Authentication component options which can be overridden by individual components by specifying types other than default.
|
|
56
62
|
|
|
57
63
|
##### authenticationAdminComponent?
|
|
58
64
|
|
|
59
65
|
> `optional` **authenticationAdminComponent**: `IEngineCoreTypeConfig`\<[`AuthenticationAdminComponentConfig`](../type-aliases/AuthenticationAdminComponentConfig.md)\>[]
|
|
60
66
|
|
|
61
|
-
Authentication admin component options which can be overridden by individual components by specifying types other than default
|
|
67
|
+
Authentication admin component options which can be overridden by individual components by specifying types other than default.
|
|
62
68
|
|
|
63
69
|
#### Overrides
|
|
64
70
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Type Alias: HostingComponentConfig
|
|
2
|
+
|
|
3
|
+
> **HostingComponentConfig** = `object`
|
|
4
|
+
|
|
5
|
+
Hosting component config types.
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
### type
|
|
10
|
+
|
|
11
|
+
> **type**: *typeof* [`Service`](../variables/HostingComponentType.md#service)
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### options
|
|
16
|
+
|
|
17
|
+
> **options**: `IHostingServiceConstructorOptions`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: RestRouteProcessorConfig
|
|
2
2
|
|
|
3
|
-
> **RestRouteProcessorConfig** = \{ `type`: *typeof* [`AuthHeader`](../variables/RestRouteProcessorType.md#authheader); `options?`: `IAuthHeaderProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`
|
|
3
|
+
> **RestRouteProcessorConfig** = \{ `type`: *typeof* [`AuthHeader`](../variables/RestRouteProcessorType.md#authheader); `options?`: `IAuthHeaderProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Logging`](../variables/RestRouteProcessorType.md#logging); `options?`: `ILoggingProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`ContextId`](../variables/RestRouteProcessorType.md#contextid); `options`: `IContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`StaticContextId`](../variables/RestRouteProcessorType.md#staticcontextid); `options`: `IStaticContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Tenant`](../variables/RestRouteProcessorType.md#tenant); `options?`: `ITenantProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`RestRoute`](../variables/RestRouteProcessorType.md#restroute); `options?`: `IRestRouteProcessorConstructorOptions`; \}
|
|
4
4
|
|
|
5
5
|
REST route processor config types.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: SocketRouteProcessorConfig
|
|
2
2
|
|
|
3
|
-
> **SocketRouteProcessorConfig** = \{ `type`: *typeof* [`AuthHeader`](../variables/SocketRouteProcessorType.md#authheader); `options?`: `IAuthHeaderProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`
|
|
3
|
+
> **SocketRouteProcessorConfig** = \{ `type`: *typeof* [`AuthHeader`](../variables/SocketRouteProcessorType.md#authheader); `options?`: `IAuthHeaderProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Logging`](../variables/SocketRouteProcessorType.md#logging); `options?`: `ILoggingProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`ContextId`](../variables/SocketRouteProcessorType.md#contextid); `options`: `IContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`StaticContextId`](../variables/SocketRouteProcessorType.md#staticcontextid); `options`: `IStaticContextIdProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`Tenant`](../variables/SocketRouteProcessorType.md#tenant); `options?`: `ITenantProcessorConstructorOptions`; \} \| \{ `type`: *typeof* [`SocketRoute`](../variables/SocketRouteProcessorType.md#socketroute); `options?`: `ISocketRouteProcessorConstructorOptions`; \}
|
|
4
4
|
|
|
5
5
|
Socket route processor config types.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/engine-server-types",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.20",
|
|
4
4
|
"description": "Server types to use in an engine server.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,10 +25,9 @@
|
|
|
25
25
|
"@twin.org/api-tenant-processor": "next",
|
|
26
26
|
"@twin.org/context": "next",
|
|
27
27
|
"@twin.org/core": "next",
|
|
28
|
-
"@twin.org/engine-models": "0.0.3-next.
|
|
29
|
-
"@twin.org/engine-types": "0.0.3-next.
|
|
28
|
+
"@twin.org/engine-models": "0.0.3-next.20",
|
|
29
|
+
"@twin.org/engine-types": "0.0.3-next.20",
|
|
30
30
|
"@twin.org/entity": "next",
|
|
31
|
-
"@twin.org/identity-authentication": "next",
|
|
32
31
|
"@twin.org/nameof": "next"
|
|
33
32
|
},
|
|
34
33
|
"main": "./dist/es/index.js",
|