Skip to content

Commit

Permalink
Update aedes to version 0.50.1
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-doyle committed Dec 23, 2023
1 parent 28bfa57 commit a985bc4
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# node-red-contrib-aedes Changelog

## Dec 23, 2023, Version 0.12.0
### Notable changes
- Update aedes to version 0.50.1

## Mar 13, 2023, Version 0.11.1
### Notable changes
- LevelDB removed, crashes on certain systems
Expand Down
31 changes: 19 additions & 12 deletions aedes.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ module.exports = function (RED) {
const listenerNodes = {};
let db;

/**
* Handles a server upgrade.
*
* @param {Object} request - The request object.
* @param {Object} socket - The socket object.
* @param {Object} head - The head object.
*/
function handleServerUpgrade (request, socket, head) {
const pathname = new URL(request.url, 'http://example.org').pathname;
if (Object.prototype.hasOwnProperty.call(listenerNodes, pathname)) {
Expand Down Expand Up @@ -199,7 +206,7 @@ module.exports = function (RED) {
const msg = {
topic: 'client',
payload: {
client: client
client
}
};
node.send([msg, null]);
Expand All @@ -209,7 +216,7 @@ module.exports = function (RED) {
const msg = {
topic: 'clientReady',
payload: {
client: client
client
}
};
node.status({
Expand All @@ -224,7 +231,7 @@ module.exports = function (RED) {
const msg = {
topic: 'clientDisconnect',
payload: {
client: client
client
}
};
node.send([msg, null]);
Expand All @@ -239,8 +246,8 @@ module.exports = function (RED) {
const msg = {
topic: 'clientError',
payload: {
client: client,
err: err
client,
err
}
};
node.send([msg, null]);
Expand All @@ -255,8 +262,8 @@ module.exports = function (RED) {
const msg = {
topic: 'connectionError',
payload: {
client: client,
err: err
client,
err
}
};
node.send([msg, null]);
Expand All @@ -271,7 +278,7 @@ module.exports = function (RED) {
const msg = {
topic: 'keepaliveTimeout',
payload: {
client: client
client
}
};
node.send([msg, null]);
Expand All @@ -288,7 +295,7 @@ module.exports = function (RED) {
payload: {
topic: subscription.topic,
qos: subscription.qos,
client: client
client
}
};
node.send([msg, null]);
Expand All @@ -300,7 +307,7 @@ module.exports = function (RED) {
payload: {
topic: subscription.topic,
qos: subscription.qos,
client: client
client
}
};
node.send([msg, null]);
Expand All @@ -312,8 +319,8 @@ module.exports = function (RED) {
const msg = {
topic: 'publish',
payload: {
packet: packet,
client: client
packet,
client
}
};
node.send([null, msg]);
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"name": "node-red-contrib-aedes",
"version": "0.11.1",
"version": "0.12.0",
"description": "Node Red MQTT broker node based on aedes.js",
"dependencies": {
"aedes": "^0.49.0",
"aedes": "^0.50.1",
"aedes-persistence-mongodb": "^9.1.1",
"aedes-persistence-level": "^8.0.1",
"level": "^8.0.0",
"websocket-stream": "^5.5.2"
},
"devDependencies": {
"mqtt": "^4.3.7",
"node-red-node-test-helper": "^0.3.0"
"mqtt": "^5.3.4",
"node-red-node-test-helper": "^0.3.3"
},
"scripts": {
"test": "semistandard --verbose | snazzy && mocha test/**/*.js --exit"
Expand All @@ -23,7 +21,7 @@
}
},
"engines": {
"node": ">=12.0.0"
"node": ">=14.0.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion test/aedes_last_will_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
const helper = require('node-red-node-test-helper');
const aedesNode = require('../aedes.js');
const mqtt = require('mqtt/mqtt.js');
const mqtt = require('mqtt');
const should = require('should');

helper.init(require.resolve('node-red'));
Expand Down
2 changes: 1 addition & 1 deletion test/aedes_qos_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const helper = require('node-red-node-test-helper');
const aedesNode = require('../aedes.js');
const mqttNode = require('../node_modules/node-red/node_modules/@node-red/nodes/core/network/10-mqtt.js');
const mqtt = require('mqtt/mqtt.js');
const mqtt = require('mqtt');
const should = require('should');

helper.init(require.resolve('node-red'));
Expand Down
2 changes: 1 addition & 1 deletion test/aedes_retain_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const helper = require('node-red-node-test-helper');
const aedesNode = require('../aedes.js');
const mqttNode = require('../node_modules/node-red/node_modules/@node-red/nodes/core/network/10-mqtt.js');
const mqtt = require('mqtt/mqtt.js');
const mqtt = require('mqtt');
const should = require('should');

helper.init(require.resolve('node-red'));
Expand Down
2 changes: 1 addition & 1 deletion test/aedes_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const helper = require('node-red-node-test-helper');
const aedesNode = require('../aedes.js');
const mqttNode = require('../node_modules/node-red/node_modules/@node-red/nodes/core/network/10-mqtt.js');
const mqtt = require('mqtt/mqtt.js');
const mqtt = require('mqtt');

const credentialsOK = { n1: { username: 'test', password: 'test' }, b1: { user: 'test', password: 'test' } };
const credentialsMissing = { n1: { username: 'test', password: 'test' }, b1: { user: 'test' } };
Expand Down
2 changes: 1 addition & 1 deletion test/aedes_ws_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const helper = require('node-red-node-test-helper');
const aedesNode = require('../aedes.js');
const mqttNode = require('../node_modules/node-red/node_modules/@node-red/nodes/core/network/10-mqtt.js');
const mqtt = require('mqtt/mqtt.js');
const mqtt = require('mqtt');

helper.init(require.resolve('node-red'));

Expand Down

0 comments on commit a985bc4

Please sign in to comment.