@ray-js/api 1.7.70 → 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
@@ -5,9 +5,31 @@ const _excluded = ["gid", "devId", "sourceEntityId"],
5
5
  import { requestCloud } from '../';
6
6
  import { THING } from '../constants';
7
7
  /**
8
- * 获取家庭下支持联动的设备列表
9
- * @param {number} gid 家庭id
10
- * @param {string} sourceType 业务范围
8
+ * 查询家庭下支持联动的所有设备
9
+ * @param params - 查询设备列表参数
10
+ * @param params.gid 家庭 ID,可通过 getCurrentHomeInfo 获取
11
+ * @param params.sourceType 请求类型
12
+ * @returns 支持联动的设备列表
13
+ * @public
14
+ * @since @ray-js/ray 1.4.61
15
+ * @example
16
+ * ```typescript
17
+ * import { getLinkageDeviceList } from '@ray-js/ray';
18
+ *
19
+ * const fetchDevices = async () => {
20
+ * try {
21
+ * const devices = await getLinkageDeviceList({
22
+ * gid: 12345678,
23
+ * sourceType: 'condition',
24
+ * });
25
+ * devices.forEach(dev => {
26
+ * console.log(`设备: ${dev.name}, ID: ${dev.devId}`);
27
+ * });
28
+ * } catch (err) {
29
+ * console.error('查询失败:', err);
30
+ * }
31
+ * };
32
+ * ```
11
33
  */
