@ray-js/api 1.5.0-beta.12 → 1.5.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.
- package/@types/BaseKit.d.ts +246 -126
- package/@types/BizKit.d.ts +1 -1
- package/@types/MapKit.d.ts +237 -1
- package/@types/MiniKit.d.ts +1 -1
- package/@types/OutdoorKit.d.ts +232 -0
- package/@types/P2PKit.d.ts +24 -2
- package/@types/all-kits.d.ts +1 -0
- package/@types/api-extend.d.ts +8 -2
- package/@types/index.d.ts +87 -0
- package/lib/{BaseKit-3.3.10.d.ts → BaseKit-3.11.0.d.ts} +1 -0
- package/lib/{BaseKit-3.3.10.js → BaseKit-3.11.0.js} +6 -2
- package/lib/BizKit-3.2.7.js +2 -1
- package/lib/DeviceKit-3.3.1.js +2 -1
- package/lib/HomeKit-3.1.4.js +2 -1
- package/lib/{MapKit-3.0.7.d.ts → MapKit-3.4.13.d.ts} +5 -0
- package/lib/{MapKit-3.0.7.js → MapKit-3.4.13.js} +19 -1
- package/lib/MiniKit-3.1.0.js +3 -2
- package/lib/OutdoorKit-1.0.4.d.ts +14 -0
- package/lib/OutdoorKit-1.0.4.js +39 -0
- package/lib/P2PKit-2.0.3.d.ts +1 -0
- package/lib/P2PKit-2.0.3.js +5 -1
- package/lib/PlayNetKit-1.1.3.d.ts +24 -25
- package/lib/PlayNetKit-1.1.3.js +2 -1
- package/lib/all-kits.d.ts +3 -2
- package/lib/all-kits.js +3 -2
- package/lib/cloud/alarm.js +2 -2
- package/lib/cloud/core.js +1 -1
- package/lib/cloud/device.d.ts +25 -1
- package/lib/cloud/device.js +20 -6
- package/lib/cloud/doorlock/README.md +62 -0
- package/lib/cloud/doorlock/auth.d.ts +235 -0
- package/lib/cloud/doorlock/auth.js +223 -0
- package/lib/cloud/doorlock/auth.md +323 -0
- package/lib/cloud/doorlock/device.d.ts +137 -0
- package/lib/cloud/doorlock/device.js +187 -0
- package/lib/cloud/doorlock/device.md +265 -0
- package/lib/cloud/doorlock/index.d.ts +10 -0
- package/lib/cloud/doorlock/index.js +20 -0
- package/lib/cloud/doorlock/log.d.ts +113 -0
- package/lib/cloud/doorlock/log.js +53 -0
- package/lib/cloud/doorlock/log.md +153 -0
- package/lib/cloud/doorlock/member-opmode.d.ts +121 -0
- package/lib/cloud/doorlock/member-opmode.js +104 -0
- package/lib/cloud/doorlock/member-opmode.md +279 -0
- package/lib/cloud/doorlock/member.d.ts +110 -0
- package/lib/cloud/doorlock/member.js +72 -0
- package/lib/cloud/doorlock/member.md +276 -0
- package/lib/cloud/doorlock/offline-pwd.d.ts +61 -0
- package/lib/cloud/doorlock/offline-pwd.js +67 -0
- package/lib/cloud/doorlock/offline-pwd.md +155 -0
- package/lib/cloud/doorlock/old.d.ts +36 -0
- package/lib/cloud/doorlock/old.js +102 -0
- package/lib/cloud/doorlock/temp-pwd.d.ts +194 -0
- package/lib/cloud/doorlock/temp-pwd.js +193 -0
- package/lib/cloud/doorlock/temp-pwd.md +362 -0
- package/lib/cloud/doorlock/unlock-method.d.ts +62 -0
- package/lib/cloud/doorlock/unlock-method.js +85 -0
- package/lib/cloud/doorlock/unlock-method.md +121 -0
- package/lib/cloud/doorlock/unlock.d.ts +89 -0
- package/lib/cloud/doorlock/unlock.js +76 -0
- package/lib/cloud/doorlock/unlock.md +222 -0
- package/lib/cloud/index.d.ts +4 -0
- package/lib/cloud/index.js +10 -1
- package/lib/cloud/interface.d.ts +39 -2
- package/lib/cloud/linkage.d.ts +8 -5
- package/lib/cloud/linkage.js +38 -17
- package/lib/cloud/outdoor.d.ts +15 -0
- package/lib/cloud/outdoor.js +25 -0
- package/lib/cloud/recipe/README.md +36 -0
- package/lib/cloud/recipe/basket.d.ts +220 -0
- package/lib/cloud/recipe/basket.js +328 -0
- package/lib/cloud/recipe/basket.md +431 -0
- package/lib/cloud/recipe/category-list.d.ts +71 -0
- package/lib/cloud/recipe/category-list.js +65 -0
- package/lib/cloud/recipe/category-list.md +132 -0
- package/lib/cloud/recipe/custom.d.ts +177 -0
- package/lib/cloud/recipe/custom.js +171 -0
- package/lib/cloud/recipe/custom.md +265 -0
- package/lib/cloud/recipe/index.d.ts +8 -0
- package/lib/cloud/recipe/index.js +8 -0
- package/lib/cloud/recipe/menu.d.ts +170 -0
- package/lib/cloud/recipe/menu.js +76 -0
- package/lib/cloud/recipe/menu.md +276 -0
- package/lib/cloud/recipe/query.d.ts +87 -0
- package/lib/cloud/recipe/query.js +101 -0
- package/lib/cloud/recipe/query.md +112 -0
- package/lib/cloud/recipe/record.d.ts +54 -0
- package/lib/cloud/recipe/record.js +87 -0
- package/lib/cloud/recipe/record.md +115 -0
- package/lib/cloud/recipe/score.d.ts +69 -0
- package/lib/cloud/recipe/score.js +106 -0
- package/lib/cloud/recipe/score.md +112 -0
- package/lib/cloud/recipe/star.d.ts +131 -0
- package/lib/cloud/recipe/star.js +151 -0
- package/lib/cloud/recipe/star.md +196 -0
- package/lib/cloud/recipe/types.d.ts +7 -0
- package/lib/cloud/recipe/types.js +0 -0
- package/lib/cloud/remoteGroup.d.ts +10 -0
- package/lib/cloud/remoteGroup.js +31 -0
- package/lib/cloud/statistic.js +9 -9
- package/lib/cloud/timer.js +14 -14
- package/lib/constants.js +1 -1
- package/lib/errorCode.d.ts +4 -0
- package/lib/errorCode.js +3 -0
- package/lib/getCdnUrl/index.d.ts +2 -2
- package/lib/getCdnUrl/index.js +1 -2
- package/lib/getCdnUrl/index.wechat.d.ts +2 -2
- package/lib/getCdnUrl/index.wechat.js +1 -2
- package/lib/getElementById/index.thing.js +1 -1
- package/lib/getElementById/index.wechat.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/nativeRouters/common.d.ts +15 -0
- package/lib/nativeRouters/common.js +38 -0
- package/lib/nativeRouters/device.d.ts +59 -0
- package/lib/nativeRouters/device.js +69 -0
- package/lib/nativeRouters/gw.d.ts +23 -0
- package/lib/nativeRouters/gw.js +27 -0
- package/lib/nativeRouters/index.d.ts +6 -1
- package/lib/nativeRouters/index.js +6 -1
- package/lib/nativeRouters/ipc.d.ts +30 -0
- package/lib/nativeRouters/ipc.js +44 -0
- package/lib/nativeRouters/outdoors.d.ts +47 -0
- package/lib/nativeRouters/outdoors.js +41 -0
- package/lib/nativeRouters/remoteGroup.d.ts +22 -0
- package/lib/nativeRouters/remoteGroup.js +11 -0
- package/lib/nativeRouters/root.d.ts +41 -0
- package/lib/nativeRouters/root.js +53 -0
- package/lib/openGroupCreate/index.js +3 -3
- package/lib/panel/i18n/index.d.ts +7 -6
- package/lib/panel/i18n/index.js +39 -23
- package/lib/panel/i18n/index.wechat.js +13 -12
- package/lib/panel/normalizeNetwork.js +1 -1
- package/lib/panel/publishDps.js +1 -1
- package/lib/redirectTo/index.js +1 -0
- package/lib/utils.d.ts +5 -2
- package/lib/utils.js +46 -20
- package/lib/utils.wechat.d.ts +3 -0
- package/lib/utils.wechat.js +22 -6
- package/lib/viewAPI.d.ts +1 -0
- package/lib/viewAPI.js +4 -3
- package/package.json +8 -7
- package/@types/PlayNetKit.d.ts +0 -444
- package/lib/nativeRouters/scene.d.ts +0 -34
- package/lib/nativeRouters/scene.js +0 -60
@@ -0,0 +1,265 @@
|
|
1
|
+
## setDeviceProperties
|
2
|
+
|
3
|
+
设置设备属性。
|
4
|
+
|
5
|
+
### 引入
|
6
|
+
|
7
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
8
|
+
|
9
|
+
```js
|
10
|
+
import { setDeviceProperties } from '@ray-js/ray'
|
11
|
+
```
|
12
|
+
|
13
|
+
### 参数
|
14
|
+
|
15
|
+
**SetDevicePropertiesParams**
|
16
|
+
|
17
|
+
| 属性 | 类型 | 必填 | 说明 |
|
18
|
+
| ------- | -------- | ---- | -------------------------------------------------- |
|
19
|
+
| devId | `string` | 是 | 设备 ID |
|
20
|
+
| propKvs | `string` | 是 | JSON 字符串,例如:`{"LOST_ALERTER_HELPER": true}` |
|
21
|
+
|
22
|
+
### 返回
|
23
|
+
|
24
|
+
**SetDevicePropertiesResponse**
|
25
|
+
|
26
|
+
`boolean`,表示设置是否成功。
|
27
|
+
|
28
|
+
### 函数定义示例
|
29
|
+
|
30
|
+
```typescript
|
31
|
+
/**
|
32
|
+
* 设置设备属性
|
33
|
+
*/
|
34
|
+
export function setDeviceProperties(
|
35
|
+
params: SetDevicePropertiesParams
|
36
|
+
): Promise<SetDevicePropertiesResponse>
|
37
|
+
```
|
38
|
+
|
39
|
+
## getDeviceProperties
|
40
|
+
|
41
|
+
查看设置的设备属性。
|
42
|
+
|
43
|
+
### 引入
|
44
|
+
|
45
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
46
|
+
|
47
|
+
```js
|
48
|
+
import { getDeviceProperties } from '@ray-js/ray'
|
49
|
+
```
|
50
|
+
|
51
|
+
### 参数
|
52
|
+
|
53
|
+
**GetDevicePropertiesParams**
|
54
|
+
|
55
|
+
| 属性 | 类型 | 必填 | 说明 |
|
56
|
+
| ----- | -------- | ---- | ------------------------------------------------------------- |
|
57
|
+
| devId | `string` | 是 | 设备 ID |
|
58
|
+
| props | `string` | 是 | 属性代码字符串,多个代码用逗号隔开,如:"LOST_ALERTER_HELPER" |
|
59
|
+
|
60
|
+
### 返回
|
61
|
+
|
62
|
+
**GetDevicePropertiesResponse**
|
63
|
+
|
64
|
+
`Record<string, string>`,返回参数键值对,key 为属性代码,值为对应状态字符串。
|
65
|
+
|
66
|
+
### 函数定义示例
|
67
|
+
|
68
|
+
```typescript
|
69
|
+
/**
|
70
|
+
* 查看设置的设备属性
|
71
|
+
*/
|
72
|
+
export function getDeviceProperties(
|
73
|
+
params: GetDevicePropertiesParams
|
74
|
+
): Promise<GetDevicePropertiesResponse>
|
75
|
+
```
|
76
|
+
|
77
|
+
## getMemberList
|
78
|
+
|
79
|
+
获取家庭成员基础信息列表。
|
80
|
+
|
81
|
+
### 引入
|
82
|
+
|
83
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
84
|
+
|
85
|
+
```js
|
86
|
+
import { getMemberList } from '@ray-js/ray'
|
87
|
+
```
|
88
|
+
|
89
|
+
### 参数
|
90
|
+
|
91
|
+
**MemberListParams**
|
92
|
+
|
93
|
+
| 属性 | 类型 | 必填 | 说明 |
|
94
|
+
| ----- | -------- | ---- | -------- |
|
95
|
+
| devId | `string` | 是 | 门锁编号 |
|
96
|
+
|
97
|
+
### 返回
|
98
|
+
|
99
|
+
**MemberListResponse**
|
100
|
+
|
101
|
+
`Array<MemberListResponseItem>`,包含家庭成员基础信息列表项。
|
102
|
+
|
103
|
+
### 函数定义示例
|
104
|
+
|
105
|
+
```typescript
|
106
|
+
/**
|
107
|
+
* 获取家庭成员基础信息列表
|
108
|
+
*/
|
109
|
+
export function getMemberList(params: MemberListParams): Promise<MemberListResponse>
|
110
|
+
```
|
111
|
+
|
112
|
+
## syncUnlockMode
|
113
|
+
|
114
|
+
解锁方式同步。
|
115
|
+
|
116
|
+
### 引入
|
117
|
+
|
118
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
119
|
+
|
120
|
+
```js
|
121
|
+
import { syncUnlockMode } from '@ray-js/ray'
|
122
|
+
```
|
123
|
+
|
124
|
+
### 参数
|
125
|
+
|
126
|
+
**UnlockSyncParams**
|
127
|
+
|
128
|
+
| 属性 | 类型 | 必填 | 说明 |
|
129
|
+
| ----- | --------------- | ---- | --------------------- |
|
130
|
+
| devId | `string` | 是 | 门锁编号 |
|
131
|
+
| dpIds | `Array<string>` | 是 | 需要同步的解锁方式 dp |
|
132
|
+
|
133
|
+
### 返回
|
134
|
+
|
135
|
+
**UnlockSyncResponse**
|
136
|
+
|
137
|
+
| 属性 | 类型 | 说明 |
|
138
|
+
| ----------- | -------- | ---------------------- |
|
139
|
+
| ins | `string` | 同步指令(仅协议部分) |
|
140
|
+
| distributed | `number` | 是否需要下发 |
|
141
|
+
| dpId | `number` | dp 点 |
|
142
|
+
|
143
|
+
### 函数定义示例
|
144
|
+
|
145
|
+
```typescript
|
146
|
+
/**
|
147
|
+
* 解锁方式同步
|
148
|
+
*/
|
149
|
+
export function syncUnlockMode(params: UnlockSyncParams): Promise<UnlockSyncResponse>
|
150
|
+
```
|
151
|
+
|
152
|
+
## queryDateFormat
|
153
|
+
|
154
|
+
查询时间对应的格式。
|
155
|
+
|
156
|
+
### 引入
|
157
|
+
|
158
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
159
|
+
|
160
|
+
```js
|
161
|
+
import { queryDateFormat } from '@ray-js/ray'
|
162
|
+
```
|
163
|
+
|
164
|
+
### 参数
|
165
|
+
|
166
|
+
**QueryDateFormatParams**
|
167
|
+
|
168
|
+
| 属性 | 类型 | 必填 | 说明 |
|
169
|
+
| ----- | -------- | ---- | ------- |
|
170
|
+
| devId | `string` | 是 | 设备 ID |
|
171
|
+
| uiId | `string` | 是 | 面板 ID |
|
172
|
+
|
173
|
+
### 返回
|
174
|
+
|
175
|
+
**QueryDateFormatResponse**
|
176
|
+
|
177
|
+
`string`,日期格式化格式。
|
178
|
+
|
179
|
+
### 函数定义示例
|
180
|
+
|
181
|
+
```typescript
|
182
|
+
/**
|
183
|
+
* 查询时间对应的格式
|
184
|
+
*/
|
185
|
+
export function queryDateFormat(params: QueryDateFormatParams): Promise<QueryDateFormatResponse>
|
186
|
+
```
|
187
|
+
|
188
|
+
## queryDeviceActiveDate
|
189
|
+
|
190
|
+
用户获取设备自身的激活时间(配网时间)。
|
191
|
+
|
192
|
+
### 引入
|
193
|
+
|
194
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
195
|
+
|
196
|
+
```js
|
197
|
+
import { queryDeviceActiveDate } from '@ray-js/ray'
|
198
|
+
```
|
199
|
+
|
200
|
+
### 参数
|
201
|
+
|
202
|
+
**QueryActiveDateParams**
|
203
|
+
|
204
|
+
| 属性 | 类型 | 必填 | 说明 |
|
205
|
+
| ----- | -------- | ---- | ------- |
|
206
|
+
| devId | `string` | 是 | 设备 ID |
|
207
|
+
|
208
|
+
### 返回
|
209
|
+
|
210
|
+
**QueryActiveDateResponse**
|
211
|
+
|
212
|
+
`string`,64 dp password_offline_time 最新数据。
|
213
|
+
|
214
|
+
### 函数定义示例
|
215
|
+
|
216
|
+
```typescript
|
217
|
+
/**
|
218
|
+
* 用户获取设备自身的激活时间(配网时间)
|
219
|
+
*/
|
220
|
+
export function queryDeviceActiveDate(
|
221
|
+
params: QueryActiveDateParams
|
222
|
+
): Promise<QueryActiveDateResponse>
|
223
|
+
```
|
224
|
+
|
225
|
+
## queryDeviceTrackDetails
|
226
|
+
|
227
|
+
获取设备位置。
|
228
|
+
|
229
|
+
### 引入
|
230
|
+
|
231
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
232
|
+
|
233
|
+
```js
|
234
|
+
import { queryDeviceTrackDetails } from '@ray-js/ray'
|
235
|
+
```
|
236
|
+
|
237
|
+
### 参数
|
238
|
+
|
239
|
+
**QueryTrackDetailsParams**
|
240
|
+
|
241
|
+
| 属性 | 类型 | 必填 | 说明 |
|
242
|
+
| --------- | -------- | ---- | -------- |
|
243
|
+
| devId | `string` | 是 | 设备 ID |
|
244
|
+
| startTime | `number` | 是 | 开始时间 |
|
245
|
+
| stopTime | `number` | 是 | 结束时间 |
|
246
|
+
|
247
|
+
### 返回
|
248
|
+
|
249
|
+
**QueryTrackDetailsResponse**
|
250
|
+
|
251
|
+
| 属性 | 类型 | 说明 |
|
252
|
+
| ---- | -------- | ---- |
|
253
|
+
| lat | `number` | 纬度 |
|
254
|
+
| lng | `number` | 经度 |
|
255
|
+
|
256
|
+
### 函数定义示例
|
257
|
+
|
258
|
+
```typescript
|
259
|
+
/**
|
260
|
+
* 获取设备位置
|
261
|
+
*/
|
262
|
+
export function queryDeviceTrackDetails(
|
263
|
+
params: QueryTrackDetailsParams
|
264
|
+
): Promise<QueryTrackDetailsResponse>
|
265
|
+
```
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export * from './old';
|
2
|
+
export * from './auth';
|
3
|
+
export * from './device';
|
4
|
+
export * from './log';
|
5
|
+
export * from './member-opmode';
|
6
|
+
export * from './member';
|
7
|
+
export * from './offline-pwd';
|
8
|
+
export * from './temp-pwd';
|
9
|
+
export * from './unlock';
|
10
|
+
export * from './unlock-method';
|
@@ -0,0 +1,20 @@
|
|
1
|
+
export * from './old';
|
2
|
+
|
3
|
+
// 授权相关
|
4
|
+
export * from './auth';
|
5
|
+
// 设备相关
|
6
|
+
export * from './device';
|
7
|
+
// 日志相关
|
8
|
+
export * from './log';
|
9
|
+
// 成员解锁相关
|
10
|
+
export * from './member-opmode';
|
11
|
+
// 用户相关
|
12
|
+
export * from './member';
|
13
|
+
// 离线临时密码相关
|
14
|
+
export * from './offline-pwd';
|
15
|
+
// 临时开锁相关
|
16
|
+
export * from './temp-pwd';
|
17
|
+
// 解锁相关
|
18
|
+
export * from './unlock';
|
19
|
+
// 解锁方式分配相关
|
20
|
+
export * from './unlock-method';
|
@@ -0,0 +1,113 @@
|
|
1
|
+
type LatestLogParams = {
|
2
|
+
devId: string;
|
3
|
+
};
|
4
|
+
type UnionUnlockInfo = {
|
5
|
+
userName?: string;
|
6
|
+
opMode?: string;
|
7
|
+
unlockName?: string;
|
8
|
+
currentUser?: boolean;
|
9
|
+
sn?: number;
|
10
|
+
};
|
11
|
+
type LatestLogResponse = {
|
12
|
+
exist: boolean;
|
13
|
+
logId: number;
|
14
|
+
logCategory: string;
|
15
|
+
logType: string;
|
16
|
+
recordType?: number;
|
17
|
+
unlockNameRosettaKey?: string;
|
18
|
+
currentUser?: boolean;
|
19
|
+
userId?: string;
|
20
|
+
userName?: string;
|
21
|
+
unlockName?: string;
|
22
|
+
time: number;
|
23
|
+
relateDevName?: string;
|
24
|
+
relateOpMode?: string;
|
25
|
+
unionUnlockInfo?: UnionUnlockInfo;
|
26
|
+
data?: string;
|
27
|
+
unReadCount?: number;
|
28
|
+
};
|
29
|
+
/**
|
30
|
+
* 查询最近一条日志记录
|
31
|
+
* @param {LatestLogParams} params - 包含设备Id的参数
|
32
|
+
* @returns {Promise<LatestLogResponse>} - 包含请求结果和状态的响应
|
33
|
+
*/
|
34
|
+
export declare const getLatestLog: (params: LatestLogParams) => Promise<LatestLogResponse>;
|
35
|
+
type UserAction = {
|
36
|
+
userType: number;
|
37
|
+
userId: number;
|
38
|
+
operClassify: number;
|
39
|
+
operType: number;
|
40
|
+
operDetail: string;
|
41
|
+
toUserType: number;
|
42
|
+
toUserId: number;
|
43
|
+
};
|
44
|
+
type MediaInfo = {
|
45
|
+
fileUrl: string;
|
46
|
+
fileKey: string;
|
47
|
+
mediaPath: string;
|
48
|
+
mediaBucket: string;
|
49
|
+
mediaKey: string;
|
50
|
+
};
|
51
|
+
type LogRecord = {
|
52
|
+
logId: number;
|
53
|
+
logCategory: number;
|
54
|
+
logType: string;
|
55
|
+
recordType?: number;
|
56
|
+
unlockNameRosettaKey?: string;
|
57
|
+
currentUser?: boolean;
|
58
|
+
userId?: string;
|
59
|
+
userName?: string;
|
60
|
+
memberBindableFlag: boolean;
|
61
|
+
unlockName?: string;
|
62
|
+
time: number;
|
63
|
+
relateDevName?: string;
|
64
|
+
relateOpMode?: string;
|
65
|
+
unionUnlockInfo?: string;
|
66
|
+
mediaInfoList?: MediaInfo[];
|
67
|
+
localOperateRecordInfo?: UserAction;
|
68
|
+
};
|
69
|
+
type QueryLogRecordParams = {
|
70
|
+
devId: string;
|
71
|
+
logCategories?: string[];
|
72
|
+
userIds?: string[];
|
73
|
+
onlyShowMediaRecord: boolean;
|
74
|
+
startTime?: number;
|
75
|
+
endTime?: number;
|
76
|
+
lastRowKey?: string;
|
77
|
+
limit: number;
|
78
|
+
};
|
79
|
+
type QueryLogRecordResponse = LogRecord[];
|
80
|
+
/**
|
81
|
+
* 查询日志记录
|
82
|
+
* @param {QueryLogRecordParams} params
|
83
|
+
* @returns {Promise<QueryLogRecordResponse>} - 包含请求结果和状态的响应
|
84
|
+
*/
|
85
|
+
export declare const queryLogRecord: (params: QueryLogRecordParams) => Promise<QueryLogRecordResponse>;
|
86
|
+
type UploadLogRecordResult = boolean;
|
87
|
+
type UploadLogRecordParams = {
|
88
|
+
devId: string;
|
89
|
+
logType: string;
|
90
|
+
data: string[];
|
91
|
+
};
|
92
|
+
/**
|
93
|
+
* 上报操作日志记录
|
94
|
+
* @param {UploadLogRecordParams} params
|
95
|
+
* @returns {Promise<UploadLogRecordResult>}
|
96
|
+
*/
|
97
|
+
export declare const uploadLogRecord: (params: UploadLogRecordParams) => Promise<UploadLogRecordResult>;
|
98
|
+
type QueryAlbumRecordParams = {
|
99
|
+
devId: string;
|
100
|
+
offset: number;
|
101
|
+
limit: number;
|
102
|
+
};
|
103
|
+
type QueryAlbumRecordResponse = {
|
104
|
+
eventTypes: string;
|
105
|
+
albumList: any[];
|
106
|
+
};
|
107
|
+
/**
|
108
|
+
* 分页获取获取可以查看的相册列表
|
109
|
+
* @param {QueryAlbumRecordParams} params
|
110
|
+
* @returns {Promise<QueryAlbumRecordResponse>}
|
111
|
+
*/
|
112
|
+
export declare const queryAlbumRecord: (params: QueryAlbumRecordParams) => Promise<QueryAlbumRecordResponse>;
|
113
|
+
export {};
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { THING } from '../../constants';
|
2
|
+
import requestCloud from '../../requestCloud';
|
3
|
+
/**
|
4
|
+
* 查询最近一条日志记录
|
5
|
+
* @param {LatestLogParams} params - 包含设备Id的参数
|
6
|
+
* @returns {Promise<LatestLogResponse>} - 包含请求结果和状态的响应
|
7
|
+
*/
|
8
|
+
export const getLatestLog = params => {
|
9
|
+
return requestCloud({
|
10
|
+
api: "".concat(THING, ".m.device.lock.log.latest"),
|
11
|
+
version: '1.0',
|
12
|
+
data: params
|
13
|
+
});
|
14
|
+
};
|
15
|
+
/**
|
16
|
+
* 查询日志记录
|
17
|
+
* @param {QueryLogRecordParams} params
|
18
|
+
* @returns {Promise<QueryLogRecordResponse>} - 包含请求结果和状态的响应
|
19
|
+
*/
|
20
|
+
export const queryLogRecord = params => {
|
21
|
+
return requestCloud({
|
22
|
+
api: "".concat(THING, ".m.device.lock.log.list"),
|
23
|
+
version: '1.0',
|
24
|
+
data: params
|
25
|
+
});
|
26
|
+
};
|
27
|
+
/**
|
28
|
+
* 上报操作日志记录
|
29
|
+
* @param {UploadLogRecordParams} params
|
30
|
+
* @returns {Promise<UploadLogRecordResult>}
|
31
|
+
*/
|
32
|
+
export const uploadLogRecord = params => {
|
33
|
+
return requestCloud({
|
34
|
+
api: "".concat(THING, ".m.device.lock.log.upload"),
|
35
|
+
version: '1.0',
|
36
|
+
data: params
|
37
|
+
});
|
38
|
+
};
|
39
|
+
|
40
|
+
// 2.4. m.lock.album.media.list
|
41
|
+
|
42
|
+
/**
|
43
|
+
* 分页获取获取可以查看的相册列表
|
44
|
+
* @param {QueryAlbumRecordParams} params
|
45
|
+
* @returns {Promise<QueryAlbumRecordResponse>}
|
46
|
+
*/
|
47
|
+
export const queryAlbumRecord = params => {
|
48
|
+
return requestCloud({
|
49
|
+
api: "".concat(THING, ".m.lock.album.media.list"),
|
50
|
+
version: '2.0',
|
51
|
+
data: params
|
52
|
+
});
|
53
|
+
};
|
@@ -0,0 +1,153 @@
|
|
1
|
+
## getLatestLog
|
2
|
+
|
3
|
+
查询最近一条日志记录。
|
4
|
+
|
5
|
+
### 引入
|
6
|
+
|
7
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
8
|
+
|
9
|
+
```js
|
10
|
+
import { getLatestLog } from '@ray-js/ray'
|
11
|
+
```
|
12
|
+
|
13
|
+
### 参数
|
14
|
+
|
15
|
+
**LatestLogParams**
|
16
|
+
|
17
|
+
| 属性 | 类型 | 必填 | 说明 |
|
18
|
+
| ----- | -------- | ---- | ------- |
|
19
|
+
| devId | `string` | 是 | 设备 ID |
|
20
|
+
|
21
|
+
### 返回
|
22
|
+
|
23
|
+
**LatestLogResponse**
|
24
|
+
|
25
|
+
结构包含日志记录的各种详细信息。
|
26
|
+
|
27
|
+
### 函数定义示例
|
28
|
+
|
29
|
+
```typescript
|
30
|
+
/**
|
31
|
+
* 查询最近一条日志记录
|
32
|
+
*/
|
33
|
+
export function getLatestLog(params: LatestLogParams): Promise<LatestLogResponse>
|
34
|
+
```
|
35
|
+
|
36
|
+
## queryLogRecord
|
37
|
+
|
38
|
+
查询日志记录。
|
39
|
+
|
40
|
+
### 引入
|
41
|
+
|
42
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
43
|
+
|
44
|
+
```js
|
45
|
+
import { queryLogRecord } from '@ray-js/ray'
|
46
|
+
```
|
47
|
+
|
48
|
+
### 参数
|
49
|
+
|
50
|
+
**QueryLogRecordParams**
|
51
|
+
|
52
|
+
| 属性 | 类型 | 必填 | 说明 |
|
53
|
+
| ------------------- | ---------- | ---- | ---------------------------- |
|
54
|
+
| devId | `string` | 是 | 设备 ID |
|
55
|
+
| logCategories | `string[]` | 否 | 日志大类 |
|
56
|
+
| userIds | `string[]` | 否 | 用户 ID 列表 |
|
57
|
+
| onlyShowMediaRecord | `boolean` | 是 | 是否仅显示带图片或视频的记录 |
|
58
|
+
| startTime | `number` | 否 | 开始时间 |
|
59
|
+
| endTime | `number` | 否 | 结束时间 |
|
60
|
+
| lastRowKey | `string` | 否 | 上一页的数据 key |
|
61
|
+
| limit | `number` | 是 | 每页数据个数 |
|
62
|
+
|
63
|
+
### 返回
|
64
|
+
|
65
|
+
**QueryLogRecordResponse**
|
66
|
+
|
67
|
+
`Array<LogRecord>`,包含日志记录的数组。
|
68
|
+
|
69
|
+
### 函数定义示例
|
70
|
+
|
71
|
+
```typescript
|
72
|
+
/**
|
73
|
+
* 查询日志记录
|
74
|
+
*/
|
75
|
+
export function queryLogRecord(params: QueryLogRecordParams): Promise<QueryLogRecordResponse>
|
76
|
+
```
|
77
|
+
|
78
|
+
## uploadLogRecord
|
79
|
+
|
80
|
+
上报操作日志记录。
|
81
|
+
|
82
|
+
### 引入
|
83
|
+
|
84
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
85
|
+
|
86
|
+
```js
|
87
|
+
import { uploadLogRecord } from '@ray-js/ray'
|
88
|
+
```
|
89
|
+
|
90
|
+
### 参数
|
91
|
+
|
92
|
+
**UploadLogRecordParams**
|
93
|
+
|
94
|
+
| 属性 | 类型 | 必填 | 说明 |
|
95
|
+
| ------- | ---------- | ---- | -------- |
|
96
|
+
| devId | `string` | 是 | 设备 ID |
|
97
|
+
| logType | `string` | 是 | 日志类型 |
|
98
|
+
| data | `string[]` | 是 | 业务参数 |
|
99
|
+
|
100
|
+
### 返回
|
101
|
+
|
102
|
+
**UploadLogRecordResult**
|
103
|
+
|
104
|
+
`boolean`,表示操作是否成功。
|
105
|
+
|
106
|
+
### 函数定义示例
|
107
|
+
|
108
|
+
```typescript
|
109
|
+
/**
|
110
|
+
* 上报操作日志记录
|
111
|
+
*/
|
112
|
+
export function uploadLogRecord(params: UploadLogRecordParams): Promise<UploadLogRecordResult>
|
113
|
+
```
|
114
|
+
|
115
|
+
## queryAlbumRecord
|
116
|
+
|
117
|
+
分页获取可以查看的相册列表。
|
118
|
+
|
119
|
+
### 引入
|
120
|
+
|
121
|
+
> @ray-js/ray^1.5.0 以上版本可使用
|
122
|
+
|
123
|
+
```js
|
124
|
+
import { queryAlbumRecord } from '@ray-js/ray'
|
125
|
+
```
|
126
|
+
|
127
|
+
### 参数
|
128
|
+
|
129
|
+
**QueryAlbumRecordParams**
|
130
|
+
|
131
|
+
| 属性 | 类型 | 必填 | 说明 |
|
132
|
+
| ------ | -------- | ---- | ------------ |
|
133
|
+
| devId | `string` | 是 | 设备 ID |
|
134
|
+
| offset | `number` | 是 | 起始页 |
|
135
|
+
| limit | `number` | 是 | 每页数据个数 |
|
136
|
+
|
137
|
+
### 返回
|
138
|
+
|
139
|
+
**QueryAlbumRecordResponse**
|
140
|
+
|
141
|
+
| 属性 | 类型 | 说明 |
|
142
|
+
| ---------- | -------- | ------------ |
|
143
|
+
| eventTypes | `string` | 事件类型 |
|
144
|
+
| albumList | `any[]` | 相册信息数组 |
|
145
|
+
|
146
|
+
### 函数定义示例
|
147
|
+
|
148
|
+
```typescript
|
149
|
+
/**
|
150
|
+
* 分页获取可以查看的相册列表
|
151
|
+
*/
|
152
|
+
export function queryAlbumRecord(params: QueryAlbumRecordParams): Promise<QueryAlbumRecordResponse>
|
153
|
+
```
|