pmcf 2.13.2 → 2.14.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.13.2",
3
+ "version": "2.14.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/service.mjs CHANGED
@@ -166,19 +166,28 @@ export class Service extends Base {
166
166
  }
167
167
 
168
168
  get endpoints() {
169
+ const nis = [...this.server.networkInterfaces.values()];
170
+
169
171
  if (!ServiceTypes[this.type]) {
170
- return [
171
- new Endpoint(this, {
172
- rawAddress: this.rawAddress,
173
- port: this._port,
174
- tls: false
175
- })
176
- ];
172
+ return nis.map(
173
+ networkInterface =>
174
+ new Endpoint(this, networkInterface, {
175
+ rawAddress: this.rawAddress,
176
+ port: this._port,
177
+ tls: false
178
+ })
179
+ );
177
180
  }
178
181
 
179
- return ServiceTypes[this.type].endpoints.map(
180
- e => new Endpoint(this, { rawAddress: this.rawAddress, ...e })
181
- );
182
+ return nis.map(networkInterface =>
183
+ ServiceTypes[this.type].endpoints.map(
184
+ e =>
185
+ new Endpoint(this, networkInterface, {
186
+ rawAddress: this.rawAddress,
187
+ ...e
188
+ })
189
+ )
190
+ ).flat();
182
191
  }
183
192
 
184
193
  set alias(value) {
@@ -286,8 +295,9 @@ export class Service extends Base {
286
295
  }
287
296
 
288
297
  export class Endpoint {
289
- constructor(service, data) {
298
+ constructor(service, networkInterface, data) {
290
299
  this.service = service;
300
+ this.networkInterface = networkInterface;
291
301
  Object.assign(this, data);
292
302
  }
293
303
  }
@@ -267,7 +267,7 @@ export class Service extends Base {
267
267
  set ipAddresses(value: any);
268
268
  get addresses(): any;
269
269
  get networks(): any;
270
- get endpoints(): any;
270
+ get endpoints(): any[];
271
271
  set alias(value: any);
272
272
  get alias(): any;
273
273
  set port(value: any);
@@ -285,8 +285,9 @@ export class Service extends Base {
285
285
  }[];
286
286
  }
287
287
  export class Endpoint {
288
- constructor(service: any, data: any);
288
+ constructor(service: any, networkInterface: any, data: any);
289
289
  service: any;
290
+ networkInterface: any;
290
291
  }
291
292
  export function sortByPriority(a: any, b: any): number;
292
293
  import { Base } from "./base.mjs";