12
34
  const getLinkageDeviceList = params => {
13
35
  return requestCloud({
@@ -21,9 +43,29 @@ const getLinkageDeviceList = params => {
21
43
  };
22
44
 
23
45
  /**
24
- * 查询家庭下联动规则列表,包含失效及自动化规则
25
- * @param {number} devId 设备id
26
- * @param {number} gid 家庭Id
46
+ * 查询设备支持的一键执行场景,包含失效及自动化规则
47
+ * @param params - 查询参数
48
+ * @param params.devId 设备 ID
49
+ * @param params.gid 家庭 ID
50
+ * @returns 联动规则列表
51
+ * @public
52
+ * @since @ray-js/ray 1.4.61
53
+ * @example
54
+ * ```typescript
55
+ * import { getSceneList } from '@ray-js/ray';
56
+ *
57
+ * const fetchScenes = async () => {
58
+ * try {
59
+ * const scenes = await getSceneList({
60
+ * devId: 'device_001',
61
+ * gid: '12345678',
62
+ * });
63
+ * console.log('场景列表:', scenes);
64
+ * } catch (err) {
65
+ * console.error('查询失败:', err);
66
+ * }
67
+ * };
68
+ * ```
27
69
  */
28
70
  const getSceneList = _ref => {
29
71
  let {
@@ -44,9 +86,31 @@ const getSceneList = _ref => {
44
86
 
45
87
  /**
46
88
  * 查询家庭下一键执行列表,会去掉失效或自动化规则
47
- * @param {number} devId 设备id
48
- * @param {boolean} containStandardZigBee 是否包含标准场景,默认不包含
49
- * @param {number} gid 家庭Id
89
+ * @param params - 查询参数
90
+ * @param params.devId 设备 ID
91
+ * @param params.gid 家庭 ID
92
+ * @param params.containStandardZigBee 是否包含标准场景
93
+ * @defaultValue containStandardZigBee false
94
+ * @returns 一键执行类型的联动规则列表
95
+ * @public
96
+ * @since @ray-js/ray 1.5.15
97
+ * @example
98
+ * ```typescript
99
+ * import { getSceneListV2 } from '@ray-js/ray';
100
+ *
101
+ * const fetchScenes = async () => {
102
+ * try {
103
+ * const scenes = await getSceneListV2({
104
+ * devId: 'device_001',
105
+ * gid: '12345678',
106
+ * containStandardZigBee: false,
107
+ * });
108
+ * console.log('一键执行列表:', scenes);
109
+ * } catch (err) {
110
+ * console.error('查询失败:', err);
111
+ * }
112
+ * };
113
+ * ```
50
114
  */
51
115
  const getSceneListV2 = _ref2 => {
52
116
  let {
@@ -68,10 +132,35 @@ const getSceneListV2 = _ref2 => {
68
132
  };
69
133
 
70
134
  /**
71
- * 查询家庭下已绑定的列表
72
- * @param {string} bizDomain 业务范围
73
- * @param {string} devId 设备id
74
- * @param {number} entityType 实体类型
135
+ * 查询设备条件已绑定的场景
136
+ * @param params - 查询参数
137
+ * @param params.bizDomain 业务域
138
+ * @param params.devId 设备 ID
139
+ * @param params.entityType 实体类型,1 为设备,2 为联动规则
140
+ * @param params.gid 家庭 ID
141
+ * @returns 已绑定的规则列表
142
+ * @public
143
+ * @since @ray-js/ray 1.4.61
144
+ * @example
145
+ * ```typescript
146
+ * import { getBindRuleList } from '@ray-js/ray';
147
+ *
148
+ * const fetchBindRules = async () => {
149
+ * try {
150
+ * const rules = await getBindRuleList({
151
+ * bizDomain: 'wirelessSwitch',
152
+ * devId: 'device_001',
153
+ * entityType: 1,
154
+ * gid: '12345678',
155
+ * });
156
+ * rules.forEach(rule => {
157
+ * console.log(`绑定ID: ${rule.bindId}, 启用: ${rule.enable}`);
158
+ * });
159
+ * } catch (err) {
160
+ * console.error('查询失败:', err);
161
+ * }
162
+ * };
163
+ * ```
75
164
  */
76
165
  const getBindRuleList = async params => {
77
166
  const {
@@ -93,14 +182,39 @@ const getBindRuleList = async params => {
93
182
  };
94
183
 
95
184
  /**
96
- * 绑定联动
97
- * @param {string} devId 设备 ID
98
- * @param {string} associativeEntityId 关联DP点和DP点值的组合
99
- * @param {string} ruleId 关联场景 ID
100
- * @param {string} entitySubIds 关联 DP 点
101
- * @param {Array} expr 关联DP点、动作组合
102
- * @param {string} bizDomain 业务域
103
- * @param {string} bizDomain 业务域
185
+ * 将按键条件与场景规则关联,建立设备按键与联动规则的绑定关系
186
+ * @param params - 绑定规则参数
187
+ * @param params.devId 设备 ID
188
+ * @param params.associativeEntityId 与面板/设备建立绑定关系,通常为设备 ID、DP 点、群组、规则,dpId#value 等
189
+ * @param params.ruleId 关联场景 ID
190
+ * @param params.entitySubIds 关联 DP
191
+ * @param params.expr 关联 DP 点、动作组合
192
+ * @param params.bizDomain 业务域
193
+ * @param params.gid 家庭 ID,可通过 getCurrentHomeInfo 获取
194
+ * @returns 绑定结果信息
195
+ * @public
196
+ * @since @ray-js/ray 1.7.60
197
+ * @example
198
+ * ```typescript
199
+ * import { bindRule } from '@ray-js/ray';
200
+ *
201
+ * const bindSceneRule = async () => {
202
+ * try {
203
+ * const result = await bindRule({
204
+ * devId: 'device_001',
205
+ * associativeEntityId: '1',
206
+ * ruleId: 'rule_001',
207
+ * entitySubIds: '1',
208
+ * expr: [['$dp1', '==', 'true']],
209
+ * bizDomain: 'wirelessSwitch',
210
+ * gid: '12345678',
211
+ * });
212
+ * console.log('绑定成功, ID:', result.id);
213
+ * } catch (err) {
214
+ * console.error('绑定失败:', err);
215
+ * }
216
+ * };
217
+ * ```
104
218
  */
105
219
  const bindRule = params => {
106
220
  const {
@@ -149,9 +263,29 @@ const bindRule = params => {
149
263
  };
150
264
 
151
265
  /**
152
- * 解绑联动
153
- * @param {string} bindId 绑定 id
154
- * @param {string} gid 家庭id
266
+ * 解绑联动,删除按键条件与场景规则的绑定关系
267
+ * @param params - 解绑规则参数
268
+ * @param params.bindId 绑定 ID
269
+ * @param params.gid 家庭 ID
270
+ * @returns 是否解绑成功
271
+ * @public
272
+ * @since @ray-js/ray 1.5.15
273
+ * @example
274
+ * ```typescript
275
+ * import { unbindRule } from '@ray-js/ray';
276
+ *
277
+ * const unbindSceneRule = async () => {
278
+ * try {
279
+ * const success = await unbindRule({
280
+ * bindId: '123456',
281
+ * gid: '12345678',
282
+ * });
283
+ * console.log('解绑结果:', success);
284
+ * } catch (err) {
285
+ * console.error('解绑失败:', err);
286
+ * }
287
+ * };
288
+ * ```
155
289
  */
156
290
  const unbindRule = params => {
157
291
  return requestCloud({
@@ -167,12 +301,35 @@ const unbindRule = params => {
167
301
  };
168
302
 
169
303
  /**
170
- * 解除联动
171
- * @param {string} bizDomain 业务范围
172
- * @param {string} devId 设备id
173
- * @param {string} associativeEntityId 关联dp组合
174
- * @param {string} associativeEntityValue 规则id
175
- * @param {string} gid 家庭id
304
+ * 移除相关按键条件下的场景规则
305
+ * @param params - 移除规则参数
306
+ * @param params.bizDomain 业务域
307
+ * @param params.devId 设备 ID
308
+ * @param params.associativeEntityId 绑定关系标识
309
+ * @param params.associativeEntityValue 规则 ID
310
+ * @param params.gid 家庭 ID
311
+ * @returns 是否删除成功
312
+ * @public
313
+ * @since @ray-js/ray 1.7.60
314
+ * @example
315
+ * ```typescript
316
+ * import { removeRule } from '@ray-js/ray';
317
+ *
318
+ * const removeSceneRule = async () => {
319
+ * try {
320
+ * const success = await removeRule({
321
+ * bizDomain: 'wirelessSwitch',
322
+ * devId: 'device_001',
323
+ * associativeEntityId: '1',
324
+ * associativeEntityValue: 'rule_001',
325
+ * gid: '12345678',
326
+ * });
327
+ * console.log('移除结果:', success);
328
+ * } catch (err) {
329
+ * console.error('移除失败:', err);
330
+ * }
331
+ * };
332
+ * ```
176
333
  */
177
334
  const removeRule = params => {
178
335
  const {
@@ -194,52 +351,100 @@ const removeRule = params => {
194
351
  };
195
352
 
196
353
  /**
197
- * 触发联动
198
- * @param {string} ruleId 规则id
354
+ * 一键触发场景联动,由云端执行关联的自动化规则
355
+ * @param params - 触发规则参数
356
+ * @param params.ruleId 规则 ID
357
+ * @returns 是否执行成功
358
+ * @public
359
+ * @since @ray-js/ray 1.7.60
360
+ * @example
361
+ * ```typescript
362
+ * import { triggerRule } from '@ray-js/ray';
363
+ *
364
+ * const triggerSceneRule = async () => {
365
+ * try {
366
+ * const success = await triggerRule({
367
+ * ruleId: 'rule_001',
368
+ * });
369
+ * console.log('触发结果:', success);
370
+ * } catch (err) {
371
+ * console.error('触发失败:', err);
372
+ * }
373
+ * };
374
+ * ```
199
375
  */
200
- const triggerRule = _ref3 => {
201
- let {
202
- ruleId
203
- } = _ref3;
376
+ const triggerRule = params => {
204
377
  return requestCloud({
205
378
  api: "".concat(THING, ".m.linkage.rule.trigger"),
206
379
  version: '1.0',
207
380
  data: {
208
- ruleId
381
+ ruleId: params.ruleId
209
382
  }
210
383
  });
211
384
  };
212
385
 
213
386
  /**
214
- * 启用联动
215
- * @param {string} ruleId 规则id
387
+ * 开启已绑定规则,恢复规则的自动执行
388
+ * @param params - 启用规则参数
389
+ * @param params.ruleId 规则 ID
390
+ * @returns 是否操作成功
391
+ * @public
392
+ * @since @ray-js/ray 1.7.60
393
+ * @example
394
+ * ```typescript
395
+ * import { enableRule } from '@ray-js/ray';
396
+ *
397
+ * const enableSceneRule = async () => {
398
+ * try {
399
+ * const success = await enableRule({
400
+ * ruleId: 'rule_001',
401
+ * });
402
+ * console.log('开启规则结果:', success);
403
+ * } catch (err) {
404
+ * console.error('开启失败:', err);
405
+ * }
406
+ * };
407
+ * ```
216
408
  */
217
- const enableRule = _ref4 => {
218
- let {
219
- ruleId
220
- } = _ref4;
409
+ const enableRule = params => {
221
410
  return requestCloud({
222
411
  api: "".concat(THING, ".m.linkage.rule.enable"),
223
412
  version: '1.0',
224
413
  data: {
225
- ruleId
414
+ ruleId: params.ruleId
226
415
  }
227
416
  });
228
417
  };
229
418
 
230
419
  /**
231
- * 停用联动
232
- * @param {string} ruleId 规则id
420
+ * 关闭已绑定规则,暂停规则的自动执行
421
+ * @param params - 禁用规则参数
422
+ * @param params.ruleId 规则 ID
423
+ * @returns 是否操作成功
424
+ * @public
425
+ * @since @ray-js/ray 1.7.60
426
+ * @example
427
+ * ```typescript
428
+ * import { disableRule } from '@ray-js/ray';
429
+ *
430
+ * const disableSceneRule = async () => {
431
+ * try {
432
+ * const success = await disableRule({
433
+ * ruleId: 'rule_001',
434
+ * });
435
+ * console.log('关闭规则结果:', success);
436
+ * } catch (err) {
437
+ * console.error('关闭失败:', err);
438
+ * }
439
+ * };
440
+ * ```
233
441
  */
234
- const disableRule = _ref5 => {
235
- let {
236
- ruleId
237
- } = _ref5;
442
+ const disableRule = params => {
238
443
  return requestCloud({
239
444
  api: "".concat(THING, ".m.linkage.rule.disable"),
240
445
  version: '1.0',
241
446
  data: {
242
- ruleId
447
+ ruleId: params.ruleId
243
448
  }
244
449
  });
245
450
  };
@@ -1,10 +1,47 @@
1
1
  import { IGetZigbeeLocalGroupDeviceList, IGetZigbeeLocalGroupDeviceListResponse, IGetZigbeeLocalGroupRelation, IGetZigbeeLocalGroupRelationResponse } from './interface';
2
2
  /**
3
3
  * 获取 Zigbee 遥控器群组 localId 列表
4
+ *
5
+ * @public
6
+ * @since @ray-js/ray 1.5.2
7
+ * @param params - 请求参数
8
+ * @returns 包含 locals 数组的对象,每个元素包含 code、order、localId、categoryCode 信息
9
+ * @example 基础用法
10
+ * ```ts
11
+ * import { getZigbeeLocalGroupRelation } from '@ray-js/ray';
12
+ *
13
+ * getZigbeeLocalGroupRelation({
14
+ * devId: 'your_device_id',
15
+ * }).then((response) => {
16
+ * console.log('localId 列表:', response.locals);
17
+ * }).catch((err) => {
18
+ * console.error(err);
19
+ * });
20
+ * ```
4
21
  */
5
22
  declare const getZigbeeLocalGroupRelation: (params: IGetZigbeeLocalGroupRelation) => Promise<IGetZigbeeLocalGroupRelationResponse>;
6
23
  /**
7
24
  * 获取可以加入 Zigbee 遥控器群组的设备列表
25
+ *
26
+ * @public
27
+ * @since @ray-js/ray 1.5.2
28
+ * @param params - 请求参数
29
+ * @returns 设备列表数组,每个元素包含 productId、devId、devOnline、devName 等设备信息
30
+ * @example 基础用法
31
+ * ```ts
32
+ * import { getZigbeeLocalGroupDeviceList } from '@ray-js/ray';
33
+ *
34
+ * getZigbeeLocalGroupDeviceList({
35
+ * devId: 'your_device_id',
36
+ * meshId: 'gateway_mesh_id',
37
+ * categoryCode: '7001',
38
+ * homeId: 'your_home_id',
39
+ * }).then((response) => {
40
+ * console.log('设备列表:', response);
41
+ * }).catch((err) => {
42
+ * console.error(err);
43
+ * });
44
+ * ```
8
45
  */
9
46
  declare const getZigbeeLocalGroupDeviceList: (params: IGetZigbeeLocalGroupDeviceList) => Promise<IGetZigbeeLocalGroupDeviceListResponse>;
10
47
  export { getZigbeeLocalGroupRelation, getZigbeeLocalGroupDeviceList };
@@ -3,6 +3,23 @@ import { requestCloud } from '../';
3
3
  import { THING } from '../constants';
4
4
  /**
5
5
  * 获取 Zigbee 遥控器群组 localId 列表
6
+ *
7
+ * @public
8
+ * @since @ray-js/ray 1.5.2
9
+ * @param params - 请求参数
10
+ * @returns 包含 locals 数组的对象,每个元素包含 code、order、localId、categoryCode 信息
11
+ * @example 基础用法
12
+ * ```ts
13
+ * import { getZigbeeLocalGroupRelation } from '@ray-js/ray';
14
+ *
15
+ * getZigbeeLocalGroupRelation({
16
+ * devId: 'your_device_id',
17
+ * }).then((response) => {
18
+ * console.log('localId 列表:', response.locals);
19
+ * }).catch((err) => {
20
+ * console.error(err);
21
+ * });
22
+ * ```
6
23
  */
7
24
  const getZigbeeLocalGroupRelation = params => {
8
25
  return requestCloud({
@@ -17,6 +34,26 @@ const getZigbeeLocalGroupRelation = params => {
17
34
 
18
35
  /**
19
36
  * 获取可以加入 Zigbee 遥控器群组的设备列表
37
+ *
38
+ * @public
39
+ * @since @ray-js/ray 1.5.2
40
+ * @param params - 请求参数
41
+ * @returns 设备列表数组,每个元素包含 productId、devId、devOnline、devName 等设备信息
42
+ * @example 基础用法
43
+ * ```ts
44
+ * import { getZigbeeLocalGroupDeviceList } from '@ray-js/ray';
45
+ *
46
+ * getZigbeeLocalGroupDeviceList({
47
+ * devId: 'your_device_id',
48
+ * meshId: 'gateway_mesh_id',
49
+ * categoryCode: '7001',
50
+ * homeId: 'your_home_id',
51
+ * }).then((response) => {
52
+ * console.log('设备列表:', response);
53
+ * }).catch((err) => {
54
+ * console.error(err);
55
+ * });
56
+ * ```
20
57
  */
21
58
  const getZigbeeLocalGroupDeviceList = params => {
22
59
  return requestCloud({
@@ -98,47 +98,125 @@ declare const getDpsLastTimer: (params: IGetDpLastTimer) => Promise<IGetDpLastTi
98
98
  declare const getLastTimerPeriod: (params: IGetLastTimerPeriod) => Promise<IGetLastTimerPeriodResponse>;
99
99
  /**
100
100
  * 获取天文定时列表
101
+ *
102
+ * @public
103
+ * @since @ray-js/ray 1.5.2
104
+ * @param params - 请求参数
105
+ * @returns 天文定时列表数组
106
+ * @example 基础用法
107
+ * ```ts
108
+ * import { getAstronomicalList } from '@ray-js/ray';
109
+ *
110
+ * getAstronomicalList({
111
+ * bizId: 'vdevo160456552237748',
112
+ * }).then((response) => {
113
+ * console.log('天文定时列表:', response);
114
+ * }).catch((err) => {
115
+ * console.error(err);
116
+ * });
117
+ * ```
101
118
  */
102
119
  declare const getAstronomicalList: (params: IGetAstronomicalList) => Promise<IGetAstronomicalListResponse>;
103
120
  /**
104
121
  * 添加天文定时
105
- * @param {string} bizId 设备 ID 或群组 ID
106
- * @param {number} bizType 0:设备; 1:设备群组
107
- * @param {string} loops 周期
108
- * @param {any} dps dp 点,json 格式
109
- * @param {number} astronomicalType 天文类型, 0:日出; 1:日落
110
- * @param {string} timezone 时区
111
- * @param {string} date 日期 yyyyMMdd
112
- * @param {string} time 偏移时间,“HH:mm” 24 进制
113
- * @param {number} offsetType 偏移类型,-1 : 向前; 0 正常; 1 : 向后
114
- * @param {number} lat 纬度
115
- * @param {number} lon 经度
122
+ *
123
+ * @public
124
+ * @since @ray-js/ray 1.5.2
125
+ * @param params - 请求参数
126
+ * @returns 新添加天文定时的 ID
127
+ * @example 基础用法
128
+ * ```ts
129
+ * import { addAstronomical } from '@ray-js/ray';
130
+ *
131
+ * addAstronomical({
132
+ * astronomicalType: 1,
133
+ * bizId: 'vdevo160456552237748',
134
+ * bizType: 0,
135
+ * dps: { 1: true },
136
+ * lat: 30.300694,
137
+ * lon: 120.068634,
138
+ * loops: '1111111',
139
+ * offsetType: -1,
140
+ * time: '00:04',
141
+ * timezone: '+08:00',
142
+ * }).then((response) => {
143
+ * console.log('新增天文定时 ID:', response);
144
+ * }).catch((err) => {
145
+ * console.error(err);
146
+ * });
147
+ * ```
116
148
  */
117
149
  declare const addAstronomical: (params: IAstronomical) => Promise<number>;
118
150
  /**
119
151
  * 修改天文定时
120
- * @param {string} bizId 设备 ID 或群组 ID
121
- * @param {number} bizType 0:设备; 1:设备群组
122
- * @param {string} loops 周期
123
- * @param {any} dps dp 点,json 格式
124
- * @param {number} astronomicalType 天文类型, 0:日出; 1:日落
125
- * @param {string} timezone 时区
126
- * @param {string} date 日期 yyyyMMdd
127
- * @param {string} time 偏移时间,“HH:mm” 24 进制
128
- * @param {number} offsetType 偏移类型,-1 : 向前; 0 正常; 1 : 向后
129
- * @param {number} lat 纬度
130
- * @param {number} lon 经度
152
+ *
153
+ * @public
154
+ * @since @ray-js/ray 1.5.2
155
+ * @param params - 请求参数
156
+ * @returns 是否成功修改天文定时
157
+ * @example 基础用法
158
+ * ```ts
159
+ * import { updateAstronomical } from '@ray-js/ray';
160
+ *
161
+ * updateAstronomical({
162
+ * id: 8642566,
163
+ * astronomicalType: 1,
164
+ * bizId: 'vdevo160456552237748',
165
+ * bizType: 0,
166
+ * dps: { 1: true },
167
+ * lat: 30.300694,
168
+ * lon: 120.068634,
169
+ * loops: '1111111',
170
+ * offsetType: -1,
171
+ * time: '00:04',
172
+ * timezone: '+08:00',
173
+ * }).then((response) => {
174
+ * console.log('修改结果:', response);
175
+ * }).catch((err) => {
176
+ * console.error(err);
177
+ * });
178
+ * ```
131
179
  */
132
180
  declare const updateAstronomical: (params: IAstronomical) => Promise<boolean>;
133
181
  /**
134
- * 修改天文定时使能
135
- * @param {string} id 定时任务id
136
- * @param {number} status 0:关闭;1开启
182
+ * 修改天文定时使能状态
183
+ *
184
+ * @public
185
+ * @since @ray-js/ray 1.5.2
186
+ * @param params - 请求参数
187
+ * @returns 是否成功修改状态
188
+ * @example 基础用法
189
+ * ```ts
190
+ * import { updateAstronomicalStatus } from '@ray-js/ray';
191
+ *
192
+ * updateAstronomicalStatus({
193
+ * id: '8642566',
194
+ * status: 0,
195
+ * }).then((response) => {
196
+ * console.log('修改状态结果:', response);
197
+ * }).catch((err) => {
198
+ * console.error(err);
199
+ * });
200
+ * ```
137
201
  */
138
202
  declare const updateAstronomicalStatus: (params: IUpdateAstronomicalStatus) => Promise<boolean>;
139
203
  /**
140
204
  * 删除天文定时
141
- * @param {string} id 定时任务 id
205
+ *
206
+ * @public
207
+ * @since @ray-js/ray 1.5.2
208
+ * @param params - 请求参数
209
+ * @returns 是否成功删除天文定时
210
+ * @example 基础用法
211
+ * ```ts
212
+ * import { removeAstronomical } from '@ray-js/ray';
213
+ *
214
+ * removeAstronomical({ id: '8642566' }).then((response) => {
215
+ * console.log('删除结果:', response);
216
+ * }).catch((err) => {
217
+ * console.error(err);
218
+ * });
219
+ * ```
142
220
  */
143
221
  declare const removeAstronomical: (params: {
144
222
  id: string;