pmcf 6.16.3 → 6.17.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.16.3",
3
+ "version": "6.17.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -43,7 +43,7 @@ import { owner_attribute } from "../common-attributes.mjs";
43
43
 
44
44
  const bindNetworkAddressTypes = networkAddressType + "|bind_group";
45
45
 
46
- class zone extends Base {
46
+ class bind_zone extends Base {
47
47
  static priority = 1;
48
48
  static key = "id";
49
49
  static attributes = {
@@ -58,6 +58,14 @@ class zone extends Base {
58
58
 
59
59
  records = new Set();
60
60
 
61
+ get name() {
62
+ return this.id;
63
+ }
64
+
65
+ get fullName() {
66
+ return this.id;
67
+ }
68
+
61
69
  get domain() {
62
70
  return this.id;
63
71
  }
@@ -71,6 +79,20 @@ class zone extends Base {
71
79
  }
72
80
  }
73
81
 
82
+ class bind_zone_config extends Base {
83
+ static priority = 1;
84
+ static attributes = {
85
+ type: { ...string_attribute, name: "type" },
86
+ zones: { ...default_collection_attribute, type: bind_zone, name: "zones" }
87
+ };
88
+
89
+ static {
90
+ addType(this);
91
+ }
92
+
93
+ zones = [];
94
+ }
95
+
74
96
  class bind_group extends Base {
75
97
  static priority = 1;
76
98
  static attributes = {
@@ -96,9 +118,13 @@ class bind_group extends Base {
96
118
  type: networkAddressType + "|owner",
97
119
  name: "entries"
98
120
  },
121
+ domains: {
122
+ ...string_set_attribute,
123
+ name: "domains"
124
+ },
99
125
  zones: {
100
126
  ...default_collection_attribute,
101
- type: zone,
127
+ type: bind_zone,
102
128
  backpointer: owner_attribute,
103
129
  name: "zones"
104
130
  },
@@ -209,18 +235,24 @@ class bind_group extends Base {
209
235
  ];
210
236
  }
211
237
 
238
+ get domains() {
239
+ return this.entries.reduce(
240
+ (all, net) => all.union(net.localDomains),
241
+ new Set()
242
+ );
243
+ }
244
+
212
245
  get zones() {
213
246
  const zs = new Map();
214
247
 
215
248
  for (const source of this.entries) {
216
249
  for (const domain of source.localDomains) {
217
- const config = {
218
- name: `${domain}.zone.conf`,
219
- type: this.service.serverType,
220
- zones: []
221
- };
250
+ const config = new bind_zone_config();
251
+
252
+ config.name = `${domain}.zone.conf`;
253
+ config.type = this.service.serverType;
222
254
 
223
- const z = new zone();
255
+ const z = new bind_zone();
224
256
 
225
257
  z.id = domain;
226
258
  z.source = source;
@@ -239,7 +271,7 @@ class bind_group extends Base {
239
271
  domainNames,
240
272
  family
241
273
  } of source.networkAddresses()) {
242
- // console.log(address);
274
+ // console.log(address);
243
275
  }
244
276
  }
245
277
  }