@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.
Files changed (154) hide show
  1. package/@types/AIKit.d.ts +5509 -610
  2. package/@types/AIStreamKit.d.ts +2641 -0
  3. package/@types/AVideoKit.d.ts +1827 -0
  4. package/@types/BaseKit.d.ts +8682 -1893
  5. package/@types/BizKit.d.ts +6639 -1038
  6. package/@types/CategoryCommonBizKit.d.ts +1459 -0
  7. package/@types/CommunityKit.d.ts +154 -0
  8. package/@types/DeviceKit.d.ts +18475 -5662
  9. package/@types/GroupCITestKit.d.ts +651 -0
  10. package/@types/HealthKit.d.ts +2290 -357
  11. package/@types/HomeKit.d.ts +4068 -182
  12. package/@types/IPCKit.d.ts +4327 -1227
  13. package/@types/LightKit.d.ts +125 -0
  14. package/@types/MapKit.d.ts +1560 -204
  15. package/@types/MediaKit.d.ts +136 -16
  16. package/@types/MediaPlayerKit.d.ts +47 -0
  17. package/@types/MiniKit.d.ts +2976 -628
  18. package/@types/OutdoorKit.d.ts +1337 -24
  19. package/@types/P2PKit.d.ts +622 -103
  20. package/@types/PayKit.d.ts +115 -0
  21. package/@types/PlayNetKit.d.ts +3454 -1309
  22. package/@types/SweeperKit.d.ts +154 -0
  23. package/@types/ThirdAuthKit.d.ts +324 -0
  24. package/@types/ThirdPartyDeviceKit.d.ts +410 -0
  25. package/@types/WearKit.d.ts +10177 -375
  26. package/@types/gateway.d.ts +349 -61
  27. package/@types/health.d.ts +486 -304
  28. package/lib/AIKit-1.6.0.d.ts +265 -41
  29. package/lib/AIKit-1.6.0.js +374 -120
  30. package/lib/BaseKit-3.17.7.d.ts +704 -0
  31. package/lib/BaseKit-3.17.7.js +720 -1
  32. package/lib/BizKit-4.10.4.d.ts +336 -0
  33. package/lib/BizKit-4.10.4.js +342 -5
  34. package/lib/DeviceKit-4.13.1.d.ts +996 -0
  35. package/lib/DeviceKit-4.13.1.js +1247 -249
  36. package/lib/HealthKit-6.5.0.d.ts +210 -44
  37. package/lib/HealthKit-6.5.0.js +295 -128
  38. package/lib/HomeKit-3.1.4.d.ts +20 -6
  39. package/lib/HomeKit-3.1.4.js +29 -14
  40. package/lib/IPCKit-6.4.5.d.ts +375 -77
  41. package/lib/IPCKit-6.4.5.js +525 -228
  42. package/lib/MapKit-3.4.13.d.ts +70 -16
  43. package/lib/MapKit-3.4.13.js +98 -47
  44. package/lib/MediaKit-3.4.1.d.ts +5 -3
  45. package/lib/MediaKit-3.4.1.js +7 -6
  46. package/lib/MiniKit-3.14.1.d.ts +300 -0
  47. package/lib/MiniKit-3.14.1.js +302 -0
  48. package/lib/OutdoorKit-1.0.4.d.ts +55 -13
  49. package/lib/OutdoorKit-1.0.4.js +78 -35
  50. package/lib/P2PKit-2.0.3.d.ts +125 -27
  51. package/lib/P2PKit-2.0.3.js +175 -78
  52. package/lib/PlayNetKit-1.3.30.d.ts +290 -60
  53. package/lib/PlayNetKit-1.3.30.js +407 -176
  54. package/lib/WearKit-1.1.6.d.ts +125 -27
  55. package/lib/WearKit-1.1.6.js +176 -77
  56. package/lib/all-kits.d.ts +10 -10
  57. package/lib/all-kits.js +10 -10
  58. package/lib/cloud/core.d.ts +31 -1
  59. package/lib/cloud/core.js +31 -1
  60. package/lib/cloud/device.d.ts +155 -24
  61. package/lib/cloud/device.js +153 -22
  62. package/lib/cloud/gateway.d.ts +254 -0
  63. package/lib/cloud/gateway.js +269 -9
  64. package/lib/cloud/health.d.ts +1 -0
  65. package/lib/cloud/health.js +121 -0
  66. package/lib/cloud/interface.d.ts +222 -44
  67. package/lib/cloud/interface.js +15 -2
  68. package/lib/cloud/laser-clean/deleteCleaningRecord/index.d.ts +27 -0
  69. package/lib/cloud/laser-clean/deleteCleaningRecord/index.js +28 -0
  70. package/lib/cloud/laser-clean/deleteCleaningRecord/type.d.ts +7 -0
  71. package/lib/cloud/laser-clean/deleteCleaningRecord/type.js +1 -0
  72. package/lib/cloud/laser-clean/deleteGyroCleanRecord/index.d.ts +27 -0
  73. package/lib/cloud/laser-clean/deleteGyroCleanRecord/index.js +28 -0
  74. package/lib/cloud/laser-clean/deleteGyroCleanRecord/type.d.ts +7 -0
  75. package/lib/cloud/laser-clean/deleteGyroCleanRecord/type.js +1 -0
  76. package/lib/cloud/laser-clean/deleteMultipleMapFiles/index.d.ts +27 -0
  77. package/lib/cloud/laser-clean/deleteMultipleMapFiles/index.js +28 -0
  78. package/lib/cloud/laser-clean/deleteMultipleMapFiles/type.d.ts +7 -0
  79. package/lib/cloud/laser-clean/deleteMultipleMapFiles/type.js +1 -0
  80. package/lib/cloud/laser-clean/getCleaningRecords/index.d.ts +30 -0
  81. package/lib/cloud/laser-clean/getCleaningRecords/index.js +31 -0
  82. package/lib/cloud/laser-clean/getCleaningRecords/type.d.ts +39 -0
  83. package/lib/cloud/laser-clean/getCleaningRecords/type.js +1 -0
  84. package/lib/cloud/laser-clean/getGyroCleanRecordDetail/index.d.ts +29 -0
  85. package/lib/cloud/laser-clean/getGyroCleanRecordDetail/index.js +30 -0
  86. package/lib/cloud/laser-clean/getGyroCleanRecordDetail/type.d.ts +30 -0
  87. package/lib/cloud/laser-clean/getGyroCleanRecordDetail/type.js +1 -0
  88. package/lib/cloud/laser-clean/getGyroCleanRecords/index.d.ts +29 -0
  89. package/lib/cloud/laser-clean/getGyroCleanRecords/index.js +30 -0
  90. package/lib/cloud/laser-clean/getGyroCleanRecords/type.d.ts +35 -0
  91. package/lib/cloud/laser-clean/getGyroCleanRecords/type.js +1 -0
  92. package/lib/cloud/laser-clean/getGyroLatestCleanMap/index.d.ts +28 -0
  93. package/lib/cloud/laser-clean/getGyroLatestCleanMap/index.js +29 -0
  94. package/lib/cloud/laser-clean/getGyroLatestCleanMap/type.d.ts +28 -0
  95. package/lib/cloud/laser-clean/getGyroLatestCleanMap/type.js +1 -0
  96. package/lib/cloud/laser-clean/getMultipleMapFiles/index.d.ts +24 -0
  97. package/lib/cloud/laser-clean/getMultipleMapFiles/index.js +25 -0
  98. package/lib/cloud/laser-clean/getMultipleMapFiles/type.d.ts +29 -0
  99. package/lib/cloud/laser-clean/getMultipleMapFiles/type.js +1 -0
  100. package/lib/cloud/laser-clean/getSweeperStorageConfig/index.d.ts +24 -0
  101. package/lib/cloud/laser-clean/getSweeperStorageConfig/index.js +25 -0
  102. package/lib/cloud/laser-clean/getSweeperStorageConfig/type.d.ts +26 -0
  103. package/lib/cloud/laser-clean/getSweeperStorageConfig/type.js +1 -0
  104. package/lib/cloud/laser-clean/getVoiceList/index.d.ts +28 -0
  105. package/lib/cloud/laser-clean/getVoiceList/index.js +29 -0
  106. package/lib/cloud/laser-clean/getVoiceList/type.d.ts +48 -0
  107. package/lib/cloud/laser-clean/getVoiceList/type.js +1 -0
  108. package/lib/cloud/laser-clean/index.d.ts +1 -1
  109. package/lib/cloud/laser-clean/index.js +1 -1
  110. package/lib/cloud/laser-clean/map.d.ts +5 -7
  111. package/lib/cloud/laser-clean/map.js +5 -9
  112. package/lib/cloud/laser-clean/record.d.ts +5 -6
  113. package/lib/cloud/laser-clean/record.js +5 -7
  114. package/lib/cloud/laser-clean/renameHistoryMap/index.d.ts +28 -0
  115. package/lib/cloud/laser-clean/renameHistoryMap/index.js +29 -0
  116. package/lib/cloud/laser-clean/renameHistoryMap/type.d.ts +9 -0
  117. package/lib/cloud/laser-clean/renameHistoryMap/type.js +1 -0
  118. package/lib/cloud/laser-clean/voice.d.ts +1 -3
  119. package/lib/cloud/laser-clean/voice.js +1 -4
  120. package/lib/cloud/linkage.d.ts +271 -53
  121. package/lib/cloud/linkage.js +256 -51
  122. package/lib/cloud/remoteGroup.d.ts +37 -0
  123. package/lib/cloud/remoteGroup.js +37 -0
  124. package/lib/cloud/timer.d.ts +104 -26
  125. package/lib/cloud/timer.js +104 -26
  126. package/lib/getApp/index.thing.d.ts +47 -1
  127. package/lib/getApp/index.thing.js +40 -2
  128. package/lib/getBoundingClientRect/index.thing.d.ts +101 -1
  129. package/lib/getBoundingClientRect/index.thing.js +59 -0
  130. package/lib/getCurrentPages/index.thing.d.ts +40 -15
  131. package/lib/getCurrentPages/index.thing.js +36 -15
  132. package/lib/getCustomConfig/index.d.ts +5 -2
  133. package/lib/getCustomConfig/index.thing.d.ts +68 -2
  134. package/lib/getCustomConfig/index.thing.js +62 -0
  135. package/lib/getCustomConfig/index.wechat.d.ts +5 -2
  136. package/lib/getCustomConfig/type.d.ts +26 -15
  137. package/lib/getElementById/index.thing.d.ts +42 -1
  138. package/lib/getElementById/index.thing.js +40 -0
  139. package/lib/index.d.ts +3 -0
  140. package/lib/index.js +4 -2
  141. package/lib/nativeRouters/common.d.ts +8 -0
  142. package/lib/nativeRouters/device.d.ts +137 -5
  143. package/lib/nativeRouters/device.js +138 -6
  144. package/lib/nativeRouters/gw.d.ts +58 -8
  145. package/lib/nativeRouters/gw.js +57 -8
  146. package/lib/nativeRouters/outdoors.d.ts +16 -3
  147. package/lib/nativeRouters/outdoors.js +16 -3
  148. package/lib/nativeRouters/remoteGroup.d.ts +23 -0
  149. package/lib/nativeRouters/remoteGroup.js +23 -0
  150. package/lib/nativeRouters/root.d.ts +19 -0
  151. package/lib/nativeRouters/root.js +17 -0
  152. package/lib/openGroupCreate/index.d.ts +45 -0
  153. package/lib/openGroupCreate/index.js +32 -0
  154. package/package.json +5 -5
