@ipsme/msgenv-mqtt 0.2.1 → 0.2.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.
@@ -13003,7 +13003,7 @@ var auth = {};
13003
13003
 
13004
13004
  var shared = {};
13005
13005
 
13006
- var version = "5.14.1";
13006
+ var version = "5.15.1";
13007
13007
  var require$$0$2 = {
13008
13008
  version: version};
13009
13009
 
@@ -31290,6 +31290,7 @@ function requireMqtt () {
31290
31290
  exports$1.Client = client_1.default;
31291
31291
  __exportStar(requireClient(), exports$1);
31292
31292
  __exportStar(requireShared(), exports$1);
31293
+ __exportStar(requireValidations(), exports$1);
31293
31294
  var ack_1 = requireAck();
31294
31295
  Object.defineProperty(exports$1, "ReasonCodes", { enumerable: true, get: function () { return ack_1.ReasonCodes; } });
31295
31296
 
@@ -31388,16 +31389,19 @@ class MsgEnvSingleton {
31388
31389
  hostname: 'localhost', // or '127.0.0.1'
31389
31390
  port: 1883
31390
31391
  });
31391
- this.client.on('error', function (err) {
31392
+ this.client.on('error', (err) => {
31392
31393
  console.error('MQTT Connection Error:', err);
31393
31394
  });
31394
- this.client.on('connect', function () {
31395
- // console.log('MQTT Connected');
31395
+ this.client.on('connect', () => {
31396
+ logr_.log(l_.CONNECTIONS, () => ['MQTT connected / reconnected successfully']);
31397
+ });
31398
+ this.client.on('disconnect', () => {
31399
+ logr_.log(l_.CONNECTIONS, () => ['MQTT clean disconnect']);
31396
31400
  });
31397
31401
  this.client.on('close', () => {
31398
- if (!this._disposed) {
31399
- logr_.log(l_.CONNECTIONS, () => ['MQTT client disconnected unexpectedly']);
31400
- }
31402
+ if (this._disposed)
31403
+ return;
31404
+ logr_.log(l_.CONNECTIONS, () => ['MQTT DISCONNECTED unexpectedly (will auto-reconnect)']);
31401
31405
  });
31402
31406
  }
31403
31407
  static get_instance() {
@@ -13001,7 +13001,7 @@ var auth = {};
13001
13001
 
13002
13002
  var shared = {};
13003
13003
 
13004
- var version = "5.14.1";
13004
+ var version = "5.15.1";
13005
13005
  var require$$0$2 = {
13006
13006
  version: version};
13007
13007
 
@@ -31288,6 +31288,7 @@ function requireMqtt () {
31288
31288
  exports$1.Client = client_1.default;
31289
31289
  __exportStar(requireClient(), exports$1);
31290
31290
  __exportStar(requireShared(), exports$1);
31291
+ __exportStar(requireValidations(), exports$1);
31291
31292
  var ack_1 = requireAck();
31292
31293
  Object.defineProperty(exports$1, "ReasonCodes", { enumerable: true, get: function () { return ack_1.ReasonCodes; } });
31293
31294
 
@@ -31386,16 +31387,19 @@ class MsgEnvSingleton {
31386
31387
  hostname: 'localhost', // or '127.0.0.1'
31387
31388
  port: 1883
31388
31389
  });
31389
- this.client.on('error', function (err) {
31390
+ this.client.on('error', (err) => {
31390
31391
  console.error('MQTT Connection Error:', err);
31391
31392
  });
31392
- this.client.on('connect', function () {
31393
- // console.log('MQTT Connected');
31393
+ this.client.on('connect', () => {
31394
+ logr_.log(l_.CONNECTIONS, () => ['MQTT connected / reconnected successfully']);
31395
+ });
31396
+ this.client.on('disconnect', () => {
31397
+ logr_.log(l_.CONNECTIONS, () => ['MQTT clean disconnect']);
31394
31398
  });
31395
31399
  this.client.on('close', () => {
31396
- if (!this._disposed) {
31397
- logr_.log(l_.CONNECTIONS, () => ['MQTT client disconnected unexpectedly']);
31398
- }
31400
+ if (this._disposed)
31401
+ return;
31402
+ logr_.log(l_.CONNECTIONS, () => ['MQTT DISCONNECTED unexpectedly (will auto-reconnect)']);
31399
31403
  });
31400
31404
  }
31401
31405
  static get_instance() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ipsme/msgenv-mqtt",
3
- "version": "0.2.1",
3
+ "version": "0.2.7",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -28,18 +28,18 @@
28
28
  },
29
29
  "homepage": "https://github.com/IPSME/npm-msgenv-MQTT#readme",
30
30
  "dependencies": {
31
- "@knev/bitlogr": "^3.1.3",
32
- "mqtt": "^5.14.1"
31
+ "@knev/bitlogr": "^3.2.2",
32
+ "mqtt": "^5.15.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@rollup/plugin-commonjs": "^29.0.0",
35
+ "@rollup/plugin-commonjs": "^29.0.2",
36
36
  "@rollup/plugin-json": "^6.1.0",
37
37
  "@rollup/plugin-node-resolve": "^16.0.3",
38
38
  "@rollup/plugin-typescript": "^12.3.0",
39
- "@types/node": "^25.0.9",
39
+ "@types/node": "^25.6.0",
40
40
  "del-cli": "^7.0.0",
41
- "rollup": "^4.55.3",
41
+ "rollup": "^4.60.1",
42
42
  "tslib": "^2.8.1",
43
- "typescript": "^5.9.3"
43
+ "typescript": "^6.0.3"
44
44
  }
45
45
  }
@@ -58,18 +58,21 @@ class MsgEnvSingleton {
58
58
  port: 1883
59
59
  });
60
60
 
61
- this.client.on('error', function (err) {
61
+ this.client.on('error', (err) => {
62
62
  console.error('MQTT Connection Error:', err);
63
63
  });
64
64
 
65
- this.client.on('connect', function () {
66
- // console.log('MQTT Connected');
65
+ this.client.on('connect', () => {
66
+ logr_.log(l_.CONNECTIONS, () => ['MQTT connected / reconnected successfully']);
67
+ });
68
+
69
+ this.client.on('disconnect', () => {
70
+ logr_.log(l_.CONNECTIONS, () => ['MQTT clean disconnect']);
67
71
  });
68
72
 
69
73
  this.client.on('close', () => {
70
- if (!this._disposed) {
71
- logr_.log(l_.CONNECTIONS, () => ['MQTT client disconnected unexpectedly']);
72
- }
74
+ if (this._disposed) return;
75
+ logr_.log(l_.CONNECTIONS, () => ['MQTT DISCONNECTED unexpectedly (will auto-reconnect)']);
73
76
  });
74
77
  }
75
78
 
package/tsconfig.json CHANGED
@@ -28,7 +28,7 @@
28
28
  /* Modules */
29
29
  "module": "ESNext", /* Specify what module code is generated. */
30
30
  "rootDir": "./src", /* Specify the root folder within your source files. */
31
- "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
31
+ "moduleResolution": "bundler", /* Specify how TypeScript looks up a file from a given module specifier. */
32
32
  // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
33
33
  // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
34
34
  // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */