From 0dde613f8e84e751ec9f5514301c7d58172e31a5 Mon Sep 17 00:00:00 2001
From: Marin Karamihalev <marin.karamihalev@iopsys.eu>
Date: Tue, 28 Mar 2023 14:51:48 +0200
Subject: [PATCH] qjs clientId fixes, notifyResp correction

---
 package.json                      | 2 +-
 src/commands/common/notifyResp.ts | 4 ++--
 tests/integration/index.test.ts   | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/package.json b/package.json
index 611d4fc..e966f7a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "usp-js",
-  "version": "0.3.8",
+  "version": "0.3.9",
   "description": "Helper library for easy usp communication using mqtt over tcp or ws.",
   "main": "node/index.js",
   "browser": "web/index.js",
diff --git a/src/commands/common/notifyResp.ts b/src/commands/common/notifyResp.ts
index e09f722..f12af64 100644
--- a/src/commands/common/notifyResp.ts
+++ b/src/commands/common/notifyResp.ts
@@ -12,12 +12,12 @@ const encode: EncodeFn = ({ subscriptionId }) => ({
   },
   body: {
     lookup: "Body",
-    request: {
+    response: {
       lookup: "Request",
       notifyResp: { subscriptionId },
     },
   },
-});
+} as any);
 
 export default {
   decode,
diff --git a/tests/integration/index.test.ts b/tests/integration/index.test.ts
index f78c790..ff87274 100644
--- a/tests/integration/index.test.ts
+++ b/tests/integration/index.test.ts
@@ -11,6 +11,7 @@ describe("Test general API", function () {
 
   before(async () => {
     device = await connect(config.ws as ConnectionOptions);
+    await device.del("Device.NAT.PortMapping.*.");
     added = [
       await device.add("Device.NAT.PortMapping."),
       await device.add("Device.NAT.PortMapping."),
-- 
GitLab