@@ -1,146 +1,434 @@
1
1
  declare namespace ty.gateway {
2
- // 1. 下发更新LQI指令
3
2
  type SendCmdForRefreshDeviceLQIParams = {
4
- devId: string; // 子设备id
3
+ /** 子设备 ID */
4
+ devId: string;
5
5
  };
6
6
 
7
- type SendCmdForRefreshDeviceLQIResponse = boolean; // 是否下发成功
7
+ type SendCmdForRefreshDeviceLQIResponse = boolean;
8
8
 
9
- function sendCmdForRefreshDeviceLQI(params: SendCmdForRefreshDeviceLQIParams): Promise<SendCmdForRefreshDeviceLQIResponse>;
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
- devId: string; //子设备id
14
- offsetTime: number; //时间偏移量,单位为毫秒
37
+ /** 子设备 ID */
38
+ devId: string;
39
+ /** 时间偏移量,单位为毫秒 */
40
+ offsetTime: number;
15
41
  };
16
42
 
17
43
  type DeviceLQI = {
18
- deviceId: string; //设备id
19
- deviceName: string; //设备名称
20
- isGateway: boolean; //是否是网关
21
- lqi: number; // 子设备lqi值
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
- devId: string; // 设备id
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
- devId: string; // 设备id
120
+ /** 设备 ID */
121
+ devId: string;
42
122
  };
