@ray-js/api 1.7.69 → 1.7.71
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/@types/AIKit.d.ts +5509 -610
- package/@types/AIStreamKit.d.ts +2641 -0
- package/@types/AVideoKit.d.ts +1827 -0
- package/@types/BaseKit.d.ts +8682 -1893
- package/@types/BizKit.d.ts +6639 -1038
- package/@types/CategoryCommonBizKit.d.ts +1459 -0
- package/@types/CommunityKit.d.ts +154 -0
- package/@types/DeviceKit.d.ts +18475 -5662
- package/@types/GroupCITestKit.d.ts +651 -0
- package/@types/HealthKit.d.ts +2290 -357
- package/@types/HomeKit.d.ts +4068 -182
- package/@types/IPCKit.d.ts +4327 -1227
- package/@types/LightKit.d.ts +125 -0
- package/@types/MapKit.d.ts +1560 -204
- package/@types/MediaKit.d.ts +136 -16
- package/@types/MediaPlayerKit.d.ts +47 -0
- package/@types/MiniKit.d.ts +2976 -628
- package/@types/OutdoorKit.d.ts +1337 -24
- package/@types/P2PKit.d.ts +622 -103
- package/@types/PayKit.d.ts +115 -0
- package/@types/PlayNetKit.d.ts +3454 -1309
- package/@types/SweeperKit.d.ts +154 -0
- package/@types/ThirdAuthKit.d.ts +324 -0
- package/@types/ThirdPartyDeviceKit.d.ts +410 -0
- package/@types/WearKit.d.ts +10177 -375
- package/@types/gateway.d.ts +349 -61
- package/@types/health.d.ts +486 -304
- package/lib/AIKit-1.6.0.d.ts +265 -41
- package/lib/AIKit-1.6.0.js +374 -120
- package/lib/BaseKit-3.17.7.d.ts +704 -0
- package/lib/BaseKit-3.17.7.js +720 -1
- package/lib/BizKit-4.10.4.d.ts +336 -0
- package/lib/BizKit-4.10.4.js +342 -5
- package/lib/DeviceKit-4.13.1.d.ts +996 -0
- package/lib/DeviceKit-4.13.1.js +1247 -249
- package/lib/HealthKit-6.5.0.d.ts +210 -44
- package/lib/HealthKit-6.5.0.js +295 -128
- package/lib/HomeKit-3.1.4.d.ts +20 -6
- package/lib/HomeKit-3.1.4.js +29 -14
- package/lib/IPCKit-6.4.5.d.ts +375 -77
- package/lib/IPCKit-6.4.5.js +525 -228
- package/lib/MapKit-3.4.13.d.ts +70 -16
- package/lib/MapKit-3.4.13.js +98 -47
- package/lib/MediaKit-3.4.1.d.ts +5 -3
- package/lib/MediaKit-3.4.1.js +7 -6
- package/lib/MiniKit-3.14.1.d.ts +300 -0
- package/lib/MiniKit-3.14.1.js +302 -0
- package/lib/OutdoorKit-1.0.4.d.ts +55 -13
- package/lib/OutdoorKit-1.0.4.js +78 -35
- package/lib/P2PKit-2.0.3.d.ts +125 -27
- package/lib/P2PKit-2.0.3.js +175 -78
- package/lib/PlayNetKit-1.3.30.d.ts +290 -60
- package/lib/PlayNetKit-1.3.30.js +407 -176
- package/lib/WearKit-1.1.6.d.ts +125 -27
- package/lib/WearKit-1.1.6.js +176 -77
- package/lib/all-kits.d.ts +10 -10
- package/lib/all-kits.js +10 -10
- package/lib/cloud/core.d.ts +31 -1
- package/lib/cloud/core.js +31 -1
- package/lib/cloud/device.d.ts +155 -24
- package/lib/cloud/device.js +153 -22
- package/lib/cloud/gateway.d.ts +254 -0
- package/lib/cloud/gateway.js +269 -9
- package/lib/cloud/health.d.ts +1 -0
- package/lib/cloud/health.js +121 -0
- package/lib/cloud/interface.d.ts +222 -44
- package/lib/cloud/interface.js +15 -2
- package/lib/cloud/laser-clean/deleteCleaningRecord/index.d.ts +27 -0
- package/lib/cloud/laser-clean/deleteCleaningRecord/index.js +28 -0
- package/lib/cloud/laser-clean/deleteCleaningRecord/type.d.ts +7 -0
- package/lib/cloud/laser-clean/deleteCleaningRecord/type.js +1 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/index.d.ts +27 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/index.js +28 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/type.d.ts +7 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/type.js +1 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/index.d.ts +27 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/index.js +28 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/type.d.ts +7 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/type.js +1 -0
- package/lib/cloud/laser-clean/getCleaningRecords/index.d.ts +30 -0
- package/lib/cloud/laser-clean/getCleaningRecords/index.js +31 -0
- package/lib/cloud/laser-clean/getCleaningRecords/type.d.ts +39 -0
- package/lib/cloud/laser-clean/getCleaningRecords/type.js +1 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/index.d.ts +29 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/index.js +30 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/type.d.ts +30 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/type.js +1 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/index.d.ts +29 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/index.js +30 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/type.d.ts +35 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/type.js +1 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/index.d.ts +28 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/index.js +29 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/type.d.ts +28 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/type.js +1 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/index.d.ts +24 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/index.js +25 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/type.d.ts +29 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/type.js +1 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/index.d.ts +24 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/index.js +25 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/type.d.ts +26 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/type.js +1 -0
- package/lib/cloud/laser-clean/getVoiceList/index.d.ts +28 -0
- package/lib/cloud/laser-clean/getVoiceList/index.js +29 -0
- package/lib/cloud/laser-clean/getVoiceList/type.d.ts +48 -0
- package/lib/cloud/laser-clean/getVoiceList/type.js +1 -0
- package/lib/cloud/laser-clean/index.d.ts +1 -1
- package/lib/cloud/laser-clean/index.js +1 -1
- package/lib/cloud/laser-clean/map.d.ts +5 -7
- package/lib/cloud/laser-clean/map.js +5 -9
- package/lib/cloud/laser-clean/record.d.ts +5 -6
- package/lib/cloud/laser-clean/record.js +5 -7
- package/lib/cloud/laser-clean/renameHistoryMap/index.d.ts +28 -0
- package/lib/cloud/laser-clean/renameHistoryMap/index.js +29 -0
- package/lib/cloud/laser-clean/renameHistoryMap/type.d.ts +9 -0
- package/lib/cloud/laser-clean/renameHistoryMap/type.js +1 -0
- package/lib/cloud/laser-clean/voice.d.ts +1 -3
- package/lib/cloud/laser-clean/voice.js +1 -4
- package/lib/cloud/linkage.d.ts +271 -53
- package/lib/cloud/linkage.js +256 -51
- package/lib/cloud/remoteGroup.d.ts +37 -0
- package/lib/cloud/remoteGroup.js +37 -0
- package/lib/cloud/timer.d.ts +104 -26
- package/lib/cloud/timer.js +104 -26
- package/lib/getApp/index.thing.d.ts +47 -1
- package/lib/getApp/index.thing.js +40 -2
- package/lib/getBoundingClientRect/index.thing.d.ts +101 -1
- package/lib/getBoundingClientRect/index.thing.js +59 -0
- package/lib/getCurrentPages/index.thing.d.ts +40 -15
- package/lib/getCurrentPages/index.thing.js +36 -15
- package/lib/getCustomConfig/index.d.ts +5 -2
- package/lib/getCustomConfig/index.thing.d.ts +68 -2
- package/lib/getCustomConfig/index.thing.js +62 -0
- package/lib/getCustomConfig/index.wechat.d.ts +5 -2
- package/lib/getCustomConfig/type.d.ts +26 -15
- package/lib/getElementById/index.thing.d.ts +42 -1
- package/lib/getElementById/index.thing.js +40 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +4 -2
- package/lib/nativeRouters/common.d.ts +8 -0
- package/lib/nativeRouters/device.d.ts +137 -5
- package/lib/nativeRouters/device.js +138 -6
- package/lib/nativeRouters/gw.d.ts +58 -8
- package/lib/nativeRouters/gw.js +57 -8
- package/lib/nativeRouters/outdoors.d.ts +16 -3
- package/lib/nativeRouters/outdoors.js +16 -3
- package/lib/nativeRouters/remoteGroup.d.ts +23 -0
- package/lib/nativeRouters/remoteGroup.js +23 -0
- package/lib/nativeRouters/root.d.ts +19 -0
- package/lib/nativeRouters/root.js +17 -0
- package/lib/openGroupCreate/index.d.ts +45 -0
- package/lib/openGroupCreate/index.js +32 -0
- package/package.json +5 -5
package/lib/cloud/device.d.ts
CHANGED
|
@@ -1,28 +1,89 @@
|
|
|
1
|
-
import { IGetDpsInfos, IUpdateDpName, IUpdateGroupDpName, IGetWeatherQuality, IGetWeathers, ISaveCustomizePosition, IGetCustomizePosition, IGetDpsInfosResponse, IGetGroupDpsInfosResponse, IGetWeatherQualityResponse, IGetCustomizePositionResponse, IGetWeathersResponse, IGetDevProperty, IGetDevPropertyResponse, ISaveDevProperty } from './interface';
|
|
1
|
+
import { IGetDpsInfos, IUpdateDpName, IUpdateGroupDpName, IGetWeatherQuality, IGetWeathers, ISaveCustomizePosition, IGetCustomizePosition, IGetDpsInfosResponse, IGetGroupDpsInfosResponse, IGetWeatherQualityResponse, IGetCustomizePositionResponse, IGetWeathersResponse, IGetDevProperty, IGetDevPropertyResponse, ISaveDevProperty, ISaveDevPropertyResponse } from './interface';
|
|
2
2
|
/**
|
|
3
|
-
* 获取设备所有 DP
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
3
|
+
* 获取设备所有 DP 信息,通常用于获取设备 DP 名称,配合 updateDpName 使用
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
* @since @ray-js/ray 1.5.2
|
|
7
|
+
* @param params - 请求参数
|
|
8
|
+
* @returns DP 信息数组,每个元素包含 code、dpId、value、time、type、name
|
|
9
|
+
* @example 基础用法
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { getDpsInfos } from '@ray-js/ray';
|
|
12
|
+
*
|
|
13
|
+
* getDpsInfos({
|
|
14
|
+
* devId: 'vdevo169477319679442',
|
|
15
|
+
* gwId: 'vdevo169477319679442',
|
|
16
|
+
* }).then((res) => {
|
|
17
|
+
* console.log('DP 信息:', res);
|
|
18
|
+
* }).catch((error) => {
|
|
19
|
+
* console.error(error);
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
6
22
|
*/
|
|
7
23
|
declare const getDpsInfos: (params: IGetDpsInfos) => Promise<IGetDpsInfosResponse[]>;
|
|
8
24
|
/**
|
|
9
25
|
* 更新设备 DP 名称
|
|
10
|
-
*
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
13
|
-
* @param
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
* @since @ray-js/ray 1.5.2
|
|
29
|
+
* @param params - 请求参数
|
|
30
|
+
* @returns 是否成功更新
|
|
31
|
+
* @example 基础用法
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { updateDpName } from '@ray-js/ray';
|
|
34
|
+
*
|
|
35
|
+
* updateDpName({
|
|
36
|
+
* devId: 'vdevo169477319679442',
|
|
37
|
+
* dpId: '21',
|
|
38
|
+
* name: 'work_mode',
|
|
39
|
+
* }).then((res) => {
|
|
40
|
+
* console.log('更新结果:', res);
|
|
41
|
+
* }).catch((error) => {
|
|
42
|
+
* console.error(error);
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
14
45
|
*/
|
|
15
46
|
declare const updateDpName: (params: IUpdateDpName) => Promise<boolean>;
|
|
16
47
|
/**
|
|
17
|
-
* 获取群组设备所有 DP
|
|
18
|
-
*
|
|
48
|
+
* 获取群组设备所有 DP 信息,通常用于获取群组设备 DP 名称,配合 updateGroupDpName 使用
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
* @since @ray-js/ray 1.5.2
|
|
52
|
+
* @param groupId - 群组 ID
|
|
53
|
+
* @returns DP 信息对象,包含 code、dpId、value、name、time、type
|
|
54
|
+
* @example 基础用法
|
|
55
|
+
* ```ts
|
|
56
|
+
* import { getGroupDpsInfos } from '@ray-js/ray';
|
|
57
|
+
*
|
|
58
|
+
* getGroupDpsInfos('1').then((response) => {
|
|
59
|
+
* console.log('群组 DP 信息:', response);
|
|
60
|
+
* }).catch((err) => {
|
|
61
|
+
* console.error(err);
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
19
64
|
*/
|
|
20
65
|
declare const getGroupDpsInfos: (groupId: string) => Promise<IGetGroupDpsInfosResponse>;
|
|
21
66
|
/**
|
|
22
67
|
* 更新群组设备 DP 名称
|
|
23
|
-
*
|
|
24
|
-
* @
|
|
25
|
-
* @
|
|
68
|
+
*
|
|
69
|
+
* @public
|
|
70
|
+
* @since @ray-js/ray 1.5.2
|
|
71
|
+
* @param params - 请求参数
|
|
72
|
+
* @returns 是否成功更新群组设备 DP 名称
|
|
73
|
+
* @example 基础用法
|
|
74
|
+
* ```ts
|
|
75
|
+
* import { updateGroupDpName } from '@ray-js/ray';
|
|
76
|
+
*
|
|
77
|
+
* updateGroupDpName({
|
|
78
|
+
* group: '1',
|
|
79
|
+
* dpId: '20',
|
|
80
|
+
* name: 'switch_led',
|
|
81
|
+
* }).then((response) => {
|
|
82
|
+
* console.log('更新结果:', response);
|
|
83
|
+
* }).catch((err) => {
|
|
84
|
+
* console.error(err);
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
26
87
|
*/
|
|
27
88
|
declare const updateGroupDpName: (params: IUpdateGroupDpName) => Promise<boolean>;
|
|
28
89
|
/**
|
|
@@ -38,28 +99,98 @@ declare const getWeatherQuality: (params: IGetWeatherQuality) => Promise<IGetWea
|
|
|
38
99
|
*/
|
|
39
100
|
declare const getWeathers: (params: IGetWeathers) => Promise<IGetWeathersResponse>;
|
|
40
101
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* @
|
|
44
|
-
* @
|
|
45
|
-
* @param
|
|
102
|
+
* 创建设备自定义位置信息。当天气接口不适用于设备配网经纬度时,可通过自定义设备经纬度获取实时天气,例如户外穿戴设备。
|
|
103
|
+
*
|
|
104
|
+
* @public
|
|
105
|
+
* @since @ray-js/ray 1.5.2
|
|
106
|
+
* @param params - 请求参数
|
|
107
|
+
* @returns 是否成功保存
|
|
108
|
+
* @example 基础用法
|
|
109
|
+
* ```ts
|
|
110
|
+
* import { saveCustomizePosition } from '@ray-js/ray';
|
|
111
|
+
*
|
|
112
|
+
* saveCustomizePosition({
|
|
113
|
+
* devId: 'your_device_id',
|
|
114
|
+
* lon: '113.2333',
|
|
115
|
+
* lat: '23.1666',
|
|
116
|
+
* }).then((response) => {
|
|
117
|
+
* console.log('保存结果:', response);
|
|
118
|
+
* }).catch((err) => {
|
|
119
|
+
* console.error(err);
|
|
120
|
+
* });
|
|
121
|
+
* ```
|
|
46
122
|
*/
|
|
47
123
|
declare const saveCustomizePosition: (params: ISaveCustomizePosition) => Promise<boolean>;
|
|
48
124
|
/**
|
|
49
125
|
* 设备自定义位置信息获取
|
|
50
|
-
*
|
|
126
|
+
*
|
|
127
|
+
* @public
|
|
128
|
+
* @since @ray-js/ray 1.5.2
|
|
129
|
+
* @param params - 请求参数
|
|
130
|
+
* @returns 包含 lon(经度)和 lat(纬度)的位置信息对象
|
|
131
|
+
* @example 基础用法
|
|
132
|
+
* ```ts
|
|
133
|
+
* import { getCustomizePosition } from '@ray-js/ray';
|
|
134
|
+
*
|
|
135
|
+
* getCustomizePosition({
|
|
136
|
+
* devId: 'your_device_id',
|
|
137
|
+
* }).then((response) => {
|
|
138
|
+
* console.log('位置信息:', response);
|
|
139
|
+
* }).catch((err) => {
|
|
140
|
+
* console.error(err);
|
|
141
|
+
* });
|
|
142
|
+
* ```
|
|
51
143
|
*/
|
|
52
144
|
declare const getCustomizePosition: (params: IGetCustomizePosition) => Promise<IGetCustomizePositionResponse>;
|
|
53
145
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
146
|
+
* 获取自定义设置的设备属性数据,可通过 saveDevProperty 写入
|
|
147
|
+
*
|
|
148
|
+
* @public
|
|
149
|
+
* @since @ray-js/ray 1.5.2
|
|
150
|
+
* @param params - 请求参数
|
|
151
|
+
* @returns 设备属性数据数组
|
|
152
|
+
* @example 基础用法
|
|
153
|
+
* ```ts
|
|
154
|
+
* import { getDevProperty } from '@ray-js/ray';
|
|
155
|
+
*
|
|
156
|
+
* getDevProperty({
|
|
157
|
+
* devId: 'your_device_id',
|
|
158
|
+
* bizType: 0,
|
|
159
|
+
* code: 'hello',
|
|
160
|
+
* }).then((response) => {
|
|
161
|
+
* console.log('设备属性:', response);
|
|
162
|
+
* }).catch((err) => {
|
|
163
|
+
* console.error(err);
|
|
164
|
+
* });
|
|
165
|
+
* ```
|
|
56
166
|
*/
|
|
57
167
|
declare const getDevProperty: (params: IGetDevProperty) => Promise<IGetDevPropertyResponse>;
|
|
58
168
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
169
|
+
* 写入自定义设置的设备属性数据,保存后可通过 getDevProperty 获取
|
|
170
|
+
*
|
|
171
|
+
* @public
|
|
172
|
+
* @since @ray-js/ray 1.5.2
|
|
173
|
+
* @param params - 请求参数
|
|
174
|
+
* @returns 是否成功保存
|
|
175
|
+
* @example 基础用法
|
|
176
|
+
* ```ts
|
|
177
|
+
* import { saveDevProperty } from '@ray-js/ray';
|
|
178
|
+
*
|
|
179
|
+
* saveDevProperty({
|
|
180
|
+
* devId: 'your_device_id',
|
|
181
|
+
* bizType: 0,
|
|
182
|
+
* propertyList: JSON.stringify([
|
|
183
|
+
* { code: 'hello', value: 'world' },
|
|
184
|
+
* { code: 'foo', value: 'bar' },
|
|
185
|
+
* ]),
|
|
186
|
+
* }).then((response) => {
|
|
187
|
+
* console.log('保存结果:', response);
|
|
188
|
+
* }).catch((err) => {
|
|
189
|
+
* console.error(err);
|
|
190
|
+
* });
|
|
191
|
+
* ```
|
|
61
192
|
*/
|
|
62
|
-
declare const saveDevProperty: (params: ISaveDevProperty) => Promise<
|
|
193
|
+
declare const saveDevProperty: (params: ISaveDevProperty) => Promise<ISaveDevPropertyResponse>;
|
|
63
194
|
export interface GetRemoteLocalRelationParams {
|
|
64
195
|
/**
|
|
65
196
|
* 遥控器设备id
|
package/lib/cloud/device.js
CHANGED
|
@@ -3,9 +3,25 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
3
3
|
import { requestCloud } from '../';
|
|
4
4
|
import { THING } from '../constants';
|
|
5
5
|
/**
|
|
6
|
-
* 获取设备所有 DP
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
6
|
+
* 获取设备所有 DP 信息,通常用于获取设备 DP 名称,配合 updateDpName 使用
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
* @since @ray-js/ray 1.5.2
|
|
10
|
+
* @param params - 请求参数
|
|
11
|
+
* @returns DP 信息数组,每个元素包含 code、dpId、value、time、type、name
|
|
12
|
+
* @example 基础用法
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { getDpsInfos } from '@ray-js/ray';
|
|
15
|
+
*
|
|
16
|
+
* getDpsInfos({
|
|
17
|
+
* devId: 'vdevo169477319679442',
|
|
18
|
+
* gwId: 'vdevo169477319679442',
|
|
19
|
+
* }).then((res) => {
|
|
20
|
+
* console.log('DP 信息:', res);
|
|
21
|
+
* }).catch((error) => {
|
|
22
|
+
* console.error(error);
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
9
25
|
*/
|
|
10
26
|
const getDpsInfos = params => {
|
|
11
27
|
return requestCloud({
|
|
@@ -17,10 +33,25 @@ const getDpsInfos = params => {
|
|
|
17
33
|
|
|
18
34
|
/**
|
|
19
35
|
* 更新设备 DP 名称
|
|
20
|
-
*
|
|
21
|
-
* @
|
|
22
|
-
* @
|
|
23
|
-
* @param
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
* @since @ray-js/ray 1.5.2
|
|
39
|
+
* @param params - 请求参数
|
|
40
|
+
* @returns 是否成功更新
|
|
41
|
+
* @example 基础用法
|
|
42
|
+
* ```ts
|
|
43
|
+
* import { updateDpName } from '@ray-js/ray';
|
|
44
|
+
*
|
|
45
|
+
* updateDpName({
|
|
46
|
+
* devId: 'vdevo169477319679442',
|
|
47
|
+
* dpId: '21',
|
|
48
|
+
* name: 'work_mode',
|
|
49
|
+
* }).then((res) => {
|
|
50
|
+
* console.log('更新结果:', res);
|
|
51
|
+
* }).catch((error) => {
|
|
52
|
+
* console.error(error);
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
24
55
|
*/
|
|
25
56
|
const updateDpName = params => {
|
|
26
57
|
return requestCloud({
|
|
@@ -31,8 +62,22 @@ const updateDpName = params => {
|
|
|
31
62
|
};
|
|
32
63
|
|
|
33
64
|
/**
|
|
34
|
-
* 获取群组设备所有 DP
|
|
35
|
-
*
|
|
65
|
+
* 获取群组设备所有 DP 信息,通常用于获取群组设备 DP 名称,配合 updateGroupDpName 使用
|
|
66
|
+
*
|
|
67
|
+
* @public
|
|
68
|
+
* @since @ray-js/ray 1.5.2
|
|
69
|
+
* @param groupId - 群组 ID
|
|
70
|
+
* @returns DP 信息对象,包含 code、dpId、value、name、time、type
|
|
71
|
+
* @example 基础用法
|
|
72
|
+
* ```ts
|
|
73
|
+
* import { getGroupDpsInfos } from '@ray-js/ray';
|
|
74
|
+
*
|
|
75
|
+
* getGroupDpsInfos('1').then((response) => {
|
|
76
|
+
* console.log('群组 DP 信息:', response);
|
|
77
|
+
* }).catch((err) => {
|
|
78
|
+
* console.error(err);
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
36
81
|
*/
|
|
37
82
|
const getGroupDpsInfos = groupId => {
|
|
38
83
|
return requestCloud({
|
|
@@ -46,9 +91,25 @@ const getGroupDpsInfos = groupId => {
|
|
|
46
91
|
|
|
47
92
|
/**
|
|
48
93
|
* 更新群组设备 DP 名称
|
|
49
|
-
*
|
|
50
|
-
* @
|
|
51
|
-
* @
|
|
94
|
+
*
|
|
95
|
+
* @public
|
|
96
|
+
* @since @ray-js/ray 1.5.2
|
|
97
|
+
* @param params - 请求参数
|
|
98
|
+
* @returns 是否成功更新群组设备 DP 名称
|
|
99
|
+
* @example 基础用法
|
|
100
|
+
* ```ts
|
|
101
|
+
* import { updateGroupDpName } from '@ray-js/ray';
|
|
102
|
+
*
|
|
103
|
+
* updateGroupDpName({
|
|
104
|
+
* group: '1',
|
|
105
|
+
* dpId: '20',
|
|
106
|
+
* name: 'switch_led',
|
|
107
|
+
* }).then((response) => {
|
|
108
|
+
* console.log('更新结果:', response);
|
|
109
|
+
* }).catch((err) => {
|
|
110
|
+
* console.error(err);
|
|
111
|
+
* });
|
|
112
|
+
* ```
|
|
52
113
|
*/
|
|
53
114
|
const updateGroupDpName = params => {
|
|
54
115
|
return requestCloud({
|
|
@@ -85,11 +146,26 @@ const getWeathers = params => {
|
|
|
85
146
|
};
|
|
86
147
|
|
|
87
148
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* @
|
|
91
|
-
* @
|
|
92
|
-
* @param
|
|
149
|
+
* 创建设备自定义位置信息。当天气接口不适用于设备配网经纬度时,可通过自定义设备经纬度获取实时天气,例如户外穿戴设备。
|
|
150
|
+
*
|
|
151
|
+
* @public
|
|
152
|
+
* @since @ray-js/ray 1.5.2
|
|
153
|
+
* @param params - 请求参数
|
|
154
|
+
* @returns 是否成功保存
|
|
155
|
+
* @example 基础用法
|
|
156
|
+
* ```ts
|
|
157
|
+
* import { saveCustomizePosition } from '@ray-js/ray';
|
|
158
|
+
*
|
|
159
|
+
* saveCustomizePosition({
|
|
160
|
+
* devId: 'your_device_id',
|
|
161
|
+
* lon: '113.2333',
|
|
162
|
+
* lat: '23.1666',
|
|
163
|
+
* }).then((response) => {
|
|
164
|
+
* console.log('保存结果:', response);
|
|
165
|
+
* }).catch((err) => {
|
|
166
|
+
* console.error(err);
|
|
167
|
+
* });
|
|
168
|
+
* ```
|
|
93
169
|
*/
|
|
94
170
|
const saveCustomizePosition = params => {
|
|
95
171
|
return requestCloud({
|
|
@@ -101,7 +177,23 @@ const saveCustomizePosition = params => {
|
|
|
101
177
|
|
|
102
178
|
/**
|
|
103
179
|
* 设备自定义位置信息获取
|
|
104
|
-
*
|
|
180
|
+
*
|
|
181
|
+
* @public
|
|
182
|
+
* @since @ray-js/ray 1.5.2
|
|
183
|
+
* @param params - 请求参数
|
|
184
|
+
* @returns 包含 lon(经度)和 lat(纬度)的位置信息对象
|
|
185
|
+
* @example 基础用法
|
|
186
|
+
* ```ts
|
|
187
|
+
* import { getCustomizePosition } from '@ray-js/ray';
|
|
188
|
+
*
|
|
189
|
+
* getCustomizePosition({
|
|
190
|
+
* devId: 'your_device_id',
|
|
191
|
+
* }).then((response) => {
|
|
192
|
+
* console.log('位置信息:', response);
|
|
193
|
+
* }).catch((err) => {
|
|
194
|
+
* console.error(err);
|
|
195
|
+
* });
|
|
196
|
+
* ```
|
|
105
197
|
*/
|
|
106
198
|
const getCustomizePosition = params => {
|
|
107
199
|
return requestCloud({
|
|
@@ -112,8 +204,26 @@ const getCustomizePosition = params => {
|
|
|
112
204
|
};
|
|
113
205
|
|
|
114
206
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
207
|
+
* 获取自定义设置的设备属性数据,可通过 saveDevProperty 写入
|
|
208
|
+
*
|
|
209
|
+
* @public
|
|
210
|
+
* @since @ray-js/ray 1.5.2
|
|
211
|
+
* @param params - 请求参数
|
|
212
|
+
* @returns 设备属性数据数组
|
|
213
|
+
* @example 基础用法
|
|
214
|
+
* ```ts
|
|
215
|
+
* import { getDevProperty } from '@ray-js/ray';
|
|
216
|
+
*
|
|
217
|
+
* getDevProperty({
|
|
218
|
+
* devId: 'your_device_id',
|
|
219
|
+
* bizType: 0,
|
|
220
|
+
* code: 'hello',
|
|
221
|
+
* }).then((response) => {
|
|
222
|
+
* console.log('设备属性:', response);
|
|
223
|
+
* }).catch((err) => {
|
|
224
|
+
* console.error(err);
|
|
225
|
+
* });
|
|
226
|
+
* ```
|
|
117
227
|
*/
|
|
118
228
|
const getDevProperty = params => {
|
|
119
229
|
return requestCloud({
|
|
@@ -124,8 +234,29 @@ const getDevProperty = params => {
|
|
|
124
234
|
};
|
|
125
235
|
|
|
126
236
|
/**
|
|
127
|
-
*
|
|
128
|
-
*
|
|
237
|
+
* 写入自定义设置的设备属性数据,保存后可通过 getDevProperty 获取
|
|
238
|
+
*
|
|
239
|
+
* @public
|
|
240
|
+
* @since @ray-js/ray 1.5.2
|
|
241
|
+
* @param params - 请求参数
|
|
242
|
+
* @returns 是否成功保存
|
|
243
|
+
* @example 基础用法
|
|
244
|
+
* ```ts
|
|
245
|
+
* import { saveDevProperty } from '@ray-js/ray';
|
|
246
|
+
*
|
|
247
|
+
* saveDevProperty({
|
|
248
|
+
* devId: 'your_device_id',
|
|
249
|
+
* bizType: 0,
|
|
250
|
+
* propertyList: JSON.stringify([
|
|
251
|
+
* { code: 'hello', value: 'world' },
|
|
252
|
+
* { code: 'foo', value: 'bar' },
|
|
253
|
+
* ]),
|
|
254
|
+
* }).then((response) => {
|
|
255
|
+
* console.log('保存结果:', response);
|
|
256
|
+
* }).catch((err) => {
|
|
257
|
+
* console.error(err);
|
|
258
|
+
* });
|
|
259
|
+
* ```
|
|
129
260
|
*/
|
|
130
261
|
const saveDevProperty = params => {
|
|
131
262
|
return requestCloud({
|
package/lib/cloud/gateway.d.ts
CHANGED
|
@@ -1,4 +1,258 @@
|
|
|
1
|
+
/// <reference path="../../@types/GroupCITestKit.d.ts" />
|
|
1
2
|
/// <reference path="../../@types/gateway.d.ts" />
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare const hasParamsMethod: typeof ty.groupcitest.hasParamsMethod;
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare const richDocMethod: typeof ty.groupcitest.richDocMethod;
|
|
11
|
+
/**
|
|
12
|
+
* 下发更新 LQI 指令,用于刷新网关子设备的信号质量值
|
|
13
|
+
* @param params.devId 子设备 ID
|
|
14
|
+
* @returns 是否下发成功
|
|
15
|
+
* @public
|
|
16
|
+
* @since @ray-js/ray 1.7.60
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { gateway } from '@ray-js/ray';
|
|
20
|
+
*
|
|
21
|
+
* const refreshLQI = async () => {
|
|
22
|
+
* try {
|
|
23
|
+
* const success = await gateway.sendCmdForRefreshDeviceLQI({
|
|
24
|
+
* devId: 'sub_device_001',
|
|
25
|
+
* });
|
|
26
|
+
* console.log('下发刷新LQI指令:', success);
|
|
27
|
+
* } catch (err) {
|
|
28
|
+
* console.error('下发失败:', err);
|
|
29
|
+
* }
|
|
30
|
+
* };
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const sendCmdForRefreshDeviceLQI: typeof ty.gateway.sendCmdForRefreshDeviceLQI;
|
|
34
|
+
/**
|
|
35
|
+
* 获取设备最新 LQI(链路质量指示)信息
|
|
36
|
+
* @param params.devId 子设备 ID
|
|
37
|
+
* @param params.offsetTime 时间偏移量,单位为毫秒
|
|
38
|
+
* @returns 设备 LQI 信息列表
|
|
39
|
+
* @public
|
|
40
|
+
* @since @ray-js/ray 1.7.60
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* import { gateway } from '@ray-js/ray';
|
|
44
|
+
*
|
|
45
|
+
* const fetchLQI = async () => {
|
|
46
|
+
* try {
|
|
47
|
+
* const lqiList = await gateway.getLastDeviceLQI({
|
|
48
|
+
* devId: 'sub_device_001',
|
|
49
|
+
* offsetTime: 60000,
|
|
50
|
+
* });
|
|
51
|
+
* lqiList.forEach(item => {
|
|
52
|
+
* console.log(`设备: ${item.deviceName}, LQI: ${item.lqi}`);
|
|
53
|
+
* });
|
|
54
|
+
* } catch (err) {
|
|
55
|
+
* console.error('获取LQI失败:', err);
|
|
56
|
+
* }
|
|
57
|
+
* };
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare const getLastDeviceLQI: typeof ty.gateway.getLastDeviceLQI;
|
|
61
|
+
/**
|
|
62
|
+
* 查询设备高级能力,返回设备支持的扩展能力键值对
|
|
63
|
+
* @param params.devId 设备 ID
|
|
64
|
+
* @returns 设备高级能力键值对
|
|
65
|
+
* @public
|
|
66
|
+
* @since @ray-js/ray 1.7.60
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* import { gateway } from '@ray-js/ray';
|
|
70
|
+
*
|
|
71
|
+
* const querySeniorAbility = async () => {
|
|
72
|
+
* try {
|
|
73
|
+
* const abilities = await gateway.getSeniorAbility({
|
|
74
|
+
* devId: 'device_001',
|
|
75
|
+
* });
|
|
76
|
+
* console.log('设备高级能力:', abilities);
|
|
77
|
+
* } catch (err) {
|
|
78
|
+
* console.error('查询失败:', err);
|
|
79
|
+
* }
|
|
80
|
+
* };
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare const getSeniorAbility: typeof ty.gateway.getSeniorAbility;
|
|
84
|
+
/**
|
|
85
|
+
* 获取网关子设备数量限制,包括各类型子设备的上限
|
|
86
|
+
* @param params.devId 设备 ID
|
|
87
|
+
* @returns 子设备数量限制信息
|
|
88
|
+
* @public
|
|
89
|
+
* @since @ray-js/ray 1.7.60
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* import { gateway } from '@ray-js/ray';
|
|
93
|
+
*
|
|
94
|
+
* const fetchSubDevLimit = async () => {
|
|
95
|
+
* try {
|
|
96
|
+
* const limit = await gateway.getGatewaySubDevLimit({
|
|
97
|
+
* devId: 'gateway_001',
|
|
98
|
+
* });
|
|
99
|
+
* console.log('子设备上限:', limit.max);
|
|
100
|
+
* console.log('蓝牙子设备上限:', limit.blu);
|
|
101
|
+
* console.log('Zigbee子设备上限:', limit.zig);
|
|
102
|
+
* } catch (err) {
|
|
103
|
+
* console.error('获取失败:', err);
|
|
104
|
+
* }
|
|
105
|
+
* };
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export declare const getGatewaySubDevLimit: typeof ty.gateway.getGatewaySubDevLimit;
|
|
109
|
+
/**
|
|
110
|
+
* Mesh 类设备拖拽,将子设备从一个 Mesh 网络移动到另一个
|
|
111
|
+
* @param params.nodeIds 需要拖拽的子设备 ID 列表
|
|
112
|
+
* @param params.sourceMeshId 原 Mesh ID 或网关 ID
|
|
113
|
+
* @param params.targetMeshId 目标 Mesh ID 或网关 ID
|
|
114
|
+
* @returns 拖拽结果,包含已在目标网关下的设备列表
|
|
115
|
+
* @public
|
|
116
|
+
* @since @ray-js/ray 1.7.60
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* import { gateway } from '@ray-js/ray';
|
|
120
|
+
*
|
|
121
|
+
* const moveMeshDevices = async () => {
|
|
122
|
+
* try {
|
|
123
|
+
* const result = await gateway.updateRelationMesh({
|
|
124
|
+
* nodeIds: ['node_001', 'node_002'],
|
|
125
|
+
* sourceMeshId: 'mesh_source',
|
|
126
|
+
* targetMeshId: 'mesh_target',
|
|
127
|
+
* });
|
|
128
|
+
* if (result.repeatNodeIds.length > 0) {
|
|
129
|
+
* console.log('已在目标网关下的设备:', result.repeatNodeIds);
|
|
130
|
+
* }
|
|
131
|
+
* } catch (err) {
|
|
132
|
+
* console.error('拖拽失败:', err);
|
|
133
|
+
* }
|
|
134
|
+
* };
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
export declare const updateRelationMesh: typeof ty.gateway.updateRelationMesh;
|
|
138
|
+
/**
|
|
139
|
+
* 蓝牙单点类设备拖拽,将蓝牙子设备从一个网关移动到另一个
|
|
140
|
+
* @param params.nodes 需要拖拽的子设备 ID 与 UUID 列表
|
|
141
|
+
* @param params.sourceMeshId 原网关 ID
|
|
142
|
+
* @param params.targetMeshId 目标网关 ID
|
|
143
|
+
* @returns 拖拽结果,包含已在目标网关下的设备列表
|
|
144
|
+
* @public
|
|
145
|
+
* @since @ray-js/ray 1.7.60
|
|
146
|
+
* @example
|
|
147
|
+
* ```typescript
|
|
148
|
+
* import { gateway } from '@ray-js/ray';
|
|
149
|
+
*
|
|
150
|
+
* const moveBlueDevices = async () => {
|
|
151
|
+
* try {
|
|
152
|
+
* const result = await gateway.updateRelationBlue({
|
|
153
|
+
* nodes: [
|
|
154
|
+
* { devId: 'blue_dev_001', uuid: 'uuid_001' },
|
|
155
|
+
* { devId: 'blue_dev_002', uuid: 'uuid_002' },
|
|
156
|
+
* ],
|
|
157
|
+
* sourceMeshId: 'gateway_source',
|
|
158
|
+
* targetMeshId: 'gateway_target',
|
|
159
|
+
* });
|
|
160
|
+
* if (result.repeatNodeIds.length > 0) {
|
|
161
|
+
* console.log('已在目标网关下的设备:', result.repeatNodeIds);
|
|
162
|
+
* }
|
|
163
|
+
* } catch (err) {
|
|
164
|
+
* console.error('拖拽失败:', err);
|
|
165
|
+
* }
|
|
166
|
+
* };
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
export declare const updateRelationBlue: typeof ty.gateway.updateRelationBlue;
|
|
170
|
+
/**
|
|
171
|
+
* Beacon 类设备拖拽,将 Beacon 子设备从一个网关移动到另一个
|
|
172
|
+
* @param params.nodes 需要拖拽的子设备 ID 与 MAC 列表
|
|
173
|
+
* @param params.sourceMeshId 原网关 ID
|
|
174
|
+
* @param params.targetMeshId 目标网关 ID
|
|
175
|
+
* @returns 拖拽结果,包含已在目标网关下的设备列表
|
|
176
|
+
* @public
|
|
177
|
+
* @since @ray-js/ray 1.7.60
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* import { gateway } from '@ray-js/ray';
|
|
181
|
+
*
|
|
182
|
+
* const moveBeaconDevices = async () => {
|
|
183
|
+
* try {
|
|
184
|
+
* const result = await gateway.updateRelationBeacon({
|
|
185
|
+
* nodes: [
|
|
186
|
+
* { devId: 'beacon_dev_001', mac: 'AA:BB:CC:DD:EE:01' },
|
|
187
|
+
* { devId: 'beacon_dev_002', mac: 'AA:BB:CC:DD:EE:02' },
|
|
188
|
+
* ],
|
|
189
|
+
* sourceMeshId: 'gateway_source',
|
|
190
|
+
* targetMeshId: 'gateway_target',
|
|
191
|
+
* });
|
|
192
|
+
* if (result.repeatNodeIds.length > 0) {
|
|
193
|
+
* console.log('已在目标网关下的设备:', result.repeatNodeIds);
|
|
194
|
+
* }
|
|
195
|
+
* } catch (err) {
|
|
196
|
+
* console.error('拖拽失败:', err);
|
|
197
|
+
* }
|
|
198
|
+
* };
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
export declare const updateRelationBeacon: typeof ty.gateway.updateRelationBeacon;
|
|
202
|
+
/**
|
|
203
|
+
* 获取网关的能力信息,包括信号质量、性能指标和子设备数量上限
|
|
204
|
+
* @param params.devIds 设备 ID 拼成的字符串,以逗号分隔
|
|
205
|
+
* @returns 网关能力信息列表
|
|
206
|
+
* @public
|
|
207
|
+
* @since @ray-js/ray 1.7.60
|
|
208
|
+
* @example
|
|
209
|
+
* ```typescript
|
|
210
|
+
* import { gateway } from '@ray-js/ray';
|
|
211
|
+
*
|
|
212
|
+
* const fetchGatewayAbility = async () => {
|
|
213
|
+
* try {
|
|
214
|
+
* const abilities = await gateway.getGatewayAbility({
|
|
215
|
+
* devIds: 'gateway_001,gateway_002',
|
|
216
|
+
* });
|
|
217
|
+
* abilities.forEach(item => {
|
|
218
|
+
* console.log(`设备: ${item.devId}, 能力值: ${item.capability}, LQI: ${item.lqi}`);
|
|
219
|
+
* });
|
|
220
|
+
* } catch (err) {
|
|
221
|
+
* console.error('获取失败:', err);
|
|
222
|
+
* }
|
|
223
|
+
* };
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
export declare const getGatewayAbility: typeof ty.gateway.getGatewayAbility;
|
|
227
|
+
/**
|
|
228
|
+
* 获取设备安全日志,支持分页查询
|
|
229
|
+
* @param params.queryStr 查询条件字符串
|
|
230
|
+
* @returns 设备日志数据,包含日志列表和分页信息
|
|
231
|
+
* @public
|
|
232
|
+
* @since @ray-js/ray 1.7.60
|
|
233
|
+
* @example
|
|
234
|
+
* ```typescript
|
|
235
|
+
* import { gateway } from '@ray-js/ray';
|
|
236
|
+
*
|
|
237
|
+
* const fetchDeviceLog = async () => {
|
|
238
|
+
* try {
|
|
239
|
+
* const logData = await gateway.getSecurityDeviceLog({
|
|
240
|
+
* queryStr: 'device_001',
|
|
241
|
+
* });
|
|
242
|
+
* console.log('总数:', logData.totalCount);
|
|
243
|
+
* logData.datas.forEach(log => {
|
|
244
|
+
* console.log(`DP: ${log.dpName}, 值: ${log.value}, 时间: ${log.eventTime}`);
|
|
245
|
+
* });
|
|
246
|
+
* if (logData.hasNext) {
|
|
247
|
+
* console.log('还有更多数据');
|
|
248
|
+
* }
|
|
249
|
+
* } catch (err) {
|
|
250
|
+
* console.error('获取日志失败:', err);
|
|
251
|
+
* }
|
|
252
|
+
* };
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
255
|
+
export declare const getSecurityDeviceLog: typeof ty.gateway.getSecurityDeviceLog;
|
|
2
256
|
export declare const gateway: {
|
|
3
257
|
sendCmdForRefreshDeviceLQI: typeof ty.gateway.sendCmdForRefreshDeviceLQI;
|
|
4
258
|
getLastDeviceLQI: typeof ty.gateway.getLastDeviceLQI;
|