@tuya-miniapp/ark-extension-virtual-device 1.7.0-beta-1 → 1.7.0-beta-3
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/worker/index.js +25 -22
- package/package.json +1 -1
package/dist/worker/index.js
CHANGED
|
@@ -220712,7 +220712,7 @@ var require_package2 = __commonJS({
|
|
|
220712
220712
|
"package.json"(exports, module2) {
|
|
220713
220713
|
module2.exports = {
|
|
220714
220714
|
name: "@tuya-miniapp/ark-extension-virtual-device",
|
|
220715
|
-
version: "1.
|
|
220715
|
+
version: "1.7.0-beta-1",
|
|
220716
220716
|
license: "MIT",
|
|
220717
220717
|
files: [
|
|
220718
220718
|
"manifest.json",
|
|
@@ -262488,21 +262488,31 @@ var import_path = require("path");
|
|
|
262488
262488
|
|
|
262489
262489
|
// worker/api/services/getTuyaProjectInfo.ts
|
|
262490
262490
|
var getTuyaProjectInfo = async () => {
|
|
262491
|
-
|
|
262492
|
-
|
|
262493
|
-
|
|
262494
|
-
const
|
|
262495
|
-
|
|
262496
|
-
if (
|
|
262497
|
-
|
|
262498
|
-
|
|
262499
|
-
|
|
262500
|
-
|
|
262501
|
-
|
|
262502
|
-
|
|
262503
|
-
|
|
262491
|
+
try {
|
|
262492
|
+
const json = await readProjectConfigJson();
|
|
262493
|
+
console.log("-----readProjectConfigJson", json);
|
|
262494
|
+
const mode = await getDebugMode();
|
|
262495
|
+
console.log("-----getDebugMode", mode);
|
|
262496
|
+
if (mode === "real") {
|
|
262497
|
+
const deviceId = await getDeviceId();
|
|
262498
|
+
console.log("-----getDeviceId", deviceId);
|
|
262499
|
+
const productId = await getProductId();
|
|
262500
|
+
console.log("-----getProductId", productId);
|
|
262501
|
+
if (deviceId)
|
|
262502
|
+
json.deviceId = deviceId;
|
|
262503
|
+
if (productId)
|
|
262504
|
+
json.productId = productId;
|
|
262505
|
+
} else if (mode === "group") {
|
|
262506
|
+
const groupId = await getGroupId();
|
|
262507
|
+
if (groupId)
|
|
262508
|
+
json.groupId = await getGroupId();
|
|
262509
|
+
}
|
|
262510
|
+
console.log("-----getTuyaProjectInfo return ", json);
|
|
262511
|
+
return json;
|
|
262512
|
+
} catch (error) {
|
|
262513
|
+
console.log("getTuyaProjectInfo error", error);
|
|
262514
|
+
return null;
|
|
262504
262515
|
}
|
|
262505
|
-
return json;
|
|
262506
262516
|
};
|
|
262507
262517
|
var getEnvInfo = async () => {
|
|
262508
262518
|
const u2 = await ark.auth.getCustomerUserInfo();
|
|
@@ -263864,13 +263874,6 @@ var MqttClientManager = class _MqttClientManager {
|
|
|
263864
263874
|
});
|
|
263865
263875
|
});
|
|
263866
263876
|
global.__mqttClient = client;
|
|
263867
|
-
console.log("--------------mqtt client-------------------");
|
|
263868
|
-
console.log(
|
|
263869
|
-
global.__mqttClient.version,
|
|
263870
|
-
global.__mqttClient.connected,
|
|
263871
|
-
global.__mqttClient.options
|
|
263872
|
-
);
|
|
263873
|
-
console.log("--------------mqtt client-------------------");
|
|
263874
263877
|
return client;
|
|
263875
263878
|
}
|
|
263876
263879
|
// destroy() {
|