@thzero/library_server 0.18.8 → 0.18.10

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.initialize(LibraryCommonUtility.correlationId(), await this._initServerDiscoveryOptsMdns(opts));
397
+ await this.mdnsDiscoveryServiceI.initializeDiscovery(await this._initServerDiscoveryOptsMdns(opts));
398
398
  }
399
399
 
400
400
  async _initServerDiscoveryOpts() {
@@ -432,16 +432,17 @@ class BootMain {
432
432
  if (!this.resourceDiscoveryServiceI)
433
433
  return;
434
434
 
435
- await this.resourceDiscoveryServiceI.initialize(LibraryCommonUtility.correlationId(), await this._initServerDiscoveryOptsResources(opts));
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
- console.log(service.key);
442
- if (service.dependency && service.dependency.instantiate) {
443
- console.log(`services.instantiate - ${service.key}`);
444
- await service.dependency.instantiate();
441
+ if (service.dependency && service.dependency.initialize) {
442
+ if (service.dependency.initialize.length === 0) {
443
+ console.log(`services.initialize - ${service.key}`);
444
+ await service.dependency.initialize();
445
+ }
445
446
  }
446
447
  }
447
448
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@thzero/library_server",
3
3
  "type": "module",
4
- "version": "0.18.8",
4
+ "version": "0.18.10",
5
5
  "version_major": 0,
6
6
  "version_minor": 18,
7
- "version_patch": 8,
8
- "version_date": "04/22/2024",
7
+ "version_patch": 10,
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 initialize(correlationId, opts) {
45
+ async initializeDiscovery(opts) {
46
46
  try {
47
- this._enforceNotEmpty('ResourceDiscoveryService', 'initialize', opts, 'opts', correlationId);
48
- this._enforceNotEmpty('ResourceDiscoveryService', 'initialize', opts.address, 'address', correlationId);
49
- this._enforceNotNull('ResourceDiscoveryService', 'initialize', opts.port, 'port', correlationId);
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._initialize(correlationId, opts);
51
+ return await this._initializeDiscovery(opts);
52
52
  }
53
53
  catch(err) {
54
- return this._error('ResourceDiscoveryService', 'initialize', null, err, null, null, correlationId);
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 _initialize(correlationId, opts) {
88
+ async _initializeDiscovery(opts) {
89
89
  throw new NotImplementedError();
90
90
  }
91
91