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.
Files changed (55) hide show
  1. package/index.ts +2 -3
  2. package/package.json +9 -7
  3. package/src/GizLog.ts +16 -16
  4. package/src/handler/ble.ts +198 -284
  5. package/src/handler/lan.ts +18 -18
  6. package/src/handler/socket.ts +78 -38
  7. package/src/openApiRequest.ts +17 -1
  8. package/src/productConfigFileManage.ts +6 -6
  9. package/src/protocol/Reset.ts +16 -0
  10. package/src/protocol/SetReset.ts +13 -0
  11. package/src/protocol/tool.ts +0 -4
  12. package/src/request.ts +1 -1
  13. package/src/sdk.ts +30 -822
  14. package/src/sentry.ts +70 -47
  15. package/src/services/devices.ts +20 -152
  16. package/src/utils.ts +11 -70
  17. package/dist/index.d.ts +0 -6
  18. package/dist/index.js +0 -18
  19. package/dist/src/GizLog.d.ts +0 -18
  20. package/dist/src/errorCode.d.ts +0 -5
  21. package/dist/src/globalData.d.ts +0 -2
  22. package/dist/src/handler/EventListener.d.ts +0 -9
  23. package/dist/src/handler/ble.d.ts +0 -140
  24. package/dist/src/handler/lan.d.ts +0 -93
  25. package/dist/src/handler/socket.d.ts +0 -139
  26. package/dist/src/openApiRequest.d.ts +0 -7
  27. package/dist/src/productConfigFileManage.d.ts +0 -13
  28. package/dist/src/protocol/Bind.d.ts +0 -7
  29. package/dist/src/protocol/DataPoint.d.ts +0 -67
  30. package/dist/src/protocol/DiscoverUdp.d.ts +0 -17
  31. package/dist/src/protocol/GetDeviceStatus.d.ts +0 -5
  32. package/dist/src/protocol/Login.d.ts +0 -12
  33. package/dist/src/protocol/Ntp.d.ts +0 -5
  34. package/dist/src/protocol/OffLineData.d.ts +0 -23
  35. package/dist/src/protocol/ProtocolBase.d.ts +0 -11
  36. package/dist/src/protocol/WifiConfig.d.ts +0 -6
  37. package/dist/src/protocol/tool.d.ts +0 -11
  38. package/dist/src/randomCode.d.ts +0 -7
  39. package/dist/src/request.d.ts +0 -1
  40. package/dist/src/sentry.d.ts +0 -2
  41. package/dist/src/services/devices.d.ts +0 -63
  42. package/dist/src/services/login.d.ts +0 -8
  43. package/dist/src/services/monitor.d.ts +0 -11
  44. package/dist/src/services/tool.d.ts +0 -4
  45. package/dist/src/services/uploadP0.d.ts +0 -13
  46. package/dist/src/sleep.d.ts +0 -2
  47. package/dist/src/utils.d.ts +0 -47
  48. package/dist/src/wechatApi.d.ts +0 -36
  49. package/dist/src/wifiConfig/ConfigBase.d.ts +0 -26
  50. package/dist/src/wifiConfig/ap.d.ts +0 -21
  51. package/dist/src/wifiConfig/ble.d.ts +0 -44
  52. package/src/services/monitor.ts +0 -116
  53. package/src/wifiConfig/ConfigBase.ts +0 -185
  54. package/src/wifiConfig/ap.ts +0 -192
  55. 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, BleHandle };
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.30",
4
- "description": "修正flag转换",
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.9.0",
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": "^6.2.2",
40
+ "ts-loader": "^9.4.3",
39
41
  "ts-node": "^8.8.1",
40
- "typescript": "^4.9.5",
42
+ "typescript": "^3.8.3",
41
43
  "uglifyjs-webpack-plugin": "^2.2.0",
42
- "webpack": "^4.42.1",
44
+ "webpack": "^5.88.0",
43
45
  "webpack-bundle-analyzer": "^4.5.0",
44
- "webpack-cli": "^3.3.11"
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();