pmcf 6.7.5 → 6.8.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/bin/pmcf-info CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { extendingAttributeIterator } from "pacc";
2
3
  import { prepare } from "../src/cli.mjs";
3
4
 
4
5
  const { root, args, options } = await prepare({});
@@ -15,7 +16,14 @@ function show(value) {
15
16
  show(v);
16
17
  }
17
18
  } else {
18
- console.log(`${value.fullName}:`);
19
+ console.log(`${value.fullName}(${value.constructor.name}):`);
20
+
21
+ for (const [path, attribute] of extendingAttributeIterator(
22
+ value,
23
+ attribute => !attribute.private
24
+ )) {
25
+ console.log(path);
26
+ }
19
27
  ex(value);
20
28
  }
21
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.7.5",
3
+ "version": "6.8.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -101,7 +101,7 @@ export class NetworkInterface extends SkeletonNetworkInterface {
101
101
  }
102
102
 
103
103
  get hostName() {
104
- return this.attribute("_hostName") ?? this.host.hostName;
104
+ return this.attribute("_hostName") ?? this.host?.hostName;
105
105
  }
106
106
 
107
107
  set hostName(value) {
@@ -143,9 +143,13 @@ export class kea extends CoreService {
143
143
 
144
144
  const network = this.network;
145
145
  const host = this.host;
146
+
147
+ const source = host.owner;
146
148
  const name = host.name;
147
149
 
148
- const dnsServerEndpoints = serviceEndpoints(network, {
150
+ //console.log(source.fullName, [...source.hosts.keys()]);
151
+
152
+ const dnsServerEndpoints = serviceEndpoints(source, {
149
153
  services: "services[types[dns] && priority>=300]",
150
154
  endpoints: endpoint => endpoint.networkInterface?.kind !== "loopback"
151
155
  });
@@ -156,7 +160,7 @@ export class kea extends CoreService {
156
160
 
157
161
  const peers = async family =>
158
162
  Array.from(
159
- network.expression(
163
+ source.expression(
160
164
  `services[types[kea] && priority>=${Math.min(this.priority, 100)}]`
161
165
  )
162
166
  )
@@ -350,7 +354,7 @@ export class kea extends CoreService {
350
354
  const hwmap = new Map();
351
355
  const hostNames = new Set();
352
356
 
353
- for await (const { networkInterface } of network.networkAddresses()) {
357
+ for await (const { networkInterface } of source.networkAddresses()) {
354
358
  if (networkInterface.hwaddr) {
355
359
  if (!hostNames.has(networkInterface.hostName)) {
356
360
  hwmap.set(networkInterface.hwaddr, networkInterface);
@@ -379,7 +383,7 @@ export class kea extends CoreService {
379
383
  "client-classes": ["SKIP_DDNS"]
380
384
  };
381
385
  })
382
- .sort((a, b) => a.hostname.localeCompare(b.hostname));
386
+ .sort((a, b) => a.hostname?.localeCompare(b.hostname));
383
387
 
384
388
  const listenInterfaces = family =>
385
389
  this.endpoints(