pmcf 4.27.2 → 4.27.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 +1 -1
- package/src/base.mjs +22 -4
- package/src/host.mjs +0 -10
- package/src/owner.mjs +8 -16
- package/src/service-owner.mjs +0 -11
- package/src/services/bind.mjs +1 -11
- package/src/subnet.mjs +0 -12
package/package.json
CHANGED
package/src/base.mjs
CHANGED
|
@@ -156,10 +156,24 @@ export class Base {
|
|
|
156
156
|
this.constructor,
|
|
157
157
|
(name, attribute) => attribute.owner && !attribute.type.primitive
|
|
158
158
|
)) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
const value = this[path];
|
|
160
|
+
if (value) {
|
|
161
|
+
if (attribute.collection) {
|
|
162
|
+
if (typeof value.values !== "function") {
|
|
163
|
+
if (value instanceof Iterator) {
|
|
164
|
+
all.push(...value);
|
|
165
|
+
} else {
|
|
166
|
+
if (typeof value === "object") {
|
|
167
|
+
//console.log("NO F", this.fullName, path, value);
|
|
168
|
+
all.push(...Object.values(value));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
all.push(...value.values());
|
|
173
|
+
}
|
|
174
|
+
} else {
|
|
175
|
+
all.push(value);
|
|
176
|
+
}
|
|
163
177
|
}
|
|
164
178
|
}
|
|
165
179
|
|
|
@@ -533,6 +547,10 @@ export class Base {
|
|
|
533
547
|
|
|
534
548
|
visitor(this, ...args);
|
|
535
549
|
|
|
550
|
+
for (const child of this.children) {
|
|
551
|
+
child._traverse(visited, visitor, ...args);
|
|
552
|
+
}
|
|
553
|
+
|
|
536
554
|
return true;
|
|
537
555
|
}
|
|
538
556
|
|
package/src/host.mjs
CHANGED
|
@@ -117,16 +117,6 @@ export class Host extends ServiceOwner {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
_traverse(...args) {
|
|
121
|
-
if (super._traverse(...args)) {
|
|
122
|
-
for (const ni of this.networkInterfaces.values()) {
|
|
123
|
-
ni._traverse(...args);
|
|
124
|
-
}
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
120
|
set serial(value) {
|
|
131
121
|
this._serial = value;
|
|
132
122
|
}
|
package/src/owner.mjs
CHANGED
|
@@ -23,7 +23,12 @@ export class Owner extends Base {
|
|
|
23
23
|
static key = "name";
|
|
24
24
|
static attributes = {
|
|
25
25
|
networks: networks_attribute,
|
|
26
|
-
hosts: {
|
|
26
|
+
hosts: {
|
|
27
|
+
...default_attribute_writable,
|
|
28
|
+
type: "host",
|
|
29
|
+
collection: true,
|
|
30
|
+
owner: true
|
|
31
|
+
},
|
|
27
32
|
clusters: {
|
|
28
33
|
...default_attribute_writable,
|
|
29
34
|
type: "cluster",
|
|
@@ -45,7 +50,6 @@ export class Owner extends Base {
|
|
|
45
50
|
template: { ...boolean_attribute_writable, private: true }
|
|
46
51
|
};
|
|
47
52
|
|
|
48
|
-
|
|
49
53
|
static {
|
|
50
54
|
addType(this);
|
|
51
55
|
}
|
|
@@ -61,20 +65,6 @@ export class Owner extends Base {
|
|
|
61
65
|
return this.template ?? super.isTemplate;
|
|
62
66
|
}
|
|
63
67
|
|
|
64
|
-
_traverse(...args) {
|
|
65
|
-
if (super._traverse(...args)) {
|
|
66
|
-
for (const typeSlot of this._membersByType.values()) {
|
|
67
|
-
for (const object of typeSlot.values()) {
|
|
68
|
-
object._traverse(...args);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
68
|
*find(pattern) {
|
|
79
69
|
for (const node of this.traverse(() => {})) {
|
|
80
70
|
for (const p of pattern) {
|
|
@@ -195,6 +185,7 @@ export class Owner extends Base {
|
|
|
195
185
|
}
|
|
196
186
|
|
|
197
187
|
get networks() {
|
|
188
|
+
//return this._membersByType.get("network") || new Map();
|
|
198
189
|
return this.typeList("network");
|
|
199
190
|
}
|
|
200
191
|
|
|
@@ -234,6 +225,7 @@ export class Owner extends Base {
|
|
|
234
225
|
}
|
|
235
226
|
|
|
236
227
|
get clusters() {
|
|
228
|
+
//return this._membersByType.get("cluster") || new Map();
|
|
237
229
|
return this.typeList("cluster");
|
|
238
230
|
}
|
|
239
231
|
|
package/src/service-owner.mjs
CHANGED
|
@@ -54,17 +54,6 @@ export class ServiceOwner extends Base {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
_traverse(...args) {
|
|
58
|
-
if (super._traverse(...args)) {
|
|
59
|
-
for (const service of this._services.values()) {
|
|
60
|
-
service._traverse(...args);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
57
|
typeNamed(typeName, name) {
|
|
69
58
|
if (typeName === "service") {
|
|
70
59
|
const service = this.services.get(name);
|
package/src/services/bind.mjs
CHANGED
|
@@ -407,6 +407,7 @@ export class BindService extends ExtraSourceService {
|
|
|
407
407
|
...default_attribute_writable,
|
|
408
408
|
type: bind_group,
|
|
409
409
|
collection: true,
|
|
410
|
+
owner: true,
|
|
410
411
|
writable: true
|
|
411
412
|
},
|
|
412
413
|
primaries: {
|
|
@@ -501,17 +502,6 @@ export class BindService extends ExtraSourceService {
|
|
|
501
502
|
}
|
|
502
503
|
}
|
|
503
504
|
|
|
504
|
-
_traverse(...args) {
|
|
505
|
-
if (super._traverse(...args)) {
|
|
506
|
-
for (const group of Object.values(this.groups)) {
|
|
507
|
-
group._traverse(...args);
|
|
508
|
-
}
|
|
509
|
-
return true;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
return false;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
505
|
typeNamed(type, name) {
|
|
516
506
|
if (type === bind_group.name) {
|
|
517
507
|
return this.groups[name];
|
package/src/subnet.mjs
CHANGED
|
@@ -28,7 +28,6 @@ export class Subnet extends Base {
|
|
|
28
28
|
family: string_attribute
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
|
|
32
31
|
static {
|
|
33
32
|
addType(this);
|
|
34
33
|
}
|
|
@@ -84,17 +83,6 @@ export class Subnet extends Base {
|
|
|
84
83
|
get longAddress() {
|
|
85
84
|
return `${this.longPrefix}/${this.prefixLength}`;
|
|
86
85
|
}
|
|
87
|
-
|
|
88
|
-
_traverse(...args) {
|
|
89
|
-
if (super._traverse(...args)) {
|
|
90
|
-
for (const network of this.networks) {
|
|
91
|
-
network._traverse(...args);
|
|
92
|
-
}
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
86
|
}
|
|
99
87
|
|
|
100
88
|
const _owner = { addObject() {} };
|