pmcf 2.70.2 → 2.70.4
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/README.md +15 -0
- package/package.json +1 -1
- package/src/endpoint.mjs +9 -5
- package/src/services/mosquitto.mjs +4 -1
- package/types/endpoint.d.mts +10 -1
package/README.md
CHANGED
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
* [extends](#extends)
|
|
26
26
|
* [findService](#findservice)
|
|
27
27
|
* [Parameters](#parameters-1)
|
|
28
|
+
* [port](#port)
|
|
29
|
+
* [socketAddress](#socketaddress)
|
|
30
|
+
* [port](#port-1)
|
|
28
31
|
* [SkeletonNetworkInterface](#skeletonnetworkinterface)
|
|
29
32
|
* [networkAddresses](#networkaddresses)
|
|
30
33
|
* [Parameters](#parameters-2)
|
|
@@ -57,6 +60,18 @@ Returns **Iterable<[Base](#base)>** 
|
|
|
57
60
|
|
|
58
61
|
Returns **any** service with the highest priority
|
|
59
62
|
|
|
63
|
+
## port
|
|
64
|
+
|
|
65
|
+
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
|
|
66
|
+
|
|
67
|
+
## socketAddress
|
|
68
|
+
|
|
69
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
70
|
+
|
|
71
|
+
## port
|
|
72
|
+
|
|
73
|
+
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
|
|
74
|
+
|
|
60
75
|
## SkeletonNetworkInterface
|
|
61
76
|
|
|
62
77
|
**Extends ServiceOwner**
|
package/package.json
CHANGED
package/src/endpoint.mjs
CHANGED
|
@@ -34,10 +34,16 @@ class PortEndpoint extends BaseEndpoint {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* @return {number}
|
|
39
|
+
*/
|
|
37
40
|
get port() {
|
|
38
41
|
return this._port ?? this.service.port;
|
|
39
42
|
}
|
|
40
43
|
|
|
44
|
+
/**
|
|
45
|
+
* @return {string}
|
|
46
|
+
*/
|
|
41
47
|
get socketAddress() {
|
|
42
48
|
return `${this.address}:${this.port}`;
|
|
43
49
|
}
|
|
@@ -53,11 +59,6 @@ export class Endpoint extends PortEndpoint {
|
|
|
53
59
|
this.networkAddress = networkAddress;
|
|
54
60
|
}
|
|
55
61
|
|
|
56
|
-
/*
|
|
57
|
-
get socketAddress() {
|
|
58
|
-
return `${this.address}:${this.port}`;
|
|
59
|
-
}*/
|
|
60
|
-
|
|
61
62
|
get hostName() {
|
|
62
63
|
return this.networkAddress.networkInterface.hostName;
|
|
63
64
|
}
|
|
@@ -125,6 +126,9 @@ export class HTTPEndpoint extends BaseEndpoint {
|
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
|
|
129
|
+
/**
|
|
130
|
+
* @return {number}
|
|
131
|
+
*/
|
|
128
132
|
get port() {
|
|
129
133
|
const port = this.url.port;
|
|
130
134
|
if (port.length) {
|
|
@@ -56,7 +56,10 @@ export class MosquittoService extends Service {
|
|
|
56
56
|
const lines = [
|
|
57
57
|
`listener ${endpoint.port}`,
|
|
58
58
|
"log_timestamp false",
|
|
59
|
-
"allow_anonymous true"
|
|
59
|
+
"allow_anonymous true",
|
|
60
|
+
"persistence_location /var/lib/mosquitto",
|
|
61
|
+
"password_file /etc/mosquitto/passwd",
|
|
62
|
+
"acl_file /etc/mosquitto/acl"
|
|
60
63
|
];
|
|
61
64
|
|
|
62
65
|
await writeLines(join(dir, "etc", "mosquitto"), "mosquitto.conf", lines);
|
package/types/endpoint.d.mts
CHANGED
|
@@ -20,6 +20,9 @@ export class HTTPEndpoint extends BaseEndpoint {
|
|
|
20
20
|
url: URL;
|
|
21
21
|
family: any;
|
|
22
22
|
hostname: any;
|
|
23
|
+
/**
|
|
24
|
+
* @return {number}
|
|
25
|
+
*/
|
|
23
26
|
get port(): number;
|
|
24
27
|
get pathname(): string;
|
|
25
28
|
get address(): URL;
|
|
@@ -37,7 +40,13 @@ declare class PortEndpoint extends BaseEndpoint {
|
|
|
37
40
|
_port: any;
|
|
38
41
|
protocol: any;
|
|
39
42
|
tls: any;
|
|
40
|
-
|
|
43
|
+
/**
|
|
44
|
+
* @return {number}
|
|
45
|
+
*/
|
|
46
|
+
get port(): number;
|
|
47
|
+
/**
|
|
48
|
+
* @return {string}
|
|
49
|
+
*/
|
|
41
50
|
get socketAddress(): string;
|
|
42
51
|
}
|
|
43
52
|
declare class BaseEndpoint {
|