pmcf 1.51.0 → 1.52.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 +6 -2
- package/src/host.mjs +20 -2
- package/src/owner.mjs +0 -1
- package/src/service.mjs +0 -1
- package/types/host.d.mts +1 -0
package/package.json
CHANGED
package/src/base.mjs
CHANGED
|
@@ -131,13 +131,17 @@ export class Base {
|
|
|
131
131
|
case "string":
|
|
132
132
|
{
|
|
133
133
|
value = this.expand(value);
|
|
134
|
-
|
|
134
|
+
let object = this.typeNamed(property.type.name, value);
|
|
135
135
|
|
|
136
136
|
if (object) {
|
|
137
137
|
assign(property, object);
|
|
138
138
|
} else {
|
|
139
139
|
if (property.type.constructWithIdentifierOnly) {
|
|
140
|
-
new property.type.clazz(
|
|
140
|
+
object = new property.type.clazz(
|
|
141
|
+
this.ownerFor(property, value),
|
|
142
|
+
value
|
|
143
|
+
);
|
|
144
|
+
this.addObject(object);
|
|
141
145
|
} else {
|
|
142
146
|
this.finalize(() => {
|
|
143
147
|
value = this.expand(value);
|
package/src/host.mjs
CHANGED
|
@@ -79,14 +79,19 @@ export class Host extends Base {
|
|
|
79
79
|
if (data.extends) {
|
|
80
80
|
this.finalize(() => {
|
|
81
81
|
for (const host of this.extends) {
|
|
82
|
+
host.execFinalize();
|
|
82
83
|
this.depends = host.depends;
|
|
83
84
|
this.provides = host.provides;
|
|
84
85
|
this.replaces = host.replaces;
|
|
85
86
|
|
|
86
|
-
for (const service of host.
|
|
87
|
+
for (const service of host.services) {
|
|
87
88
|
this.services = service.forOwner(this);
|
|
88
89
|
}
|
|
89
90
|
}
|
|
91
|
+
|
|
92
|
+
this.#depends = this.expand(this.depends);
|
|
93
|
+
this.#provides = this.expand(this.provides);
|
|
94
|
+
this.#replaces = this.expand(this.replaces);
|
|
90
95
|
});
|
|
91
96
|
}
|
|
92
97
|
}
|
|
@@ -129,6 +134,10 @@ export class Host extends Base {
|
|
|
129
134
|
return this.#vendor || this.extends.find(e => e.vendor)?.vendor;
|
|
130
135
|
}
|
|
131
136
|
|
|
137
|
+
get isTemplate() {
|
|
138
|
+
return this.isModel || this.name.match(/services\//); // TODO
|
|
139
|
+
}
|
|
140
|
+
|
|
132
141
|
get isModel() {
|
|
133
142
|
return this.#vendor || this.#chassis ? true : false;
|
|
134
143
|
}
|
|
@@ -256,6 +265,12 @@ export class Host extends Base {
|
|
|
256
265
|
return ni;
|
|
257
266
|
}
|
|
258
267
|
}
|
|
268
|
+
if (typeName === "service") {
|
|
269
|
+
const service = this.services.find(s => s.name === name);
|
|
270
|
+
if (service) {
|
|
271
|
+
return service;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
259
274
|
|
|
260
275
|
return super.typeNamed(typeName, name);
|
|
261
276
|
}
|
|
@@ -266,7 +281,10 @@ export class Host extends Base {
|
|
|
266
281
|
|
|
267
282
|
set networkInterfaces(networkInterface) {
|
|
268
283
|
this.#networkInterfaces.set(networkInterface.name, networkInterface);
|
|
269
|
-
|
|
284
|
+
|
|
285
|
+
if (!this.isTemplate) {
|
|
286
|
+
networkInterface.network?.addObject(this);
|
|
287
|
+
}
|
|
270
288
|
}
|
|
271
289
|
|
|
272
290
|
*networkAddresses() {
|
package/src/owner.mjs
CHANGED
package/src/service.mjs
CHANGED
package/types/host.d.mts
CHANGED