@lumiastream/tapo-cove 3.0.13 → 3.0.14
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 +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -171,12 +171,13 @@ var handshake = (deviceIp) => __async(void 0, null, function* () {
|
|
|
171
171
|
key: keyPair.publicKey
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
|
-
const response = yield (
|
|
174
|
+
const response = yield (globalThis.nodeAxios ? globalThis.nodeAxios : import_axios.default)({
|
|
175
175
|
method: "post",
|
|
176
176
|
url: `http://${deviceIp}/app`,
|
|
177
177
|
data: handshakeRequest
|
|
178
178
|
});
|
|
179
179
|
throwErrorIfFound(response.data);
|
|
180
|
+
console.log("response.headers: ", response.headers);
|
|
180
181
|
const setCookieHeader = (_c = (_b = (_a = response.headers.get("set-cookie")) != null ? _a : response.headers.get("session-cookie")) != null ? _b : response.headers.get("session-key")) != null ? _c : response.headers.get("lumia-session");
|
|
181
182
|
const sessionCookie = setCookieHeader.substring(0, setCookieHeader.indexOf(";"));
|
|
182
183
|
const deviceKey = readDeviceKey(response.data.result.key, keyPair.privateKey);
|
|
@@ -195,7 +196,7 @@ var securePassthrough = (deviceRequest, deviceKey) => __async(void 0, null, func
|
|
|
195
196
|
request: encryptedRequest
|
|
196
197
|
}
|
|
197
198
|
};
|
|
198
|
-
const response = yield (
|
|
199
|
+
const response = yield (globalThis.nodeAxios ? globalThis.nodeAxios : import_axios.default)({
|
|
199
200
|
method: "post",
|
|
200
201
|
url: `http://${deviceKey.deviceIp}/app?token=${deviceKey.token}`,
|
|
201
202
|
data: securePassthroughRequest,
|
package/dist/index.mjs
CHANGED
|
@@ -139,12 +139,13 @@ var handshake = (deviceIp) => __async(void 0, null, function* () {
|
|
|
139
139
|
key: keyPair.publicKey
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
const response = yield axios({
|
|
142
|
+
const response = yield (globalThis.nodeAxios ? globalThis.nodeAxios : axios)({
|
|
143
143
|
method: "post",
|
|
144
144
|
url: `http://${deviceIp}/app`,
|
|
145
145
|
data: handshakeRequest
|
|
146
146
|
});
|
|
147
147
|
throwErrorIfFound(response.data);
|
|
148
|
+
console.log("response.headers: ", response.headers);
|
|
148
149
|
const setCookieHeader = (_c = (_b = (_a = response.headers.get("set-cookie")) != null ? _a : response.headers.get("session-cookie")) != null ? _b : response.headers.get("session-key")) != null ? _c : response.headers.get("lumia-session");
|
|
149
150
|
const sessionCookie = setCookieHeader.substring(0, setCookieHeader.indexOf(";"));
|
|
150
151
|
const deviceKey = readDeviceKey(response.data.result.key, keyPair.privateKey);
|
|
@@ -163,7 +164,7 @@ var securePassthrough = (deviceRequest, deviceKey) => __async(void 0, null, func
|
|
|
163
164
|
request: encryptedRequest
|
|
164
165
|
}
|
|
165
166
|
};
|
|
166
|
-
const response = yield axios({
|
|
167
|
+
const response = yield (globalThis.nodeAxios ? globalThis.nodeAxios : axios)({
|
|
167
168
|
method: "post",
|
|
168
169
|
url: `http://${deviceKey.deviceIp}/app?token=${deviceKey.token}`,
|
|
169
170
|
data: securePassthroughRequest,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumiastream/tapo-cove",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.14",
|
|
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": "
|
|
26
|
+
"gitHead": "b9daf4a655697189e3399fe4c769a939c269a61e"
|
|
27
27
|
}
|