@thzero/library_server 0.18.8 → 0.18.9
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/boot/index.js
CHANGED
|
@@ -394,7 +394,7 @@ class BootMain {
|
|
|
394
394
|
if (!this.mdnsDiscoveryServiceI)
|
|
395
395
|
return;
|
|
396
396
|
|
|
397
|
-
await this.mdnsDiscoveryServiceI.
|
|
397
|
+
await this.mdnsDiscoveryServiceI.initializeDiscovery(await this._initServerDiscoveryOptsMdns(opts));
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
async _initServerDiscoveryOpts() {
|
|
@@ -432,16 +432,15 @@ class BootMain {
|
|
|
432
432
|
if (!this.resourceDiscoveryServiceI)
|
|
433
433
|
return;
|
|
434
434
|
|
|
435
|
-
await this.resourceDiscoveryServiceI.
|
|
435
|
+
await this.resourceDiscoveryServiceI.initializeDiscovery(await this._initServerDiscoveryOptsResources(opts));
|
|
436
436
|
}
|
|
437
437
|
|
|
438
438
|
async _initServerStart() {
|
|
439
439
|
for(const service of injector.getServices()) {
|
|
440
440
|
if (service.dependency) {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
await service.dependency.instantiate();
|
|
441
|
+
if (service.dependency && service.dependency.initialize) {
|
|
442
|
+
console.log(`services.initialize - ${service.key}`);
|
|
443
|
+
await service.dependency.initialize();
|
|
445
444
|
}
|
|
446
445
|
}
|
|
447
446
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thzero/library_server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.18.
|
|
4
|
+
"version": "0.18.9",
|
|
5
5
|
"version_major": 0,
|
|
6
6
|
"version_minor": 18,
|
|
7
|
-
"version_patch":
|
|
8
|
-
"version_date": "04/
|
|
7
|
+
"version_patch": 9,
|
|
8
|
+
"version_date": "04/23/2024",
|
|
9
9
|
"description": "An opinionated library of common functionality to bootstrap an API using either Fastify or Koa as the web server.",
|
|
10
10
|
"author": "thZero",
|
|
11
11
|
"license": "MIT",
|
|
@@ -42,16 +42,16 @@ class ResourcesDiscoveryService extends DiscoveryService {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// options { name, ttl, description }
|
|
45
|
-
async
|
|
45
|
+
async initializeDiscovery(opts) {
|
|
46
46
|
try {
|
|
47
|
-
this._enforceNotEmpty('ResourceDiscoveryService', '
|
|
48
|
-
this._enforceNotEmpty('ResourceDiscoveryService', '
|
|
49
|
-
this._enforceNotNull('ResourceDiscoveryService', '
|
|
47
|
+
this._enforceNotEmpty('ResourceDiscoveryService', 'initializeDiscovery', opts, 'opts', null);
|
|
48
|
+
this._enforceNotEmpty('ResourceDiscoveryService', 'initializeDiscovery', opts.address, 'address', null);
|
|
49
|
+
this._enforceNotNull('ResourceDiscoveryService', 'initializeDiscovery', opts.port, 'port', null);
|
|
50
50
|
|
|
51
|
-
return await this.
|
|
51
|
+
return await this._initializeDiscovery(opts);
|
|
52
52
|
}
|
|
53
53
|
catch(err) {
|
|
54
|
-
return this._error('ResourceDiscoveryService', '
|
|
54
|
+
return this._error('ResourceDiscoveryService', 'initializeDiscovery', null, err, null, null, null);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -85,7 +85,7 @@ class ResourcesDiscoveryService extends DiscoveryService {
|
|
|
85
85
|
throw new NotImplementedError();
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
async
|
|
88
|
+
async _initializeDiscovery(opts) {
|
|
89
89
|
throw new NotImplementedError();
|
|
90
90
|
}
|
|
91
91
|
|