@twin.org/engine-server 0.0.1-next.13 → 0.0.1-next.15

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.
@@ -1,40 +1,37 @@
1
- import { type IEngineCore, type IEngineCoreTypeConfig, type IEngineServer, type IEngineServerConfig, type RestRouteGenerator, type SocketRouteGenerator } from "@twin.org/engine-models";
1
+ import type { IEngineCore, IEngineCoreTypeConfig, IEngineServer } from "@twin.org/engine-models";
2
+ import { type IEngineServerConfig } from "@twin.org/engine-server-types";
2
3
  /**
3
4
  * Server for the engine.
4
5
  */
5
- export declare class EngineServer implements IEngineServer {
6
+ export declare class EngineServer<T extends IEngineServerConfig = IEngineServerConfig> implements IEngineServer {
6
7
  /**
7
8
  * Runtime name for the class.
8
9
  */
9
10
  readonly CLASS_NAME: string;
10
- /**
11
- * The server config.
12
- */
13
- protected readonly _config: IEngineServerConfig;
14
11
  /**
15
12
  * Create a new instance of EngineServer.
16
13
  * @param options The options for the engine.
17
- * @param options.server The server options for the engine.
18
14
  * @param options.engineCore The engine core to serve from.
19
15
  */
20
16
  constructor(options: {
21
- engineCore: IEngineCore;
22
- server?: IEngineServerConfig;
17
+ engineCore: IEngineCore<T>;
23
18
  });
24
19
  /**
25
20
  * Add a REST route generator.
26
21
  * @param type The type to add the generator for.
27
22
  * @param typeConfig The type config.
28
- * @param generator The generator to add.
23
+ * @param module The module containing the generator.
24
+ * @param method The method to call on the module.
29
25
  */
30
- addRestRouteGenerator(type: string, typeConfig: IEngineCoreTypeConfig[] | undefined, generator: RestRouteGenerator): void;
26
+ addRestRouteGenerator(type: string, typeConfig: IEngineCoreTypeConfig[] | undefined, module: string, method: string): void;
31
27
  /**
32
28
  * Add a socket route generator.
33
29
  * @param type The type to add the generator for.
34
30
  * @param typeConfig The type config.
35
- * @param generator The generator to add.
31
+ * @param module The module containing the generator.
32
+ * @param method The method to call on the module.
36
33
  */
37
- addSocketRouteGenerator(type: string, typeConfig: IEngineCoreTypeConfig[] | undefined, generator: SocketRouteGenerator): void;
34
+ addSocketRouteGenerator(type: string, typeConfig: IEngineCoreTypeConfig[] | undefined, module: string, method: string): void;
38
35
  /**
39
36
  * Start the engine server.
40
37
  * @returns True if the start was successful.
@@ -1,5 +1,6 @@
1
1
  import type { IServerInfo } from "@twin.org/api-models";
2
- import { type IEngineCoreConfig, type IEngineServerConfig } from "@twin.org/engine-models";
2
+ import type { IEngineCoreConfig } from "@twin.org/engine-models";
3
+ import { type IEngineServerConfig } from "@twin.org/engine-server-types";
3
4
  import type { IEngineServerEnvironmentVariables } from "../models/IEngineServerEnvironmentVariables";
4
5
  /**
5
6
  * Handles the configuration of the server.
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/engine-server - Changelog
2
2
 
3
- ## v0.0.1-next.13
3
+ ## v0.0.1-next.15
4
4
 
5
5
  - Initial Release
@@ -1,7 +1,11 @@
1
- # Class: EngineServer
1
+ # Class: EngineServer\<T\>
2
2
 
3
3
  Server for the engine.
4
4
 
5
+ ## Type Parameters
6
+
7
+ • **T** *extends* `IEngineServerConfig` = `IEngineServerConfig`
8
+
5
9
  ## Implements
6
10
 
7
11
  - `IEngineServer`
@@ -10,7 +14,7 @@ Server for the engine.
10
14
 
11
15
  ### new EngineServer()
12
16
 
13
- > **new EngineServer**(`options`): [`EngineServer`](EngineServer.md)
17
+ > **new EngineServer**\<`T`\>(`options`): [`EngineServer`](EngineServer.md)\<`T`\>
14
18
 
15
19
  Create a new instance of EngineServer.
16
20
 
@@ -20,17 +24,13 @@ Create a new instance of EngineServer.
20
24
 
21
25
  The options for the engine.
22
26
 
23
- • **options.engineCore**: `IEngineCore`\<`IEngineState`\>
27
+ • **options.engineCore**: `IEngineCore`\<`T`, `IEngineState`\>
24
28
 
25
29
  The engine core to serve from.
26
30
 
27
- • **options.server?**: `IEngineServerConfig`
28
-
29
- The server options for the engine.
30
-
31
31
  #### Returns
32
32
 
33
- [`EngineServer`](EngineServer.md)
33
+ [`EngineServer`](EngineServer.md)\<`T`\>
34
34
 
35
35
  ## Properties
36
36
 
@@ -40,19 +40,11 @@ The server options for the engine.
40
40
 
41
41
  Runtime name for the class.
42
42
 
43
- ***
44
-
45
- ### \_config
46
-
47
- > `protected` `readonly` **\_config**: `IEngineServerConfig`
48
-
49
- The server config.
50
-
51
43
  ## Methods
52
44
 
53
45
  ### addRestRouteGenerator()
54
46
 
55
- > **addRestRouteGenerator**(`type`, `typeConfig`, `generator`): `void`
47
+ > **addRestRouteGenerator**(`type`, `typeConfig`, `module`, `method`): `void`
56
48
 
57
49
  Add a REST route generator.
58
50
 
@@ -66,9 +58,13 @@ The type to add the generator for.
66
58
 
67
59
  The type config.
68
60
 
69
- • **generator**: `RestRouteGenerator`
61
+ • **module**: `string`
62
+
63
+ The module containing the generator.
70
64
 
71
- The generator to add.
65
+ **method**: `string`
66
+
67
+ The method to call on the module.
72
68
 
73
69
  #### Returns
74
70
 
@@ -82,7 +78,7 @@ The generator to add.
82
78
 
83
79
  ### addSocketRouteGenerator()
84
80
 
85
- > **addSocketRouteGenerator**(`type`, `typeConfig`, `generator`): `void`
81
+ > **addSocketRouteGenerator**(`type`, `typeConfig`, `module`, `method`): `void`
86
82
 
87
83
  Add a socket route generator.
88
84
 
@@ -96,9 +92,13 @@ The type to add the generator for.
96
92
 
97
93
  The type config.
98
94
 
99
- • **generator**: `SocketRouteGenerator`
95
+ • **module**: `string`
96
+
97
+ The module containing the generator.
98
+
99
+ • **method**: `string`
100
100
 
101
- The generator to add.
101
+ The method to call on the module.
102
102
 
103
103
  #### Returns
104
104
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/engine-server",
3
- "version": "0.0.1-next.13",
3
+ "version": "0.0.1-next.15",
4
4
  "description": "Engine implementation for a server.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,74 +14,14 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/api-auth-entity-storage-service": "next",
18
- "@twin.org/api-core": "next",
19
17
  "@twin.org/api-models": "next",
20
- "@twin.org/api-processors": "next",
21
18
  "@twin.org/api-server-fastify": "next",
22
- "@twin.org/api-service": "next",
23
- "@twin.org/attestation-connector-entity-storage": "next",
24
- "@twin.org/attestation-connector-iota": "next",
25
- "@twin.org/attestation-models": "next",
26
- "@twin.org/attestation-service": "next",
27
- "@twin.org/auditable-item-graph-models": "next",
28
- "@twin.org/auditable-item-graph-service": "next",
29
- "@twin.org/auditable-item-stream-models": "next",
30
- "@twin.org/auditable-item-stream-service": "next",
31
- "@twin.org/background-task-connector-entity-storage": "next",
32
- "@twin.org/background-task-models": "next",
33
- "@twin.org/blob-storage-connector-aws-s3": "next",
34
- "@twin.org/blob-storage-connector-azure": "next",
35
- "@twin.org/blob-storage-connector-file": "next",
36
- "@twin.org/blob-storage-connector-gcp": "next",
37
- "@twin.org/blob-storage-connector-ipfs": "next",
38
- "@twin.org/blob-storage-connector-memory": "next",
39
- "@twin.org/blob-storage-models": "next",
40
- "@twin.org/blob-storage-service": "next",
41
- "@twin.org/cli-core": "next",
42
19
  "@twin.org/core": "next",
43
- "@twin.org/crypto": "next",
44
- "@twin.org/data-core": "next",
45
- "@twin.org/data-schema-org": "next",
46
- "@twin.org/engine-core": "0.0.1-next.13",
47
- "@twin.org/engine-models": "0.0.1-next.13",
48
- "@twin.org/entity": "next",
49
- "@twin.org/entity-storage-connector-cosmosdb": "next",
50
- "@twin.org/entity-storage-connector-dynamodb": "next",
51
- "@twin.org/entity-storage-connector-file": "next",
52
- "@twin.org/entity-storage-connector-gcp-firestore": "next",
53
- "@twin.org/entity-storage-connector-memory": "next",
54
- "@twin.org/entity-storage-connector-scylladb": "next",
55
- "@twin.org/entity-storage-models": "next",
56
- "@twin.org/entity-storage-service": "next",
57
- "@twin.org/identity-connector-entity-storage": "next",
58
- "@twin.org/identity-connector-iota": "next",
59
- "@twin.org/identity-models": "next",
60
- "@twin.org/identity-service": "next",
61
- "@twin.org/immutable-proof-models": "next",
62
- "@twin.org/immutable-proof-service": "next",
63
- "@twin.org/immutable-storage-connector-entity-storage": "next",
64
- "@twin.org/immutable-storage-connector-iota": "next",
65
- "@twin.org/immutable-storage-models": "next",
66
- "@twin.org/logging-connector-console": "next",
67
- "@twin.org/logging-connector-entity-storage": "next",
68
- "@twin.org/logging-models": "next",
69
- "@twin.org/logging-service": "next",
70
- "@twin.org/nameof": "next",
71
- "@twin.org/nft-connector-entity-storage": "next",
72
- "@twin.org/nft-connector-iota": "next",
73
- "@twin.org/nft-models": "next",
74
- "@twin.org/nft-service": "next",
75
- "@twin.org/telemetry-connector-entity-storage": "next",
76
- "@twin.org/telemetry-models": "next",
77
- "@twin.org/telemetry-service": "next",
78
- "@twin.org/vault-connector-entity-storage": "next",
79
- "@twin.org/vault-connector-hashicorp": "next",
80
- "@twin.org/vault-models": "next",
81
- "@twin.org/wallet-connector-entity-storage": "next",
82
- "@twin.org/wallet-connector-iota": "next",
83
- "@twin.org/wallet-models": "next",
84
- "@twin.org/web": "next"
20
+ "@twin.org/engine-core": "0.0.1-next.15",
21
+ "@twin.org/engine-models": "0.0.1-next.15",
22
+ "@twin.org/engine-server-types": "0.0.1-next.15",
23
+ "@twin.org/modules": "next",
24
+ "@twin.org/nameof": "next"
85
25
  },
86
26
  "main": "./dist/cjs/index.cjs",
87
27
  "module": "./dist/esm/index.mjs",
@@ -1,11 +0,0 @@
1
- import { type IEngineCoreContext, type AuthenticationComponentConfig, type IEngineCore } from "@twin.org/engine-models";
2
- /**
3
- * Initialise the authentication.
4
- * @param engineCore The engine core.
5
- * @param context The context for the engine.
6
- * @param instanceConfig The instance config.
7
- * @param overrideInstanceType The instance type to override the default.
8
- * @returns The name of the instance created.
9
- * @throws GeneralError if the component type is unknown.
10
- */
11
- export declare function initialiseAuthenticationComponent(engineCore: IEngineCore, context: IEngineCoreContext, instanceConfig: AuthenticationComponentConfig, overrideInstanceType?: string): string | undefined;
@@ -1,11 +0,0 @@
1
- import { type IEngineCore, type IEngineCoreContext, type InformationComponentConfig } from "@twin.org/engine-models";
2
- /**
3
- * Initialise the information component.
4
- * @param engineCore The engine core.
5
- * @param context The context for the engine.
6
- * @param instanceConfig The instance config.
7
- * @param overrideInstanceType The instance type to override the default.
8
- * @returns The name of the instance created.
9
- * @throws GeneralError if the component type is unknown.
10
- */
11
- export declare function initialiseInformationComponent(engineCore: IEngineCore, context: IEngineCoreContext, instanceConfig: InformationComponentConfig, overrideInstanceType?: string): string | undefined;
@@ -1,11 +0,0 @@
1
- import { type IEngineCore, type IEngineCoreContext, type MimeTypeProcessorConfig } from "@twin.org/engine-models";
2
- /**
3
- * Initialise the mime type processor.
4
- * @param engineCore The engine core.
5
- * @param context The context for the engine.
6
- * @param instanceConfig The instance config.
7
- * @param overrideInstanceType The instance type to override the default.
8
- * @returns The name of the instance created.
9
- * @throws GeneralError if the component type is unknown.
10
- */
11
- export declare function initialiseMimeTypeProcessorComponent(engineCore: IEngineCore, context: IEngineCoreContext, instanceConfig: MimeTypeProcessorConfig, overrideInstanceType?: string): string | undefined;
@@ -1,11 +0,0 @@
1
- import { type IEngineCoreContext, type IEngineCore, type RestRouteProcessorConfig } from "@twin.org/engine-models";
2
- /**
3
- * Initialise the rest route processor.
4
- * @param engineCore The engine core.
5
- * @param context The context for the engine.
6
- * @param instanceConfig The instance config.
7
- * @param overrideInstanceType The instance type to override the default.
8
- * @returns The name of the instance created.
9
- * @throws GeneralError if the component type is unknown.
10
- */
11
- export declare function initialiseRestRouteProcessorComponent(engineCore: IEngineCore, context: IEngineCoreContext, instanceConfig: RestRouteProcessorConfig, overrideInstanceType?: string): string | undefined;
@@ -1,11 +0,0 @@
1
- import { type IEngineCoreContext, type IEngineCore, type SocketRouteProcessorConfig } from "@twin.org/engine-models";
2
- /**
3
- * Initialise the socket route processor.
4
- * @param engineCore The engine core.
5
- * @param context The context for the engine.
6
- * @param instanceConfig The instance config.
7
- * @param overrideInstanceType The instance type to override the default.
8
- * @returns The name of the instance created.
9
- * @throws GeneralError if the component type is unknown.
10
- */
11
- export declare function initialiseSocketRouteProcessorComponent(engineCore: IEngineCore, context: IEngineCoreContext, instanceConfig: SocketRouteProcessorConfig, overrideInstanceType?: string): string | undefined;