@twin.org/engine-server 0.0.1-next.30 → 0.0.1-next.32

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.
@@ -291,9 +291,10 @@ class EngineServer {
291
291
  * @param envVars The environment variables.
292
292
  * @param coreEngineConfig The core engine config.
293
293
  * @param serverInfo The server information.
294
+ * @param openApiSpecPath The path to the open api spec.
294
295
  * @returns The the config for the core and the server.
295
296
  */
296
- function buildEngineServerConfiguration(envVars, coreEngineConfig, serverInfo) {
297
+ function buildEngineServerConfiguration(envVars, coreEngineConfig, serverInfo, openApiSpecPath) {
297
298
  envVars.authSigningKeyId ??= "auth-signing";
298
299
  const webServerOptions = {
299
300
  port: core.Coerce.number(envVars.port),
@@ -320,7 +321,8 @@ function buildEngineServerConfiguration(envVars, coreEngineConfig, serverInfo) {
320
321
  type: engineServerTypes.InformationComponentType.Service,
321
322
  options: {
322
323
  config: {
323
- serverInfo
324
+ serverInfo,
325
+ openApiSpecPath
324
326
  }
325
327
  }
326
328
  }
@@ -289,9 +289,10 @@ class EngineServer {
289
289
  * @param envVars The environment variables.
290
290
  * @param coreEngineConfig The core engine config.
291
291
  * @param serverInfo The server information.
292
+ * @param openApiSpecPath The path to the open api spec.
292
293
  * @returns The the config for the core and the server.
293
294
  */
294
- function buildEngineServerConfiguration(envVars, coreEngineConfig, serverInfo) {
295
+ function buildEngineServerConfiguration(envVars, coreEngineConfig, serverInfo, openApiSpecPath) {
295
296
  envVars.authSigningKeyId ??= "auth-signing";
296
297
  const webServerOptions = {
297
298
  port: Coerce.number(envVars.port),
@@ -318,7 +319,8 @@ function buildEngineServerConfiguration(envVars, coreEngineConfig, serverInfo) {
318
319
  type: InformationComponentType.Service,
319
320
  options: {
320
321
  config: {
321
- serverInfo
322
+ serverInfo,
323
+ openApiSpecPath
322
324
  }
323
325
  }
324
326
  }
@@ -7,6 +7,7 @@ import type { IEngineServerEnvironmentVariables } from "../models/IEngineServerE
7
7
  * @param envVars The environment variables.
8
8
  * @param coreEngineConfig The core engine config.
9
9
  * @param serverInfo The server information.
10
+ * @param openApiSpecPath The path to the open api spec.
10
11
  * @returns The the config for the core and the server.
11
12
  */
12
- export declare function buildEngineServerConfiguration(envVars: IEngineServerEnvironmentVariables, coreEngineConfig: IEngineCoreConfig, serverInfo: IServerInfo): IEngineServerConfig;
13
+ export declare function buildEngineServerConfiguration(envVars: IEngineServerEnvironmentVariables, coreEngineConfig: IEngineCoreConfig, serverInfo: IServerInfo, openApiSpecPath?: string): IEngineServerConfig;
@@ -20,11 +20,13 @@ Create a new instance of EngineServer.
20
20
 
21
21
  #### Parameters
22
22
 
23
- **options**
23
+ ##### options
24
24
 
25
25
  The options for the engine.
26
26
 
27
- **options.engineCore**: `IEngineCore`\<`T`, `IEngineState`\>
27
+ ###### engineCore
28
+
29
+ `IEngineCore`\<`T`\>
28
30
 
29
31
  The engine core to serve from.
30
32
 
@@ -50,19 +52,27 @@ Add a REST route generator.
50
52
 
51
53
  #### Parameters
52
54
 
53
- **type**: `string`
55
+ ##### type
56
+
57
+ `string`
54
58
 
55
59
  The type to add the generator for.
56
60
 
57
- **typeConfig**: `undefined` \| `IEngineCoreTypeConfig`[]
61
+ ##### typeConfig
58
62
 
59
63
  The type config.
60
64
 
61
- **module**: `string`
65
+ `undefined` | `IEngineCoreTypeConfig`[]
66
+
67
+ ##### module
68
+
69
+ `string`
62
70
 
63
71
  The module containing the generator.
64
72
 
65
- **method**: `string`
73
+ ##### method
74
+
75
+ `string`
66
76
 
67
77
  The method to call on the module.
68
78
 
@@ -84,19 +94,27 @@ Add a socket route generator.
84
94
 
85
95
  #### Parameters
86
96
 
87
- **type**: `string`
97
+ ##### type
98
+
99
+ `string`
88
100
 
89
101
  The type to add the generator for.
90
102
 
91
- **typeConfig**: `undefined` \| `IEngineCoreTypeConfig`[]
103
+ ##### typeConfig
92
104
 
93
105
  The type config.
94
106
 
95
- **module**: `string`
107
+ `undefined` | `IEngineCoreTypeConfig`[]
108
+
109
+ ##### module
110
+
111
+ `string`
96
112
 
97
113
  The module containing the generator.
98
114
 
99
- **method**: `string`
115
+ ##### method
116
+
117
+ `string`
100
118
 
101
119
  The method to call on the module.
102
120
 
@@ -1,23 +1,35 @@
1
1
  # Function: buildEngineServerConfiguration()
2
2
 
3
- > **buildEngineServerConfiguration**(`envVars`, `coreEngineConfig`, `serverInfo`): `IEngineServerConfig`
3
+ > **buildEngineServerConfiguration**(`envVars`, `coreEngineConfig`, `serverInfo`, `openApiSpecPath`?): `IEngineServerConfig`
4
4
 
5
5
  Handles the configuration of the server.
6
6
 
7
7
  ## Parameters
8
8
 
9
- **envVars**: [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md)
9
+ ### envVars
10
+
11
+ [`IEngineServerEnvironmentVariables`](../interfaces/IEngineServerEnvironmentVariables.md)
10
12
 
11
13
  The environment variables.
12
14
 
13
- **coreEngineConfig**: `IEngineCoreConfig`
15
+ ### coreEngineConfig
16
+
17
+ `IEngineCoreConfig`
14
18
 
15
19
  The core engine config.
16
20
 
17
- **serverInfo**: `IServerInfo`
21
+ ### serverInfo
22
+
23
+ `IServerInfo`
18
24
 
19
25
  The server information.
20
26
 
27
+ ### openApiSpecPath?
28
+
29
+ `string`
30
+
31
+ The path to the open api spec.
32
+
21
33
  ## Returns
22
34
 
23
35
  `IEngineServerConfig`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/engine-server",
3
- "version": "0.0.1-next.30",
3
+ "version": "0.0.1-next.32",
4
4
  "description": "Engine implementation for a server.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,9 +17,9 @@
17
17
  "@twin.org/api-models": "next",
18
18
  "@twin.org/api-server-fastify": "next",
19
19
  "@twin.org/core": "next",
20
- "@twin.org/engine-core": "0.0.1-next.30",
21
- "@twin.org/engine-models": "0.0.1-next.30",
22
- "@twin.org/engine-server-types": "0.0.1-next.30",
20
+ "@twin.org/engine-core": "0.0.1-next.32",
21
+ "@twin.org/engine-models": "0.0.1-next.32",
22
+ "@twin.org/engine-server-types": "0.0.1-next.32",
23
23
  "@twin.org/modules": "next",
24
24
  "@twin.org/nameof": "next"
25
25
  },