Skip to content

Commit c321059

Browse files
3.0.0 (#1)
* build: 3.0.0
1 parent 2dc2b80 commit c321059

File tree

10 files changed

+350
-198
lines changed

10 files changed

+350
-198
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
api
33
node_modules
44
samples
5-
*.md
6-
*.json
75
.DS_Store
86
LICENSE

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"global": true
1010
},
1111
"parserOptions": {
12-
"ecmaVersion": 2020,
12+
"ecmaVersion": 2021,
1313
"sourceType": "module",
1414
"ecmaFeatures": {
1515
"jsx": true

.prettierignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ LICENSE
88
*.png
99
*.txt
1010
TODO
11-
docs/functions.md
12-
*.md
13-
test.log

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Runnerty Tech S.L.
3+
Copyright (c) 2021 Runnerty Tech S.L.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,42 @@
77

88
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Dependency Status][david-badge]][david-badge-url]
99
<a href="#badge">
10-
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg">
10+
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg">
1111
</a>
1212

1313
# Executor for [Runnerty]: MQTT
14+
1415
Module MQTT Publisher.
1516
This is a wrapper from the [MQTT.js](https://github.com/mqttjs/MQTT.js)
1617

1718
### Installation:
19+
20+
Through NPM
21+
1822
```bash
1923
npm i @runnerty/executor-mqtt
2024
```
2125

26+
You can also add modules to your project with [runnerty-cli]
27+
28+
```bash
29+
npx runnerty-cli add @runnerty/executor-mqtt
30+
```
31+
32+
This command installs the module in your project, adds example configuration in your `config.json` and creates an example plan of use.
33+
34+
If you have installed [runnerty-cli] globally you can include the module with this command:
35+
36+
```bash
37+
rty add @runnerty/executor-mqtt
38+
```
39+
2240
### Configuration:
41+
2342
Add in [config.json]:
43+
2444
##### Simple:
45+
2546
```json
2647
{
2748
"id": "mqtt_default",
@@ -31,6 +52,7 @@ Add in [config.json]:
3152
```
3253

3354
##### All parameters:
55+
3456
```json
3557
{
3658
"id": "mqtt_default",
@@ -54,26 +76,29 @@ Add in [config.json]:
5476
"tlsCAFile": "./my_cert.ca",
5577
"rejectUnauthorized": false,
5678
"properties": {
57-
"sessionExpiryInterval": 3600,
58-
"receiveMaximum": 1024,
59-
"maximumPacketSize": 32,
60-
"topicAliasMaximum":32,
61-
"requestResponseInformation": true,
62-
"userProperties": {
63-
"some": "value"
64-
},
65-
"authenticationMethod": "auth_method",
66-
"authPacket": {
67-
"some": "value"
68-
},
69-
"resubscribe": true
79+
"sessionExpiryInterval": 3600,
80+
"receiveMaximum": 1024,
81+
"maximumPacketSize": 32,
82+
"topicAliasMaximum": 32,
83+
"requestResponseInformation": true,
84+
"userProperties": {
85+
"some": "value"
86+
},
87+
"authenticationMethod": "auth_method",
88+
"authPacket": {
89+
"some": "value"
90+
},
91+
"resubscribe": true
7092
}
7193
}
7294
```
7395

7496
### Plan sample:
97+
7598
Add in [plan.json]:
99+
76100
##### Simple:
101+
77102
```json
78103
{
79104
"id": "mqtt_default",
@@ -94,15 +119,15 @@ Add in [plan.json]:
94119
"retain": false,
95120
"dup": false,
96121
"properties": {
97-
"payloadFormatIndicator": true,
98-
"messageExpiryInterval": 60,
99-
"topicAlias": 1,
100-
"responseTopic": "res_topic",
101-
"userProperties": {
102-
"some": "value"
103-
},
104-
"subscriptionIdentifier": 1234,
105-
"contentType": "contenttype_value"
122+
"payloadFormatIndicator": true,
123+
"messageExpiryInterval": 60,
124+
"topicAlias": 1,
125+
"responseTopic": "res_topic",
126+
"userProperties": {
127+
"some": "value"
128+
},
129+
"subscriptionIdentifier": 1234,
130+
"contentType": "contenttype_value"
106131
}
107132
}
108133
}
@@ -111,13 +136,15 @@ Add in [plan.json]:
111136
More information in MQTT [api reference](https://github.com/mqttjs/MQTT.js/#api)
112137

113138
### Output (Process values):
114-
* `PROCESS_EXEC_ERR_OUTPUT`: Error output message.
115139

116-
[Runnerty]: http://www.runnerty.io
140+
- `PROCESS_EXEC_ERR_OUTPUT`: Error output message.
141+
142+
[runnerty]: http://www.runnerty.io
117143
[downloads-image]: https://img.shields.io/npm/dm/@runnerty/executor-mqtt.svg
118144
[npm-url]: https://www.npmjs.com/package/@runnerty/executor-mqtt
119145
[npm-image]: https://img.shields.io/npm/v/@runnerty/executor-mqtt.svg
120146
[david-badge]: https://david-dm.org/runnerty/executor-mqtt.svg
121147
[david-badge-url]: https://david-dm.org/runnerty/executor-mqtt
122148
[config.json]: http://docs.runnerty.io/config/
123149
[plan.json]: http://docs.runnerty.io/plan/
150+
[runnerty-cli]: https://www.npmjs.com/package/runnerty-cli

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
22
const mqtt = require('async-mqtt');
33

4-
const Execution = global.ExecutionClass;
4+
const Executor = require('@runnerty/module-core').Executor;
55

6-
class mqttExecutor extends Execution {
6+
class mqttExecutor extends Executor {
77
constructor(process) {
88
super(process);
99
this.options = {};

0 commit comments

Comments
 (0)