pmcf 6.16.4 → 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.4",
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 = {
@@ -79,6 +79,20 @@ class zone extends Base {
79
79
  }
80
80
  }
81
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
+
82
96
  class bind_group extends Base {
83
97
  static priority = 1;
84
98
  static attributes = {
@@ -104,9 +118,13 @@ class bind_group extends Base {
104
118
  type: networkAddressType + "|owner",
105
119
  name: "entries"
106
120
  },
121
+ domains: {
122
+ ...string_set_attribute,
123
+ name: "domains"
124
+ },
107
125
  zones: {
108
126
  ...default_collection_attribute,
109
- type: zone,
127
+ type: bind_zone,
110
128
  backpointer: owner_attribute,
111
129
  name: "zones"
112
130
  },
@@ -217,18 +235,24 @@ class bind_group extends Base {
217
235
  ];
218
236
  }
219
237
 
238
+ get domains() {
239
+ return this.entries.reduce(
240
+ (all, net) => all.union(net.localDomains),
241
+ new Set()
242
+ );
243
+ }
244
+
220
245
  get zones() {
221
246
  const zs = new Map();
222
247
 
223
248
  for (const source of this.entries) {
224
249
  for (const domain of source.localDomains) {
225
- const config = {
226
- name: `${domain}.zone.conf`,
227
- type: this.service.serverType,
228
- zones: []
229
- };
250
+ const config = new bind_zone_config();
251
+
252
+ config.name = `${domain}.zone.conf`;
253
+ config.type = this.service.serverType;
230
254
 
231
- const z = new zone();
255
+ const z = new bind_zone();
232
256
 
233
257
  z.id = domain;
234
258
  z.source = source;