pmcf 6.31.4 → 6.32.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.31.4",
3
+ "version": "6.32.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -110,7 +110,10 @@ export class Base {
110
110
 
111
111
  for (const [path, attribute] of extendingAttributeIterator(
112
112
  this.constructor,
113
- attribute => attribute.collection && !attribute.type.primitive
113
+ attribute =>
114
+ attribute.collection &&
115
+ !attribute.type.primitive &&
116
+ !attribute.deferredExpression
114
117
  )) {
115
118
  const collection = this[attribute.name];
116
119
  if (typeof collection?.get === "function") {
@@ -127,24 +130,21 @@ export class Base {
127
130
  collection.set(extending.name, extending.forOwner(this));
128
131
  }
129
132
  }
130
- }
131
- /*
132
- else {
133
- if (collection instanceof Set) {
134
- for (const all of this.unionFromDirections(["extends"], attribute.name)) {
135
- if (all instanceof Set) {
136
- const d = collection.difference(all);
137
-
138
- // if (d.size) {
139
- console.log("ME", this.fullName, attribute.name, d);
140
- // }
141
- }
142
- else {
143
- // console.error("NO SET",this.fullName, attribute.name, typeof all, all.constructor.name);
133
+ } /*else {
134
+ if (Array.isArray(collection)) {
135
+ // TODO
136
+ } else {
137
+ //console.log("EXTENDS", this.fullName, attribute.name);
138
+
139
+ for (const extending of this.unionFromDirections(
140
+ ["extends"],
141
+ attribute.name
142
+ )) {
143
+ if (!collection.has(extending)) {
144
+ //console.log("ADD", this.fullName, extending.fullName);
145
+ collection.add(extending);
144
146
  }
145
147
  }
146
- } else {
147
- //console.log("NO MAP OR SET", this.fullName, name);
148
148
  }
149
149
  }*/
150
150
  }
@@ -195,6 +195,9 @@ export class Base {
195
195
  for (const node of this.walkDirections(directions)) {
196
196
  const value = node[property];
197
197
  if (value !== undefined) {
198
+ if (!(value instanceof Set)) {
199
+ console.log("NO SET", value, node.fullName, property);
200
+ }
198
201
  collected = collected.union(value);
199
202
  }
200
203
  }
@@ -695,6 +695,10 @@ export class bind extends CoreService {
695
695
  type: networkAddressType,
696
696
  deferredExpression: true
697
697
  },
698
+ serverType: {
699
+ ...string_attribute_writable,
700
+ name: "serverType"
701
+ },
698
702
  keys: {
699
703
  ...default_collection_attribute_writable,
700
704
  name: "keys",
@@ -762,8 +766,19 @@ export class bind extends CoreService {
762
766
  acls = new Map();
763
767
  groups = new Map();
764
768
 
769
+ set serverType(value) {
770
+ //console.log("SET SERVERTYPE", this.fullName, value);
771
+ this._serverType = value;
772
+ }
773
+
765
774
  get serverType() {
766
- return this.primaries ? "secondary" : "primary";
775
+ /*console.log(
776
+ "GET SERVERTYPE",
777
+ this.fullName,
778
+ this._serverType ?? (this.primaries ? "secondary" : "primary")
779
+ );*/
780
+
781
+ return this._serverType ?? (this.primaries ? "secondary" : "primary");
767
782
  }
768
783
 
769
784
  async writeForwarders(outputControl) {