@twin.org/engine-server 0.0.2-next.4 → 0.0.2-next.6
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/cjs/index.cjs +17 -11
- package/dist/esm/index.mjs +17 -11
- package/docs/changelog.md +36 -0
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -190,8 +190,9 @@ class EngineServer {
|
|
|
190
190
|
const socketRouteProcessors = apiModels.SocketRouteProcessorFactory.names().map(n => apiModels.SocketRouteProcessorFactory.get(n));
|
|
191
191
|
const mimeTypeProcessors = apiModels.MimeTypeProcessorFactory.names().map(n => apiModels.MimeTypeProcessorFactory.get(n));
|
|
192
192
|
const coreConfig = this._engineCore.getConfig();
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
this._loggingComponentType = coreConfig.silent
|
|
194
|
+
? undefined
|
|
195
|
+
: this._engineCore.getRegisteredInstanceType("loggingComponent");
|
|
195
196
|
this._webServer = new apiServerFastify.FastifyWebServer({
|
|
196
197
|
loggingComponentType: this._loggingComponentType,
|
|
197
198
|
mimeTypeProcessors
|
|
@@ -233,12 +234,12 @@ class EngineServer {
|
|
|
233
234
|
*/
|
|
234
235
|
async initialiseRestTypeRoute(routes, typeKey, typeConfig, module, method) {
|
|
235
236
|
if (core.Is.arrayValue(typeConfig)) {
|
|
236
|
-
const defaultEngineTypes = this._engineCore.getDefaultTypes();
|
|
237
237
|
const generateRoutes = await modules.ModuleHelper.getModuleEntry(module, method);
|
|
238
238
|
for (let i = 0; i < typeConfig.length; i++) {
|
|
239
239
|
const restPath = typeConfig[i].restPath;
|
|
240
240
|
if (core.Is.string(restPath)) {
|
|
241
|
-
const serviceType = typeConfig[i].overrideInstanceType ??
|
|
241
|
+
const serviceType = typeConfig[i].overrideInstanceType ??
|
|
242
|
+
this._engineCore.getRegisteredInstanceType(typeKey);
|
|
242
243
|
if (core.Is.stringValue(serviceType)) {
|
|
243
244
|
const generatedRoutes = generateRoutes(restPath, serviceType);
|
|
244
245
|
for (const route of generatedRoutes) {
|
|
@@ -264,12 +265,12 @@ class EngineServer {
|
|
|
264
265
|
*/
|
|
265
266
|
async initialiseSocketTypeRoute(routes, typeKey, typeConfig, module, method) {
|
|
266
267
|
if (core.Is.arrayValue(typeConfig)) {
|
|
267
|
-
const defaultEngineTypes = this._engineCore.getDefaultTypes();
|
|
268
268
|
const generateRoutes = await modules.ModuleHelper.getModuleEntry(module, method);
|
|
269
269
|
for (let i = 0; i < typeConfig.length; i++) {
|
|
270
270
|
const socketPath = typeConfig[i].socketPath;
|
|
271
271
|
if (core.Is.string(socketPath)) {
|
|
272
|
-
const serviceType = typeConfig[i].overrideInstanceType ??
|
|
272
|
+
const serviceType = typeConfig[i].overrideInstanceType ??
|
|
273
|
+
this._engineCore.getRegisteredInstanceType(typeKey);
|
|
273
274
|
if (core.Is.stringValue(serviceType)) {
|
|
274
275
|
routes.push(...generateRoutes(socketPath, serviceType));
|
|
275
276
|
}
|
|
@@ -313,8 +314,9 @@ class EngineServer {
|
|
|
313
314
|
this.addRestRouteGenerator("entityStorageComponent", coreConfig.types.entityStorageComponent, "@twin.org/entity-storage-service", "generateRestRoutesEntityStorage");
|
|
314
315
|
this.addRestRouteGenerator("dataProcessingComponent", coreConfig.types.dataProcessingComponent, "@twin.org/data-processing-service", "generateRestRoutesDataProcessing");
|
|
315
316
|
this.addRestRouteGenerator("documentManagementComponent", coreConfig.types.documentManagementComponent, "@twin.org/document-management-service", "generateRestRoutesDocumentManagement");
|
|
316
|
-
this.addRestRouteGenerator("federatedCatalogueComponent", coreConfig.types.federatedCatalogueComponent, "@twin.org/federated-catalogue-service", "generateRestRoutesFederatedCatalogue");
|
|
317
317
|
this.addRestRouteGenerator("rightsManagementComponent", coreConfig.types.rightsManagementComponent, "@twin.org/rights-management-service", "generateRestRoutesRightsManagement");
|
|
318
|
+
this.addRestRouteGenerator("synchronisedStorageComponent", coreConfig.types.synchronisedStorageComponent, "@twin.org/synchronised-storage-service", "generateRestRoutesSynchronisedStorage");
|
|
319
|
+
this.addRestRouteGenerator("federatedCatalogueComponent", coreConfig.types.federatedCatalogueComponent, "@twin.org/federated-catalogue-service", "generateRestRoutesFederatedCatalogue");
|
|
318
320
|
}
|
|
319
321
|
/**
|
|
320
322
|
* Add the server socket route generators.
|
|
@@ -396,14 +398,18 @@ function addDefaultRestPaths(serverConfig) {
|
|
|
396
398
|
!core.Is.stringValue(serverConfig.types.documentManagementComponent[0].restPath)) {
|
|
397
399
|
serverConfig.types.documentManagementComponent[0].restPath = "/documents";
|
|
398
400
|
}
|
|
399
|
-
if (core.Is.arrayValue(serverConfig.types.federatedCatalogueComponent) &&
|
|
400
|
-
!core.Is.stringValue(serverConfig.types.federatedCatalogueComponent[0].restPath)) {
|
|
401
|
-
serverConfig.types.federatedCatalogueComponent[0].restPath = "/federated-catalogue";
|
|
402
|
-
}
|
|
403
401
|
if (core.Is.arrayValue(serverConfig.types.rightsManagementComponent) &&
|
|
404
402
|
!core.Is.stringValue(serverConfig.types.rightsManagementComponent[0].restPath)) {
|
|
405
403
|
serverConfig.types.rightsManagementComponent[0].restPath = "/rights-management";
|
|
406
404
|
}
|
|
405
|
+
if (core.Is.arrayValue(serverConfig.types.synchronisedStorageComponent) &&
|
|
406
|
+
!core.Is.stringValue(serverConfig.types.synchronisedStorageComponent[0].restPath)) {
|
|
407
|
+
serverConfig.types.synchronisedStorageComponent[0].restPath = "/synchronised-storage";
|
|
408
|
+
}
|
|
409
|
+
if (core.Is.arrayValue(serverConfig.types.federatedCatalogueComponent) &&
|
|
410
|
+
!core.Is.stringValue(serverConfig.types.federatedCatalogueComponent[0].restPath)) {
|
|
411
|
+
serverConfig.types.federatedCatalogueComponent[0].restPath = "/federated-catalogue";
|
|
412
|
+
}
|
|
407
413
|
}
|
|
408
414
|
/**
|
|
409
415
|
* Adds the socket paths to the server config.
|
package/dist/esm/index.mjs
CHANGED
|
@@ -188,8 +188,9 @@ class EngineServer {
|
|
|
188
188
|
const socketRouteProcessors = SocketRouteProcessorFactory.names().map(n => SocketRouteProcessorFactory.get(n));
|
|
189
189
|
const mimeTypeProcessors = MimeTypeProcessorFactory.names().map(n => MimeTypeProcessorFactory.get(n));
|
|
190
190
|
const coreConfig = this._engineCore.getConfig();
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
this._loggingComponentType = coreConfig.silent
|
|
192
|
+
? undefined
|
|
193
|
+
: this._engineCore.getRegisteredInstanceType("loggingComponent");
|
|
193
194
|
this._webServer = new FastifyWebServer({
|
|
194
195
|
loggingComponentType: this._loggingComponentType,
|
|
195
196
|
mimeTypeProcessors
|
|
@@ -231,12 +232,12 @@ class EngineServer {
|
|
|
231
232
|
*/
|
|
232
233
|
async initialiseRestTypeRoute(routes, typeKey, typeConfig, module, method) {
|
|
233
234
|
if (Is.arrayValue(typeConfig)) {
|
|
234
|
-
const defaultEngineTypes = this._engineCore.getDefaultTypes();
|
|
235
235
|
const generateRoutes = await ModuleHelper.getModuleEntry(module, method);
|
|
236
236
|
for (let i = 0; i < typeConfig.length; i++) {
|
|
237
237
|
const restPath = typeConfig[i].restPath;
|
|
238
238
|
if (Is.string(restPath)) {
|
|
239
|
-
const serviceType = typeConfig[i].overrideInstanceType ??
|
|
239
|
+
const serviceType = typeConfig[i].overrideInstanceType ??
|
|
240
|
+
this._engineCore.getRegisteredInstanceType(typeKey);
|
|
240
241
|
if (Is.stringValue(serviceType)) {
|
|
241
242
|
const generatedRoutes = generateRoutes(restPath, serviceType);
|
|
242
243
|
for (const route of generatedRoutes) {
|
|
@@ -262,12 +263,12 @@ class EngineServer {
|
|
|
262
263
|
*/
|
|
263
264
|
async initialiseSocketTypeRoute(routes, typeKey, typeConfig, module, method) {
|
|
264
265
|
if (Is.arrayValue(typeConfig)) {
|
|
265
|
-
const defaultEngineTypes = this._engineCore.getDefaultTypes();
|
|
266
266
|
const generateRoutes = await ModuleHelper.getModuleEntry(module, method);
|
|
267
267
|
for (let i = 0; i < typeConfig.length; i++) {
|
|
268
268
|
const socketPath = typeConfig[i].socketPath;
|
|
269
269
|
if (Is.string(socketPath)) {
|
|
270
|
-
const serviceType = typeConfig[i].overrideInstanceType ??
|
|
270
|
+
const serviceType = typeConfig[i].overrideInstanceType ??
|
|
271
|
+
this._engineCore.getRegisteredInstanceType(typeKey);
|
|
271
272
|
if (Is.stringValue(serviceType)) {
|
|
272
273
|
routes.push(...generateRoutes(socketPath, serviceType));
|
|
273
274
|
}
|
|
@@ -311,8 +312,9 @@ class EngineServer {
|
|
|
311
312
|
this.addRestRouteGenerator("entityStorageComponent", coreConfig.types.entityStorageComponent, "@twin.org/entity-storage-service", "generateRestRoutesEntityStorage");
|
|
312
313
|
this.addRestRouteGenerator("dataProcessingComponent", coreConfig.types.dataProcessingComponent, "@twin.org/data-processing-service", "generateRestRoutesDataProcessing");
|
|
313
314
|
this.addRestRouteGenerator("documentManagementComponent", coreConfig.types.documentManagementComponent, "@twin.org/document-management-service", "generateRestRoutesDocumentManagement");
|
|
314
|
-
this.addRestRouteGenerator("federatedCatalogueComponent", coreConfig.types.federatedCatalogueComponent, "@twin.org/federated-catalogue-service", "generateRestRoutesFederatedCatalogue");
|
|
315
315
|
this.addRestRouteGenerator("rightsManagementComponent", coreConfig.types.rightsManagementComponent, "@twin.org/rights-management-service", "generateRestRoutesRightsManagement");
|
|
316
|
+
this.addRestRouteGenerator("synchronisedStorageComponent", coreConfig.types.synchronisedStorageComponent, "@twin.org/synchronised-storage-service", "generateRestRoutesSynchronisedStorage");
|
|
317
|
+
this.addRestRouteGenerator("federatedCatalogueComponent", coreConfig.types.federatedCatalogueComponent, "@twin.org/federated-catalogue-service", "generateRestRoutesFederatedCatalogue");
|
|
316
318
|
}
|
|
317
319
|
/**
|
|
318
320
|
* Add the server socket route generators.
|
|
@@ -394,14 +396,18 @@ function addDefaultRestPaths(serverConfig) {
|
|
|
394
396
|
!Is.stringValue(serverConfig.types.documentManagementComponent[0].restPath)) {
|
|
395
397
|
serverConfig.types.documentManagementComponent[0].restPath = "/documents";
|
|
396
398
|
}
|
|
397
|
-
if (Is.arrayValue(serverConfig.types.federatedCatalogueComponent) &&
|
|
398
|
-
!Is.stringValue(serverConfig.types.federatedCatalogueComponent[0].restPath)) {
|
|
399
|
-
serverConfig.types.federatedCatalogueComponent[0].restPath = "/federated-catalogue";
|
|
400
|
-
}
|
|
401
399
|
if (Is.arrayValue(serverConfig.types.rightsManagementComponent) &&
|
|
402
400
|
!Is.stringValue(serverConfig.types.rightsManagementComponent[0].restPath)) {
|
|
403
401
|
serverConfig.types.rightsManagementComponent[0].restPath = "/rights-management";
|
|
404
402
|
}
|
|
403
|
+
if (Is.arrayValue(serverConfig.types.synchronisedStorageComponent) &&
|
|
404
|
+
!Is.stringValue(serverConfig.types.synchronisedStorageComponent[0].restPath)) {
|
|
405
|
+
serverConfig.types.synchronisedStorageComponent[0].restPath = "/synchronised-storage";
|
|
406
|
+
}
|
|
407
|
+
if (Is.arrayValue(serverConfig.types.federatedCatalogueComponent) &&
|
|
408
|
+
!Is.stringValue(serverConfig.types.federatedCatalogueComponent[0].restPath)) {
|
|
409
|
+
serverConfig.types.federatedCatalogueComponent[0].restPath = "/federated-catalogue";
|
|
410
|
+
}
|
|
405
411
|
}
|
|
406
412
|
/**
|
|
407
413
|
* Adds the socket paths to the server config.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @twin.org/engine-server - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.6](https://github.com/twinfoundation/engine/compare/engine-server-v0.0.2-next.5...engine-server-v0.0.2-next.6) (2025-08-21)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update framework core ([acc0f8d](https://github.com/twinfoundation/engine/commit/acc0f8d455a4b8ec47f1da643139fa0f07775fa6))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/engine-core bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
16
|
+
* @twin.org/engine-models bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
17
|
+
* @twin.org/engine-server-types bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
18
|
+
* devDependencies
|
|
19
|
+
* @twin.org/engine bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
20
|
+
|
|
21
|
+
## [0.0.2-next.5](https://github.com/twinfoundation/engine/compare/engine-server-v0.0.2-next.4...engine-server-v0.0.2-next.5) (2025-08-14)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* add synchronised storage support ([5142e34](https://github.com/twinfoundation/engine/commit/5142e3488f09195cf9f48a9c6c6d1014231a4c2c))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Dependencies
|
|
30
|
+
|
|
31
|
+
* The following workspace dependencies were updated
|
|
32
|
+
* dependencies
|
|
33
|
+
* @twin.org/engine-core bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
34
|
+
* @twin.org/engine-models bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
35
|
+
* @twin.org/engine-server-types bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
36
|
+
* devDependencies
|
|
37
|
+
* @twin.org/engine bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
38
|
+
|
|
3
39
|
## [0.0.2-next.4](https://github.com/twinfoundation/engine/compare/engine-server-v0.0.2-next.3...engine-server-v0.0.2-next.4) (2025-07-25)
|
|
4
40
|
|
|
5
41
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/engine-server",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.6",
|
|
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.2-next.
|
|
21
|
-
"@twin.org/engine-models": "0.0.2-next.
|
|
22
|
-
"@twin.org/engine-server-types": "0.0.2-next.
|
|
20
|
+
"@twin.org/engine-core": "0.0.2-next.6",
|
|
21
|
+
"@twin.org/engine-models": "0.0.2-next.6",
|
|
22
|
+
"@twin.org/engine-server-types": "0.0.2-next.6",
|
|
23
23
|
"@twin.org/modules": "next",
|
|
24
24
|
"@twin.org/nameof": "next"
|
|
25
25
|
},
|