@thzero/library_server_service_grpc 0.13.18 → 0.13.19

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.
Files changed (2) hide show
  1. package/client.js +12 -10
  2. package/package.json +3 -3
package/client.js CHANGED
@@ -40,7 +40,7 @@ class BaseClientGrpcService extends Service {
40
40
  });
41
41
  }
42
42
 
43
- _credentials(correlationId, host) {
43
+ _credentials(correlationId) {
44
44
  return grpc.credentials.createInsecure();
45
45
  }
46
46
 
@@ -52,14 +52,16 @@ class BaseClientGrpcService extends Service {
52
52
  secure: false
53
53
  };
54
54
 
55
- if (opts.resource)
56
- host = this._hostFromResource(correlationId, host, opts.resource, opts);
57
- else if (!String.url(opts.url)) {
58
- host.url = opts.url;
59
- host.secure = opts.secure;
55
+ if (opts) {
56
+ if (opts.resource)
57
+ host = await this._hostFromResource(correlationId, host, opts.resource, opts);
58
+ else if (!String.url(opts.url)) {
59
+ host.url = opts.url;
60
+ host.secure = opts.secure;
61
+ }
60
62
  }
61
63
  else
62
- host = this._hostFromConfig(correlationId, key, opts);
64
+ host = await this._hostFromConfig(correlationId, host, key, opts);
63
65
 
64
66
  return host;
65
67
  }
@@ -70,19 +72,19 @@ class BaseClientGrpcService extends Service {
70
72
 
71
73
  const config = this._config.getBackend(key);
72
74
  this._enforceNotNull('BaseClientGrpcService', '_hostFromConfig', config, 'config', correlationId);
73
- this._enforceNotEmpty('BaseClientGrpcService', '_hostFromConfig', config.host, 'config.host', correlationId);
75
+ this._enforceNotEmpty('BaseClientGrpcService', '_hostFromConfig', config.url, 'config.url', correlationId);
74
76
 
75
77
  host.url = config.url;
76
78
 
77
79
  this._logger.debug('BaseServerGrpcService', '_host', 'config.discoverable', config.discoverable, correlationId);
78
80
  if (!(this._serviceDiscoveryResources && config.discoverable))
79
- return this.host;
81
+ return host;
80
82
 
81
83
  this._logger.debug('BaseServerGrpcService', '_host', 'config.discoverable.enabled', config.discoverable.enabled, correlationId);
82
84
  const enabled = config.discoverable.enabled === false ? false : true;
83
85
  this._logger.debug('BaseServerGrpcService', '_host', 'enabled', enabled, correlationId);
84
86
  if (!enabled)
85
- return this.host;
87
+ return host;
86
88
 
87
89
  host = this._hosts.get(key);
88
90
  if (host)
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@thzero/library_server_service_grpc",
3
- "version": "0.13.18",
3
+ "version": "0.13.19",
4
4
  "version_major": 0,
5
5
  "version_minor": 13,
6
- "version_patch": 18,
7
- "version_date": "09/26/2021",
6
+ "version_patch": 19,
7
+ "version_date": "10/02/2021",
8
8
  "description": "",
9
9
  "author": "thZero",
10
10
  "repository": {