pmcf 2.13.1 → 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.1",
3
+ "version": "2.14.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/host.mjs CHANGED
@@ -671,7 +671,7 @@ export class NetworkInterface extends Base {
671
671
  }
672
672
 
673
673
  get scope() {
674
- return this.extendedProperty("_scope") ?? this.network?.scope ?? "global";
674
+ return this.extendedProperty("_scope") ?? this.network?.scope ?? networkProperties.scope.default;
675
675
  }
676
676
 
677
677
  set hwaddr(value) {
@@ -687,7 +687,15 @@ export class NetworkInterface extends Base {
687
687
  }
688
688
 
689
689
  get metric() {
690
- return this.extendedProperty("_metric") ?? this.network?.metric ?? 1004;
690
+ return this.extendedProperty("_metric") ?? this.network?.metric ?? networkProperties.metric.default;
691
+ }
692
+
693
+ set MTU(value) {
694
+ this._MTU = value;
695
+ }
696
+
697
+ get MTU() {
698
+ return this.extendedProperty("_MTU") ?? networkProperties.MTU.default;
691
699
  }
692
700
 
693
701
  set class(value) {
@@ -3,7 +3,8 @@ export const networkProperties = {
3
3
  type: "string",
4
4
  collection: false,
5
5
  writeable: true,
6
- values: ["global", "site", "link", "host"]
6
+ values: ["global", "site", "link", "host"],
7
+ default: "global"
7
8
  },
8
9
  class: {
9
10
  type: "string",
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
  }
package/types/host.d.mts CHANGED
@@ -365,6 +365,7 @@ export class NetworkInterface extends Base {
365
365
  collection: boolean;
366
366
  writeable: boolean;
367
367
  values: string[];
368
+ default: string;
368
369
  };
369
370
  class: {
370
371
  type: string;
@@ -454,6 +455,9 @@ export class NetworkInterface extends Base {
454
455
  get hwaddr(): any;
455
456
  set metric(value: any);
456
457
  get metric(): any;
458
+ set MTU(value: any);
459
+ get MTU(): any;
460
+ _MTU: any;
457
461
  set class(value: any);
458
462
  get class(): any;
459
463
  set ssid(value: any);
@@ -1,9 +1,11 @@
1
1
  export namespace networkProperties {
2
2
  export namespace scope {
3
- let type: string;
4
- let collection: boolean;
5
- let writeable: boolean;
6
- let values: string[];
3
+ export let type: string;
4
+ export let collection: boolean;
5
+ export let writeable: boolean;
6
+ export let values: string[];
7
+ let _default: string;
8
+ export { _default as default };
7
9
  }
8
10
  export namespace _class {
9
11
  let type_1: string;
@@ -49,8 +51,8 @@ export namespace networkProperties {
49
51
  export { collection_5 as collection };
50
52
  let writeable_5: boolean;
51
53
  export { writeable_5 as writeable };
52
- let _default: number;
53
- export { _default as default };
54
+ let _default_1: number;
55
+ export { _default_1 as default };
54
56
  }
55
57
  export namespace MTU {
56
58
  let type_6: string;
@@ -59,8 +61,8 @@ export namespace networkProperties {
59
61
  export { collection_6 as collection };
60
62
  let writeable_6: boolean;
61
63
  export { writeable_6 as writeable };
62
- let _default_1: number;
63
- export { _default_1 as default };
64
+ let _default_2: number;
65
+ export { _default_2 as default };
64
66
  }
65
67
  export namespace gateway {
66
68
  let type_7: string;
@@ -77,8 +79,8 @@ export namespace networkProperties {
77
79
  export { collection_8 as collection };
78
80
  let writeable_8: boolean;
79
81
  export { writeable_8 as writeable };
80
- let _default_2: boolean;
81
- export { _default_2 as default };
82
+ let _default_3: boolean;
83
+ export { _default_3 as default };
82
84
  }
83
85
  }
84
86
  export namespace networkAddressProperties {
@@ -151,6 +151,7 @@ export class Network extends Owner {
151
151
  collection: boolean;
152
152
  writeable: boolean;
153
153
  values: string[];
154
+ default: string;
154
155
  };
155
156
  class: {
156
157
  type: string;
@@ -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";