pmcf 1.50.0 → 1.51.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": "1.50.0",
3
+ "version": "1.51.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -149,7 +149,12 @@ export class Base {
149
149
  if (object) {
150
150
  assign(property, object);
151
151
  } else {
152
- this.error("Not found", property.name, property.type.name, value);
152
+ this.error(
153
+ "Not found",
154
+ property.name,
155
+ property.type.name,
156
+ value
157
+ );
153
158
  }
154
159
  });
155
160
  }
package/src/cluster.mjs CHANGED
@@ -1,21 +1,32 @@
1
1
  import { Owner } from "./owner.mjs";
2
2
  import { addType } from "./types.mjs";
3
3
 
4
- const typeDefinition = {
4
+ const ClusterTypeDefinition = {
5
5
  name: "cluster",
6
6
  owners: [Owner.typeDefinition, "network", "root"],
7
7
  priority: 0.7,
8
8
  extends: Owner.typeDefinition,
9
- properties: {}
9
+ properties: {
10
+ masters: { type: "host", collection: true, writeable: true },
11
+ backups: { type: "host", collection: true, writeable: true },
12
+ }
10
13
  };
11
14
 
12
15
  export class Cluster extends Owner {
16
+
17
+ masters = new Set();
18
+ backups = new Set();
19
+
13
20
  static {
14
21
  addType(this);
15
22
  }
16
23
 
17
24
  static get typeDefinition() {
18
- return typeDefinition;
25
+ return ClusterTypeDefinition;
19
26
  }
20
27
 
28
+ constructor(owner, data) {
29
+ super(owner, data);
30
+ this.read(data, ClusterTypeDefinition);
31
+ }
21
32
  }
package/src/owner.mjs CHANGED
@@ -294,7 +294,7 @@ export class Owner extends Base {
294
294
  }
295
295
 
296
296
  get locales() {
297
- if(this.owner) {
297
+ if (this.owner) {
298
298
  return this.owner.locales.union(this.#locales);
299
299
  }
300
300
  return this.#locales;
@@ -321,11 +321,10 @@ export class Owner extends Base {
321
321
  return this.#administratorEmail;
322
322
  }
323
323
 
324
- if (this.owner) {
324
+ if (this.owner && !this.#domain) {
325
325
  return this.owner.administratorEmail;
326
326
  }
327
327
 
328
- //console.log("administratorEmail", this.domain, this.toString());
329
328
  return "admin@" + this.domain;
330
329
  }
331
330
 
@@ -308,7 +308,20 @@ export class Cluster extends Owner {
308
308
  };
309
309
  };
310
310
  };
311
- properties: {};
311
+ properties: {
312
+ masters: {
313
+ type: string;
314
+ collection: boolean;
315
+ writeable: boolean;
316
+ };
317
+ backups: {
318
+ type: string;
319
+ collection: boolean;
320
+ writeable: boolean;
321
+ };
322
+ };
312
323
  };
324
+ masters: Set<any>;
325
+ backups: Set<any>;
313
326
  }
314
327
  import { Owner } from "./owner.mjs";