@ray-js/api 1.4.0-alpha.1 → 1.4.0-alpha.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. package/@types/P2PKit.d.ts +402 -0
  2. package/@types/all-kits.d.ts +1 -0
  3. package/lib/BaseKit-3.3.10.js +85 -83
  4. package/lib/BizKit-3.2.7.js +48 -47
  5. package/lib/DeviceKit-3.3.1.js +194 -193
  6. package/lib/HomeKit-3.1.4.js +2 -1
  7. package/lib/MapKit-3.0.7.js +4 -2
  8. package/lib/MiniKit-3.1.0.js +65 -64
  9. package/lib/P2PKit-2.0.3.d.ts +27 -0
  10. package/lib/P2PKit-2.0.3.js +79 -0
  11. package/lib/PlayNetKit-1.1.3.js +2 -1
  12. package/lib/all-kits.d.ts +1 -0
  13. package/lib/all-kits.js +1 -0
  14. package/lib/cloud/alarm.js +4 -7
  15. package/lib/cloud/core.js +2 -3
  16. package/lib/cloud/device.js +20 -31
  17. package/lib/cloud/interface.d.ts +7 -7
  18. package/lib/cloud/linkage.js +43 -41
  19. package/lib/cloud/statistic.js +21 -33
  20. package/lib/cloud/timer.js +31 -48
  21. package/lib/constants.js +1 -1
  22. package/lib/core/promisify/index.js +5 -9
  23. package/lib/getBoundingClientRect/index.js +16 -17
  24. package/lib/getBoundingClientRect/index.thing.js +16 -17
  25. package/lib/getBoundingClientRect/index.wechat.js +16 -17
  26. package/lib/getCdnUrl/index.d.ts +1 -0
  27. package/lib/getCdnUrl/index.js +4 -0
  28. package/lib/getCdnUrl/index.thing.d.ts +3 -1
  29. package/lib/getCdnUrl/index.thing.js +54 -19
  30. package/lib/getCdnUrl/index.wechat.d.ts +1 -0
  31. package/lib/getCdnUrl/index.wechat.js +4 -0
  32. package/lib/getElementById/index.js +1 -3
  33. package/lib/getElementById/index.thing.js +2 -4
  34. package/lib/getElementById/index.wechat.js +2 -4
  35. package/lib/hideTabBar/index.d.ts +7 -1
  36. package/lib/index.d.ts +1 -1
  37. package/lib/index.js +4 -3
  38. package/lib/lifecycles/offAppEvent/index.js +2 -2
  39. package/lib/lifecycles/offAppHide/index.js +2 -2
  40. package/lib/lifecycles/offAppShow/index.js +2 -2
  41. package/lib/lifecycles/offError/index.js +2 -2
  42. package/lib/lifecycles/offThemeChange/index.js +2 -2
  43. package/lib/lifecycles/offWindowResize/index.js +2 -2
  44. package/lib/lifecycles/onAppEvent/index.js +2 -2
  45. package/lib/lifecycles/onAppHide/index.js +2 -2
  46. package/lib/lifecycles/onAppShow/index.js +2 -2
  47. package/lib/lifecycles/onError/index.js +2 -2
  48. package/lib/lifecycles/onPageNotFound/index.js +2 -2
  49. package/lib/lifecycles/onThemeChange/index.js +2 -2
  50. package/lib/lifecycles/onWindowResize/index.js +2 -2
  51. package/lib/navigateBack/index.js +3 -6
  52. package/lib/navigateTo/index.js +2 -5
  53. package/lib/onNavigationBarBack/index.js +1 -2
  54. package/lib/onNavigationBarBack/index.wechat.js +1 -2
  55. package/lib/panel/devInfo/index.js +84 -121
  56. package/lib/panel/i18n/index.d.ts +1 -1
  57. package/lib/panel/i18n/index.js +180 -262
  58. package/lib/panel/i18n/index.wechat.d.ts +1 -1
  59. package/lib/panel/i18n/index.wechat.js +184 -267
  60. package/lib/panel/normalizeNetwork.d.ts +2 -2
  61. package/lib/panel/normalizeNetwork.js +2 -7
  62. package/lib/panel/publishDps.d.ts +1 -1
  63. package/lib/panel/publishDps.js +13 -18
  64. package/lib/panel/types/devInfo.d.ts +3 -3
  65. package/lib/panel/types/utilities.d.ts +8 -8
  66. package/lib/panel/utils.js +1 -3
  67. package/lib/reLaunch/index.js +2 -5
  68. package/lib/redirectTo/index.js +2 -6
  69. package/lib/requestCloud/index.js +2 -2
  70. package/lib/requestCloud/index.wechat.js +0 -1
  71. package/lib/setNavigationBarBack/index.js +1 -2
  72. package/lib/setNavigationBarBack/index.wechat.js +1 -2
  73. package/lib/setNavigationBarColor/index.js +3 -6
  74. package/lib/setNavigationBarTitle/index.js +5 -6
  75. package/lib/showTabBar/index.d.ts +7 -1
  76. package/lib/switchTab/index.js +2 -5
  77. package/lib/utils.d.ts +1 -1
  78. package/lib/utils.js +5 -14
  79. package/lib/utils.wechat.d.ts +1 -1
  80. package/lib/utils.wechat.js +9 -21
  81. package/lib/viewAPI.js +13 -12
  82. package/package.json +25 -25