43
123
 
44
124
  type GetGatewaySubDevLimitResponse = {
45
- max?: number; // 子设备数量上限
46
- blu?: number; // 蓝牙子设备数量上限
47
- zig?: number; // zigbee子设备数量上限
48
- ver?: number; // 版本,嵌入式端上报
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
- nodeIds: string[]; // 需要拖拽的子设备id列表
56
- sourceMeshId?: string; // 原meshId或者网关Id
57
- targetMeshId?: string; // 目标meshId或者网关Id
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
- repeatNodeIds: string[]; //已在网关下的设备列表
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
- }[]; // 需要拖拽的子设备id与uuid列表
72
- sourceMeshId?: string; // 原网关Id
73
- targetMeshId?: string; // 目标网关Id
214
+ }[];
215
+ /** 原网关 ID */
216
+ sourceMeshId?: string;
217
+ /** 目标网关 ID */
218
+ targetMeshId?: string;
74
219
  };
75
220
 
76
221
  type UpdateRelationBlueResponse = {
77
- repeatNodeIds: string[]; //已在网关下的设备列表
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
- }[]; // 需要拖拽的子设备id与mac列表
88
- sourceMeshId?: string; // 原网关Id
89
- targetMeshId?: string; // 目标网关Id
267
+ }[];
268
+ /** 原网关 ID */
269
+ sourceMeshId?: string;
270
+ /** 目标网关 ID */
271
+ targetMeshId?: string;
90
272
  };
