@kronos-integration/service-mqtt 1.0.1 → 1.0.2
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/.github/workflows/ci.yml +2 -5
- package/.github/workflows/codeql_analysis.yml +1 -1
- package/.github/workflows/update_package_lock.yml +1 -1
- package/.github/workflows/update_readme_api.yml +1 -1
- package/package.json +9 -9
- package/src/service-mqtt.mjs +30 -3
- package/types/service-mqtt.d.mts +1 -2
package/.github/workflows/ci.yml
CHANGED
|
@@ -18,11 +18,8 @@ jobs:
|
|
|
18
18
|
os:
|
|
19
19
|
- ubuntu-latest
|
|
20
20
|
node-version:
|
|
21
|
-
-
|
|
22
|
-
- 24.3.0
|
|
21
|
+
- 24.4.1
|
|
23
22
|
steps:
|
|
24
|
-
- name: install
|
|
25
|
-
run: sudo apt-get -y install mosquitto
|
|
26
23
|
- name: checkout
|
|
27
24
|
uses: actions/checkout@v4.2.2
|
|
28
25
|
- name: prepare node
|
|
@@ -58,7 +55,7 @@ jobs:
|
|
|
58
55
|
- name: prepare node
|
|
59
56
|
uses: actions/setup-node@v4.4.0
|
|
60
57
|
with:
|
|
61
|
-
node-version: 22.17.
|
|
58
|
+
node-version: 22.17.1
|
|
62
59
|
cache: npm
|
|
63
60
|
cache-dependency-path: package-lock.json
|
|
64
61
|
- name: install
|
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.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"types": "./types/service-mqtt.d.mts"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"description": "
|
|
15
|
+
"description": "MQTT service",
|
|
16
16
|
"keywords": [
|
|
17
17
|
"mqtt",
|
|
18
18
|
"kronos-service"
|
|
@@ -36,23 +36,23 @@
|
|
|
36
36
|
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib es2024 -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@kronos-integration/service": "^11.2.
|
|
40
|
-
"attributes": "^
|
|
41
|
-
"mqtt": "^5.13.
|
|
39
|
+
"@kronos-integration/service": "^11.2.13",
|
|
40
|
+
"model-attributes": "^4.2.6",
|
|
41
|
+
"mqtt": "^5.13.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@kronos-integration/test-interceptor": "^7.0.29",
|
|
45
|
-
"@types/node": "^24.0.
|
|
46
|
-
"ava": "^6.4.
|
|
45
|
+
"@types/node": "^24.0.14",
|
|
46
|
+
"ava": "^6.4.1",
|
|
47
47
|
"c8": "^10.1.3",
|
|
48
48
|
"documentation": "^14.0.3",
|
|
49
49
|
"got": "^14.4.7",
|
|
50
50
|
"network-address": "^1.1.2",
|
|
51
|
-
"semantic-release": "^24.2.
|
|
51
|
+
"semantic-release": "^24.2.7",
|
|
52
52
|
"typescript": "^5.8.3"
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
55
|
-
"node": ">=22.
|
|
55
|
+
"node": ">=22.17.1"
|
|
56
56
|
},
|
|
57
57
|
"repository": {
|
|
58
58
|
"type": "git",
|
package/src/service-mqtt.mjs
CHANGED
|
@@ -28,11 +28,24 @@ export class ServiceMQTT extends Service {
|
|
|
28
28
|
needsRestart: true,
|
|
29
29
|
type: "url"
|
|
30
30
|
},
|
|
31
|
+
clean: {
|
|
32
|
+
type: "boolean"
|
|
33
|
+
},
|
|
34
|
+
clientId: {
|
|
35
|
+
type: "string"
|
|
36
|
+
},
|
|
37
|
+
connectTimeout: {
|
|
38
|
+
type: "integer"
|
|
39
|
+
},
|
|
40
|
+
reconnectPeriod: {
|
|
41
|
+
type: "integer"
|
|
42
|
+
},
|
|
31
43
|
username: {
|
|
32
44
|
type: "string"
|
|
33
45
|
},
|
|
34
46
|
password: {
|
|
35
|
-
type: "string"
|
|
47
|
+
type: "string",
|
|
48
|
+
private: true
|
|
36
49
|
}
|
|
37
50
|
}),
|
|
38
51
|
Service.configurationAttributes
|
|
@@ -47,11 +60,24 @@ export class ServiceMQTT extends Service {
|
|
|
47
60
|
}
|
|
48
61
|
|
|
49
62
|
get options() {
|
|
50
|
-
return
|
|
63
|
+
return Object.fromEntries(
|
|
64
|
+
[
|
|
65
|
+
"username",
|
|
66
|
+
"password",
|
|
67
|
+
"clean",
|
|
68
|
+
"clientId",
|
|
69
|
+
"connectTimeout",
|
|
70
|
+
"reconnectPeriod"
|
|
71
|
+
]
|
|
72
|
+
.filter(key => this[key] !== undefined)
|
|
73
|
+
.map(key => [key, this[key]])
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
//return { username: this.username, password: this.password };
|
|
51
77
|
}
|
|
52
78
|
|
|
53
79
|
get topics() {
|
|
54
|
-
return Object.keys(this.endpoints).filter(e=>e.topic);
|
|
80
|
+
return Object.keys(this.endpoints).filter(e => e.topic);
|
|
55
81
|
}
|
|
56
82
|
|
|
57
83
|
/**
|
|
@@ -71,6 +97,7 @@ export class ServiceMQTT extends Service {
|
|
|
71
97
|
async _start() {
|
|
72
98
|
await super._start();
|
|
73
99
|
|
|
100
|
+
console.log(this.options);
|
|
74
101
|
const client = connect(this.url, this.options);
|
|
75
102
|
|
|
76
103
|
this.client = client;
|