pmcf 6.2.1 → 6.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.2.1",
3
+ "version": "6.2.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -52,9 +52,9 @@
52
52
  "dependencies": {
53
53
  "aggregated-map": "^1.0.7",
54
54
  "content-entry-transform": "^1.6.9",
55
- "ip-utilties": "^3.5.1",
55
+ "ip-utilties": "^3.4.0",
56
56
  "npm-pkgbuild": "^20.7.12",
57
- "pacc": "^10.4.0",
57
+ "pacc": "^10.4.1",
58
58
  "package-directory": "^8.2.0"
59
59
  },
60
60
  "devDependencies": {
package/src/base.mjs CHANGED
@@ -287,12 +287,8 @@ export class Base {
287
287
  return Object.fromEntries(this.attributeIterator(filter));
288
288
  }
289
289
 
290
- valueFor(name, at) {
291
- if (at !== undefined) {
292
- return this.attribute(name) ?? this.property(name);
293
- }
294
-
295
- return globals[name];
290
+ value(name) {
291
+ return this.attribute(name) ?? this.property(name);
296
292
  }
297
293
 
298
294
  /**
@@ -374,7 +370,8 @@ export class Base {
374
370
  expression(expression, options) {
375
371
  return parse(expression, {
376
372
  root: this,
377
- valueFor: (name, at) => this.valueFor(name, at),
373
+ valueFor: (name, at) =>
374
+ at === undefined ? globals[name] : at.value(name),
378
375
  ...options
379
376
  });
380
377
  }
@@ -445,7 +442,8 @@ export class Base {
445
442
  expression =>
446
443
  parse(expression, {
447
444
  root: this,
448
- valueFor: (name, at) => this.valueFor(name, at)
445
+ valueFor: (name, at) =>
446
+ at === undefined ? globals[name] : at.value(name)
449
447
  })
450
448
  )
451
449
  ];
@@ -512,7 +510,8 @@ export class Base {
512
510
  return expand(object, {
513
511
  stopClass: Base,
514
512
  root: this,
515
- valueFor: (name, at) => this.valueFor(name, at)
513
+ valueFor: (name, at) =>
514
+ at === undefined ? globals[name] : at.value(name)
516
515
  });
517
516
  }
518
517
 
@@ -8,8 +8,7 @@ export class openldap extends CoreService {
8
8
  };
9
9
  static service = {
10
10
  systemdService: "slapd.service",
11
- extends: ["ldap", "ldapi"],
12
- services: {}
11
+ extends: ["ldap", "ldapi"]
13
12
  };
14
13
 
15
14
  static {
@@ -3,8 +3,7 @@ import { CoreService, addType } from "pmcf";
3
3
  export class postfix extends CoreService {
4
4
  static service = {
5
5
  systemdService: "postfix.service",
6
- extends: ["smtp", "lmtp", "submission"],
7
- services: {}
6
+ extends: ["smtp", "lmtp", "submission"]
8
7
  };
9
8
 
10
9
  static {
package/src/subnet.mjs CHANGED
@@ -7,7 +7,12 @@ import {
7
7
  matchPrefixIP,
8
8
  FAMILY_IPV6
9
9
  } from "ip-utilties";
10
- import { string_attribute, name_attribute, integer_attribute } from "pacc";
10
+ import {
11
+ string_attribute,
12
+ name_attribute,
13
+ integer_attribute,
14
+ getAttribute
15
+ } from "pacc";
11
16
  import { networks_attribute } from "./common-attributes.mjs";
12
17
  import { addType, Network } from "pmcf";
13
18
 
@@ -46,14 +51,21 @@ export class Subnet {
46
51
 
47
52
  set owner(value) {
48
53
  this._owner = value;
49
- if(value instanceof Network) {
54
+ if (value instanceof Network) {
50
55
  this.networks.add(value);
51
56
  }
52
57
  }
53
58
 
54
- *_walkDirections(directions, seen) {
59
+ value(name) {
60
+ const value = getAttribute(this, name);
61
+
62
+ console.log("SUBNET VALUE", name, value);
63
+
64
+ return value;
55
65
  }
56
66
 
67
+ *_walkDirections(directions, seen) {}
68
+
57
69
  get cidr() {
58
70
  return this.address;
59
71
  }