pmcf 6.23.0 → 6.24.1

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
@@ -62,6 +62,7 @@ generates config packages for:
62
62
  * [Parameters](#parameters-8)
63
63
  * [templateContent](#templatecontent)
64
64
  * [Parameters](#parameters-9)
65
+ * [enabled](#enabled)
65
66
  * [isTemplate](#istemplate)
66
67
  * [expand](#expand)
67
68
  * [Parameters](#parameters-10)
@@ -78,30 +79,30 @@ generates config packages for:
78
79
  * [domainNames](#domainnames)
79
80
  * [InitializationContext](#initializationcontext)
80
81
  * [Parameters](#parameters-14)
82
+ * [SkeletonNetworkInterface](#skeletonnetworkinterface)
83
+ * [networkAddresses](#networkaddresses)
84
+ * [Parameters](#parameters-15)
81
85
  * [zones](#zones)
82
86
  * [type](#type)
83
87
  * [addressesStatement](#addressesstatement)
84
- * [Parameters](#parameters-15)
88
+ * [Parameters](#parameters-16)
85
89
  * [SystemdJournalRemoteService](#systemdjournalremoteservice)
86
90
  * [Properties](#properties)
87
91
  * [systemdConfigs](#systemdconfigs)
88
- * [Parameters](#parameters-16)
92
+ * [Parameters](#parameters-17)
89
93
  * [SystemdJournalUploadService](#systemdjournaluploadservice)
90
94
  * [Properties](#properties-1)
91
95
  * [systemdConfigs](#systemdconfigs-1)
92
- * [Parameters](#parameters-17)
96
+ * [Parameters](#parameters-18)
93
97
  * [NetworkAddress](#networkaddress)
94
- * [Parameters](#parameters-18)
98
+ * [Parameters](#parameters-19)
95
99
  * [subnet](#subnet)
96
100
  * [networkInterface](#networkinterface)
97
101
  * [address](#address)
98
102
  * [addresses](#addresses)
99
- * [Parameters](#parameters-19)
100
- * [cidrAddresses](#cidraddresses)
101
103
  * [Parameters](#parameters-20)
102
- * [SkeletonNetworkInterface](#skeletonnetworkinterface)
103
- * [networkAddresses](#networkaddresses)
104
- * [Parameters](#parameters-21)
104
+ * [cidrAddresses](#cidraddresses)
105
+ * [Parameters](#parameters-21)
105
106
  * [families](#families)
106
107
  * [secretName](#secretname)
107
108
  * [directHosts](#directhosts)
@@ -218,6 +219,10 @@ Returns **any** 
218
219
 
219
220
  Returns **AsyncIterable\<ContentProvider>**&#x20;
220
221
 
222
+ ### enabled
223
+
224
+ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
225
+
221
226
  ### isTemplate
222
227
 
223
228
  Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
@@ -296,6 +301,18 @@ Keeps track of all in flight object creations and loose ends during config initi
296
301
 
297
302
  * `directory` (optional, default `"/"`)
298
303
 
304
+ ## SkeletonNetworkInterface
305
+
306
+ **Extends ServiceOwner**
307
+
308
+ ### networkAddresses
309
+
310
+ #### Parameters
311
+
312
+ * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
313
+
314
+ Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
315
+
299
316
  ## zones
300
317
 
301
318
  Type: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<bind\_zone>
@@ -392,18 +409,6 @@ Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Re
392
409
 
393
410
  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;
394
411
 
395
- ## SkeletonNetworkInterface
396
-
397
- **Extends ServiceOwner**
398
-
399
- ### networkAddresses
400
-
401
- #### Parameters
402
-
403
- * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
404
-
405
- Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
406
-
407
412
  ## families
408
413
 
409
414
  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.23.0",
3
+ "version": "6.24.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -45,6 +45,7 @@ export class Base {
45
45
  directory: { ...string_attribute_writable, name: "directory" },
46
46
  packaging: { ...string_set_attribute_writable, name: "packaging" },
47
47
  disabled: { ...boolean_attribute_writable, name: "disabled" },
48
+ enabled: { ...boolean_attribute_writable, name: "enabled" },
48
49
  tags: { ...string_set_attribute_writable, name: "tags" },
49
50
  template: { ...boolean_attribute_writable, name: "template", private: true }
50
51
  };
@@ -564,6 +565,19 @@ export class Base {
564
565
  }
565
566
  }
566
567
 
568
+ /**
569
+ * @return {boolean}
570
+ */
571
+ get enabled()
572
+ {
573
+ return !this.disabled;
574
+ }
575
+
576
+ set enabled(value)
577
+ {
578
+ this.disabled = !value;
579
+ }
580
+
567
581
  get tags() {
568
582
  return this.unionFromDirections(["this", "extends"], "_tags");
569
583
  }
@@ -1,7 +1,8 @@
1
1
  import { join } from "node:path";
2
2
  import {
3
3
  string_attribute_writable,
4
- default_collection_attribute_writable
4
+ default_collection_attribute_writable,
5
+ number_attribute_writable
5
6
  } from "pacc";
6
7
  import { network_attribute } from "../common-attributes.mjs";
7
8
  import { Host, cidrAddresses, addType } from "pmcf";
@@ -52,7 +53,12 @@ export class NetworkInterface extends SkeletonNetworkInterface {
52
53
  private: true
53
54
  },
54
55
  hwaddr: { ...string_attribute_writable, name: "hwaddr" },
55
- destination: { ...string_attribute_writable, name: "destination" }
56
+ destination: { ...string_attribute_writable, name: "destination" },
57
+
58
+ /*
59
+ InitialCongestionWindow: { ...number_attribute_writable, name: "InitialCongestionWindow", default: 10, configurable: true },
60
+ InitialAdvertisedReceiveWindow: { ...number_attribute_writable, name: "InitialAdvertisedReceiveWindow", default: 10, configurable: true },
61
+ */
56
62
  };
57
63
 
58
64
  static {
@@ -401,7 +401,8 @@ class bind_group extends Base {
401
401
  );
402
402
 
403
403
  const reverseZone =
404
- this.hasReverse && na.subnet.prefix &&
404
+ this.hasReverse &&
405
+ na.subnet.prefix &&
405
406
  this._zones.getOrInsertComputed(
406
407
  reverseArpa(na.subnet.prefix),
407
408
  domain =>
@@ -585,6 +586,10 @@ function addressesStatement(prefix, objects, empty = false, indent = "") {
585
586
 
586
587
  export class bind extends ExtraSourceService {
587
588
  static attributes = {
589
+ forwarders: {
590
+ ...default_collection_attribute,
591
+ name: "forwarders"
592
+ },
588
593
  groups: {
589
594
  ...default_collection_attribute_writable,
590
595
  name: "groups",
@@ -647,7 +652,7 @@ export class bind extends ExtraSourceService {
647
652
  return this.primaries ? "secondary" : "primary";
648
653
  }
649
654
 
650
- async writeForwarders(outputControl) {
655
+ get forwarders() {
651
656
  const forwarders = serviceEndpoints(this.source, {
652
657
  services: "services[types[dns] && priority>=100 && priority<200]",
653
658
  endpoints: endpoint => endpoint.family !== FAMILY_DNS,
@@ -655,6 +660,12 @@ export class bind extends ExtraSourceService {
655
660
  limit: 5
656
661
  });
657
662
 
663
+ return forwarders;
664
+ }
665
+
666
+ async writeForwarders(outputControl) {
667
+ const forwarders = this.forwarders;
668
+
658
669
  if (forwarders.length) {
659
670
  await writeLines(
660
671
  join(outputControl.dir, "etc/named/options"),