pmcf 6.17.3 → 6.17.5

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,27 +77,27 @@ 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)
83
80
  * [type](#type)
84
81
  * [SystemdJournalRemoteService](#systemdjournalremoteservice)
85
82
  * [Properties](#properties)
86
83
  * [systemdConfigs](#systemdconfigs)
87
- * [Parameters](#parameters-15)
84
+ * [Parameters](#parameters-14)
88
85
  * [SystemdJournalUploadService](#systemdjournaluploadservice)
89
86
  * [Properties](#properties-1)
90
87
  * [systemdConfigs](#systemdconfigs-1)
91
- * [Parameters](#parameters-16)
88
+ * [Parameters](#parameters-15)
92
89
  * [NetworkAddress](#networkaddress)
93
- * [Parameters](#parameters-17)
90
+ * [Parameters](#parameters-16)
94
91
  * [subnet](#subnet)
95
92
  * [networkInterface](#networkinterface)
96
93
  * [address](#address)
97
94
  * [addresses](#addresses)
98
- * [Parameters](#parameters-18)
95
+ * [Parameters](#parameters-17)
99
96
  * [cidrAddresses](#cidraddresses)
100
- * [Parameters](#parameters-19)
97
+ * [Parameters](#parameters-18)
98
+ * [SkeletonNetworkInterface](#skeletonnetworkinterface)
99
+ * [networkAddresses](#networkaddresses)
100
+ * [Parameters](#parameters-19)
101
101
  * [families](#families)
102
102
  * [secretName](#secretname)
103
103
  * [directHosts](#directhosts)
@@ -287,18 +287,6 @@ Keeps track of all in flight object creations and loose ends during config initi
287
287
 
288
288
  * `directory` (optional, default `"/"`)
289
289
 
290
- ## SkeletonNetworkInterface
291
-
292
- **Extends ServiceOwner**
293
-
294
- ### networkAddresses
295
-
296
- #### Parameters
297
-
298
- * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
299
-
300
- Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
301
-
302
290
  ## type
303
291
 
304
292
  Type of the group.
@@ -380,6 +368,18 @@ Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Re
380
368
 
381
369
  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;
382
370
 
371
+ ## SkeletonNetworkInterface
372
+
373
+ **Extends ServiceOwner**
374
+
375
+ ### networkAddresses
376
+
377
+ #### Parameters
378
+
379
+ * `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
380
+
381
+ Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
382
+
383
383
  ## families
384
384
 
385
385
  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/bin/pmcf-info CHANGED
@@ -5,13 +5,21 @@ import { prepare } from "../src/cli.mjs";
5
5
  const { root, args, options } = await prepare({});
6
6
 
7
7
  for (const expression of args) {
8
- const result = root.named(expression);
8
+ const result = root.expression(expression);
9
9
 
10
10
  show(result);
11
11
  }
12
12
 
13
13
  function show(value, indent = 0, short = false) {
14
- if (value instanceof Iterator) {
14
+ switch (typeof value) {
15
+ case "string":
16
+ case "number":
17
+ case "bigint":
18
+ console.log(value);
19
+ return;
20
+ }
21
+
22
+ if (value instanceof Iterator || Array.isArray(value)) {
15
23
  for (const v of value) {
16
24
  show(v, indent);
17
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.17.3",
3
+ "version": "6.17.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -52,14 +52,14 @@
52
52
  "dependencies": {
53
53
  "aggregated-map": "^1.0.8",
54
54
  "content-entry-transform": "^1.7.0",
55
- "ip-utilties": "^3.9.0",
56
- "npm-pkgbuild": "^20.8.6",
57
- "pacc": "^10.6.0",
55
+ "ip-utilties": "^3.10.0",
56
+ "npm-pkgbuild": "^20.8.8",
57
+ "pacc": "^11.0.1",
58
58
  "package-directory": "^8.2.0",
59
59
  "yaml": "^2.9.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@types/node": "^26.1.1",
62
+ "@types/node": "^26.1.2",
63
63
  "ava": "^8.0.1",
64
64
  "c8": "^12.0.0",
65
65
  "documentation": "^14.0.3",
package/src/base.mjs CHANGED
@@ -399,7 +399,8 @@ export class Base {
399
399
  */
400
400
  expression(expression, options) {
401
401
  return parse(expression, {
402
- root: this,
402
+ root: this.root,
403
+ current: this,
403
404
  valueFor: (name, at) =>
404
405
  at === undefined ? globals[name] : at.value(name),
405
406
  ...options
@@ -496,7 +497,8 @@ export class Base {
496
497
  e => e.isBlob,
497
498
  expression =>
498
499
  parse(expression, {
499
- root: this,
500
+ root: this.root,
501
+ current: this,
500
502
  valueFor: (name, at) =>
501
503
  at === undefined ? globals[name] : at.value(name)
502
504
  })
@@ -565,7 +567,8 @@ export class Base {
565
567
 
566
568
  return expand(object, {
567
569
  stopClass: Base,
568
- root: this,
570
+ root: this.root,
571
+ current: this,
569
572
  valueFor: (name, at) =>
570
573
  at === undefined ? globals[name] : at.value(name)
571
574
  });
@@ -1,13 +1,37 @@
1
- import { getAttribute } from "pacc";
1
+ import {
2
+ default_attribute,
3
+ string_attribute,
4
+ name_attribute,
5
+ getAttribute
6
+ } from "pacc";
7
+
2
8
  import { familyIP, formatCIDR, decodeIP } from "ip-utilties";
3
9
  import { Subnet } from "./subnet.mjs";
4
- import { Owner } from "pmcf";
10
+ import { Owner, addType } from "pmcf";
5
11
  import { NetworkInterface } from "./network-interfaces/network-interface.mjs";
6
12
 
7
13
  /**
8
14
  *
9
15
  */
10
16
  export class NetworkAddress {
17
+ static name = "network-address";
18
+ static priority = 1;
19
+ static key = "address";
20
+ static attributes = {
21
+ address: { ...name_attribute, name: "address" },
22
+ cidrAddress: { ...string_attribute, name: "cidrAddress" },
23
+ networkInterface: {
24
+ ...default_attribute,
25
+ name: "networkInterface",
26
+ type: "network_interface"
27
+ },
28
+ family: { ...string_attribute, name: "family" }
29
+ };
30
+
31
+ static {
32
+ addType(this);
33
+ }
34
+
11
35
  /** @type {Subnet} */ subnet;
12
36
  /** @type {NetworkInterface} */ networkInterface;
13
37
  /** @type {string|Uint8Array|Uint16Array} */ address;