pmcf 6.54.4 → 6.54.6

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 CHANGED
@@ -81,30 +81,30 @@ generates config packages for:
81
81
  * [domainNames](#domainnames)
82
82
  * [InitializationContext](#initializationcontext)
83
83
  * [Parameters](#parameters-14)
84
+ * [SkeletonNetworkInterface](#skeletonnetworkinterface)
85
+ * [networkAddresses](#networkaddresses)
86
+ * [Parameters](#parameters-15)
84
87
  * [Interface](#interface)
85
88
  * [zones](#zones)
86
89
  * [addressesStatement](#addressesstatement)
87
- * [Parameters](#parameters-15)
90
+ * [Parameters](#parameters-16)
88
91
  * [SystemdJournalRemoteService](#systemdjournalremoteservice)
89
92
  * [Properties](#properties)
90
93
  * [systemdConfigs](#systemdconfigs)
91
- * [Parameters](#parameters-16)
94
+ * [Parameters](#parameters-17)
92
95
  * [SystemdJournalUploadService](#systemdjournaluploadservice)
93
96
  * [Properties](#properties-1)
94
97
  * [systemdConfigs](#systemdconfigs-1)
95
- * [Parameters](#parameters-17)
98
+ * [Parameters](#parameters-18)
96
99
  * [NetworkAddress](#networkaddress)
97
- * [Parameters](#parameters-18)
100
+ * [Parameters](#parameters-19)
98
101
  * [subnet](#subnet)
99
102
  * [networkInterface](#networkinterface)
100
103
  * [address](#address)
101
104
  * [addresses](#addresses)
102
- * [Parameters](#parameters-19)
103
- * [cidrAddresses](#cidraddresses)
104
105
  * [Parameters](#parameters-20)
105
- * [SkeletonNetworkInterface](#skeletonnetworkinterface)
106
- * [networkAddresses](#networkaddresses)
107
- * [Parameters](#parameters-21)
106
+ * [cidrAddresses](#cidraddresses)
107
+ * [Parameters](#parameters-21)
108
108
  * [families](#families)
109
109
  * [secretName](#secretname)
110
110
  * [directHosts](#directhosts)
@@ -308,6 +308,18 @@ Keeps track of all in flight object creations and loose ends during config initi
308
308
 
309
309
  * `directory` (optional, default `"/"`)
310
310
 
311
+ ## SkeletonNetworkInterface
312
+
313
+ **Extends Interface**
314
+
315
+ ### networkAddresses
316
+
317
+ #### Parameters
318
+
319
+ * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
320
+
321
+ Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
322
+
311
323
  ## Interface
312
324
 
313
325
  **Extends ServiceOwner**
@@ -390,7 +402,6 @@ Type: ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Glob
390
402
  * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
391
403
 
392
404
  * `options.aggregate` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
393
- * `options.filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
394
405
 
395
406
  Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** addresses
396
407
 
@@ -402,18 +413,6 @@ Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Re
402
413
 
403
414
  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)>**&#x20;
404
415
 
405
- ## SkeletonNetworkInterface
406
-
407
- **Extends Interface**
408
-
409
- ### networkAddresses
410
-
411
- #### Parameters
412
-
413
- * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
414
-
415
- Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
416
-
417
416
  ## families
418
417
 
419
418
  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)>**&#x20;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.54.4",
3
+ "version": "6.54.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -18,9 +18,9 @@ import {
18
18
  Endpoint,
19
19
  DomainNameEndpoint,
20
20
  HTTPEndpoint,
21
- unix_endpoint,
22
- addType
21
+ unix_endpoint
23
22
  } from "pmcf";
23
+ import { addType } from "./type.mjs";
24
24
  import { FAMILY_UNIX, FAMILY_DNS } from "./constants.mjs";
25
25
  import {
26
26
  networkAddressAttributes,
@@ -116,8 +116,7 @@ export class CoreService extends base {
116
116
  return this.host?.domainName;
117
117
  }
118
118
 
119
- networkAddresses(filter)
120
- {
119
+ networkAddresses(filter) {
121
120
  return this.owner.networkAddresses(filter);
122
121
  }
123
122
 
@@ -169,7 +168,7 @@ export class CoreService extends base {
169
168
  ) {
170
169
  continue;
171
170
  }
172
-
171
+
173
172
  if (e.pathname) {
174
173
  result.push(new HTTPEndpoint(this, na, options));
175
174
  } else {
@@ -406,7 +405,7 @@ export function serviceEndpoints(sources, options = {}) {
406
405
  return options.join ? res.join(options.join) : res;
407
406
  }
408
407
 
409
- export function endpoints(entries,filter) {
408
+ export function endpoints(entries, filter) {
410
409
  return asArray(entries)
411
410
  .map(e => e.endpoints(filter))
412
411
  .flat();
@@ -1,4 +1,10 @@
1
- import { default_attribute, type_attribute, getAttribute, asArray } from "pacc";
1
+ import {
2
+ default_attribute,
3
+ type_attribute,
4
+ getAttribute,
5
+ asArray,
6
+ leafValues
7
+ } from "pacc";
2
8
  import { familyIP, formatCIDR, decodeIP, addressType } from "ip-utilties";
3
9
  import { Subnet } from "./subnet.mjs";
4
10
  import { owner } from "./owner.mjs";
@@ -10,6 +16,7 @@ import {
10
16
  address_attribute,
11
17
  cidr_address_attribute
12
18
  } from "./common-attributes.mjs";
19
+
13
20
  /**
14
21
  *
15
22
  */
@@ -96,31 +103,30 @@ export class NetworkAddress {
96
103
  * @param {Iterable<owner|string>} sources
97
104
  * @param {Object} options
98
105
  * @param {boolean} options.aggregate
99
- * @param {Object} options.filter
100
106
  * @returns {Iterable<string>} addresses
101
107
  */
102
108
  export function addresses(sources, options) {
103
109
  return [
104
- ...new Set(
105
- asArray(sources)
106
- .map(s => {
107
- if (typeof s === "string") {
108
- return s;
110
+ ...[...leafValues(sources)].reduce((all, source) => {
111
+ if (typeof source === "string") {
112
+ all.add(source);
113
+ } else {
114
+ if (source.subnets?.size && options?.aggregate) {
115
+ for (const address of source.subnets.keys()) {
116
+ all.add(address);
109
117
  }
110
- if (options?.aggregate && s instanceof owner && s.subnets.size > 0) {
111
- return [...s.subnets.keys()];
118
+ } else if (source.networkAddresses) {
119
+ for (const na of source.networkAddresses()) {
120
+ all.add(decodeIP(na.address));
112
121
  }
113
-
114
- return s.networkAddresses
115
- ? [...s.networkAddresses(options?.filter)]
116
- : s;
117
- })
118
- .flat()
119
- .map(object =>
120
- typeof object === "string" ? object : decodeIP(object.address)
121
- )
122
- )
123
- ].filter(e => e !== "");
122
+ } else {
123
+ all.add(decodeIP(source.address));
124
+ }
125
+ }
126
+
127
+ return all;
128
+ }, new Set())
129
+ ];
124
130
  }
125
131
 
126
132
  /**
@@ -799,7 +799,7 @@ export class bind extends CoreService {
799
799
  systemGroupName: "named",
800
800
  services: {
801
801
  "bind-statistics": {
802
- // extends: ["http"],
802
+ //extends: ["http"],
803
803
  endpoints: [
804
804
  {
805
805
  family: FAMILY_IPV4_IPV6,
@@ -811,7 +811,7 @@ export class bind extends CoreService {
811
811
  }
812
812
  ]
813
813
  },
814
- "bind-rndc": {
814
+ "bind-control": {
815
815
  endpoints: [
816
816
  {
817
817
  family: FAMILY_IPV4_IPV6,