pmcf 1.11.0 → 1.13.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.11.0",
3
+ "version": "1.13.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -48,7 +48,7 @@
48
48
  "typescript": "^5.7.3"
49
49
  },
50
50
  "engines": {
51
- "node": ">=22.13.0"
51
+ "node": ">=22.13.1"
52
52
  },
53
53
  "repository": {
54
54
  "type": "git",
package/src/model.mjs CHANGED
@@ -430,7 +430,7 @@ class DNSService {
430
430
 
431
431
  yield* this.owner.services(filter);
432
432
 
433
- for (const s of this.forwardsTo) {
433
+ for (const s of asArray(this.forwardsTo)) {
434
434
  const owner = await this.owner.world.load(s);
435
435
  yield* owner.services(filter);
436
436
  }
@@ -481,7 +481,6 @@ export class Location extends Owner {
481
481
  return this.#dns;
482
482
  }
483
483
 
484
-
485
484
  async *networkAddresses() {
486
485
  for await (const host of this.hosts()) {
487
486
  for (const networkAddresses of host.networkAddresses()) {
@@ -592,7 +591,9 @@ export class Host extends Base {
592
591
  }
593
592
 
594
593
  if (data.extends) {
595
- data.extends = await Promise.all(data.extends.map(e => world.host(e)));
594
+ data.extends = await Promise.all(
595
+ asArray(data.extends).map(e => world.host(e))
596
+ );
596
597
  }
597
598
 
598
599
  return this;
@@ -863,15 +864,15 @@ export class Subnet extends Base {
863
864
  }
864
865
 
865
866
  const ServiceTypes = {
866
- dns: { srvPrefix: "_dns._udp", port: 53 },
867
- ldap: { srvPrefix: "_ldap._tcp", port: 389 },
868
- http: { srvPrefix: "_http._tcp", port: 80 },
869
- https: { srvPrefix: "_http._tcp", port: 443 },
870
- rtsp: { srvPrefix: "_rtsp._tcp", port: 554 },
871
- smtp: { srvPrefix: "_smtp._tcp", port: 25 },
872
- ssh: { srvPrefix: "_ssh._tcp", port: 22 },
873
- imap: { srvPrefix: "_imap._tcp", port: 143 },
874
- imaps: { srvPrefix: "_imaps._tcp", port: 993 },
867
+ dns: { protocol: "udp", port: 53 },
868
+ ldap: { protocol: "tcp", port: 389 },
869
+ http: { protocol: "tcp", port: 80 },
870
+ https: { protocol: "tcp", port: 443 },
871
+ rtsp: { protocol: "tcp", port: 554 },
872
+ smtp: { protocol: "tcp", port: 25 },
873
+ ssh: { protocol: "tcp", port: 22 },
874
+ imap: { protocol: "tcp", port: 143 },
875
+ imaps: { protocol: "tcp", port: 993 },
875
876
  dhcp: {}
876
877
  };
877
878
 
@@ -941,8 +942,15 @@ export class Service extends Base {
941
942
  return this;
942
943
  }
943
944
 
945
+ get protocol() {
946
+ return ServiceTypes[this.type]?.protocol;
947
+ }
948
+
944
949
  get srvPrefix() {
945
- return ServiceTypes[this.type]?.srvPrefix;
950
+ const st = ServiceTypes[this.type];
951
+ if (st) {
952
+ return `_${this.type}._${st.protocol}`;
953
+ }
946
954
  }
947
955
 
948
956
  get ipAddress() {
@@ -973,6 +981,8 @@ export class Service extends Base {
973
981
  return [
974
982
  ...super.propertyNames,
975
983
  "ipAddress",
984
+ "port",
985
+ "protocol",
976
986
  "alias",
977
987
  "type",
978
988
  "master",
package/types/model.d.mts CHANGED
@@ -135,7 +135,8 @@ export class Subnet extends Base {
135
135
  }
136
136
  export class Service extends Base {
137
137
  alias: any;
138
- get srvPrefix(): any;
138
+ get protocol(): any;
139
+ get srvPrefix(): string;
139
140
  get ipAddress(): any;
140
141
  get port(): any;
141
142
  get priority(): any;