pmcf 2.51.6 → 2.51.7

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": "2.51.6",
3
+ "version": "2.51.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/endpoint.mjs CHANGED
@@ -89,7 +89,7 @@ export class DomainNameEndpoint extends PortEndpoint {
89
89
  }
90
90
  }
91
91
 
92
- export class HTTPEndpoint extends PortEndpoint {
92
+ export class HTTPEndpoint extends BaseEndpoint {
93
93
  constructor(service, address, data) {
94
94
  super(service, data);
95
95
 
@@ -98,21 +98,24 @@ export class HTTPEndpoint extends PortEndpoint {
98
98
  } else if (address instanceof URL) {
99
99
  this.url = address;
100
100
  } else {
101
+ this.family = address.family;
101
102
  this.url = new URL(
102
- "http://" +
103
+ (data.tls ? "https://" : "http://") +
103
104
  (address.family === "IPv6"
104
105
  ? "[" + address.address + "]"
105
106
  : address.address) +
106
107
  ":" +
107
108
  data.port +
108
- data.path
109
+ (data.pathname || "/")
109
110
  );
110
111
  this.hostname = address.address;
111
112
  }
112
113
  }
113
114
 
114
115
  get port() {
115
- return this.url.port || 80;
116
+ return (
117
+ this.url.port || (this.url.toString().startsWith("https:") ? 443 : 80)
118
+ );
116
119
  }
117
120
 
118
121
  get pathname() {
@@ -123,6 +126,14 @@ export class HTTPEndpoint extends PortEndpoint {
123
126
  return this.url;
124
127
  }
125
128
 
129
+ get protocol() {
130
+ return "tcp";
131
+ }
132
+
133
+ get tls() {
134
+ return this.url.toString().startsWith("https:");
135
+ }
136
+
126
137
  toString() {
127
138
  return `${this.type}:${this.url}`;
128
139
  }
@@ -25,7 +25,7 @@ const DHCPServiceTypeDefinition = {
25
25
  const controlAgentEndpoint = {
26
26
  type: "kea-control-agent",
27
27
  port: 53002,
28
- path: "/",
28
+ pathname: "/",
29
29
  method: "get",
30
30
  protocol: "tcp",
31
31
  tls: false
@@ -14,13 +14,16 @@ export class DomainNameEndpoint extends PortEndpoint {
14
14
  get networkInterface(): {};
15
15
  get address(): any;
16
16
  }
17
- export class HTTPEndpoint extends PortEndpoint {
17
+ export class HTTPEndpoint extends BaseEndpoint {
18
18
  constructor(service: any, address: any, data: any);
19
19
  url: URL;
20
+ family: any;
20
21
  hostname: any;
21
- get port(): string | 80;
22
+ get port(): string | 80 | 443;
22
23
  get pathname(): string;
23
24
  get address(): URL;
25
+ get protocol(): string;
26
+ get tls(): boolean;
24
27
  }
25
28
  export class UnixEndpoint extends BaseEndpoint {
26
29
  constructor(service: any, path: any, data: any);