pmcf 1.30.4 → 1.30.5

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": "1.30.4",
3
+ "version": "1.30.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -191,7 +191,7 @@ export function extractFrom(object, propertyNames) {
191
191
 
192
192
  if (value !== undefined) {
193
193
  if (value instanceof Base && value.name !== undefined) {
194
- json[p] = { name: value.name };
194
+ json[p] = { name: value.name, type: value.typeName };
195
195
  } else {
196
196
  json[p] = value;
197
197
  }
package/src/model.mjs CHANGED
@@ -112,6 +112,14 @@ export class Location extends Owner {
112
112
  get location() {
113
113
  return this;
114
114
  }
115
+
116
+ locationNamed(name) {
117
+ if (this.fullName === name) {
118
+ return this;
119
+ }
120
+
121
+ return super.locationNamed(name);
122
+ }
115
123
  }
116
124
 
117
125
  export class Host extends Base {
@@ -529,5 +537,14 @@ export class NetworkInterface extends Base {
529
537
  }
530
538
  }
531
539
 
532
- const _types = [Location, Network, Subnet, Host, Cluster, Service, DNSService, NetworkInterface];
540
+ const _types = [
541
+ Location,
542
+ Network,
543
+ Subnet,
544
+ Host,
545
+ Cluster,
546
+ Service,
547
+ DNSService,
548
+ NetworkInterface
549
+ ];
533
550
  const _typesByName = Object.fromEntries(_types.map(t => [t.typeName, t]));
package/src/owner.mjs CHANGED
@@ -280,6 +280,13 @@ export class Network extends Owner {
280
280
  this.bridge = owner.addBridge(this, bridge);
281
281
  }
282
282
 
283
+ networkNamed(name) {
284
+ if (this.fullName === name) {
285
+ return this;
286
+ }
287
+ return super.networkNamed(name);
288
+ }
289
+
283
290
  get netmask() {
284
291
  const m = this.ipv4?.match(/\/(\d+)$/);
285
292
  if (m) {