@ray-js/api 1.6.0-beta.9 → 1.6.1

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 (84) hide show
  1. package/@types/BaseKit.d.ts +837 -37
  2. package/@types/BizKit.d.ts +1831 -85
  3. package/@types/DeviceKit.d.ts +581 -58
  4. package/@types/HomeKit.d.ts +0 -74
  5. package/@types/MiniKit.d.ts +411 -8
  6. package/@types/api-cloud.d.ts +145 -0
  7. package/@types/api-extend.d.ts +42 -10
  8. package/@types/api.d.ts +4 -0
  9. package/@types/energy.d.ts +250 -0
  10. package/@types/gateway.d.ts +146 -0
  11. package/@types/health.d.ts +309 -0
  12. package/lib/{BaseKit-3.11.0.d.ts → BaseKit-3.14.3.d.ts} +29 -1
  13. package/lib/{BaseKit-3.11.0.js → BaseKit-3.14.3.js} +32 -1
  14. package/lib/BizKit-4.10.4.d.ts +84 -0
  15. package/lib/{BizKit-3.2.7.js → BizKit-4.10.4.js} +46 -5
  16. package/lib/{DeviceKit-3.3.1.d.ts → DeviceKit-4.9.0.d.ts} +22 -1
  17. package/lib/{DeviceKit-3.3.1.js → DeviceKit-4.9.0.js} +66 -0
  18. package/lib/HomeKit-3.1.4.d.ts +0 -1
  19. package/lib/MapKit-3.4.13.d.ts +0 -1
  20. package/lib/{MiniKit-3.1.0.d.ts → MiniKit-3.12.1.d.ts} +11 -1
  21. package/lib/{MiniKit-3.1.0.js → MiniKit-3.12.1.js} +12 -1
  22. package/lib/OutdoorKit-1.0.4.d.ts +0 -1
  23. package/lib/P2PKit-2.0.3.d.ts +0 -1
  24. package/lib/PlayNetKit-1.1.3.d.ts +24 -24
  25. package/lib/all-kits.d.ts +5 -5
  26. package/lib/all-kits.js +5 -5
  27. package/lib/cloud/device.d.ts +3 -3
  28. package/lib/cloud/energy.d.ts +15 -0
  29. package/lib/cloud/energy.js +55 -0
  30. package/lib/cloud/gateway.d.ts +11 -0
  31. package/lib/cloud/gateway.js +39 -0
  32. package/lib/cloud/health.d.ts +19 -0
  33. package/lib/cloud/health.js +71 -0
  34. package/lib/cloud/index.d.ts +4 -0
  35. package/lib/cloud/index.js +7 -1
  36. package/lib/cloud/interface.d.ts +40 -1
  37. package/lib/cloud/laser-clean/index.d.ts +3 -0
  38. package/lib/cloud/laser-clean/index.js +3 -0
  39. package/lib/cloud/laser-clean/map.d.ts +3 -0
  40. package/lib/cloud/laser-clean/map.js +4 -0
  41. package/lib/cloud/laser-clean/record.d.ts +3 -0
  42. package/lib/cloud/laser-clean/record.js +4 -0
  43. package/lib/cloud/laser-clean/voice.d.ts +2 -0
  44. package/lib/cloud/laser-clean/voice.js +3 -0
  45. package/lib/cloud/recipe/basket.js +1 -0
  46. package/lib/cloud/recipe/custom.js +1 -0
  47. package/lib/cloud/recipe/menu.js +1 -0
  48. package/lib/cloud/recipe/query.js +1 -0
  49. package/lib/cloud/recipe/score.js +1 -0
  50. package/lib/cloud/recipe/star.js +1 -0
  51. package/lib/getBoundingClientRect/index.thing.js +1 -0
  52. package/lib/getBoundingClientRect/index.wechat.js +1 -0
  53. package/lib/getCdnUrl/index.thing.js +22 -18
  54. package/lib/hideTabBar/index.d.ts +4 -5
  55. package/lib/index.d.ts +0 -1
  56. package/lib/navigateBack/index.d.ts +0 -1
  57. package/lib/navigateTo/index.d.ts +0 -1
  58. package/lib/panel/devInfo/index.js +7 -1
  59. package/lib/panel/i18n/index.js +4 -0
  60. package/lib/panel/i18n/index.wechat.js +4 -0
  61. package/lib/panel/publishDps.js +2 -0
  62. package/lib/reLaunch/index.d.ts +0 -1
  63. package/lib/redirectTo/index.d.ts +0 -1
  64. package/lib/redirectTo/index.js +1 -0
  65. package/lib/requestCloud/index.d.ts +0 -1
  66. package/lib/setNavigationBarColor/index.d.ts +0 -1
  67. package/lib/setNavigationBarTitle/index.d.ts +0 -1
  68. package/lib/showTabBar/index.d.ts +4 -5
  69. package/lib/switchTab/index.d.ts +0 -1
  70. package/lib/utils.wechat.js +1 -0
  71. package/lib/viewAPI.d.ts +1 -1
  72. package/lib/viewAPI.js +2 -1
  73. package/package.json +8 -8
  74. package/lib/BizKit-3.2.7.d.ts +0 -46
  75. package/lib/cloud/doorlock/README.md +0 -62
  76. package/lib/cloud/doorlock/auth.md +0 -323
  77. package/lib/cloud/doorlock/device.md +0 -265
  78. package/lib/cloud/doorlock/log.md +0 -153
  79. package/lib/cloud/doorlock/member-opmode.md +0 -279
  80. package/lib/cloud/doorlock/member.md +0 -276
  81. package/lib/cloud/doorlock/offline-pwd.md +0 -155
  82. package/lib/cloud/doorlock/temp-pwd.md +0 -362
  83. package/lib/cloud/doorlock/unlock-method.md +0 -121
  84. package/lib/cloud/doorlock/unlock.md +0 -222
