mini_program_gizwits_sdk 3.2.30 → 3.2.31-yujunshimini
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/index.ts +2 -3
- package/package.json +9 -7
- package/src/GizLog.ts +16 -16
- package/src/handler/ble.ts +198 -284
- package/src/handler/lan.ts +18 -18
- package/src/handler/socket.ts +78 -38
- package/src/openApiRequest.ts +17 -1
- package/src/productConfigFileManage.ts +6 -6
- package/src/protocol/Reset.ts +16 -0
- package/src/protocol/SetReset.ts +13 -0
- package/src/protocol/tool.ts +0 -4
- package/src/request.ts +1 -1
- package/src/sdk.ts +30 -822
- package/src/sentry.ts +70 -47
- package/src/services/devices.ts +20 -152
- package/src/utils.ts +11 -70
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -18
- package/dist/src/GizLog.d.ts +0 -18
- package/dist/src/errorCode.d.ts +0 -5
- package/dist/src/globalData.d.ts +0 -2
- package/dist/src/handler/EventListener.d.ts +0 -9
- package/dist/src/handler/ble.d.ts +0 -140
- package/dist/src/handler/lan.d.ts +0 -93
- package/dist/src/handler/socket.d.ts +0 -139
- package/dist/src/openApiRequest.d.ts +0 -7
- package/dist/src/productConfigFileManage.d.ts +0 -13
- package/dist/src/protocol/Bind.d.ts +0 -7
- package/dist/src/protocol/DataPoint.d.ts +0 -67
- package/dist/src/protocol/DiscoverUdp.d.ts +0 -17
- package/dist/src/protocol/GetDeviceStatus.d.ts +0 -5
- package/dist/src/protocol/Login.d.ts +0 -12
- package/dist/src/protocol/Ntp.d.ts +0 -5
- package/dist/src/protocol/OffLineData.d.ts +0 -23
- package/dist/src/protocol/ProtocolBase.d.ts +0 -11
- package/dist/src/protocol/WifiConfig.d.ts +0 -6
- package/dist/src/protocol/tool.d.ts +0 -11
- package/dist/src/randomCode.d.ts +0 -7
- package/dist/src/request.d.ts +0 -1
- package/dist/src/sentry.d.ts +0 -2
- package/dist/src/services/devices.d.ts +0 -63
- package/dist/src/services/login.d.ts +0 -8
- package/dist/src/services/monitor.d.ts +0 -11
- package/dist/src/services/tool.d.ts +0 -4
- package/dist/src/services/uploadP0.d.ts +0 -13
- package/dist/src/sleep.d.ts +0 -2
- package/dist/src/utils.d.ts +0 -47
- package/dist/src/wechatApi.d.ts +0 -36
- package/dist/src/wifiConfig/ConfigBase.d.ts +0 -26
- package/dist/src/wifiConfig/ap.d.ts +0 -21
- package/dist/src/wifiConfig/ble.d.ts +0 -44
- package/src/services/monitor.ts +0 -116
- package/src/wifiConfig/ConfigBase.ts +0 -185
- package/src/wifiConfig/ap.ts +0 -192
- package/src/wifiConfig/ble.ts +0 -430
package/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import 'miniprogram-api-typings';
|
|
2
2
|
import gizwitsSdk from './src/sdk';
|
|
3
3
|
import errorCode from './src/errorCode';
|
|
4
|
-
import { BleHandle } from './src/handler/ble';
|
|
5
4
|
|
|
6
|
-
export { errorCode
|
|
7
|
-
export default gizwitsSdk;
|
|
5
|
+
export { errorCode };
|
|
6
|
+
export default gizwitsSdk;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mini_program_gizwits_sdk",
|
|
3
|
-
"version": "3.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.2.31-yujunshimini",
|
|
4
|
+
"description": "减少日志",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "node_modules/mocha/bin/_mocha -r ts-node/register tests/**/*.spec.ts -file ./tests/setup-wx.js -timeout 60s",
|
|
@@ -30,18 +30,20 @@
|
|
|
30
30
|
"@types/sinon": "^10.0.6",
|
|
31
31
|
"chai": "^4.2.0",
|
|
32
32
|
"coveralls": "^3.0.11",
|
|
33
|
+
"esbuild-loader": "^3.0.1",
|
|
33
34
|
"istanbul": "^1.1.0-alpha.1",
|
|
34
|
-
"miniprogram-api-typings": "^3.
|
|
35
|
+
"miniprogram-api-typings": "^3.5.0",
|
|
35
36
|
"mocha": "^7.1.1",
|
|
37
|
+
"npm-dts-webpack-plugin": "^1.3.12",
|
|
36
38
|
"release-it": "^14.2.2",
|
|
37
39
|
"sinon": "^9.2.4",
|
|
38
|
-
"ts-loader": "^
|
|
40
|
+
"ts-loader": "^9.4.3",
|
|
39
41
|
"ts-node": "^8.8.1",
|
|
40
|
-
"typescript": "^
|
|
42
|
+
"typescript": "^3.8.3",
|
|
41
43
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
|
42
|
-
"webpack": "^
|
|
44
|
+
"webpack": "^5.88.0",
|
|
43
45
|
"webpack-bundle-analyzer": "^4.5.0",
|
|
44
|
-
"webpack-cli": "^
|
|
46
|
+
"webpack-cli": "^5.1.4"
|
|
45
47
|
},
|
|
46
48
|
"author": "gizwits",
|
|
47
49
|
"license": "ISC",
|
package/src/GizLog.ts
CHANGED
|
@@ -5,47 +5,47 @@ export type TLogType = 'debug' | 'info' | 'warn' | 'error';
|
|
|
5
5
|
class Log {
|
|
6
6
|
|
|
7
7
|
logMap = [
|
|
8
|
-
{id: 'debug'},
|
|
9
|
-
{id: 'info'},
|
|
10
|
-
{id: 'warn'},
|
|
11
|
-
{id: 'error'}
|
|
8
|
+
{ id: 'debug' },
|
|
9
|
+
{ id: 'info' },
|
|
10
|
+
{ id: 'warn' },
|
|
11
|
+
{ id: 'error' }
|
|
12
12
|
]
|
|
13
13
|
|
|
14
14
|
console = console
|
|
15
15
|
// debug info(log) warn error
|
|
16
|
-
debug = (...data)=> {
|
|
16
|
+
debug = (...data) => {
|
|
17
17
|
this.console.debug(...data);
|
|
18
18
|
}
|
|
19
19
|
info = (...data) => {
|
|
20
20
|
this.console.info(...data);
|
|
21
21
|
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
23
|
log = (...data) => {
|
|
24
24
|
this.console.log(...data);
|
|
25
25
|
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
27
|
warn = (...data) => {
|
|
28
28
|
this.console.warn(...data);
|
|
29
|
-
}
|
|
30
|
-
error = (info: string, error: Error) => {
|
|
29
|
+
}
|
|
30
|
+
error = (info: string, error: Error, notSentry = false) => {
|
|
31
31
|
this.console.error(info, error);
|
|
32
|
-
sentry(error)
|
|
33
|
-
}
|
|
32
|
+
!notSentry && sentry(error)
|
|
33
|
+
}
|
|
34
34
|
|
|
35
35
|
setLogLevel = (type: TLogType) => {
|
|
36
36
|
const targetIndex = this.logMap.findIndex(item => item.id === type);
|
|
37
37
|
if (targetIndex !== -1) {
|
|
38
|
-
this.console = {...console as any};
|
|
38
|
+
this.console = { ...console as any };
|
|
39
39
|
this.logMap.map((item, index) => {
|
|
40
40
|
if (index < targetIndex) {
|
|
41
|
-
this.console[item.id] = () => {};
|
|
41
|
+
this.console[item.id] = () => { };
|
|
42
42
|
}
|
|
43
43
|
})
|
|
44
|
-
return {success: true, err: null}
|
|
44
|
+
return { success: true, err: null }
|
|
45
45
|
} else {
|
|
46
|
-
return {success: false,err: errorCode.GIZ_SDK_LOG_LEVEL_INVALID}
|
|
46
|
+
return { success: false, err: errorCode.GIZ_SDK_LOG_LEVEL_INVALID }
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export default new Log();
|
|
51
|
+
export default new Log();
|