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 +1 -1
- package/src/host.mjs +10 -2
- package/src/network-support.mjs +2 -1
- package/src/service.mjs +21 -11
- package/types/host.d.mts +4 -0
- package/types/network-support.d.mts +12 -10
- package/types/network.d.mts +1 -0
- package/types/service.d.mts +3 -2
package/package.json
CHANGED
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 ??
|
|
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 ??
|
|
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) {
|
package/src/network-support.mjs
CHANGED
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
|
180
|
-
|
|
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
|
|
53
|
-
export {
|
|
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
|
|
63
|
-
export {
|
|
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
|
|
81
|
-
export {
|
|
82
|
+
let _default_3: boolean;
|
|
83
|
+
export { _default_3 as default };
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
86
|
export namespace networkAddressProperties {
|
package/types/network.d.mts
CHANGED
package/types/service.d.mts
CHANGED
|
@@ -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";
|