@@ -0,0 +1,145 @@
1
+ // api云能力扩展
2
+ declare namespace ty {
3
+ // #region 获取云存储配置
4
+ type GetSweeperStorageConfigParams = {
5
+ // 设备id
6
+ devId: string
7
+ // 类型
8
+ type?: string
9
+ }
10
+
11
+ // 获取云存储配置返回值
12
+ type GetSweeperStorageConfigResponse = {
13
+ // ak
14
+ ak: string
15
+ // bucket
16
+ bucket: string
17
+ // sk
18
+ sk: string
19
+ // token
20
+ token: string
21
+ // endpoint
22
+ endpoint: string
23
+ // 过期时间
24
+ expiration: string
25
+ // 生命周期
26
+ lifeCycle: number
27
+ // 区域
28
+ region: string
29
+ }
30
+
31
+ /**
32
+ * 获取云存储配置
33
+ * @returns 获取云存储配置结果的 Promise
34
+ */
35
+ function getSweeperStorageConfig(
36
+ params: GetSweeperStorageConfigParams
37
+ ): Promise<GetSweeperStorageConfigResponse>
38
+
39
+ // #region 获取扫地机的历史地图
40
+ type GetMultipleMapFilesParams = {
41
+ //设备id
42
+ devId: string
43
+ }
44
+
45
+ type GetMultipleMapFilesResponse = {
46
+ datas: {
47
+ bucket: string // 存储文件的存储桶
48
+ extend: string // 文件的附加信息
49
+ time: number // 文件的时间戳
50
+ id: number // 文件的唯一标识符
51
+ file: string // 文件路径或路径
52
+ devId: string // 与文件关联的设备ID
53
+ fileType: string // 文件类型
54
+ }[] // 历史地图列表
55
+ totalCount: number // 数据总数
56
+ }
57
+
58
+ /**
59
+ * 获取扫地机的历史地图
60
+ * @returns 获取扫地机的历史地图结果的 Promise
61
+ */
62
+ export function getMultipleMapFiles(
63
+ params: GetMultipleMapFilesParams
64
+ ): Promise<GetMultipleMapFilesResponse>
65
+
66
+ // #region 获取清扫记录列表
67
+ type GetCleaningRecordsParams = {
68
+ startTime: string // 开始时间
69
+ endTime: string // 结束时间
70
+ limit: number // 返回的数据长度限制
71
+ offset: number // 偏移量
72
+ devId: string // 设备Id
73
+ fileType?: string // 可选参数,默认'pic'
74
+ }
75
+
76
+ type GetCleaningRecordsResponse = {
77
+ datas: {
78
+ bucket: string
79
+ extend: string // 清扫信息
80
+ devId: string
81
+ file: string
82
+ time: number
83
+ id: number // 清扫记录的唯一ID
84
+ fileType: string
85
+ }[]
86
+ totalCount: number // 清扫记录总长度
87
+ }
88
+
89
+ export function getCleaningRecords(
90
+ params: GetCleaningRecordsParams
91
+ ): Promise<GetCleaningRecordsResponse>
92
+
93
+ // #region 删除清扫记录
94
+ type DeleteCleaningRecordParams = {
95
+ devId: string // 设备id
96
+ fileIds: number[] // 要删除的记录id
97
+ }
98
+
99
+ type DeleteCleaningRecordResponse = boolean
100
+
101
+ /**
102
+ * 删除清扫记录
103
+ * @returns 删除清扫记录结果的 Promise
104
+ */
105
+ function deleteCleaningRecord(
106
+ params: DeleteCleaningRecordParams
107
+ ): Promise<DeleteCleaningRecordResponse>
108
+
109
+ // #region 获取扫地机的语音包列表
110
+ type GetVoiceListParams = {
111
+ //设备id
112
+ devId: string
113
+ //设备id - 兼容
114
+ deviceId?: string
115
+ // 分页参数,一般配置的语言包不多,可以不是用分页查询,直接使用0
116
+ offset: number
117
+ // 每页大小,可以传入100
118
+ limit: number
119
+ }
120
+
121
+ type GetVoiceListResponse = {
122
+ datas: {
123
+ auditionUrl: string // 试听链接
124
+ desc?: string // 描述
125
+ extendData: {
126
+ extendId: number // 扩展ID,通过这个id与设备上报的语言包id进行对比,判断语音包是否使用中
127
+ version: string // 版本
128
+ }
129
+ id: number // ID
130
+ imgUrl: string // 图片链接
131
+ name: string // 名称
132
+ officialUrl: string // 官方链接
133
+ productId: string // 产品ID
134
+ region: string[] // 区域代码
135
+ }[] // 语音数据数组
136
+ pageNo: number // 页码
137
+ totalCount: number // 数据总数
138
+ }
139
+
140
+ /**
141
+ * 获取扫地机的语音包列表
142
+ * @returns 获取扫地机的语音包列表结果的 Promise
143
+ */
144
+ function getVoiceList(params: GetVoiceListParams): Promise<GetVoiceListResponse>
145
+ }
@@ -122,20 +122,20 @@ interface setNavigationBarBackParam {
122
122
 
123
123
  interface CanvasGetImageDataProps extends Callback {
124
124
  canvasId: string
125
- x: string
126
- y: string
127
- width: string
128
- height: string
129
- success(res: { width: string; height: string; data: Uint8ClampedArray }): void
125
+ x: number
126
+ y: number
127
+ width: number
128
+ height: number
129
+ success(res: { width: number; height: number; data: Array }): void
130
130
  }
131
131
 
132
132
  interface CanvasPutImageDataProps extends Callback {
133
133
  canvasId: string
134
- x: string
135
- y: string
136
- width: string
137
- height: string
138
- data: Uint8ClampedArray
134
+ x: number
135
+ y: number
136
+ width: number
137
+ height: number
138
+ data: Array
139
139
  }
140
140
 
141
141
  interface VideoContext {
@@ -226,6 +226,29 @@ interface WebviewContext {
226
226
  postMessage(options: { data: Record<string, any> }): void
227
227
  reload(options: Callback): void
228
228
  }
229
+
230
+ interface SocketTask {
231
+ send(option: { data: string | ArrayBuffer; success?: () => void; fail?: () => void; complete?: () => void }): void
232
+ close(option: { code?: number; reason?: string; success?: () => void; fail?: () => void; complete?: () => void }): void
233
+ onOpen(callback: () => void): void
234
+ onClose(callback: () => void): void
235
+ onError(callback: () => void): void
236
+ onMessage(callback: (res: { data: string | ArrayBuffer }) => void): void
237
+ }
238
+
239
+ interface ConnectSocketProps {
240
+ url: string;
241
+ protocols?: string[];
242
+ header?: Record<string, string>;
243
+ timeout?: number;
244
+ tcpNoDelay?: boolean;
245
+ perMessageDeflate?: boolean;
246
+ forceCellularNetwork?: boolean;
247
+ success?: () => void;
248
+ fail?: () => void;
249
+ complete?: () => void
250
+ }
251
+
229
252
  declare namespace ty {
230
253
  /**
231
254
  * 小程序云能力
@@ -284,7 +307,16 @@ declare namespace ty {
284
307
  export type env = {
285
308
  USER_DATA_PATH: string
286
309
  }
310
+ export function connectSocket(param: ConnectSocketProps): SocketTask
311
+
312
+ /**
313
+ * 判断小程序的API,回调,组件等是否可用 (BaseKit 需要 3.15.1 及以上版本)
314
+ * @param schema 使用 ${API}.${method}.${param}.${option} 或者 ${component}.${attribute}.${option} 方式来调用
315
+ * @returns 是否可用
316
+ */
317
+ export function canIUse(schema: string): boolean
287
318
  }
319
+
288
320
  declare namespace WechatMiniprogram {
289
321
  interface Wx {
290
322
  requestCloud(params: RequestCloudParams): RequestCloudReturn
package/@types/api.d.ts CHANGED
@@ -1,2 +1,6 @@
1
1
  /// <reference path="./all-kits.d.ts" />
2
2
  /// <reference path="./api-extend.d.ts" />
3
+ /// <reference path="./api-cloud.d.ts" />
4
+ /// <reference path="./gateway.d.ts" />
5
+ /// <reference path="./health.d.ts" />
6
+ /// <reference path="./energy.d.ts" />
@@ -0,0 +1,250 @@
1
+ declare namespace ty.energy {
2
+ // 1. 单设备多指标汇总查询
3
+ type GetDeviceDataMultipleSumParams = {
4
+ devId: string // 设备id
5
+ indicatorCodes: string // 维度
6
+ dateType: 'day' | 'week' | 'month' | 'year' // 日期类型
7
+ beginDate: string // 开始日期
8
+ endDate: string // 结束日期
9
+ }
10
+
11
+ type GetDeviceDataMultipleSumResponse = {
12
+ [key: string]: string
13
+ }
14
+
15
+ function getDeviceDataMultipleSum(
16
+ params: GetDeviceDataMultipleSumParams
17
+ ): Promise<GetDeviceDataMultipleSumResponse>
18
+
19
+ // 2. 查询逆变器设备信息
20
+ type GetInverterDeviceInfoParams = {
21
+ devId: string // 设备id
22
+ }
23
+
24
+ type GetInverterDeviceInfoResponse = {
25
+ inverterDailyCharge: string // 当日充电量
26
+ inverterDailyDischarge: string // 当日放电量
27
+ inverterEsTotalCharge: string // 累计充电量
28
+ inverterEsTotalDischarge: string // 累计放电量
29
+ inverterSoc: string // 当天电量
30
+ inverterSoh: string // 电池健康度
31
+ inverterStatus: string // 逆变器状态
32
+ inverterWorkMode: string // 能源模式
33
+ }
34
+
35
+ function getInverterDeviceInfo(
36
+ params: GetInverterDeviceInfoParams
37
+ ): Promise<GetInverterDeviceInfoResponse>
38
+
39
+ // 3. 查询逆变器仪表盘信息
40
+ type GetInverterPanelInfoParams = {
41
+ devId: string // 设备id
42
+ }
43
+
44
+ type GetInverterPanelInfoResponse = {
45
+ eleProduce: string // 当天发电量
46
+ inverterWorkModeSetting: string // 能源模式
47
+ netOutput: string // 净输出
48
+ score: string // 得分
49
+ inverterDcVoltage1: string // 1号当前电压
50
+ inverterDcCurrent1: string // 1号当前电流
51
+ inverterPv1InputPower: string // 1号当前功率
52
+ inverterDcVoltage2: string // 2号当前电压
53
+ inverterDcCurrent2: string // 2号当前电流
54
+ inverterPv2InputPower: string // 2号当前功率
55
+ inverterDcVoltage3: string // 3号当前电压
56
+ inverterDcCurrent3: string // 3号当前电流
57
+ inverterPv3InputPower: string // 3号当前功率
58
+ inverterDcVoltage4: string // 4号当前电压
59
+ inverterDcCurrent4: string // 4号当前电流
60
+ inverterPv4InputPower: string // 4号当前功率
61
+ }
62
+
63
+ function getInverterPanelInfo(
64
+ params: GetInverterPanelInfoParams
65
+ ): Promise<GetInverterPanelInfoResponse>
66
+
67
+ // 4. 查询流向图功率
68
+ type GetInverterFlowInfoParams = {
69
+ devId: string // 设备id
70
+ }
71
+
72
+ type GetInverterFlowInfoResponse = {
73
+ loadPower: string // 负载功率
74
+ pvPower: string // pv功率
75
+ }
76
+
77
+ function getInverterFlowInfo(
78
+ params: GetInverterFlowInfoParams
79
+ ): Promise<GetInverterFlowInfoResponse>
80
+
81
+ // 5. 获取设备属性
82
+ type GetPropertyInfoParams = {
83
+ devId: string // 设备id
84
+ bizType: number // bizType类型
85
+ code: string // 能力code
86
+ }
87
+
88
+ type GetPropertyInfoResponse = {
89
+ value: string // 装机容量
90
+ }[]
91
+
92
+ function getPropertyInfo(params: GetPropertyInfoParams): Promise<GetPropertyInfoResponse>
93
+
94
+ // 6. 保存设备属性
95
+ type SavePropertyParams = {
96
+ devId: string // 设备id
97
+ bizType: number // bizType类型
98
+ code: string // 能力code
99
+ value: string // 装机容量
100
+ }
101
+
102
+ type SavePropertyResponse = boolean
103
+
104
+ function saveProperty(params: SavePropertyParams): Promise<SavePropertyResponse>
105
+
106
+ // 7. 查询EMS系统设备故障事件列表
107
+ type GetDeviceAlarmEventParams = {
108
+ devId: string // 设备id
109
+ brandCode?: string // 品牌商标识(kkt)可选
110
+ weight: number // 目前事件多语言名称权重为1,事件起因多语言权重为3,事件解决方案多语言权重为5
111
+ startTime: number // 开始时间戳
112
+ endTime: number // 结束时间戳
113
+ eventType: 'fault' | 'alarm' // 事件类型 alarm 阈值告警/fault 故障告警
114
+ eventStatus: 0 | 1 // 事件状态 0 已恢复/1 未恢复
115
+ pageNum: number // 当前页
116
+ pageSize: number // 页数
117
+ }
118
+
119
+ type GetDeviceAlarmEventResponse = {
120
+ data: {
121
+ deviceId: string // 设备ID
122
+ startTime: number // 开始时间戳
123
+ endTime: number // 结束时间戳
124
+ name: string // 事件名称
125
+ desc: string // 事件描述
126
+ }[]
127
+ }
128
+
129
+ function getDeviceAlarmEvent(
130
+ params: GetDeviceAlarmEventParams
131
+ ): Promise<GetDeviceAlarmEventResponse>
132
+
133
+ // 8. 查询EMS系统设备故障事件详情
134
+ type GetDeviceAlarmEventDetailParams = {
135
+ devId: string // 设备id
136
+ brandCode?: string // 品牌商标识(kkt)可选
137
+ weight: number // 目前事件多语言名称权重为1,事件起因多语言权重为3,事件解决方案多语言权重为5
138
+ eventId: string // 事件ID
139
+ }
140
+
141
+ type GetDeviceAlarmEventDetailResponse = {
142
+ name: string // 事件名称
143
+ eventSolution: string // 解决方案
144
+ startTime: number // 开始时间戳
145
+ endTime: number // 结束时间戳
146
+ }
147
+
148
+ function getDeviceAlarmEventDetail(
149
+ params: GetDeviceAlarmEventDetailParams
150
+ ): Promise<GetDeviceAlarmEventDetailResponse>
151
+
152
+ // 9. 炭排放查询
153
+ type GetDeviceEnergySavingDataParams = {
154
+ devId: string // 设备id
155
+ phoneCode: string // 国家手机号前缀/或国家码 如德国DE 优先填写国家码,部分国家的手机号前缀一样
156
+ types: string // 节能数据类型: 1.碳排放(吨) 2.煤炭节约量(吨) 3.等效植树量(棵) 5.三口之家1天用电(天)
157
+ }
158
+
159
+ type GetDeviceEnergySavingDataResponse = {
160
+ type: string
161
+ value: string
162
+ }[]
163
+
164
+ function getDeviceEnergySavingData(
165
+ params: GetDeviceEnergySavingDataParams
166
+ ): Promise<GetDeviceEnergySavingDataResponse>
167
+
168
+ // 10. 单设备多指标趋势查询
169
+ type GetDeviceDataTrendParams = {
170
+ devId: string // 设备id
171
+ dateType: 'hour' | 'day' | 'month' // 日期维度
172
+ indicatorCodes: string // 指标code
173
+ beginDate: string // 开始时间
174
+ endDate: string // 结束时间
175
+ aggregationType?: 'SUM' | 'AVG' | 'MAX' | 'MIN' | 'NUM'
176
+ }
177
+
178
+ type GetDeviceDataTrendResponse = {
179
+ indicator: string // 指标code
180
+ total: number // 总数值
181
+ unit: string // 单位
182
+ list: {
183
+ date: string // 日期
184
+ value: number // 数值
185
+ }[]
186
+ }[]
187
+
188
+ function getPropertySettingTranslate(
189
+ params: GetDeviceDataTrendParams
190
+ ): Promise<GetDeviceDataTrendResponse>
191
+
192
+ // 11. 查询逆变器设备模型
193
+ type GetInverterDeviceModelParams = {
194
+ devId: string // 设备id
195
+ }
196
+
197
+ type GetInverterDeviceModelResponse = {
198
+ code: string // 指标code
199
+ data_spec: {
200
+ range: string[]
201
+ range_info: {
202
+ code: string
203
+ name: string
204
+ }[]
205
+ standard: {
206
+ [key: string]: string
207
+ }
208
+ }
209
+ data_type: string
210
+ group: number
211
+ name: string // 工作模式
212
+ type: string // 工作类型
213
+ }[]
214
+
215
+ function getInverterDeviceModel(
216
+ params: GetInverterDeviceModelParams
217
+ ): Promise<GetInverterDeviceModelResponse>
218
+
219
+ // 12. 能源设备属性查询
220
+ type GetDevicePropertySettingTranslateParams = {
221
+ devId: string // 设备id
222
+ codes: string // 指标code
223
+ }
224
+
225
+ type GetDevicePropertySettingTranslateResponse = {
226
+ code: string
227
+ langValue: string
228
+ time: number
229
+ value: string
230
+ }[]
231
+
232
+ function getDevicePropertySettingTranslate(
233
+ params: GetDevicePropertySettingTranslateParams
234
+ ): Promise<GetDevicePropertySettingTranslateResponse>
235
+
236
+ // 13. 逆变器设备属性下发
237
+ type SetDevicePropertySettingParams = {
238
+ devId: string // 设备id
239
+ setting: {
240
+ code: string // 指标code
241
+ value: string // 下发数值
242
+ }[]
243
+ }
244
+
245
+ type SetDevicePropertySettingResponse = boolean
246
+
247
+ function setDevicePropertySetting(
248
+ params: SetDevicePropertySettingParams
249
+ ): Promise<SetDevicePropertySettingResponse>
250
+ }
@@ -0,0 +1,146 @@
1
+ declare namespace ty.gateway {
2
+ // 1. 下发更新LQI指令
3
+ type SendCmdForRefreshDeviceLQIParams = {
4
+ devId: string; // 子设备id
5
+ };
6
+
7
+ type SendCmdForRefreshDeviceLQIResponse = boolean; // 是否下发成功
8
+
9
+ function sendCmdForRefreshDeviceLQI(params: SendCmdForRefreshDeviceLQIParams): Promise<SendCmdForRefreshDeviceLQIResponse>;
10
+
11
+ // 2. 获取设备最新LQI
12
+ type GetLastDeviceLQIParams = {
13
+ devId: string; //子设备id
14
+ offsetTime: number; //时间偏移量,单位为毫秒
15
+ };
16
+
17
+ type DeviceLQI = {
18
+ deviceId: string; //设备id
19
+ deviceName: string; //设备名称
20
+ isGateway: boolean; //是否是网关
21
+ lqi: number; // 子设备lqi值
22
+ }
23
+
24
+ type GetLastDeviceLQIResponse = DeviceLQI[];
25
+
26
+ function getLastDeviceLQI(params: GetLastDeviceLQIParams): Promise<GetLastDeviceLQIResponse>;
27
+
28
+ // 3. 查询设备高级能力
29
+ type GetSeniorAbilityParams = {
30
+ devId: string; // 设备id
31
+ };
32
+
33
+ type GetSeniorAbilityResponse = {
34
+ [key: string]: string;
35
+ };
36
+
37
+ function getSeniorAbility(params: GetSeniorAbilityParams): Promise<GetSeniorAbilityResponse>;
38
+
39
+ // 4. 获取网关子设备数量限制
40
+ type GetGatewaySubDevLimitParams = {
41
+ devId: string; // 设备id
42
+ };
43
+
44
+ type GetGatewaySubDevLimitResponse = {
45
+ max?: number; // 子设备数量上限
46
+ blu?: number; // 蓝牙子设备数量上限
47
+ zig?: number; // zigbee子设备数量上限
48
+ ver?: number; // 版本,嵌入式端上报
49
+ };
50
+
51
+ function getGatewaySubDevLimit(params: GetGatewaySubDevLimitParams): Promise<GetGatewaySubDevLimitResponse>;
52
+
53
+ // 5. mesh类设备拖拽
54
+ type UpdateRelationMeshParams = {
55
+ nodeIds: string[]; // 需要拖拽的子设备id列表
56
+ sourceMeshId?: string; // 原meshId或者网关Id
57
+ targetMeshId?: string; // 目标meshId或者网关Id
58
+ };
59
+
60
+ type UpdateRelationMeshResponse = {
61
+ repeatNodeIds: string[]; //已在网关下的设备列表
62
+ };
63
+
64
+ function updateRelationMesh(params: UpdateRelationMeshParams): Promise<UpdateRelationMeshResponse>;
65
+
66
+ // 6. 蓝牙单点类设备拖拽
67
+ type UpdateRelationBlueParams = {
68
+ nodes: {
69
+ devId: string;
70
+ uuid: string;
71
+ }[]; // 需要拖拽的子设备id与uuid列表
72
+ sourceMeshId?: string; // 原网关Id
73
+ targetMeshId?: string; // 目标网关Id
74
+ };
75
+
76
+ type UpdateRelationBlueResponse = {
77
+ repeatNodeIds: string[]; //已在网关下的设备列表
78
+ };
79
+
80
+ function updateRelationBlue(params: UpdateRelationBlueParams): Promise<UpdateRelationBlueResponse>;
81
+
82
+ // 7. beacon类设备拖拽
83
+ type UpdateRelationBeaconParams = {
84
+ nodes: {
85
+ devId: string;
86
+ mac: string;
87
+ }[]; // 需要拖拽的子设备id与mac列表
88
+ sourceMeshId?: string; // 原网关Id
89
+ targetMeshId?: string; // 目标网关Id
90
+ };
91
+
92
+ type UpdateRelationBeaconResponse = {
93
+ repeatNodeIds: string[]; //已在网关下的设备列表
94
+ };
95
+
96
+ function updateRelationBeacon(params: UpdateRelationBeaconParams): Promise<UpdateRelationBeaconResponse>;
97
+
98
+ // 8. 获取网关的能力
99
+ type GetGatewayAbilityParams = {
100
+ devIds: string; // 设备id拼成的字符串,以逗号分隔
101
+ };
102
+
103
+ type GatewayAbility = {
104
+ capability: number; // 能力值
105
+ devId: string; // 设备id
106
+ lqi: number; // 设备信号质量
107
+ performance?: number; // 网关性能指标
108
+ subMaximum?: { // 子设备数量上线
109
+ data?: { // 各类型子设备数量上线
110
+ [key: string]: number;
111
+ },
112
+ version?: number; // 版本
113
+ };
114
+ }
115
+
116
+ type GetGatewayAbilityResponse = GatewayAbility[];
117
+
118
+ function getGatewayAbility(params: GetGatewayAbilityParams): Promise<GetGatewayAbilityResponse>;
119
+
120
+ // 9. 获取设备日志
121
+ type GetSecurityDeviceLogParams = {
122
+ queryStr: string;
123
+ };
124
+
125
+ 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
+ }
135
+
136
+ type GetSecurityDeviceLogResponse = {
137
+ devId: string; // 设备id
138
+ datas: DeviceLogData[];
139
+ hasNext: boolean; // 是否还有下一页
140
+ totalCount: number; // 总数
141
+ currentPageStartRowKey?: string; // 当前页起始key
142
+ };
143
+
144
+ function getSecurityDeviceLog(params: GetSecurityDeviceLogParams): Promise<GetSecurityDeviceLogResponse>;
145
+ }
146
+