@twin.org/engine-server 0.0.1-next.27 → 0.0.1-next.28
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 +24 -13
- package/dist/esm/index.mjs +24 -13
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -324,8 +324,7 @@ function buildEngineServerConfiguration(envVars, coreEngineConfig, serverInfo) {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
]
|
|
328
|
-
restRouteProcessor: []
|
|
327
|
+
]
|
|
329
328
|
}
|
|
330
329
|
};
|
|
331
330
|
serverConfig.types.restRouteProcessor ??= [];
|
|
@@ -398,6 +397,7 @@ function buildEngineServerConfiguration(envVars, coreEngineConfig, serverInfo) {
|
|
|
398
397
|
});
|
|
399
398
|
}
|
|
400
399
|
addRestPaths(coreEngineConfig, serverConfig);
|
|
400
|
+
addSocketPaths(coreEngineConfig);
|
|
401
401
|
return serverConfig;
|
|
402
402
|
}
|
|
403
403
|
/**
|
|
@@ -410,50 +410,61 @@ function addRestPaths(coreEngineConfig, serverConfig) {
|
|
|
410
410
|
serverConfig.types.informationComponent[0].restPath = "";
|
|
411
411
|
}
|
|
412
412
|
if (core.Is.arrayValue(serverConfig.types.authenticationComponent) &&
|
|
413
|
-
!core.Is.stringValue(serverConfig.types.authenticationComponent[0])) {
|
|
413
|
+
!core.Is.stringValue(serverConfig.types.authenticationComponent[0].restPath)) {
|
|
414
414
|
serverConfig.types.authenticationComponent[0].restPath = "authentication";
|
|
415
415
|
}
|
|
416
416
|
if (core.Is.arrayValue(coreEngineConfig.types.blobStorageComponent) &&
|
|
417
|
-
!core.Is.stringValue(coreEngineConfig.types.blobStorageComponent[0])) {
|
|
417
|
+
!core.Is.stringValue(coreEngineConfig.types.blobStorageComponent[0].restPath)) {
|
|
418
418
|
coreEngineConfig.types.blobStorageComponent[0].restPath = "blob";
|
|
419
419
|
}
|
|
420
420
|
if (core.Is.arrayValue(coreEngineConfig.types.loggingComponent) &&
|
|
421
|
-
!core.Is.stringValue(coreEngineConfig.types.loggingComponent[0])) {
|
|
421
|
+
!core.Is.stringValue(coreEngineConfig.types.loggingComponent[0].restPath)) {
|
|
422
422
|
coreEngineConfig.types.loggingComponent[0].restPath = "logging";
|
|
423
423
|
}
|
|
424
424
|
if (core.Is.arrayValue(coreEngineConfig.types.telemetryComponent) &&
|
|
425
|
-
!core.Is.stringValue(coreEngineConfig.types.telemetryComponent[0])) {
|
|
425
|
+
!core.Is.stringValue(coreEngineConfig.types.telemetryComponent[0].restPath)) {
|
|
426
426
|
coreEngineConfig.types.telemetryComponent[0].restPath = "telemetry";
|
|
427
427
|
}
|
|
428
428
|
if (core.Is.arrayValue(coreEngineConfig.types.identityComponent) &&
|
|
429
|
-
!core.Is.stringValue(coreEngineConfig.types.identityComponent[0])) {
|
|
429
|
+
!core.Is.stringValue(coreEngineConfig.types.identityComponent[0].restPath)) {
|
|
430
430
|
coreEngineConfig.types.identityComponent[0].restPath = "identity";
|
|
431
431
|
}
|
|
432
432
|
if (core.Is.arrayValue(coreEngineConfig.types.identityProfileComponent) &&
|
|
433
|
-
!core.Is.stringValue(coreEngineConfig.types.identityProfileComponent[0])) {
|
|
433
|
+
!core.Is.stringValue(coreEngineConfig.types.identityProfileComponent[0].restPath)) {
|
|
434
434
|
coreEngineConfig.types.identityProfileComponent[0].restPath = "identity/profile";
|
|
435
435
|
}
|
|
436
436
|
if (core.Is.arrayValue(coreEngineConfig.types.nftComponent) &&
|
|
437
|
-
!core.Is.stringValue(coreEngineConfig.types.nftComponent[0])) {
|
|
437
|
+
!core.Is.stringValue(coreEngineConfig.types.nftComponent[0].restPath)) {
|
|
438
438
|
coreEngineConfig.types.nftComponent[0].restPath = "nft";
|
|
439
439
|
}
|
|
440
440
|
if (core.Is.arrayValue(coreEngineConfig.types.immutableProofComponent) &&
|
|
441
|
-
!core.Is.stringValue(coreEngineConfig.types.immutableProofComponent[0])) {
|
|
441
|
+
!core.Is.stringValue(coreEngineConfig.types.immutableProofComponent[0].restPath)) {
|
|
442
442
|
coreEngineConfig.types.immutableProofComponent[0].restPath = "immutable-proof";
|
|
443
443
|
}
|
|
444
444
|
if (core.Is.arrayValue(coreEngineConfig.types.attestationComponent) &&
|
|
445
|
-
!core.Is.stringValue(coreEngineConfig.types.attestationComponent[0])) {
|
|
445
|
+
!core.Is.stringValue(coreEngineConfig.types.attestationComponent[0].restPath)) {
|
|
446
446
|
coreEngineConfig.types.attestationComponent[0].restPath = "attestation";
|
|
447
447
|
}
|
|
448
448
|
if (core.Is.arrayValue(coreEngineConfig.types.auditableItemGraphComponent) &&
|
|
449
|
-
!core.Is.stringValue(coreEngineConfig.types.auditableItemGraphComponent[0])) {
|
|
449
|
+
!core.Is.stringValue(coreEngineConfig.types.auditableItemGraphComponent[0].restPath)) {
|
|
450
450
|
coreEngineConfig.types.auditableItemGraphComponent[0].restPath = "aig";
|
|
451
451
|
}
|
|
452
452
|
if (core.Is.arrayValue(coreEngineConfig.types.auditableItemStreamComponent) &&
|
|
453
|
-
!core.Is.stringValue(coreEngineConfig.types.auditableItemStreamComponent[0])) {
|
|
453
|
+
!core.Is.stringValue(coreEngineConfig.types.auditableItemStreamComponent[0].restPath)) {
|
|
454
454
|
coreEngineConfig.types.auditableItemStreamComponent[0].restPath = "ais";
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
|
+
/**
|
|
458
|
+
* Adds the socket paths to the server config.
|
|
459
|
+
* @param coreEngineConfig The core engine config.
|
|
460
|
+
* @param serverConfig The server config.
|
|
461
|
+
*/
|
|
462
|
+
function addSocketPaths(coreEngineConfig, serverConfig) {
|
|
463
|
+
if (core.Is.arrayValue(coreEngineConfig.types.eventBusComponent) &&
|
|
464
|
+
!core.Is.stringValue(coreEngineConfig.types.eventBusComponent[0].socketPath)) {
|
|
465
|
+
coreEngineConfig.types.eventBusComponent[0].socketPath = "event-bus";
|
|
466
|
+
}
|
|
467
|
+
}
|
|
457
468
|
|
|
458
469
|
exports.EngineServer = EngineServer;
|
|
459
470
|
exports.buildEngineServerConfiguration = buildEngineServerConfiguration;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -322,8 +322,7 @@ function buildEngineServerConfiguration(envVars, coreEngineConfig, serverInfo) {
|
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
]
|
|
326
|
-
restRouteProcessor: []
|
|
325
|
+
]
|
|
327
326
|
}
|
|
328
327
|
};
|
|
329
328
|
serverConfig.types.restRouteProcessor ??= [];
|
|
@@ -396,6 +395,7 @@ function buildEngineServerConfiguration(envVars, coreEngineConfig, serverInfo) {
|
|
|
396
395
|
});
|
|
397
396
|
}
|
|
398
397
|
addRestPaths(coreEngineConfig, serverConfig);
|
|
398
|
+
addSocketPaths(coreEngineConfig);
|
|
399
399
|
return serverConfig;
|
|
400
400
|
}
|
|
401
401
|
/**
|
|
@@ -408,49 +408,60 @@ function addRestPaths(coreEngineConfig, serverConfig) {
|
|
|
408
408
|
serverConfig.types.informationComponent[0].restPath = "";
|
|
409
409
|
}
|
|
410
410
|
if (Is.arrayValue(serverConfig.types.authenticationComponent) &&
|
|
411
|
-
!Is.stringValue(serverConfig.types.authenticationComponent[0])) {
|
|
411
|
+
!Is.stringValue(serverConfig.types.authenticationComponent[0].restPath)) {
|
|
412
412
|
serverConfig.types.authenticationComponent[0].restPath = "authentication";
|
|
413
413
|
}
|
|
414
414
|
if (Is.arrayValue(coreEngineConfig.types.blobStorageComponent) &&
|
|
415
|
-
!Is.stringValue(coreEngineConfig.types.blobStorageComponent[0])) {
|
|
415
|
+
!Is.stringValue(coreEngineConfig.types.blobStorageComponent[0].restPath)) {
|
|
416
416
|
coreEngineConfig.types.blobStorageComponent[0].restPath = "blob";
|
|
417
417
|
}
|
|
418
418
|
if (Is.arrayValue(coreEngineConfig.types.loggingComponent) &&
|
|
419
|
-
!Is.stringValue(coreEngineConfig.types.loggingComponent[0])) {
|
|
419
|
+
!Is.stringValue(coreEngineConfig.types.loggingComponent[0].restPath)) {
|
|
420
420
|
coreEngineConfig.types.loggingComponent[0].restPath = "logging";
|
|
421
421
|
}
|
|
422
422
|
if (Is.arrayValue(coreEngineConfig.types.telemetryComponent) &&
|
|
423
|
-
!Is.stringValue(coreEngineConfig.types.telemetryComponent[0])) {
|
|
423
|
+
!Is.stringValue(coreEngineConfig.types.telemetryComponent[0].restPath)) {
|
|
424
424
|
coreEngineConfig.types.telemetryComponent[0].restPath = "telemetry";
|
|
425
425
|
}
|
|
426
426
|
if (Is.arrayValue(coreEngineConfig.types.identityComponent) &&
|
|
427
|
-
!Is.stringValue(coreEngineConfig.types.identityComponent[0])) {
|
|
427
|
+
!Is.stringValue(coreEngineConfig.types.identityComponent[0].restPath)) {
|
|
428
428
|
coreEngineConfig.types.identityComponent[0].restPath = "identity";
|
|
429
429
|
}
|
|
430
430
|
if (Is.arrayValue(coreEngineConfig.types.identityProfileComponent) &&
|
|
431
|
-
!Is.stringValue(coreEngineConfig.types.identityProfileComponent[0])) {
|
|
431
|
+
!Is.stringValue(coreEngineConfig.types.identityProfileComponent[0].restPath)) {
|
|
432
432
|
coreEngineConfig.types.identityProfileComponent[0].restPath = "identity/profile";
|
|
433
433
|
}
|
|
434
434
|
if (Is.arrayValue(coreEngineConfig.types.nftComponent) &&
|
|
435
|
-
!Is.stringValue(coreEngineConfig.types.nftComponent[0])) {
|
|
435
|
+
!Is.stringValue(coreEngineConfig.types.nftComponent[0].restPath)) {
|
|
436
436
|
coreEngineConfig.types.nftComponent[0].restPath = "nft";
|
|
437
437
|
}
|
|
438
438
|
if (Is.arrayValue(coreEngineConfig.types.immutableProofComponent) &&
|
|
439
|
-
!Is.stringValue(coreEngineConfig.types.immutableProofComponent[0])) {
|
|
439
|
+
!Is.stringValue(coreEngineConfig.types.immutableProofComponent[0].restPath)) {
|
|
440
440
|
coreEngineConfig.types.immutableProofComponent[0].restPath = "immutable-proof";
|
|
441
441
|
}
|
|
442
442
|
if (Is.arrayValue(coreEngineConfig.types.attestationComponent) &&
|
|
443
|
-
!Is.stringValue(coreEngineConfig.types.attestationComponent[0])) {
|
|
443
|
+
!Is.stringValue(coreEngineConfig.types.attestationComponent[0].restPath)) {
|
|
444
444
|
coreEngineConfig.types.attestationComponent[0].restPath = "attestation";
|
|
445
445
|
}
|
|
446
446
|
if (Is.arrayValue(coreEngineConfig.types.auditableItemGraphComponent) &&
|
|
447
|
-
!Is.stringValue(coreEngineConfig.types.auditableItemGraphComponent[0])) {
|
|
447
|
+
!Is.stringValue(coreEngineConfig.types.auditableItemGraphComponent[0].restPath)) {
|
|
448
448
|
coreEngineConfig.types.auditableItemGraphComponent[0].restPath = "aig";
|
|
449
449
|
}
|
|
450
450
|
if (Is.arrayValue(coreEngineConfig.types.auditableItemStreamComponent) &&
|
|
451
|
-
!Is.stringValue(coreEngineConfig.types.auditableItemStreamComponent[0])) {
|
|
451
|
+
!Is.stringValue(coreEngineConfig.types.auditableItemStreamComponent[0].restPath)) {
|
|
452
452
|
coreEngineConfig.types.auditableItemStreamComponent[0].restPath = "ais";
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
+
/**
|
|
456
|
+
* Adds the socket paths to the server config.
|
|
457
|
+
* @param coreEngineConfig The core engine config.
|
|
458
|
+
* @param serverConfig The server config.
|
|
459
|
+
*/
|
|
460
|
+
function addSocketPaths(coreEngineConfig, serverConfig) {
|
|
461
|
+
if (Is.arrayValue(coreEngineConfig.types.eventBusComponent) &&
|
|
462
|
+
!Is.stringValue(coreEngineConfig.types.eventBusComponent[0].socketPath)) {
|
|
463
|
+
coreEngineConfig.types.eventBusComponent[0].socketPath = "event-bus";
|
|
464
|
+
}
|
|
465
|
+
}
|
|
455
466
|
|
|
456
467
|
export { EngineServer, buildEngineServerConfiguration };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/engine-server",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.28",
|
|
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.
|
|
21
|
-
"@twin.org/engine-models": "0.0.1-next.
|
|
22
|
-
"@twin.org/engine-server-types": "0.0.1-next.
|
|
20
|
+
"@twin.org/engine-core": "0.0.1-next.28",
|
|
21
|
+
"@twin.org/engine-models": "0.0.1-next.28",
|
|
22
|
+
"@twin.org/engine-server-types": "0.0.1-next.28",
|
|
23
23
|
"@twin.org/modules": "next",
|
|
24
24
|
"@twin.org/nameof": "next"
|
|
25
25
|
},
|