91
273
 
92
274
  type UpdateRelationBeaconResponse = {
93
- repeatNodeIds: string[]; //已在网关下的设备列表
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
- devIds: string; // 设备id拼成的字符串,以逗号分隔
314
+ /** 设备 ID 拼成的字符串,以逗号分隔 */
315
+ devIds: string;
101
316
  };
102
317
 
103
318
  type GatewayAbility = {
104
- capability: number; // 能力值
105
- devId: string; // 设备id
106
- lqi: number; // 设备信号质量
107
- performance?: number; // 网关性能指标
108
- subMaximum?: { // 子设备数量上线
109
- data?: { // 各类型子设备数量上线
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
- version?: number; // 版本
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
- rowkey: string; // key
127
- dpName: string; // dp名称
128
- createTime: number; // 创建时间
129
- eventTime: number; // 上报时间
130
- dpId: string; // dpId
131
- eventType: string; // 事件类型
132
- value: string; // dp值
133
- deviceId: string; // 设备id
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
- devId: string; // 设备id
392
+ /** 设备 ID */
393
+ devId: string;
394
+ /** 日志数据列表 */
138
395
  datas: DeviceLogData[];
139
- hasNext: boolean; // 是否还有下一页
140
- totalCount: number; // 总数
141
- currentPageStartRowKey?: string; // 当前页起始key
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
-