@kronos-integration/service-mqtt 1.0.6 → 1.0.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 +2 -2
- package/src/service-mqtt.mjs +8 -2
- package/src/topic-endpoint.mjs +0 -1
- package/tests/mqtt-ava.mjs +1 -2
- package/types/service-mqtt.d.mts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/service-mqtt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@kronos-integration/service": "^11.2.15",
|
|
40
40
|
"model-attributes": "^4.3.0",
|
|
41
|
-
"mqtt": "^5.13.
|
|
41
|
+
"mqtt": "^5.13.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@kronos-integration/test-interceptor": "^7.0.29",
|
package/src/service-mqtt.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
mergeAttributeDefinitions,
|
|
3
|
+
prepareAttributesDefinitions
|
|
4
|
+
} from "model-attributes";
|
|
2
5
|
import { Service } from "@kronos-integration/service";
|
|
3
6
|
import { connect } from "mqtt";
|
|
4
7
|
import { TopicEndpoint } from "./topic-endpoint.mjs";
|
|
@@ -76,7 +79,9 @@ export class ServiceMQTT extends Service {
|
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
get topics() {
|
|
79
|
-
return Object.
|
|
82
|
+
return Object.values(this.endpoints)
|
|
83
|
+
.filter(e => e.topic)
|
|
84
|
+
.map(e => e.name);
|
|
80
85
|
}
|
|
81
86
|
|
|
82
87
|
/**
|
|
@@ -117,6 +122,7 @@ export class ServiceMQTT extends Service {
|
|
|
117
122
|
}
|
|
118
123
|
|
|
119
124
|
async _stop() {
|
|
125
|
+
await this.client.endAsync();
|
|
120
126
|
return super._stop();
|
|
121
127
|
}
|
|
122
128
|
}
|
package/src/topic-endpoint.mjs
CHANGED
package/tests/mqtt-ava.mjs
CHANGED