pmcf 6.2.8 → 6.3.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.2.8",
3
+ "version": "6.3.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -179,16 +179,22 @@ export class InitializationContext {
179
179
  owner.constructor,
180
180
  attribute => attribute.type === type && attribute.collection
181
181
  )) {
182
- const object = create(type, owner, data);
182
+ try {
183
+ const object = create(type, owner, data);
183
184
 
184
- // set backointer early so that parent properties can be found during load
185
- if (attribute.backpointer) {
186
- assign(attribute.backpointer, object, owner);
185
+ // set backointer early so that parent properties can be found during load
186
+ if (attribute.backpointer) {
187
+ assign(attribute.backpointer, object, owner);
188
+ }
189
+ return assign(attribute, owner, this.read(object, data));
190
+ } catch (e) {
191
+ this.error(`Unable to assign ${type.name}.${attribute.name}`, data);
187
192
  }
188
- return assign(attribute, owner, this.read(object, data));
189
193
  }
190
194
 
191
- this.error(`No attribute to assign ${type.name} to ${owner.fullName}(${owner.typeName})`);
195
+ this.error(
196
+ `No attribute to assign ${type.name} to ${owner.fullName}(${owner.typeName})`
197
+ );
192
198
  }
193
199
 
194
200
  async loadAll() {
package/src/owner.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  email_attribute
8
8
  } from "pacc";
9
9
  import { asArray, union } from "./utils.mjs";
10
- import { Base } from "./base.mjs";
10
+ import { ServiceOwner } from "./service-owner.mjs";
11
11
  import { Subnet, SUBNET_GLOBAL_IPV4, SUBNET_GLOBAL_IPV6 } from "./subnet.mjs";
12
12
  import {
13
13
  networks_attribute,
@@ -20,7 +20,7 @@ import {
20
20
  import { addType, assign } from "pmcf";
21
21
  import { loadHooks } from "./hooks.mjs";
22
22
 
23
- export class Owner extends Base {
23
+ export class Owner extends ServiceOwner {
24
24
  static name = "owner";
25
25
  static priority = 2;
26
26
  static owners = [Owner, "root"];
@@ -106,7 +106,7 @@ export class Owner extends Base {
106
106
 
107
107
  get services() {
108
108
  return new AggregatedMap(
109
- [...this.hosts.values()].map(host => host.services)
109
+ [this, ...this.hosts.values()].map(host => host._services)
110
110
  );
111
111
  }
112
112
 
@@ -481,6 +481,7 @@ export class bind extends ExtraSourceService {
481
481
  groups = new Map();
482
482
 
483
483
  materializeExtends() {
484
+ console.log("materializeExtends", this.fullName, this.owner, this.extends);
484
485
  super.materializeExtends();
485
486
 
486
487
  for (const service of this.walkDirections(["extends"])) {
@@ -528,7 +529,7 @@ export class bind extends ExtraSourceService {
528
529
 
529
530
  let hasContent = false;
530
531
 
531
- console.log("PAKAGE", Object.keys(this.groups));
532
+ console.log("PACKAGE", Object.keys(this.groups));
532
533
 
533
534
  for (const group of Object.values(this.groups)) {
534
535
  hasContent ||= await group.packageContent(outputControl);