pmcf 6.18.2 → 6.19.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/README.md +20 -20
- package/package.json +1 -1
- package/src/network-address.mjs +26 -14
- package/src/network-interfaces/network-interface.mjs +9 -2
package/README.md
CHANGED
|
@@ -78,27 +78,27 @@ generates config packages for:
|
|
|
78
78
|
* [domainNames](#domainnames)
|
|
79
79
|
* [InitializationContext](#initializationcontext)
|
|
80
80
|
* [Parameters](#parameters-14)
|
|
81
|
+
* [SkeletonNetworkInterface](#skeletonnetworkinterface)
|
|
82
|
+
* [networkAddresses](#networkaddresses)
|
|
83
|
+
* [Parameters](#parameters-15)
|
|
81
84
|
* [type](#type)
|
|
82
85
|
* [SystemdJournalRemoteService](#systemdjournalremoteservice)
|
|
83
86
|
* [Properties](#properties)
|
|
84
87
|
* [systemdConfigs](#systemdconfigs)
|
|
85
|
-
* [Parameters](#parameters-
|
|
88
|
+
* [Parameters](#parameters-16)
|
|
86
89
|
* [SystemdJournalUploadService](#systemdjournaluploadservice)
|
|
87
90
|
* [Properties](#properties-1)
|
|
88
91
|
* [systemdConfigs](#systemdconfigs-1)
|
|
89
|
-
* [Parameters](#parameters-
|
|
92
|
+
* [Parameters](#parameters-17)
|
|
90
93
|
* [NetworkAddress](#networkaddress)
|
|
91
|
-
* [Parameters](#parameters-
|
|
94
|
+
* [Parameters](#parameters-18)
|
|
92
95
|
* [subnet](#subnet)
|
|
93
96
|
* [networkInterface](#networkinterface)
|
|
94
97
|
* [address](#address)
|
|
95
98
|
* [addresses](#addresses)
|
|
96
|
-
* [Parameters](#parameters-18)
|
|
97
|
-
* [cidrAddresses](#cidraddresses)
|
|
98
99
|
* [Parameters](#parameters-19)
|
|
99
|
-
* [
|
|
100
|
-
* [
|
|
101
|
-
* [Parameters](#parameters-20)
|
|
100
|
+
* [cidrAddresses](#cidraddresses)
|
|
101
|
+
* [Parameters](#parameters-20)
|
|
102
102
|
* [families](#families)
|
|
103
103
|
* [secretName](#secretname)
|
|
104
104
|
* [directHosts](#directhosts)
|
|
@@ -293,6 +293,18 @@ Keeps track of all in flight object creations and loose ends during config initi
|
|
|
293
293
|
|
|
294
294
|
* `directory` (optional, default `"/"`)
|
|
295
295
|
|
|
296
|
+
## SkeletonNetworkInterface
|
|
297
|
+
|
|
298
|
+
**Extends ServiceOwner**
|
|
299
|
+
|
|
300
|
+
### networkAddresses
|
|
301
|
+
|
|
302
|
+
#### Parameters
|
|
303
|
+
|
|
304
|
+
* `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
|
|
305
|
+
|
|
306
|
+
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
307
|
+
|
|
296
308
|
## type
|
|
297
309
|
|
|
298
310
|
Type of the group.
|
|
@@ -374,18 +386,6 @@ Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Re
|
|
|
374
386
|
|
|
375
387
|
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
376
388
|
|
|
377
|
-
## SkeletonNetworkInterface
|
|
378
|
-
|
|
379
|
-
**Extends ServiceOwner**
|
|
380
|
-
|
|
381
|
-
### networkAddresses
|
|
382
|
-
|
|
383
|
-
#### Parameters
|
|
384
|
-
|
|
385
|
-
* `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
|
|
386
|
-
|
|
387
|
-
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
388
|
-
|
|
389
389
|
## families
|
|
390
390
|
|
|
391
391
|
Returns **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
package/package.json
CHANGED
package/src/network-address.mjs
CHANGED
|
@@ -14,20 +14,20 @@ import { NetworkInterface } from "./network-interfaces/network-interface.mjs";
|
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
16
|
export class NetworkAddress {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
static name = "network-address";
|
|
18
|
+
static priority = 1;
|
|
19
|
+
static key = "address";
|
|
20
|
+
static attributes = {
|
|
21
|
+
address: { ...name_attribute, name: "address" },
|
|
22
|
+
cidrAddress: { ...string_attribute, name: "cidrAddress" },
|
|
23
|
+
networkInterface: {
|
|
24
|
+
...default_attribute,
|
|
25
|
+
name: "networkInterface",
|
|
26
|
+
type: "network_interface"
|
|
27
|
+
},
|
|
28
|
+
family: { ...string_attribute, name: "family" }
|
|
29
|
+
};
|
|
30
|
+
|
|
31
31
|
static {
|
|
32
32
|
addType(this);
|
|
33
33
|
}
|
|
@@ -48,10 +48,18 @@ export class NetworkAddress {
|
|
|
48
48
|
this.subnet = subnet;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
get host() {
|
|
52
|
+
return this.networkInterface.host;
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
get domainNames() {
|
|
52
56
|
return this.networkInterface.domainNames;
|
|
53
57
|
}
|
|
54
58
|
|
|
59
|
+
get domains() {
|
|
60
|
+
return this.networkInterface.domains;
|
|
61
|
+
}
|
|
62
|
+
|
|
55
63
|
get family() {
|
|
56
64
|
return familyIP(this.address);
|
|
57
65
|
}
|
|
@@ -60,6 +68,10 @@ export class NetworkAddress {
|
|
|
60
68
|
return formatCIDR(this.address, this.subnet.prefixLength);
|
|
61
69
|
}
|
|
62
70
|
|
|
71
|
+
get fullName() {
|
|
72
|
+
return `${this.networkInterface.fullName}/${decodeIP(this.address)}`;
|
|
73
|
+
}
|
|
74
|
+
|
|
63
75
|
toString() {
|
|
64
76
|
return `${this.networkInterface.fullName} ${decodeIP(this.address)}`;
|
|
65
77
|
}
|
|
@@ -107,10 +107,17 @@ export class NetworkInterface extends SkeletonNetworkInterface {
|
|
|
107
107
|
set hostName(value) {
|
|
108
108
|
this._hostName = value;
|
|
109
109
|
}
|
|
110
|
+
|
|
111
|
+
get domains() {
|
|
112
|
+
if (!this.host) {
|
|
113
|
+
return new Set();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return this.host.localDomains;
|
|
117
|
+
}
|
|
110
118
|
|
|
111
119
|
get domainNames() {
|
|
112
|
-
if(!this.host) {
|
|
113
|
-
//console.log("NO HOST",this.fullName);
|
|
120
|
+
if (!this.host) {
|
|
114
121
|
return new Set();
|
|
115
122
|
}
|
|
116
123
|
return this.hostName
|