@kronos-integration/service-mqtt 4.0.9 → 4.0.11
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 +4 -4
- package/src/service-mqtt.mjs +12 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kronos-integration/service-mqtt",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"lint:docs": "documentation lint ./src/**/*.mjs"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@kronos-integration/service": "^15.
|
|
36
|
+
"@kronos-integration/service": "^15.1.1",
|
|
37
37
|
"mqtt": "^5.14.1",
|
|
38
|
-
"pacc": "^5.
|
|
38
|
+
"pacc": "^5.1.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"ava": "^6.4.1",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"semantic-release": "^25.0.2"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
|
-
"node": ">=24.
|
|
47
|
+
"node": ">=24.11.1"
|
|
48
48
|
},
|
|
49
49
|
"repository": {
|
|
50
50
|
"type": "git",
|
package/src/service-mqtt.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
getAttributesJSON,
|
|
2
3
|
prepareAttributesDefinitions,
|
|
3
4
|
string_attribute_writable,
|
|
4
5
|
url_attribute,
|
|
@@ -40,17 +41,17 @@ export class ServiceMQTT extends Service {
|
|
|
40
41
|
...integer_attribute_writable,
|
|
41
42
|
default: 60,
|
|
42
43
|
needsRestart: true,
|
|
43
|
-
|
|
44
|
+
connectionOption: true
|
|
44
45
|
},
|
|
45
|
-
clean: { ...boolean_attribute_writable_false,
|
|
46
|
-
clientId: { ...string_attribute_writable,
|
|
47
|
-
connectTimeout: { ...timeout_attribute,
|
|
46
|
+
clean: { ...boolean_attribute_writable_false, connectionOption: true },
|
|
47
|
+
clientId: { ...string_attribute_writable, connectionOption: true },
|
|
48
|
+
connectTimeout: { ...timeout_attribute, connectionOption: true },
|
|
48
49
|
reconnectPeriod: {
|
|
49
50
|
...integer_attribute_writable,
|
|
50
|
-
|
|
51
|
+
connectionOption: true
|
|
51
52
|
},
|
|
52
|
-
username: username_attribute,
|
|
53
|
-
password: password_attribute
|
|
53
|
+
username: { ...username_attribute, credential: true },
|
|
54
|
+
password: { ...password_attribute, credential: true }
|
|
54
55
|
},
|
|
55
56
|
Service.attributes
|
|
56
57
|
);
|
|
@@ -85,13 +86,10 @@ export class ServiceMQTT extends Service {
|
|
|
85
86
|
async _start() {
|
|
86
87
|
await super._start();
|
|
87
88
|
|
|
88
|
-
const options =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
attribute.isConnectionOption && this[name] !== undefined
|
|
93
|
-
)
|
|
94
|
-
.map(([name]) => [name, this[name]])
|
|
89
|
+
const options = getAttributesJSON(
|
|
90
|
+
this,
|
|
91
|
+
this.attributes,
|
|
92
|
+
(name, attribute) => attribute.connectionOption
|
|
95
93
|
);
|
|
96
94
|
|
|
97
95
|
options.username = await this.getCredential("username");
|