pmcf 2.30.0 → 2.31.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 +11 -20
- package/package.json +1 -1
- package/src/base.mjs +1 -1
- package/src/host.mjs +6 -0
- package/src/network-interfaces/skeleton.mjs +5 -0
- package/src/services/dns.mjs +1 -1
- package/src/subnet.mjs +2 -2
- package/types/host.d.mts +1 -0
- package/types/network-interfaces/skeleton.d.mts +1 -0
package/README.md
CHANGED
|
@@ -20,14 +20,21 @@
|
|
|
20
20
|
|
|
21
21
|
### Table of Contents
|
|
22
22
|
|
|
23
|
-
* [
|
|
23
|
+
* [networkAddresses](#networkaddresses)
|
|
24
24
|
* [Parameters](#parameters)
|
|
25
|
-
|
|
25
|
+
* [NetworkAddress](#networkaddress)
|
|
26
|
+
* [Parameters](#parameters-1)
|
|
26
27
|
* [subnet](#subnet)
|
|
27
28
|
* [networkInterface](#networkinterface)
|
|
28
29
|
* [address](#address)
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
|
|
31
|
+
## networkAddresses
|
|
32
|
+
|
|
33
|
+
### Parameters
|
|
34
|
+
|
|
35
|
+
* `filter` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
|
|
36
|
+
|
|
37
|
+
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
31
38
|
|
|
32
39
|
## NetworkAddress
|
|
33
40
|
|
|
@@ -37,14 +44,6 @@
|
|
|
37
44
|
* `address`  
|
|
38
45
|
* `subnet`  
|
|
39
46
|
|
|
40
|
-
### Properties
|
|
41
|
-
|
|
42
|
-
* `networkInterface` **NetworkInterface** 
|
|
43
|
-
* `address` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [Uint16Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array))** 
|
|
44
|
-
* `family` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
45
|
-
* `subnet` **Subnet** 
|
|
46
|
-
* `domainNames` **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
47
|
-
|
|
48
47
|
### subnet
|
|
49
48
|
|
|
50
49
|
Type: Subnet
|
|
@@ -57,14 +56,6 @@ Type: NetworkInterface
|
|
|
57
56
|
|
|
58
57
|
Type: ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [Uint16Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array))
|
|
59
58
|
|
|
60
|
-
## networkAddresses
|
|
61
|
-
|
|
62
|
-
### Parameters
|
|
63
|
-
|
|
64
|
-
* `filter` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
|
|
65
|
-
|
|
66
|
-
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
67
|
-
|
|
68
59
|
# install
|
|
69
60
|
|
|
70
61
|
With [npm](http://npmjs.org) do:
|
package/package.json
CHANGED
package/src/base.mjs
CHANGED
package/src/host.mjs
CHANGED
|
@@ -447,6 +447,12 @@ export class Host extends Base {
|
|
|
447
447
|
return addresses(this.networkAddresses());
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
*subnets() {
|
|
451
|
+
for (const networkInterface of this.networkInterfaces.values()) {
|
|
452
|
+
yield* networkInterface.subnets;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
450
456
|
async publicKey(type = "ed25519") {
|
|
451
457
|
return readFile(join(this.directory, `ssh_host_${type}_key.pub`), "utf8");
|
|
452
458
|
}
|
package/src/services/dns.mjs
CHANGED
|
@@ -207,7 +207,7 @@ export class DNSService extends ExtraSourceService {
|
|
|
207
207
|
...DNS_SERVICE_FILTER,
|
|
208
208
|
priority: ">=10"
|
|
209
209
|
}).join(" "),
|
|
210
|
-
Domains: [...this.
|
|
210
|
+
Domains: [...this.localDomains].join(" "),
|
|
211
211
|
DNSSEC: "no",
|
|
212
212
|
MulticastDNS: this.network.multicastDNS ? "yes" : "no",
|
|
213
213
|
LLMNR: "no"
|
package/src/subnet.mjs
CHANGED
|
@@ -98,8 +98,8 @@ export const SUBNET_LOCALHOST_IPV6 = new Subnet(_owner, "::1/128");
|
|
|
98
98
|
export function subnets(sources) {
|
|
99
99
|
const all = new Set();
|
|
100
100
|
|
|
101
|
-
for (const
|
|
102
|
-
for (const subnet of
|
|
101
|
+
for (const source of sources) {
|
|
102
|
+
for (const subnet of source.subnets()) {
|
|
103
103
|
all.add(subnet);
|
|
104
104
|
}
|
|
105
105
|
}
|
package/types/host.d.mts
CHANGED
|
@@ -237,6 +237,7 @@ export class Host extends Base {
|
|
|
237
237
|
networkAddresses(filter: any): Generator<any, void, any>;
|
|
238
238
|
get address(): any;
|
|
239
239
|
get addresses(): any[];
|
|
240
|
+
subnets(): Generator<any, void, any>;
|
|
240
241
|
publicKey(type?: string): Promise<string>;
|
|
241
242
|
preparePackages(dir: any): AsyncGenerator<{
|
|
242
243
|
dir: any;
|