pmcf 6.56.1 → 6.58.0

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.56.1",
3
+ "version": "6.58.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/endpoint.mjs CHANGED
@@ -98,7 +98,8 @@ class PortEndpoint extends BaseEndpoint {
98
98
  export class Endpoint extends PortEndpoint {
99
99
  static name = "endpoint";
100
100
  static attributes = {
101
- family: family_attribute
101
+ family: family_attribute,
102
+ addressType: { ...string_attribute, name: "addressType" }
102
103
  };
103
104
 
104
105
  static {
@@ -126,6 +127,10 @@ export class Endpoint extends PortEndpoint {
126
127
  return this.networkAddress.family;
127
128
  }
128
129
 
130
+ get addressType() {
131
+ return this.networkAddress.type;
132
+ }
133
+
129
134
  get networkInterface() {
130
135
  return this.networkAddress.networkInterface;
131
136
  }
@@ -2,7 +2,6 @@ import {
2
2
  default_attribute,
3
3
  type_attribute,
4
4
  getAttribute,
5
- asArray,
6
5
  leafValues
7
6
  } from "pacc";
8
7
  import { familyIP, formatCIDR, decodeIP, addressType } from "ip-utilties";
package/src/subnet.mjs CHANGED
@@ -3,8 +3,9 @@ import {
3
3
  rangeIP,
4
4
  decodeIP,
5
5
  matchPrefixIP,
6
+ addressType
6
7
  } from "ip-utilties";
7
- import { name_attribute, integer_attribute } from "pacc";
8
+ import { name_attribute, integer_attribute, string_attribute } from "pacc";
8
9
  import { networks_attribute, family_attribute } from "./common-attributes.mjs";
9
10
  import { addType, network, core } from "pmcf";
10
11
 
@@ -18,7 +19,8 @@ export class Subnet extends core {
18
19
  address: { ...name_attribute, name: "address", private: true },
19
20
  networks: networks_attribute,
20
21
  prefixLength: { ...integer_attribute, name: "prefixLength" },
21
- family: family_attribute
22
+ family: family_attribute,
23
+ addressType: { ...string_attribute, name: "addressType" }
22
24
  };
23
25
 
24
26
  static {
@@ -30,7 +32,7 @@ export class Subnet extends core {
30
32
  constructor(owner, address) {
31
33
  super();
32
34
 
33
- switch(typeof address) {
35
+ switch (typeof address) {
34
36
  case "object":
35
37
  address = address.address;
36
38
  }
@@ -79,6 +81,10 @@ export class Subnet extends core {
79
81
  get longAddress() {
80
82
  return `${this.longPrefix}/${this.prefixLength}`;
81
83
  }
84
+
85
+ get addressType() {
86
+ return addressType(this.address);
87
+ }
82
88
  }
83
89
 
84
90
  export const SUBNET_GLOBAL_IPV4 = new Subnet(undefined, "0.0.0.0/0");