@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/@types/gateway.d.ts
CHANGED
|
@@ -1,146 +1,434 @@
|
|
|
1
1
|
declare namespace ty.gateway {
|
|
2
|
-
// 1. 下发更新LQI指令
|
|
3
2
|
type SendCmdForRefreshDeviceLQIParams = {
|
|
4
|
-
|
|
3
|
+
/** 子设备 ID */
|
|
4
|
+
devId: string;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
type SendCmdForRefreshDeviceLQIResponse = boolean;
|
|
7
|
+
type SendCmdForRefreshDeviceLQIResponse = boolean;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* 下发更新 LQI 指令,用于刷新网关子设备的信号质量值
|
|
11
|
+
* @public
|
|
12
|
+
* @since @ray-js/ray 1.7.60
|
|
13
|
+
* @param params - 请求参数
|
|
14
|
+
* @param params.devId 子设备 ID
|
|
15
|
+
* @returns 是否下发成功
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { gateway } from '@ray-js/ray';
|
|
19
|
+
*
|
|
20
|
+
* const refreshLQI = async () => {
|
|
21
|
+
* try {
|
|
22
|
+
* const success = await gateway.sendCmdForRefreshDeviceLQI({
|
|
23
|
+
* devId: 'sub_device_001',
|
|
24
|
+
* });
|
|
25
|
+
* console.log('下发刷新LQI指令:', success);
|
|
26
|
+
* } catch (err) {
|
|
27
|
+
* console.error('下发失败:', err);
|
|
28
|
+
* }
|
|
29
|
+
* };
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function sendCmdForRefreshDeviceLQI(
|
|
33
|
+
params: SendCmdForRefreshDeviceLQIParams,
|
|
34
|
+
): Promise<SendCmdForRefreshDeviceLQIResponse>;
|
|
10
35
|
|
|
11
|
-
// 2. 获取设备最新LQI
|
|
12
36
|
type GetLastDeviceLQIParams = {
|
|
13
|
-
|
|
14
|
-
|
|
37
|
+
/** 子设备 ID */
|
|
38
|
+
devId: string;
|
|
39
|
+
/** 时间偏移量,单位为毫秒 */
|
|
40
|
+
offsetTime: number;
|
|
15
41
|
};
|
|
16
42
|
|
|
17
43
|
type DeviceLQI = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
44
|
+
/** 设备 ID */
|
|
45
|
+
deviceId: string;
|
|
46
|
+
/** 设备名称 */
|
|
47
|
+
deviceName: string;
|
|
48
|
+
/** 是否是网关 */
|
|
49
|
+
isGateway: boolean;
|
|
50
|
+
/** 子设备 LQI 值 */
|
|
51
|
+
lqi: number;
|
|
52
|
+
};
|
|
23
53
|
|
|
24
54
|
type GetLastDeviceLQIResponse = DeviceLQI[];
|
|
25
55
|
|
|
56
|
+
/**
|
|
57
|
+
* 获取设备最新 LQI(链路质量指示)信息
|
|
58
|
+
* @public
|
|
59
|
+
* @since @ray-js/ray 1.7.60
|
|
60
|
+
* @param params - 请求参数
|
|
61
|
+
* @param params.devId 子设备 ID
|
|
62
|
+
* @param params.offsetTime 时间偏移量,单位为毫秒
|
|
63
|
+
* @returns 设备 LQI 信息列表
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* import { gateway } from '@ray-js/ray';
|
|
67
|
+
*
|
|
68
|
+
* const fetchLQI = async () => {
|
|
69
|
+
* try {
|
|
70
|
+
* const lqiList = await gateway.getLastDeviceLQI({
|
|
71
|
+
* devId: 'sub_device_001',
|
|
72
|
+
* offsetTime: 60000,
|
|
73
|
+
* });
|
|
74
|
+
* lqiList.forEach(item => {
|
|
75
|
+
* console.log(`设备: ${item.deviceName}, LQI: ${item.lqi}`);
|
|
76
|
+
* });
|
|
77
|
+
* } catch (err) {
|
|
78
|
+
* console.error('获取LQI失败:', err);
|
|
79
|
+
* }
|
|
80
|
+
* };
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
26
83
|
function getLastDeviceLQI(params: GetLastDeviceLQIParams): Promise<GetLastDeviceLQIResponse>;
|
|
27
84
|
|
|
28
|
-
// 3. 查询设备高级能力
|
|
29
85
|
type GetSeniorAbilityParams = {
|
|
30
|
-
|
|
86
|
+
/** 设备 ID */
|
|
87
|
+
devId: string;
|
|
31
88
|
};
|
|
32
89
|
|
|
33
90
|
type GetSeniorAbilityResponse = {
|
|
34
91
|
[key: string]: string;
|
|
35
92
|
};
|
|
36
93
|
|
|
94
|
+
/**
|
|
95
|
+
* 查询设备高级能力,返回设备支持的扩展能力键值对
|
|
96
|
+
* @public
|
|
97
|
+
* @since @ray-js/ray 1.7.60
|
|
98
|
+
* @param params - 请求参数
|
|
99
|
+
* @param params.devId 设备 ID
|
|
100
|
+
* @returns 设备高级能力键值对
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* import { gateway } from '@ray-js/ray';
|
|
104
|
+
*
|
|
105
|
+
* const querySeniorAbility = async () => {
|
|
106
|
+
* try {
|
|
107
|
+
* const abilities = await gateway.getSeniorAbility({
|
|
108
|
+
* devId: 'device_001',
|
|
109
|
+
* });
|
|
110
|
+
* console.log('设备高级能力:', abilities);
|
|
111
|
+
* } catch (err) {
|
|
112
|
+
* console.error('查询失败:', err);
|
|
113
|
+
* }
|
|
114
|
+
* };
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
37
117
|
function getSeniorAbility(params: GetSeniorAbilityParams): Promise<GetSeniorAbilityResponse>;
|
|
38
118
|
|
|
39
|
-
// 4. 获取网关子设备数量限制
|
|
40
119
|
type GetGatewaySubDevLimitParams = {
|
|
41
|
-
|
|
120
|
+
/** 设备 ID */
|
|
121
|
+
devId: string;
|
|
42
122
|
};
|
|
43
123
|
|
|
44
124
|
type GetGatewaySubDevLimitResponse = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
125
|
+
/** 子设备数量上限 */
|
|
126
|
+
max?: number;
|
|
127
|
+
/** 蓝牙子设备数量上限 */
|
|
128
|
+
blu?: number;
|
|
129
|
+
/** Zigbee 子设备数量上限 */
|
|
130
|
+
zig?: number;
|
|
131
|
+
/** 版本,嵌入式端上报 */
|
|
132
|
+
ver?: number;
|
|
49
133
|
};
|
|
50
134
|
|
|
135
|
+
/**
|
|
136
|
+
* 获取网关子设备数量限制,包括各类型子设备的上限
|
|
137
|
+
* @public
|
|
138
|
+
* @since @ray-js/ray 1.7.60
|
|
139
|
+
* @param params - 请求参数
|
|
140
|
+
* @param params.devId 设备 ID
|
|
141
|
+
* @returns 子设备数量限制信息
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* import { gateway } from '@ray-js/ray';
|
|
145
|
+
*
|
|
146
|
+
* const fetchSubDevLimit = async () => {
|
|
147
|
+
* try {
|
|
148
|
+
* const limit = await gateway.getGatewaySubDevLimit({
|
|
149
|
+
* devId: 'gateway_001',
|
|
150
|
+
* });
|
|
151
|
+
* console.log('子设备上限:', limit.max);
|
|
152
|
+
* console.log('蓝牙子设备上限:', limit.blu);
|
|
153
|
+
* console.log('Zigbee子设备上限:', limit.zig);
|
|
154
|
+
* } catch (err) {
|
|
155
|
+
* console.error('获取失败:', err);
|
|
156
|
+
* }
|
|
157
|
+
* };
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
51
160
|
function getGatewaySubDevLimit(params: GetGatewaySubDevLimitParams): Promise<GetGatewaySubDevLimitResponse>;
|
|
52
161
|
|
|
53
|
-
// 5. mesh类设备拖拽
|
|
54
162
|
type UpdateRelationMeshParams = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
163
|
+
/** 需要拖拽的子设备 ID 列表 */
|
|
164
|
+
nodeIds: string[];
|
|
165
|
+
/** 原 Mesh ID 或网关 ID */
|
|
166
|
+
sourceMeshId?: string;
|
|
167
|
+
/** 目标 Mesh ID 或网关 ID */
|
|
168
|
+
targetMeshId?: string;
|
|
58
169
|
};
|
|
59
170
|
|
|
60
171
|
type UpdateRelationMeshResponse = {
|
|
61
|
-
|
|
172
|
+
/** 已在网关下的设备列表 */
|
|
173
|
+
repeatNodeIds: string[];
|
|
62
174
|
};
|
|
63
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Mesh 类设备拖拽,将子设备从一个 Mesh 网络移动到另一个
|
|
178
|
+
* @public
|
|
179
|
+
* @since @ray-js/ray 1.7.60
|
|
180
|
+
* @param params - 请求参数
|
|
181
|
+
* @param params.nodeIds 需要拖拽的子设备 ID 列表
|
|
182
|
+
* @param params.sourceMeshId 原 Mesh ID 或网关 ID
|
|
183
|
+
* @param params.targetMeshId 目标 Mesh ID 或网关 ID
|
|
184
|
+
* @returns 拖拽结果,包含已在目标网关下的设备列表
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* import { gateway } from '@ray-js/ray';
|
|
188
|
+
*
|
|
189
|
+
* const moveMeshDevices = async () => {
|
|
190
|
+
* try {
|
|
191
|
+
* const result = await gateway.updateRelationMesh({
|
|
192
|
+
* nodeIds: ['node_001', 'node_002'],
|
|
193
|
+
* sourceMeshId: 'mesh_source',
|
|
194
|
+
* targetMeshId: 'mesh_target',
|
|
195
|
+
* });
|
|
196
|
+
* if (result.repeatNodeIds.length > 0) {
|
|
197
|
+
* console.log('已在目标网关下的设备:', result.repeatNodeIds);
|
|
198
|
+
* }
|
|
199
|
+
* } catch (err) {
|
|
200
|
+
* console.error('拖拽失败:', err);
|
|
201
|
+
* }
|
|
202
|
+
* };
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
64
205
|
function updateRelationMesh(params: UpdateRelationMeshParams): Promise<UpdateRelationMeshResponse>;
|
|
65
206
|
|
|
66
|
-
// 6. 蓝牙单点类设备拖拽
|
|
67
207
|
type UpdateRelationBlueParams = {
|
|
208
|
+
/** 需要拖拽的子设备 ID 与 UUID 列表 */
|
|
68
209
|
nodes: {
|
|
210
|
+
/** 设备 ID */
|
|
69
211
|
devId: string;
|
|
212
|
+
/** 设备 UUID */
|
|
70
213
|
uuid: string;
|
|
71
|
-
}[];
|
|
72
|
-
|
|
73
|
-
|
|
214
|
+
}[];
|
|
215
|
+
/** 原网关 ID */
|
|
216
|
+
sourceMeshId?: string;
|
|
217
|
+
/** 目标网关 ID */
|
|
218
|
+
targetMeshId?: string;
|
|
74
219
|
};
|
|
75
220
|
|
|
76
221
|
type UpdateRelationBlueResponse = {
|
|
77
|
-
|
|
222
|
+
/** 已在网关下的设备列表 */
|
|
223
|
+
repeatNodeIds: string[];
|
|
78
224
|
};
|
|
79
225
|
|
|
226
|
+
/**
|
|
227
|
+
* 蓝牙单点类设备拖拽,将蓝牙子设备从一个网关移动到另一个
|
|
228
|
+
* @public
|
|
229
|
+
* @since @ray-js/ray 1.7.60
|
|
230
|
+
* @param params - 请求参数
|
|
231
|
+
* @param params.nodes 需要拖拽的子设备 ID 与 UUID 列表
|
|
232
|
+
* @param params.sourceMeshId 原网关 ID
|
|
233
|
+
* @param params.targetMeshId 目标网关 ID
|
|
234
|
+
* @returns 拖拽结果,包含已在目标网关下的设备列表
|
|
235
|
+
* @example
|
|
236
|
+
* ```typescript
|
|
237
|
+
* import { gateway } from '@ray-js/ray';
|
|
238
|
+
*
|
|
239
|
+
* const moveBlueDevices = async () => {
|
|
240
|
+
* try {
|
|
241
|
+
* const result = await gateway.updateRelationBlue({
|
|
242
|
+
* nodes: [
|
|
243
|
+
* { devId: 'blue_dev_001', uuid: 'uuid_001' },
|
|
244
|
+
* { devId: 'blue_dev_002', uuid: 'uuid_002' },
|
|
245
|
+
* ],
|
|
246
|
+
* sourceMeshId: 'gateway_source',
|
|
247
|
+
* targetMeshId: 'gateway_target',
|
|
248
|
+
* });
|
|
249
|
+
* if (result.repeatNodeIds.length > 0) {
|
|
250
|
+
* console.log('已在目标网关下的设备:', result.repeatNodeIds);
|
|
251
|
+
* }
|
|
252
|
+
* } catch (err) {
|
|
253
|
+
* console.error('拖拽失败:', err);
|
|
254
|
+
* }
|
|
255
|
+
* };
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
80
258
|
function updateRelationBlue(params: UpdateRelationBlueParams): Promise<UpdateRelationBlueResponse>;
|
|
81
259
|
|
|
82
|
-
// 7. beacon类设备拖拽
|
|
83
260
|
type UpdateRelationBeaconParams = {
|
|
261
|
+
/** 需要拖拽的子设备 ID 与 MAC 列表 */
|
|
84
262
|
nodes: {
|
|
263
|
+
/** 设备 ID */
|
|
85
264
|
devId: string;
|
|
265
|
+
/** 设备 MAC 地址 */
|
|
86
266
|
mac: string;
|
|
87
|
-
}[];
|
|
88
|
-
|
|
89
|
-
|
|
267
|
+
}[];
|
|
268
|
+
/** 原网关 ID */
|
|
269
|
+
sourceMeshId?: string;
|
|
270
|
+
/** 目标网关 ID */
|
|
271
|
+
targetMeshId?: string;
|
|
90
272
|
};
|
|
91
273
|
|
|
92
274
|
type UpdateRelationBeaconResponse = {
|
|
93
|
-
|
|
275
|
+
/** 已在网关下的设备列表 */
|
|
276
|
+
repeatNodeIds: string[];
|
|
94
277
|
};
|
|
95
278
|
|
|
279
|
+
/**
|
|
280
|
+
* Beacon 类设备拖拽,将 Beacon 子设备从一个网关移动到另一个
|
|
281
|
+
* @public
|
|
282
|
+
* @since @ray-js/ray 1.7.60
|
|
283
|
+
* @param params - 请求参数
|
|
284
|
+
* @param params.nodes 需要拖拽的子设备 ID 与 MAC 列表
|
|
285
|
+
* @param params.sourceMeshId 原网关 ID
|
|
286
|
+
* @param params.targetMeshId 目标网关 ID
|
|
287
|
+
* @returns 拖拽结果,包含已在目标网关下的设备列表
|
|
288
|
+
* @example
|
|
289
|
+
* ```typescript
|
|
290
|
+
* import { gateway } from '@ray-js/ray';
|
|
291
|
+
*
|
|
292
|
+
* const moveBeaconDevices = async () => {
|
|
293
|
+
* try {
|
|
294
|
+
* const result = await gateway.updateRelationBeacon({
|
|
295
|
+
* nodes: [
|
|
296
|
+
* { devId: 'beacon_dev_001', mac: 'AA:BB:CC:DD:EE:01' },
|
|
297
|
+
* { devId: 'beacon_dev_002', mac: 'AA:BB:CC:DD:EE:02' },
|
|
298
|
+
* ],
|
|
299
|
+
* sourceMeshId: 'gateway_source',
|
|
300
|
+
* targetMeshId: 'gateway_target',
|
|
301
|
+
* });
|
|
302
|
+
* if (result.repeatNodeIds.length > 0) {
|
|
303
|
+
* console.log('已在目标网关下的设备:', result.repeatNodeIds);
|
|
304
|
+
* }
|
|
305
|
+
* } catch (err) {
|
|
306
|
+
* console.error('拖拽失败:', err);
|
|
307
|
+
* }
|
|
308
|
+
* };
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
96
311
|
function updateRelationBeacon(params: UpdateRelationBeaconParams): Promise<UpdateRelationBeaconResponse>;
|
|
97
312
|
|
|
98
|
-
// 8. 获取网关的能力
|
|
99
313
|
type GetGatewayAbilityParams = {
|
|
100
|
-
|
|
314
|
+
/** 设备 ID 拼成的字符串,以逗号分隔 */
|
|
315
|
+
devIds: string;
|
|
101
316
|
};
|
|
102
317
|
|
|
103
318
|
type GatewayAbility = {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
319
|
+
/** 能力值 */
|
|
320
|
+
capability: number;
|
|
321
|
+
/** 设备 ID */
|
|
322
|
+
devId: string;
|
|
323
|
+
/** 设备信号质量 */
|
|
324
|
+
lqi: number;
|
|
325
|
+
/** 网关性能指标 */
|
|
326
|
+
performance?: number;
|
|
327
|
+
/** 子设备数量上限 */
|
|
328
|
+
subMaximum?: {
|
|
329
|
+
/** 各类型子设备数量上限 */
|
|
330
|
+
data?: {
|
|
110
331
|
[key: string]: number;
|
|
111
|
-
}
|
|
112
|
-
|
|
332
|
+
};
|
|
333
|
+
/** 版本 */
|
|
334
|
+
version?: number;
|
|
113
335
|
};
|
|
114
|
-
}
|
|
336
|
+
};
|
|
115
337
|
|
|
116
338
|
type GetGatewayAbilityResponse = GatewayAbility[];
|
|
117
339
|
|
|
340
|
+
/**
|
|
341
|
+
* 获取网关的能力信息,包括信号质量、性能指标和子设备数量上限
|
|
342
|
+
* @public
|
|
343
|
+
* @since @ray-js/ray 1.7.60
|
|
344
|
+
* @param params - 请求参数
|
|
345
|
+
* @param params.devIds 设备 ID 拼成的字符串,以逗号分隔
|
|
346
|
+
* @returns 网关能力信息列表
|
|
347
|
+
* @example
|
|
348
|
+
* ```typescript
|
|
349
|
+
* import { gateway } from '@ray-js/ray';
|
|
350
|
+
*
|
|
351
|
+
* const fetchGatewayAbility = async () => {
|
|
352
|
+
* try {
|
|
353
|
+
* const abilities = await gateway.getGatewayAbility({
|
|
354
|
+
* devIds: 'gateway_001,gateway_002',
|
|
355
|
+
* });
|
|
356
|
+
* abilities.forEach(item => {
|
|
357
|
+
* console.log(`设备: ${item.devId}, 能力值: ${item.capability}, LQI: ${item.lqi}`);
|
|
358
|
+
* });
|
|
359
|
+
* } catch (err) {
|
|
360
|
+
* console.error('获取失败:', err);
|
|
361
|
+
* }
|
|
362
|
+
* };
|
|
363
|
+
* ```
|
|
364
|
+
*/
|
|
118
365
|
function getGatewayAbility(params: GetGatewayAbilityParams): Promise<GetGatewayAbilityResponse>;
|
|
119
366
|
|
|
120
|
-
// 9. 获取设备日志
|
|
121
367
|
type GetSecurityDeviceLogParams = {
|
|
368
|
+
/** 查询条件字符串 */
|
|
122
369
|
queryStr: string;
|
|
123
370
|
};
|
|
124
371
|
|
|
125
372
|
type DeviceLogData = {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
373
|
+
/** 数据行唯一标识 */
|
|
374
|
+
rowkey: string;
|
|
375
|
+
/** DP 名称 */
|
|
376
|
+
dpName: string;
|
|
377
|
+
/** 创建时间 */
|
|
378
|
+
createTime: number;
|
|
379
|
+
/** 上报时间 */
|
|
380
|
+
eventTime: number;
|
|
381
|
+
/** DP ID */
|
|
382
|
+
dpId: string;
|
|
383
|
+
/** 事件类型 */
|
|
384
|
+
eventType: string;
|
|
385
|
+
/** DP 值 */
|
|
386
|
+
value: string;
|
|
387
|
+
/** 设备 ID */
|
|
388
|
+
deviceId: string;
|
|
389
|
+
};
|
|
135
390
|
|
|
136
391
|
type GetSecurityDeviceLogResponse = {
|
|
137
|
-
|
|
392
|
+
/** 设备 ID */
|
|
393
|
+
devId: string;
|
|
394
|
+
/** 日志数据列表 */
|
|
138
395
|
datas: DeviceLogData[];
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
396
|
+
/** 是否还有下一页 */
|
|
397
|
+
hasNext: boolean;
|
|
398
|
+
/** 总数 */
|
|
399
|
+
totalCount: number;
|
|
400
|
+
/** 当前页起始 key */
|
|
401
|
+
currentPageStartRowKey?: string;
|
|
142
402
|
};
|
|
143
403
|
|
|
404
|
+
/**
|
|
405
|
+
* 获取设备安全日志,支持分页查询
|
|
406
|
+
* @public
|
|
407
|
+
* @since @ray-js/ray 1.7.60
|
|
408
|
+
* @param params - 请求参数
|
|
409
|
+
* @param params.queryStr 查询条件字符串
|
|
410
|
+
* @returns 设备日志数据,包含日志列表和分页信息
|
|
411
|
+
* @example
|
|
412
|
+
* ```typescript
|
|
413
|
+
* import { gateway } from '@ray-js/ray';
|
|
414
|
+
*
|
|
415
|
+
* const fetchDeviceLog = async () => {
|
|
416
|
+
* try {
|
|
417
|
+
* const logData = await gateway.getSecurityDeviceLog({
|
|
418
|
+
* queryStr: 'device_001',
|
|
419
|
+
* });
|
|
420
|
+
* console.log('总数:', logData.totalCount);
|
|
421
|
+
* logData.datas.forEach(log => {
|
|
422
|
+
* console.log(`DP: ${log.dpName}, 值: ${log.value}, 时间: ${log.eventTime}`);
|
|
423
|
+
* });
|
|
424
|
+
* if (logData.hasNext) {
|
|
425
|
+
* console.log('还有更多数据');
|
|
426
|
+
* }
|
|
427
|
+
* } catch (err) {
|
|
428
|
+
* console.error('获取日志失败:', err);
|
|
429
|
+
* }
|
|
430
|
+
* };
|
|
431
|
+
* ```
|
|
432
|
+
*/
|
|
144
433
|
function getSecurityDeviceLog(params: GetSecurityDeviceLogParams): Promise<GetSecurityDeviceLogResponse>;
|
|
145
434
|
}
|
|
146
|
-
|