pmcf 4.27.3 → 4.28.1
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 +14 -23
- package/src/cluster.mjs +0 -2
- package/src/endpoint.mjs +0 -1
- package/src/network.mjs +2 -3
- package/src/owner.mjs +1 -12
package/package.json
CHANGED
package/src/base.mjs
CHANGED
|
@@ -236,6 +236,17 @@ export class Base {
|
|
|
236
236
|
: name;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
*find(pattern) {
|
|
240
|
+
for (const node of this.walkDirections(["children"])) {
|
|
241
|
+
for (const p of pattern) {
|
|
242
|
+
if (node.fullName.match(p)) {
|
|
243
|
+
yield node;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
239
250
|
get typeName() {
|
|
240
251
|
return this.constructor.name;
|
|
241
252
|
}
|
|
@@ -516,7 +527,9 @@ export class Base {
|
|
|
516
527
|
}
|
|
517
528
|
|
|
518
529
|
execFinalize() {
|
|
519
|
-
|
|
530
|
+
for (const node of this.walkDirections(["children"])) {
|
|
531
|
+
node._execFinalize();
|
|
532
|
+
}
|
|
520
533
|
}
|
|
521
534
|
|
|
522
535
|
_execFinalize() {
|
|
@@ -532,28 +545,6 @@ export class Base {
|
|
|
532
545
|
}
|
|
533
546
|
}
|
|
534
547
|
|
|
535
|
-
traverse(visitor, ...args) {
|
|
536
|
-
const visited = new Set();
|
|
537
|
-
this._traverse(visited, visitor, ...args);
|
|
538
|
-
return visited;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
_traverse(visited, visitor, ...args) {
|
|
542
|
-
if (visited.has(this)) {
|
|
543
|
-
return false;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
visited.add(this);
|
|
547
|
-
|
|
548
|
-
visitor(this, ...args);
|
|
549
|
-
|
|
550
|
-
for (const child of this.children) {
|
|
551
|
-
child._traverse(visited, visitor, ...args);
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
return true;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
548
|
error(...args) {
|
|
558
549
|
console.error(`${this.toString()}:`, ...args);
|
|
559
550
|
}
|
package/src/cluster.mjs
CHANGED
|
@@ -38,7 +38,6 @@ export class Cluster extends Host {
|
|
|
38
38
|
checkInterval: { ...duration_attribute_writable, default: 60 }
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
|
|
42
41
|
static {
|
|
43
42
|
addType(this);
|
|
44
43
|
}
|
|
@@ -59,7 +58,6 @@ export class Cluster extends Host {
|
|
|
59
58
|
|
|
60
59
|
set backups(value) {
|
|
61
60
|
this._backups.push(value);
|
|
62
|
-
|
|
63
61
|
value.cluster = this;
|
|
64
62
|
}
|
|
65
63
|
|
package/src/endpoint.mjs
CHANGED
package/src/network.mjs
CHANGED
|
@@ -6,21 +6,20 @@ import { networkAttributes } from "./network-support.mjs";
|
|
|
6
6
|
export class Network extends Owner {
|
|
7
7
|
static name = "network";
|
|
8
8
|
static priority = 2;
|
|
9
|
-
static owners = ["location",
|
|
9
|
+
static owners = ["location", Owner, "root"];
|
|
10
10
|
static extends = Owner;
|
|
11
11
|
static key = "name";
|
|
12
12
|
static attributes = {
|
|
13
13
|
...networkAttributes,
|
|
14
14
|
bridge: {
|
|
15
15
|
...default_attribute_writable,
|
|
16
|
-
type:
|
|
16
|
+
type: Network,
|
|
17
17
|
collection: true,
|
|
18
18
|
owner: false
|
|
19
19
|
},
|
|
20
20
|
gateway: { ...default_attribute_writable, type: "host", owner: false }
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
|
|
24
23
|
static {
|
|
25
24
|
addType(this);
|
|
26
25
|
}
|
package/src/owner.mjs
CHANGED
|
@@ -18,7 +18,7 @@ const EMPTY = new Map();
|
|
|
18
18
|
export class Owner extends Base {
|
|
19
19
|
static name = "owner";
|
|
20
20
|
static priority = 2;
|
|
21
|
-
static owners = ["location",
|
|
21
|
+
static owners = ["location", Owner, "root"];
|
|
22
22
|
static extends = Base;
|
|
23
23
|
static key = "name";
|
|
24
24
|
static attributes = {
|
|
@@ -65,17 +65,6 @@ export class Owner extends Base {
|
|
|
65
65
|
return this.template ?? super.isTemplate;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
*find(pattern) {
|
|
69
|
-
for (const node of this.traverse(() => {})) {
|
|
70
|
-
for (const p of pattern) {
|
|
71
|
-
if (node.fullName.match(p)) {
|
|
72
|
-
yield node;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
68
|
named(name) {
|
|
80
69
|
if (name[0] === "/") {
|
|
81
70
|
name = name.substring(this.fullName.length + 1);
|