mqtt-plus 1.4.21 → 1.4.23
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/.ase/service.log +49 -0
- package/.ase/service.yaml +1 -0
- package/CHANGELOG.md +7 -0
- package/dst-stage1/mqtt-plus-base.js +13 -0
- package/dst-stage1/mqtt-plus-options.js +1 -3
- package/dst-stage2/mqtt-plus.cjs.cjs +5 -1
- package/dst-stage2/mqtt-plus.esm.js +5 -1
- package/dst-stage2/mqtt-plus.umd.js +2 -2
- package/package.d/{vite+8.0.12.patch → vite+8.0.13.patch} +2 -2
- package/package.json +4 -4
- package/src/mqtt-plus-base.ts +14 -0
- package/src/mqtt-plus-options.ts +1 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
diff --git a/node_modules/vite/dist/node/chunks/node.js b/node_modules/vite/dist/node/chunks/node.js
|
|
2
|
-
index
|
|
2
|
+
index 07bab15..3e9d0d0 100644
|
|
3
3
|
--- a/node_modules/vite/dist/node/chunks/node.js
|
|
4
4
|
+++ b/node_modules/vite/dist/node/chunks/node.js
|
|
5
|
-
@@ -
|
|
5
|
+
@@ -34918,7 +34918,6 @@ async function runConfigHook(config, plugins, configEnv) {
|
|
6
6
|
const res = await getHookHandler(hook).call(context, conf, configEnv);
|
|
7
7
|
if (res && res !== conf) {
|
|
8
8
|
if (hasBothRollupOptionsAndRolldownOptions(res)) context.warn(`Both \`rollupOptions\` and \`rolldownOptions\` were specified by ${JSON.stringify(p.name)} plugin. \`rollupOptions\` specified by that plugin will be ignored.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mqtt-plus",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.23",
|
|
4
4
|
"description": "MQTT Communication Patterns",
|
|
5
5
|
"keywords": [ "mqtt",
|
|
6
6
|
"event", "emit",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@eslint/eslintrc": "3.3.5",
|
|
40
40
|
"knip": "6.13.1",
|
|
41
41
|
"jiti": "2.7.0",
|
|
42
|
-
"tsx": "4.
|
|
42
|
+
"tsx": "4.22.0",
|
|
43
43
|
"mocha": "11.7.5",
|
|
44
44
|
"chai": "6.2.2",
|
|
45
45
|
"sinon-chai": "4.0.1",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"@typescript-eslint/parser": "8.59.3",
|
|
52
52
|
"mqtt": "5.15.1",
|
|
53
53
|
"aedes": "1.0.2",
|
|
54
|
-
"mosquitto": "1.0
|
|
54
|
+
"mosquitto": "1.1.0",
|
|
55
55
|
"textframe": "1.2.1",
|
|
56
|
-
"vite": "8.0.
|
|
56
|
+
"vite": "8.0.13",
|
|
57
57
|
"vite-plugin-node-polyfills": "0.26.0",
|
|
58
58
|
"@rollup/plugin-replace": "6.0.3",
|
|
59
59
|
"@wroud/vite-plugin-tsc": "0.12.3",
|
package/src/mqtt-plus-base.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { type MqttClient,
|
|
|
28
28
|
type IClientSubscribeOptions,
|
|
29
29
|
type IClientPublishOptions,
|
|
30
30
|
type IPublishPacket } from "mqtt"
|
|
31
|
+
import { nanoid } from "nanoid"
|
|
31
32
|
|
|
32
33
|
/* internal requirements */
|
|
33
34
|
import type { APISchema, Registration } from "./mqtt-plus-api"
|
|
@@ -79,6 +80,19 @@ export class BaseTrait<T extends APISchema = APISchema> extends TraceTrait<T> {
|
|
|
79
80
|
/* store MQTT client */
|
|
80
81
|
this.mqtt = mqtt
|
|
81
82
|
|
|
83
|
+
/* resolve the instance "id": if the user did not provide an
|
|
84
|
+
explicit one, fetch the "clientId" from the underlying MQTT
|
|
85
|
+
client, and only as a last resort fall back to a generated id
|
|
86
|
+
(e.g. for the fake proxy MQTT client without a real clientId) */
|
|
87
|
+
if (this.options.id === "") {
|
|
88
|
+
const clientId = (mqtt as any).isFakeProxy
|
|
89
|
+
? undefined
|
|
90
|
+
: mqtt.options?.clientId
|
|
91
|
+
this.options.id = (typeof clientId === "string" && clientId !== "")
|
|
92
|
+
? clientId
|
|
93
|
+
: nanoid()
|
|
94
|
+
}
|
|
95
|
+
|
|
82
96
|
/* hook into the MQTT message processing */
|
|
83
97
|
this.log("info", "hooking into MQTT client")
|
|
84
98
|
this.messageHandler = (topic, message, packet) => {
|
package/src/mqtt-plus-options.ts
CHANGED
|
@@ -22,9 +22,6 @@
|
|
|
22
22
|
** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
/* external requirements */
|
|
26
|
-
import { nanoid } from "nanoid"
|
|
27
|
-
|
|
28
25
|
/* internal requirements */
|
|
29
26
|
import type { APISchema } from "./mqtt-plus-api"
|
|
30
27
|
|
|
@@ -55,7 +52,7 @@ export class OptionsTrait<_T extends APISchema = APISchema> {
|
|
|
55
52
|
) {
|
|
56
53
|
/* determine options and provide defaults */
|
|
57
54
|
this.options = {
|
|
58
|
-
id:
|
|
55
|
+
id: "", /* intentionally resolved later in BaseTrait */
|
|
59
56
|
codec: "cbor",
|
|
60
57
|
timeout: 10 * 1000,
|
|
61
58
|
share: "",
|