pmcf 1.13.0 → 1.14.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.13.0",
3
+ "version": "1.14.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/model.mjs CHANGED
@@ -413,15 +413,13 @@ export class World extends Owner {
413
413
  }
414
414
  }
415
415
 
416
- class DNSService {
417
- owner;
418
-
416
+ class DNSService extends Base {
419
417
  allowedUpdates = [];
420
418
  recordTTL = "1W";
421
419
  forwardsTo = [];
422
420
 
423
421
  constructor(owner, data) {
424
- this.owner = owner;
422
+ super(owner, data);
425
423
  Object.assign(this, data);
426
424
  }
427
425
 
@@ -435,6 +433,10 @@ class DNSService {
435
433
  yield* owner.services(filter);
436
434
  }
437
435
  }
436
+
437
+ get propertyNames() {
438
+ return ["recordTTL", "forwardsTo", "allowedUpdates"];
439
+ }
438
440
  }
439
441
 
440
442
  export class Location extends Owner {
@@ -494,7 +496,7 @@ export class Location extends Owner {
494
496
  }
495
497
 
496
498
  get propertyNames() {
497
- return [...super.propertyNames, "domain" /*, "hosts"*/];
499
+ return [...super.propertyNames, "domain", "administratorEmail", "dns"];
498
500
  }
499
501
  }
500
502
 
@@ -780,6 +782,10 @@ export class Host extends Base {
780
782
  }
781
783
  }
782
784
 
785
+ get ipAddresses() {
786
+ return [...this.networkAddresses()].map(na => na.address);
787
+ }
788
+
783
789
  get ipAddress() {
784
790
  for (const a of this.networkAddresses()) {
785
791
  return a.address;
@@ -882,7 +888,7 @@ export class Service extends Base {
882
888
  #priority;
883
889
  #type;
884
890
  #port;
885
- #ipAddress;
891
+ #ipAddresses;
886
892
 
887
893
  static get typeName() {
888
894
  return "service";
@@ -906,9 +912,9 @@ export class Service extends Base {
906
912
  this.#port = data.port;
907
913
  delete data.port;
908
914
  }
909
- if (data.ipAddress) {
910
- this.#ipAddress = data.ipAddress;
911
- delete data.ipAddress;
915
+ if (data.ipAddresses) {
916
+ this.#ipAddresses = data.ipAddresses;
917
+ delete data.ipAddresses;
912
918
  }
913
919
 
914
920
  Object.assign(this, data);
@@ -933,8 +939,8 @@ export class Service extends Base {
933
939
  if (this.#port) {
934
940
  data.port = this.#port;
935
941
  }
936
- if (this.#ipAddress) {
937
- data.ipAddress = this.#ipAddress;
942
+ if (this.#ipAddresses) {
943
+ data.ipAddresses = this.#ipAddresses;
938
944
  }
939
945
  return new this.constructor(owner, data);
940
946
  }
@@ -953,8 +959,8 @@ export class Service extends Base {
953
959
  }
954
960
  }
955
961
 
956
- get ipAddress() {
957
- return this.#ipAddress || this.owner.ipAddress;
962
+ get ipAddresses() {
963
+ return this.#ipAddresses || this.owner.ipAddresses;
958
964
  }
959
965
 
960
966
  get port() {
@@ -980,7 +986,7 @@ export class Service extends Base {
980
986
  get propertyNames() {
981
987
  return [
982
988
  ...super.propertyNames,
983
- "ipAddress",
989
+ "ipAddresses",
984
990
  "port",
985
991
  "protocol",
986
992
  "alias",
package/types/model.d.mts CHANGED
@@ -119,6 +119,7 @@ export class Host extends Base {
119
119
  address: any;
120
120
  networkInterface: any;
121
121
  }, void, unknown>;
122
+ get ipAddresses(): any[];
122
123
  get ipAddress(): any;
123
124
  publicKey(type?: string): Promise<string>;
124
125
  toJSON(): {
@@ -137,7 +138,7 @@ export class Service extends Base {
137
138
  alias: any;
138
139
  get protocol(): any;
139
140
  get srvPrefix(): string;
140
- get ipAddress(): any;
141
+ get ipAddresses(): any;
141
142
  get port(): any;
142
143
  get priority(): any;
143
144
  get weight(): any;
@@ -145,9 +146,7 @@ export class Service extends Base {
145
146
  get type(): any;
146
147
  #private;
147
148
  }
148
- declare class DNSService {
149
- constructor(owner: any, data: any);
150
- owner: any;
149
+ declare class DNSService extends Base {
151
150
  allowedUpdates: any[];
152
151
  recordTTL: string;
153
152
  forwardsTo: any[];