mini_program_gizwits_sdk 3.6.2 → 3.6.4
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/README.md +4 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +2 -2
- package/dist/src/types/index.d.ts +1 -0
- package/index.ts +2 -3
- package/package.json +1 -1
- package/src/handler/lan.ts +1 -0
- package/src/services/devices.ts +1 -0
- package/src/types/index.ts +1 -0
- package/src/utils.ts +2 -1
- package/src/wifiConfig/ap.ts +1 -0
- package/src/wifiConfig/ble.ts +2 -23
- package/src/wifiConfig/nfc/index.ts +1 -0
- package/dist/package.json +0 -55
- package/dist/src/sdk.js +0 -1101
- package/dist/src/services/monitor.js +0 -72
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.reportEvent = void 0;
|
|
16
|
-
const package_json_1 = require("../../package.json");
|
|
17
|
-
const globalData_1 = require("../globalData");
|
|
18
|
-
const openApiRequest_1 = __importDefault(require("../openApiRequest"));
|
|
19
|
-
class BaseInfo {
|
|
20
|
-
constructor() {
|
|
21
|
-
wx.getSystemInfoAsync({
|
|
22
|
-
success: (res) => {
|
|
23
|
-
this.app = {
|
|
24
|
-
wxSdkVersion: res.SDKVersion,
|
|
25
|
-
gizwitsSdkVersion: package_json_1.version,
|
|
26
|
-
appID: 'unknown',
|
|
27
|
-
bluetoothEnabled: res.bluetoothEnabled,
|
|
28
|
-
locationEnabled: res.locationEnabled,
|
|
29
|
-
wifiEnabled: res.wifiEnabled,
|
|
30
|
-
};
|
|
31
|
-
this.mobile = {
|
|
32
|
-
brand: res.brand,
|
|
33
|
-
model: res.model,
|
|
34
|
-
pixelRatio: res.pixelRatio,
|
|
35
|
-
systemVersion: res.system,
|
|
36
|
-
platform: res.platform,
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
updateAppId(appId) {
|
|
42
|
-
this.app.appID = appId;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const baseInfo = new BaseInfo();
|
|
46
|
-
function reportEvent({ device, eventID, eventType, success, failureType }) {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
baseInfo.updateAppId((0, globalData_1.getGlobalData)('appID') || 'unknown');
|
|
49
|
-
const path = `/v2/products/${device.productKey}/devices/bluetooth-connect-data`;
|
|
50
|
-
const curDate = new Date();
|
|
51
|
-
const eventData = {
|
|
52
|
-
origin: "MINI-WX",
|
|
53
|
-
mobileInfo: baseInfo.mobile,
|
|
54
|
-
userInfo: null,
|
|
55
|
-
appInfo: baseInfo.app,
|
|
56
|
-
eventID,
|
|
57
|
-
eventType,
|
|
58
|
-
monitorTarget: {
|
|
59
|
-
device,
|
|
60
|
-
success,
|
|
61
|
-
failureType,
|
|
62
|
-
},
|
|
63
|
-
time: curDate,
|
|
64
|
-
timeStamp: Math.floor(curDate.getTime() / 1000),
|
|
65
|
-
};
|
|
66
|
-
return (0, openApiRequest_1.default)(path, {
|
|
67
|
-
data: eventData,
|
|
68
|
-
method: 'POST',
|
|
69
|
-
}, true);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
exports.reportEvent = reportEvent;
|