@lumiastream/tapo-cove 3.0.10 → 3.0.12

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/dist/index.js CHANGED
@@ -163,6 +163,7 @@ var throwErrorIfFound = (responseData) => {
163
163
  }
164
164
  };
165
165
  var handshake = (deviceIp) => __async(void 0, null, function* () {
166
+ var _a, _b, _c;
166
167
  const keyPair = yield generateKeyPair();
167
168
  const handshakeRequest = {
168
169
  method: "handshake",
@@ -176,7 +177,7 @@ var handshake = (deviceIp) => __async(void 0, null, function* () {
176
177
  data: handshakeRequest
177
178
  });
178
179
  throwErrorIfFound(response.data);
179
- const setCookieHeader = response.headers["set-cookie"][0];
180
+ const setCookieHeader = (_c = (_a = response.headers["set-cookie"]) == null ? void 0 : _a[0]) != null ? _c : (_b = response.headers["session-cookie"]) == null ? void 0 : _b[0];
180
181
  const sessionCookie = setCookieHeader.substring(0, setCookieHeader.indexOf(";"));
181
182
  const deviceKey = readDeviceKey(response.data.result.key, keyPair.privateKey);
182
183
  return {
package/dist/index.mjs CHANGED
@@ -131,6 +131,7 @@ var throwErrorIfFound = (responseData) => {
131
131
  }
132
132
  };
133
133
  var handshake = (deviceIp) => __async(void 0, null, function* () {
134
+ var _a, _b, _c;
134
135
  const keyPair = yield generateKeyPair();
135
136
  const handshakeRequest = {
136
137
  method: "handshake",
@@ -144,7 +145,7 @@ var handshake = (deviceIp) => __async(void 0, null, function* () {
144
145
  data: handshakeRequest
145
146
  });
146
147
  throwErrorIfFound(response.data);
147
- const setCookieHeader = response.headers["set-cookie"][0];
148
+ const setCookieHeader = (_c = (_a = response.headers["set-cookie"]) == null ? void 0 : _a[0]) != null ? _c : (_b = response.headers["session-cookie"]) == null ? void 0 : _b[0];
148
149
  const sessionCookie = setCookieHeader.substring(0, setCookieHeader.indexOf(";"));
149
150
  const deviceKey = readDeviceKey(response.data.result.key, keyPair.privateKey);
150
151
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/tapo-cove",
3
- "version": "3.0.10",
3
+ "version": "3.0.12",
4
4
  "private": false,
5
5
  "license": "GPL",
6
6
  "main": "dist/index.js",
@@ -23,5 +23,5 @@
23
23
  "tsup": "*",
24
24
  "typescript": "*"
25
25
  },
26
- "gitHead": "aeb4676ebaf5bfc0fc1a7873c9cdc150fbdf9692"
26
+ "gitHead": "d79cf92963174ef9909c1ae46aee8723bc5e775c"
27
27
  }