@twin.org/engine-server 0.0.1-next.25 → 0.0.1-next.26

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.
@@ -72,6 +72,27 @@ class EngineServer {
72
72
  }
73
73
  });
74
74
  }
75
+ if (!core.Is.arrayValue(coreConfig.types.socketRouteProcessor)) {
76
+ coreConfig.types.socketRouteProcessor = [];
77
+ if (!coreConfig.silent) {
78
+ coreConfig.types.socketRouteProcessor.push({
79
+ type: engineServerTypes.SocketRouteProcessorType.Logging,
80
+ options: {
81
+ config: {
82
+ includeBody: coreConfig.debug
83
+ }
84
+ }
85
+ });
86
+ }
87
+ coreConfig.types.socketRouteProcessor.push({
88
+ type: engineServerTypes.SocketRouteProcessorType.SocketRoute,
89
+ options: {
90
+ config: {
91
+ includeErrorStack: coreConfig.debug
92
+ }
93
+ }
94
+ });
95
+ }
75
96
  this.addServerTypeInitialisers();
76
97
  this.addServerRestRouteGenerators();
77
98
  this.addServerSocketRouteGenerators();
@@ -260,8 +281,8 @@ class EngineServer {
260
281
  * @internal
261
282
  */
262
283
  addServerSocketRouteGenerators() {
263
- // const coreConfig = this._engineCore.getConfig();
264
- // this.addSocketRouteGenerator("eventBusComponent", coreConfig.eventBusComponent, generateSocketRoutesEventBus);
284
+ const coreConfig = this._engineCore.getConfig();
285
+ this.addSocketRouteGenerator("eventBusComponent", coreConfig.types.eventBusComponent, "@twin.org/event-bus-service", "generateSocketRoutesEventBus");
265
286
  }
266
287
  }
267
288
 
@@ -1,7 +1,7 @@
1
1
  import { RestRouteProcessorFactory, SocketRouteProcessorFactory, MimeTypeProcessorFactory } from '@twin.org/api-models';
2
2
  import { FastifyWebServer } from '@twin.org/api-server-fastify';
3
3
  import { Guards, Is, Coerce } from '@twin.org/core';
4
- import { RestRouteProcessorType, InformationComponentType, SocketRouteProcessorType, AuthenticationComponentType } from '@twin.org/engine-server-types';
4
+ import { RestRouteProcessorType, SocketRouteProcessorType, InformationComponentType, AuthenticationComponentType } from '@twin.org/engine-server-types';
5
5
  import { ModuleHelper } from '@twin.org/modules';
6
6
 
7
7
  /**
@@ -70,6 +70,27 @@ class EngineServer {
70
70
  }
71
71
  });
72
72
  }
73
+ if (!Is.arrayValue(coreConfig.types.socketRouteProcessor)) {
74
+ coreConfig.types.socketRouteProcessor = [];
75
+ if (!coreConfig.silent) {
76
+ coreConfig.types.socketRouteProcessor.push({
77
+ type: SocketRouteProcessorType.Logging,
78
+ options: {
79
+ config: {
80
+ includeBody: coreConfig.debug
81
+ }
82
+ }
83
+ });
84
+ }
85
+ coreConfig.types.socketRouteProcessor.push({
86
+ type: SocketRouteProcessorType.SocketRoute,
87
+ options: {
88
+ config: {
89
+ includeErrorStack: coreConfig.debug
90
+ }
91
+ }
92
+ });
93
+ }
73
94
  this.addServerTypeInitialisers();
74
95
  this.addServerRestRouteGenerators();
75
96
  this.addServerSocketRouteGenerators();
@@ -258,8 +279,8 @@ class EngineServer {
258
279
  * @internal
259
280
  */
260
281
  addServerSocketRouteGenerators() {
261
- // const coreConfig = this._engineCore.getConfig();
262
- // this.addSocketRouteGenerator("eventBusComponent", coreConfig.eventBusComponent, generateSocketRoutesEventBus);
282
+ const coreConfig = this._engineCore.getConfig();
283
+ this.addSocketRouteGenerator("eventBusComponent", coreConfig.types.eventBusComponent, "@twin.org/event-bus-service", "generateSocketRoutesEventBus");
263
284
  }
264
285
  }
265
286
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/engine-server",
3
- "version": "0.0.1-next.25",
3
+ "version": "0.0.1-next.26",
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.25",
21
- "@twin.org/engine-models": "0.0.1-next.25",
22
- "@twin.org/engine-server-types": "0.0.1-next.25",
20
+ "@twin.org/engine-core": "0.0.1-next.26",
21
+ "@twin.org/engine-models": "0.0.1-next.26",
22
+ "@twin.org/engine-server-types": "0.0.1-next.26",
23
23
  "@twin.org/modules": "next",
24
24
  "@twin.org/nameof": "next"
25
25
  },