@@ -1,6 +1,7 @@
1
1
  /// <reference path="../@types/HomeKit.d.ts" />
2
+
2
3
  import { factory } from './utils';
3
- export var home = {
4
+ export const home = {
4
5
  getCurrentHomeInfo: factory('getCurrentHomeInfo', {
5
6
  "namespace": "home"
6
7
  }),
@@ -1,7 +1,9 @@
1
1
  /// <reference path="../@types/MapKit.d.ts" />
2
- import { factory } from './utils'; // ray 1.1.0 集成
3
2
 
4
- export var map = {
3
+ import { factory } from './utils';
4
+
5
+ // ray 1.1.0 集成
6
+ export const map = {
5
7
  chooseLocation: factory('chooseLocation', {
6
8
  "namespace": "map"
7
9
  }),
@@ -1,66 +1,67 @@
1
1
  /// <reference path="../@types/MiniKit.d.ts" />
2
- import { factory } from './utils';
3
- export var nativeDisabled = factory('nativeDisabled');
4
- export var nativeInovke = factory('nativeInovke');
5
- export var getPermissionConfig = factory('getPermissionConfig');
6
- export var getPermissionConfigSync = factory('getPermissionConfigSync');
7
- export var openSetting = factory('openSetting');
8
- export var changeDebugMode = factory('changeDebugMode');
9
- export var openHelpCenter = factory('openHelpCenter');
10
- export var showTabBarRedDot = factory('showTabBarRedDot');
11
- export var showTabBar = factory('showTabBar');
12
- export var setTabBarStyle = factory('setTabBarStyle');
13
- export var setTabBarItem = factory('setTabBarItem');
14
- export var setTabBarBadge = factory('setTabBarBadge');
15
- export var removeTabBarBadge = factory('removeTabBarBadge');
16
- export var hideTabBarRedDot = factory('hideTabBarRedDot');
17
- export var hideTabBar = factory('hideTabBar');
18
- export var apiRequestByHighway = factory('apiRequestByHighway');
19
- export var navigateBackMiniProgram = factory('navigateBackMiniProgram');
20
- export var exitMiniProgram = factory('exitMiniProgram');
21
- export var getLaunchOptions = factory('getLaunchOptions');
22
- export var getLaunchOptionsSync = factory('getLaunchOptionsSync');
23
- export var getEnterOptions = factory('getEnterOptions');
24
- export var getEnterOptionsSync = factory('getEnterOptionsSync');
25
- export var setBoardTitle = factory('setBoardTitle');
26
- export var setBoardTitleSync = factory('setBoardTitleSync');
27
- export var getMenuButtonBoundingClientRect = factory('getMenuButtonBoundingClientRect');
28
- export var getMenuButtonBoundingClientRectSync = factory('getMenuButtonBoundingClientRectSync');
29
- export var preDownloadMiniApp = factory('preDownloadMiniApp');
30
- export var login = factory('login');
31
- export var setPageOrientation = factory('setPageOrientation');
32
- export var hideMenuButton = factory('hideMenuButton');
33
- export var showMenuButton = factory('showMenuButton');
34
- export var showStatusBar = factory('showStatusBar');
35
- export var hideStatusBar = factory('hideStatusBar');
36
- export var exitMiniWidget = factory('exitMiniWidget');
37
- export var canOpenURL = factory('canOpenURL');
38
- export var canOpenURLSync = factory('canOpenURLSync');
39
- export var openURL = factory('openURL');
40
- export var showNavigationBarLoading = factory('showNavigationBarLoading');
41
- export var setNavigationBarTitle = factory('setNavigationBarTitle');
42
- export var setNavigationBarColor = factory('setNavigationBarColor');
43
- export var hideNavigationBarLoading = factory('hideNavigationBarLoading');
44
- export var hideHomeButton = factory('hideHomeButton');
45
- export var navigateTo = factory('navigateTo');
46
- export var navigateBack = factory('navigateBack');
47
- export var redirectTo = factory('redirectTo');
48
- export var reLaunch = factory('reLaunch');
49
- export var switchTab = factory('switchTab');
50
- export var extApiCanIUse = factory('extApiCanIUse');
51
- export var extApiCanIUseSync = factory('extApiCanIUseSync');
52
- export var extApiInvoke = factory('extApiInvoke');
53
- export var extApiInvokeSync = factory('extApiInvokeSync');
54
- export var startPullDownRefresh = factory('startPullDownRefresh');
55
- export var stopPullDownRefresh = factory('stopPullDownRefresh');
56
- export var onNativeEvent = factory('onNativeEvent');
57
- export var offNativeEvent = factory('offNativeEvent'); // 3.1.0 新增 - 4.8.0 容器
58
2
 
59
- export var getAccountInfo = factory('getAccountInfo');
60
- export var getAccountInfoSync = factory('getAccountInfoSync');
61
- export var hideBoardTitleIcon = factory('hideBoardTitleIcon');
62
- export var hideBoardTitleIconSync = factory('hideBoardTitleIconSync');
63
- export var setBoardIcon = factory('setBoardIcon');
64
- export var setBoardIconSync = factory('setBoardIconSync');
65
- export var showBoardTitleIcon = factory('showBoardTitleIcon');
66
- export var showBoardTitleIconSync = factory('showBoardTitleIconSync');
3
+ import { factory } from './utils';
4
+ export const nativeDisabled = factory('nativeDisabled');
5
+ export const nativeInovke = factory('nativeInovke');
6
+ export const getPermissionConfig = factory('getPermissionConfig');
7
+ export const getPermissionConfigSync = factory('getPermissionConfigSync');
8
+ export const openSetting = factory('openSetting');
9
+ export const changeDebugMode = factory('changeDebugMode');
10
+ export const openHelpCenter = factory('openHelpCenter');
11
+ export const showTabBarRedDot = factory('showTabBarRedDot');
12
+ export const showTabBar = factory('showTabBar');
13
+ export const setTabBarStyle = factory('setTabBarStyle');
14
+ export const setTabBarItem = factory('setTabBarItem');
15
+ export const setTabBarBadge = factory('setTabBarBadge');
16
+ export const removeTabBarBadge = factory('removeTabBarBadge');
17
+ export const hideTabBarRedDot = factory('hideTabBarRedDot');
18
+ export const hideTabBar = factory('hideTabBar');
19
+ export const apiRequestByHighway = factory('apiRequestByHighway');
20
+ export const navigateBackMiniProgram = factory('navigateBackMiniProgram');
21
+ export const exitMiniProgram = factory('exitMiniProgram');
22
+ export const getLaunchOptions = factory('getLaunchOptions');
23
+ export const getLaunchOptionsSync = factory('getLaunchOptionsSync');
24
+ export const getEnterOptions = factory('getEnterOptions');
25
+ export const getEnterOptionsSync = factory('getEnterOptionsSync');
26
+ export const setBoardTitle = factory('setBoardTitle');
27
+ export const setBoardTitleSync = factory('setBoardTitleSync');
28
+ export const getMenuButtonBoundingClientRect = factory('getMenuButtonBoundingClientRect');
29
+ export const getMenuButtonBoundingClientRectSync = factory('getMenuButtonBoundingClientRectSync');
30
+ export const preDownloadMiniApp = factory('preDownloadMiniApp');
31
+ export const login = factory('login');
32
+ export const setPageOrientation = factory('setPageOrientation');
33
+ export const hideMenuButton = factory('hideMenuButton');
34
+ export const showMenuButton = factory('showMenuButton');
35
+ export const showStatusBar = factory('showStatusBar');
36
+ export const hideStatusBar = factory('hideStatusBar');
37
+ export const exitMiniWidget = factory('exitMiniWidget');
38
+ export const canOpenURL = factory('canOpenURL');
39
+ export const canOpenURLSync = factory('canOpenURLSync');
40
+ export const openURL = factory('openURL');
41
+ export const showNavigationBarLoading = factory('showNavigationBarLoading');
42
+ export const setNavigationBarTitle = factory('setNavigationBarTitle');
43
+ export const setNavigationBarColor = factory('setNavigationBarColor');
44
+ export const hideNavigationBarLoading = factory('hideNavigationBarLoading');
45
+ export const hideHomeButton = factory('hideHomeButton');
46
+ export const navigateTo = factory('navigateTo');
47
+ export const navigateBack = factory('navigateBack');
48
+ export const redirectTo = factory('redirectTo');
49
+ export const reLaunch = factory('reLaunch');
50
+ export const switchTab = factory('switchTab');
51
+ export const extApiCanIUse = factory('extApiCanIUse');
52
+ export const extApiCanIUseSync = factory('extApiCanIUseSync');
53
+ export const extApiInvoke = factory('extApiInvoke');
54
+ export const extApiInvokeSync = factory('extApiInvokeSync');
55
+ export const startPullDownRefresh = factory('startPullDownRefresh');
56
+ export const stopPullDownRefresh = factory('stopPullDownRefresh');
57
+ export const onNativeEvent = factory('onNativeEvent');
58
+ export const offNativeEvent = factory('offNativeEvent');
59
+ // 3.1.0 新增 - 4.8.0 容器
60
+ export const getAccountInfo = factory('getAccountInfo');
61
+ export const getAccountInfoSync = factory('getAccountInfoSync');
62
+ export const hideBoardTitleIcon = factory('hideBoardTitleIcon');
63
+ export const hideBoardTitleIconSync = factory('hideBoardTitleIconSync');
64
+ export const setBoardIcon = factory('setBoardIcon');
65
+ export const setBoardIconSync = factory('setBoardIconSync');
66
+ export const showBoardTitleIcon = factory('showBoardTitleIcon');
67
+ export const showBoardTitleIconSync = factory('showBoardTitleIconSync');
@@ -0,0 +1,27 @@
1
+ /// <reference path="../@types/MapKit.d.ts" />
2
+ export declare const p2p: {
3
+ P2PSDKInit: typeof ty.p2p.P2PSDKInit;
4
+ deInitSDK: typeof ty.p2p.deInitSDK;
5
+ isP2PActive: typeof ty.p2p.isP2PActive;
6
+ isP2PActiveSync: typeof ty.p2p.isP2PActiveSync;
7
+ connectDevice: typeof ty.p2p.connectDevice;
8
+ disconnectDevice: typeof ty.p2p.disconnectDevice;
9
+ uploadFile: typeof ty.p2p.uploadFile;
10
+ cancelUploadTask: typeof ty.p2p.cancelUploadTask;
11
+ downloadFile: typeof ty.p2p.downloadFile;
12
+ cancelDownloadTask: typeof ty.p2p.cancelDownloadTask;
13
+ downloadStream: typeof ty.p2p.downloadStream;
14
+ queryAlbumFileIndexs: typeof ty.p2p.queryAlbumFileIndexs;
15
+ onSessionStatusChange: typeof ty.p2p.onSessionStatusChange;
16
+ offSessionStatusChange: typeof ty.p2p.offSessionStatusChange;
17
+ onUploadProgressUpdate: typeof ty.p2p.onUploadProgressUpdate;
18
+ offUploadProgressUpdate: typeof ty.p2p.offUploadProgressUpdate;
19
+ onDownloadProgressUpdate: typeof ty.p2p.onDownloadProgressUpdate;
20
+ offDownloadProgressUpdate: typeof ty.p2p.offDownloadProgressUpdate;
21
+ onDownloadTotalProgressUpdate: typeof ty.p2p.onDownloadTotalProgressUpdate;
22
+ offDownloadTotalProgressUpdate: typeof ty.p2p.offDownloadTotalProgressUpdate;
23
+ onFileDownloadComplete: typeof ty.p2p.onFileDownloadComplete;
24
+ offFileDownloadComplete: typeof ty.p2p.offFileDownloadComplete;
25
+ onStreamPacketReceive: typeof ty.p2p.onStreamPacketReceive;
26
+ offStreamPacketReceive: typeof ty.p2p.offStreamPacketReceive;
27
+ };
@@ -0,0 +1,79 @@
1
+ /// <reference path="../@types/MapKit.d.ts" />
2
+
3
+ import { factory } from './utils';
4
+
5
+ // ray 1.4.0 集成
6
+ export const p2p = {
7
+ P2PSDKInit: factory('P2PSDKInit', {
8
+ "namespace": "p2p"
9
+ }),
10
+ deInitSDK: factory('deInitSDK', {
11
+ "namespace": "p2p"
12
+ }),
13
+ isP2PActive: factory('isP2PActive', {
14
+ "namespace": "p2p"
15
+ }),
16
+ isP2PActiveSync: factory('isP2PActiveSync', {
17
+ "namespace": "p2p"
18
+ }),
19
+ connectDevice: factory('connectDevice', {
20
+ "namespace": "p2p"
21
+ }),
22
+ disconnectDevice: factory('disconnectDevice', {
23
+ "namespace": "p2p"
24
+ }),
25
+ uploadFile: factory('uploadFile', {
26
+ "namespace": "p2p"
27
+ }),
28
+ cancelUploadTask: factory('cancelUploadTask', {
29
+ "namespace": "p2p"
30
+ }),
31
+ downloadFile: factory('downloadFile', {
32
+ "namespace": "p2p"
33
+ }),
34
+ cancelDownloadTask: factory('cancelDownloadTask', {
35
+ "namespace": "p2p"
36
+ }),
37
+ downloadStream: factory('downloadStream', {
38
+ "namespace": "p2p"
39
+ }),
40
+ queryAlbumFileIndexs: factory('queryAlbumFileIndexs', {
41
+ "namespace": "p2p"
42
+ }),
43
+ onSessionStatusChange: factory('onSessionStatusChange', {
44
+ "namespace": "p2p"
45
+ }),
46
+ offSessionStatusChange: factory('offSessionStatusChange', {
47
+ "namespace": "p2p"
48
+ }),
49
+ onUploadProgressUpdate: factory('onUploadProgressUpdate', {
50
+ "namespace": "p2p"
51
+ }),
52
+ offUploadProgressUpdate: factory('offUploadProgressUpdate', {
53
+ "namespace": "p2p"
54
+ }),
55
+ onDownloadProgressUpdate: factory('onDownloadProgressUpdate', {
56
+ "namespace": "p2p"
57
+ }),
58
+ offDownloadProgressUpdate: factory('offDownloadProgressUpdate', {
59
+ "namespace": "p2p"
60
+ }),
61
+ onDownloadTotalProgressUpdate: factory('onDownloadTotalProgressUpdate', {
62
+ "namespace": "p2p"
63
+ }),
64
+ offDownloadTotalProgressUpdate: factory('offDownloadTotalProgressUpdate', {
65
+ "namespace": "p2p"
66
+ }),
67
+ onFileDownloadComplete: factory('onFileDownloadComplete', {
68
+ "namespace": "p2p"
69
+ }),
70
+ offFileDownloadComplete: factory('offFileDownloadComplete', {
71
+ "namespace": "p2p"
72
+ }),
73
+ onStreamPacketReceive: factory('onStreamPacketReceive', {
74
+ "namespace": "p2p"
75
+ }),
76
+ offStreamPacketReceive: factory('offStreamPacketReceive', {
77
+ "namespace": "p2p"
78
+ })
79
+ };
@@ -1,6 +1,7 @@
1
1
  /// <reference path="../@types/PlayNetKit.d.ts" />
2
+
2
3
  import { factory } from './utils';
3
- export var playnet = {
4
+ export const playnet = {
4
5
  autoConnectToAp: factory('autoConnectToAp', {
5
6
  "namespace": "playnet"
6
7
  }),
package/lib/all-kits.d.ts CHANGED
@@ -5,5 +5,6 @@ export * from './MiniKit-3.1.0';
5
5
  export * from './PlayNetKit-1.1.3';
6
6
  export * from './MapKit-3.0.7';
7
7
  export * from './HomeKit-3.1.4';
8
+ export * from './P2PKit-2.0.3';
8
9
  import * as device from './DeviceKit-3.3.1';
9
10
  export { device };
package/lib/all-kits.js CHANGED
@@ -5,5 +5,6 @@ export * from './MiniKit-3.1.0';
5
5
  export * from './PlayNetKit-1.1.3';
6
6
  export * from './MapKit-3.0.7';
7
7
  export * from './HomeKit-3.1.4';
8
+ export * from './P2PKit-2.0.3';
8
9
  import * as device from './DeviceKit-3.3.1';
9
10
  export { device };
@@ -2,34 +2,31 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  // 告警相关接口
3
3
  import { requestCloud } from '../';
4
4
  import { THING } from '../constants';
5
-
6
5
  /**
7
6
  * 根据设备 ID 查询告警列表信息
8
7
  * @param {string} devId 设备Id
9
8
  */
10
- var getDevAlarmList = function (devId) {
9
+ const getDevAlarmList = devId => {
11
10
  return requestCloud({
12
11
  api: "".concat(THING, ".m.linkage.rule.product.query"),
13
12
  version: '1.0',
14
13
  data: {
15
- devId: devId
14
+ devId
16
15
  }
17
16
  });
18
17
  };
18
+
19
19
  /**
20
20
  * 启用或者禁用设备的告警
21
21
  * @param {string} devId 设备Id
22
22
  * @param {string} ruleIds 要开启或关闭的告警id, 用","隔开
23
23
  * @param {bool} disabled 是否禁用
24
24
  */
25
-
26
-
27
- var setAlarmSwitch = function (params) {
25
+ const setAlarmSwitch = params => {
28
26
  return requestCloud({
29
27
  api: "".concat(THING, ".m.linkage.dev.warn.set"),
30
28
  version: '1.0',
31
29
  data: _objectSpread({}, params)
32
30
  });
33
31
  };
34
-
35
32
  export { getDevAlarmList, setAlarmSwitch };
package/lib/cloud/core.js CHANGED
@@ -1,16 +1,15 @@
1
1
  // 通用核心接口
2
2
  import { requestCloud } from '../';
3
3
  import { THING } from '../constants';
4
+
4
5
  /**
5
6
  * 获取 App 面板内静态资源地址
6
7
  */
7
-
8
- var getAssetHostname = function () {
8
+ const getAssetHostname = () => {
9
9
  return requestCloud({
10
10
  api: "".concat(THING, ".m.app.panel.url.get"),
11
11
  version: '1.0',
12
12
  data: {}
13
13
  });
14
14
  };
15
-
16
15
  export { getAssetHostname };
@@ -2,19 +2,19 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  // 设备接口
3
3
  import { requestCloud } from '../';
4
4
  import { THING } from '../constants';
5
-
6
5
  /**
7
6
  * 获取设备所有 DP 信息
8
7
  * @param {string} gwId 设备Id
9
8
  * @param {string} devId 设备Id
10
9
  */
11
- var getDpsInfos = function (params) {
10
+ const getDpsInfos = params => {
12
11
  return requestCloud({
13
12
  api: 's.m.dev.dp.get',
14
13
  version: '2.0',
15
14
  data: _objectSpread({}, params)
16
15
  });
17
16
  };
17
+
18
18
  /**
19
19
  * 更新设备 DP 名称
20
20
  * @param {string} gwId 设备Id
@@ -22,73 +22,68 @@ var getDpsInfos = function (params) {
22
22
  * @param {string} dpId dpId
23
23
  * @param {string} name dp自定义名称
24
24
  */
25
-
26
-
27
- var updateDpName = function (params) {
25
+ const updateDpName = params => {
28
26
  return requestCloud({
29
27
  api: 's.m.dev.dp.name.update',
30
28
  version: '1.0',
31
29
  data: _objectSpread({}, params)
32
30
  });
33
31
  };
32
+
34
33
  /**
35
34
  * 获取群组设备所有 DP 信息
36
35
  * @param {string} groupId 群组id
37
36
  */
38
-
39
-
40
- var getGroupDpsInfos = function (groupId) {
37
+ const getGroupDpsInfos = groupId => {
41
38
  return requestCloud({
42
39
  api: 's.m.dev.group.dp.get',
43
40
  version: '2.0',
44
41
  data: {
45
- groupId: groupId
42
+ groupId
46
43
  }
47
44
  });
48
45
  };
46
+
49
47
  /**
50
48
  * 更新群组设备 DP 名称
51
49
  * @param {string} groupId 群组id
52
50
  * @param {string} dpId dpId
53
51
  * @param {string} name dp自定义名称
54
52
  */
55
-
56
-
57
- var updateGroupDpName = function (params) {
53
+ const updateGroupDpName = params => {
58
54
  return requestCloud({
59
55
  api: "".concat(THING, ".m.group.dpname.update"),
60
56
  version: '1.0',
61
57
  data: _objectSpread({}, params)
62
58
  });
63
59
  };
60
+
64
61
  /**
65
62
  * 通过设备 ID 获取当天天气
66
63
  * @param {string} devId 设备Id
67
64
  * @param {boolean} isLocal 要查询的信息
68
65
  */
69
-
70
-
71
- var getWeatherQuality = function (params) {
66
+ const getWeatherQuality = params => {
72
67
  return requestCloud({
73
68
  api: "".concat(THING, ".m.public.weather.get"),
74
69
  version: '2.0',
75
70
  data: _objectSpread({}, params)
76
71
  });
77
72
  };
73
+
78
74
  /**
79
75
  * 天气预报接口
80
76
  * @param {string} devId 设备Id
81
77
  * @param {number} dataRange 预报天数(默认值为 7,最大可预报天数为 7)
82
78
  */
83
-
84
-
85
- var getWeathers = function (params) {
79
+ const getWeathers = params => {
86
80
  return requestCloud({
87
81
  api: "".concat(THING, ".m.public.weathers.get"),
88
82
  version: '2.0',
89
83
  data: _objectSpread({}, params)
90
84
  });
91
85
  };
86
+
92
87
  /**
93
88
  * 创建设备自定义位置信息
94
89
  * @param {string} devId 设备Id
@@ -96,53 +91,47 @@ var getWeathers = function (params) {
96
91
  * @param {string} lat 纬度
97
92
  * @param {string} locationName 位置名称(目前没用,不影响天气返回结果)
98
93
  */
99
-
100
-
101
- var saveCustomizePosition = function (params) {
94
+ const saveCustomizePosition = params => {
102
95
  return requestCloud({
103
96
  api: "".concat(THING, ".m.device.customize.position.save"),
104
97
  version: '1.0',
105
98
  data: _objectSpread({}, params)
106
99
  });
107
100
  };
101
+
108
102
  /**
109
103
  * 设备自定义位置信息获取
110
104
  * @param {string} devId 设备Id
111
105
  */
112
-
113
-
114
- var getCustomizePosition = function (params) {
106
+ const getCustomizePosition = params => {
115
107
  return requestCloud({
116
108
  api: "".concat(THING, ".m.device.customize.position.get"),
117
109
  version: '1.0',
118
110
  data: _objectSpread({}, params)
119
111
  });
120
112
  };
113
+
121
114
  /**
122
115
  * 获取设备属性
123
116
  * @param {string} devId 设备Id
124
117
  */
125
-
126
-
127
- var getDevProperty = function (params) {
118
+ const getDevProperty = params => {
128
119
  return requestCloud({
129
120
  api: 's.m.dev.property.get',
130
121
  version: '3.2',
131
122
  data: _objectSpread({}, params)
132
123
  });
133
124
  };
125
+
134
126
  /**
135
127
  * 保存设备属性
136
128
  * @param {string} devId 设备Id
137
129
  */
138
-
139
-
140
- var saveDevProperty = function (params) {
130
+ const saveDevProperty = params => {
141
131
  return requestCloud({
142
132
  api: 's.m.dev.property.save',
143
133
  version: '5.1',
144
134
  data: _objectSpread({}, params)
145
135
  });
146
136
  };
147
-
148
137
  export { getDpsInfos, updateDpName, getGroupDpsInfos, updateGroupDpName, getWeatherQuality, getWeathers, saveCustomizePosition, getCustomizePosition, getDevProperty, saveDevProperty };
@@ -108,7 +108,7 @@ export interface IQueryTimerTasks {
108
108
  bizType: string;
109
109
  category: string;
110
110
  }
111
- export declare type Timers = Array<{
111
+ export type Timers = Array<{
112
112
  /**
113
113
  * 初始化状态,0:关闭;1:开启。
114
114
  */
@@ -655,7 +655,7 @@ export interface IGetLogInSpecifiedTime {
655
655
  startTime?: string;
656
656
  endTime?: string;
657
657
  }
658
- export declare type Dp = {
658
+ export type Dp = {
659
659
  /**
660
660
  * 上报数据的时间戳格式
661
661
  */
@@ -834,7 +834,7 @@ export interface IGetLinkageDeviceList {
834
834
  gid: number;
835
835
  sourceType: string;
836
836
  }
837
- export declare type IGetLinkageDeviceListResponse = Array<{
837
+ export type IGetLinkageDeviceListResponse = Array<{
838
838
  category: string;
839
839
  datapoints: any[];
840
840
  devId: string;
@@ -842,7 +842,7 @@ export declare type IGetLinkageDeviceListResponse = Array<{
842
842
  name: string;
843
843
  productId: string;
844
844
  }>;
845
- export declare type IGetSceneListResponse = Array<{
845
+ export type IGetSceneListResponse = Array<{
846
846
  actions: any[];
847
847
  attribute: number;
848
848
  auditStatus: number;
@@ -906,7 +906,7 @@ export interface IGetBindRuleList {
906
906
  sourceEntityId: string;
907
907
  entityType: number;
908
908
  }
909
- export declare type IGetBindRuleListResponse = Array<{
909
+ export type IGetBindRuleListResponse = Array<{
910
910
  associativeEntityId: string;
911
911
  associativeEntityValueList: any[];
912
912
  bizDomain: string;
@@ -932,7 +932,7 @@ export interface IGetDevProperty {
932
932
  */
933
933
  code: string;
934
934
  }
935
- export declare type IGetDevPropertyResponse = string;
935
+ export type IGetDevPropertyResponse = string;
936
936
  export interface ISaveDevProperty {
937
937
  /**
938
938
  * 设备 ID
@@ -957,4 +957,4 @@ export interface DeviceProperty {
957
957
  */
958
958
  value: string;
959
959
  }
960
- export declare type ISaveDevPropertyResponse = boolean;
960
+ export type ISaveDevPropertyResponse = boolean;