pmcf 6.3.8 → 6.3.10

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
@@ -77,26 +77,26 @@ generates config packages for:
77
77
  * [domainNames](#domainnames)
78
78
  * [InitializationContext](#initializationcontext)
79
79
  * [Parameters](#parameters-13)
80
+ * [SkeletonNetworkInterface](#skeletonnetworkinterface)
81
+ * [networkAddresses](#networkaddresses)
82
+ * [Parameters](#parameters-14)
80
83
  * [SystemdJournalRemoteService](#systemdjournalremoteservice)
81
84
  * [Properties](#properties)
82
85
  * [systemdConfigs](#systemdconfigs)
83
- * [Parameters](#parameters-14)
86
+ * [Parameters](#parameters-15)
84
87
  * [SystemdJournalUploadService](#systemdjournaluploadservice)
85
88
  * [Properties](#properties-1)
86
89
  * [systemdConfigs](#systemdconfigs-1)
87
- * [Parameters](#parameters-15)
90
+ * [Parameters](#parameters-16)
88
91
  * [NetworkAddress](#networkaddress)
89
- * [Parameters](#parameters-16)
92
+ * [Parameters](#parameters-17)
90
93
  * [subnet](#subnet)
91
94
  * [networkInterface](#networkinterface)
92
95
  * [address](#address)
93
96
  * [addresses](#addresses)
94
- * [Parameters](#parameters-17)
95
- * [cidrAddresses](#cidraddresses)
96
97
  * [Parameters](#parameters-18)
97
- * [SkeletonNetworkInterface](#skeletonnetworkinterface)
98
- * [networkAddresses](#networkaddresses)
99
- * [Parameters](#parameters-19)
98
+ * [cidrAddresses](#cidraddresses)
99
+ * [Parameters](#parameters-19)
100
100
  * [families](#families)
101
101
  * [secretName](#secretname)
102
102
  * [directHosts](#directhosts)
@@ -286,6 +286,18 @@ Keeps track of all in flight object creations and loose ends during config initi
286
286
 
287
287
  * `directory` (optional, default `"/"`)
288
288
 
289
+ ## SkeletonNetworkInterface
290
+
291
+ **Extends ServiceOwner**
292
+
293
+ ### networkAddresses
294
+
295
+ #### Parameters
296
+
297
+ * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
298
+
299
+ Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
300
+
289
301
  ## SystemdJournalRemoteService
290
302
 
291
303
  **Extends CoreService**
@@ -361,18 +373,6 @@ Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Re
361
373
 
362
374
  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;
363
375
 
364
- ## SkeletonNetworkInterface
365
-
366
- **Extends ServiceOwner**
367
-
368
- ### networkAddresses
369
-
370
- #### Parameters
371
-
372
- * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
373
-
374
- Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
375
-
376
376
  ## families
377
377
 
378
378
  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.3.8",
3
+ "version": "6.3.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -55,7 +55,8 @@
55
55
  "ip-utilties": "^3.4.0",
56
56
  "npm-pkgbuild": "^20.8.1",
57
57
  "pacc": "^10.4.1",
58
- "package-directory": "^8.2.0"
58
+ "package-directory": "^8.2.0",
59
+ "yaml": "^2.9.0"
59
60
  },
60
61
  "devDependencies": {
61
62
  "@types/node": "^26.1.1",
package/src/base.mjs CHANGED
@@ -260,7 +260,7 @@ export class Base {
260
260
  * @return {Iterable<[string,any]>} values
261
261
  */
262
262
  *attributeIterator(filter) {
263
- for (const [path, def] of extendingAttributeIterator(
263
+ for (const [path, attribute] of extendingAttributeIterator(
264
264
  this.constructor,
265
265
  filter
266
266
  )) {
@@ -268,7 +268,7 @@ export class Base {
268
268
  const value = this.attribute(name);
269
269
 
270
270
  if (value !== undefined) {
271
- yield [def.externalName ?? name, toExternal(value, def), path, def];
271
+ yield [attribute.externalName ?? name, toExternal(value, attribute), path, attribute];
272
272
  }
273
273
  }
274
274
  }
@@ -1,4 +1,5 @@
1
1
  import { join } from "node:path";
2
+ import { stringify } from "yaml";
2
3
  import { FAMILY_IPV4, FAMILY_IPV6 } from "ip-utilties";
3
4
  import { FileContentProvider } from "npm-pkgbuild";
4
5
  import { boolean_attribute_writable_true } from "pacc";
@@ -49,8 +50,12 @@ export class influxdb extends CoreService {
49
50
  await writeLines(
50
51
  join(dir, "etc", "influxdb"),
51
52
  "config.yml",
52
- setionLinesFromPropertyIterator(
53
- this.attributeIterator(filterConfigurable)
53
+ stringify(
54
+ Object.fromEntries(
55
+ [...this.attributeIterator(filterConfigurable)].map(
56
+ ([name, value, path, attribute]) => [attribute.externalName, value]
57
+ )
58
+ )
54
59
  )
55
60
  );
56
61
 
@@ -9,7 +9,8 @@ import {
9
9
  import {
10
10
  string_attribute_writable,
11
11
  number_attribute_writable,
12
- boolean_attribute_writable_true
12
+ boolean_attribute_writable_true,
13
+ extendingAttributeIterator
13
14
  } from "pacc";
14
15
  import {
15
16
  addType,
@@ -22,8 +23,6 @@ import {
22
23
  } from "pmcf";
23
24
  import { writeLines } from "../utils.mjs";
24
25
 
25
- const keaVersion = "3.0.1";
26
-
27
26
  export class kea extends CoreService {
28
27
  static attributes = {
29
28
  "ddns-send-updates": {
@@ -262,10 +261,14 @@ export class kea extends CoreService {
262
261
  ]
263
262
  };
264
263
 
265
- for (const [key] of Object.entries(KeaService.attributes).filter(
266
- ([key, attribute]) => attribute.configurable && this[key] !== undefined
264
+ for (const [path, attribute] of extendingAttributeIterator(
265
+ this.constructor,
266
+ attribute =>
267
+ attribute.configurable && this[attribute.name] !== undefined
267
268
  )) {
268
- cfg[key] = this[key];
269
+ const name = path.join(".");
270
+
271
+ cfg[name] = this[name];
269
272
  }
270
273
 
271
274
  return cfg;