@ray-js/api 1.5.35 → 1.5.37-alpha.0
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/lib/cloud/index.d.ts +1 -0
- package/lib/cloud/index.js +4 -1
- package/lib/getCdnUrl/index.thing.js +13 -8
- package/package.json +5 -5
- package/lib/cloud/doorlock/README.md +0 -62
- package/lib/cloud/doorlock/auth.md +0 -323
- package/lib/cloud/doorlock/device.md +0 -265
- package/lib/cloud/doorlock/log.md +0 -153
- package/lib/cloud/doorlock/member-opmode.md +0 -279
- package/lib/cloud/doorlock/member.md +0 -276
- package/lib/cloud/doorlock/offline-pwd.md +0 -155
- package/lib/cloud/doorlock/temp-pwd.md +0 -362
- package/lib/cloud/doorlock/unlock-method.md +0 -121
- package/lib/cloud/doorlock/unlock.md +0 -222
package/lib/cloud/index.d.ts
CHANGED
package/lib/cloud/index.js
CHANGED
@@ -7,11 +7,22 @@ const regionMap = {
|
|
7
7
|
WE: 'd2h2yqnfpu4gl5.cdn5th.com',
|
8
8
|
UE: 'usimagesd1448c85ulz2o4.cdn5th.com'
|
9
9
|
};
|
10
|
-
let
|
10
|
+
let _regionCode;
|
11
|
+
let getInternalRegionCode = () => {
|
12
|
+
if (!_regionCode) {
|
13
|
+
ty.getAppInfo({
|
14
|
+
success: function (res) {
|
15
|
+
_regionCode = res.regionCode;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
}
|
19
|
+
return 'EU';
|
20
|
+
};
|
11
21
|
export function getRegionCode() {
|
12
22
|
return new Promise((resolve, reject) => {
|
13
23
|
ty.getAppInfo({
|
14
24
|
success: function (res) {
|
25
|
+
_regionCode = res.regionCode;
|
15
26
|
resolve(res.regionCode);
|
16
27
|
},
|
17
28
|
fail: function (err) {
|
@@ -20,11 +31,6 @@ export function getRegionCode() {
|
|
20
31
|
});
|
21
32
|
});
|
22
33
|
}
|
23
|
-
ty.getAppInfo({
|
24
|
-
success: function (res) {
|
25
|
-
regionCode = res.regionCode;
|
26
|
-
}
|
27
|
-
});
|
28
34
|
export default function getCdnUrl(path, cdnMap, region) {
|
29
35
|
if (!cdnMap) {
|
30
36
|
console.warn('请传入cdnMap');
|
@@ -35,8 +41,7 @@ export default function getCdnUrl(path, cdnMap, region) {
|
|
35
41
|
console.warn('[App] cdn "' + path + '" is not exist.');
|
36
42
|
return path;
|
37
43
|
}
|
38
|
-
|
39
|
-
return cdnPath;
|
44
|
+
return 'https://' + regionMap[region || getInternalRegionCode()] + '/' + cdnShortPath;
|
40
45
|
}
|
41
46
|
export async function getCdnUrlAsync(path, cdnMap, region) {
|
42
47
|
if (!cdnMap) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.5.
|
3
|
+
"version": "1.5.37-alpha.0",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,14 +29,14 @@
|
|
29
29
|
"watch": "ray start --type=component"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@ray-js/framework": "1.5.
|
33
|
-
"@ray-js/router": "1.5.
|
32
|
+
"@ray-js/framework": "1.5.37-alpha.0",
|
33
|
+
"@ray-js/router": "1.5.37-alpha.0",
|
34
34
|
"@ray-js/wechat": "^0.2.9",
|
35
35
|
"base64-browser": "^1.0.1",
|
36
36
|
"query-string": "^7.1.3"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@ray-js/cli": "1.5.
|
39
|
+
"@ray-js/cli": "1.5.37-alpha.0",
|
40
40
|
"art-template": "^4.13.2",
|
41
41
|
"fs-extra": "^10.1.0",
|
42
42
|
"miniprogram-api-typings": "^3.12.2",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.com"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "5371da62b7b17d6d14c3a331229766c481b8d251"
|
50
50
|
}
|
@@ -1,62 +0,0 @@
|
|
1
|
-
## 门锁 API
|
2
|
-
|
3
|
-
> https://wiki.tuya-inc.com:7799/page/1782299639387521068#90E8B7
|
4
|
-
|
5
|
-
````
|
6
|
-
```javascript
|
7
|
-
let apis = [
|
8
|
-
'tuya.m.zigbee.lock.remotepwd.execute',
|
9
|
-
'tuya.m.device.lock.remote.unlock',
|
10
|
-
'tuya.m.device.lock.remote.unlock.available',
|
11
|
-
'tuya.m.device.lock.history.latest',
|
12
|
-
'tuya.m.device.lock.history.list',
|
13
|
-
'tuya.m.device.lock.log.latest',
|
14
|
-
'tuya.m.device.lock.log.list',
|
15
|
-
'tuya.m.device.lock.log.upload',
|
16
|
-
'tuya.m.lock.album.media.list',
|
17
|
-
'tuya.m.device.member.get',
|
18
|
-
'tuya.m.device.member.detail.list',
|
19
|
-
'tuya.m.device.member.remove',
|
20
|
-
'tuya.m.device.member.removed',
|
21
|
-
'tuya.m.device.lock.sync.batch',
|
22
|
-
'tuya.m.device.user.time.schedule.update',
|
23
|
-
'tuya.m.device.user.unlock.offline',
|
24
|
-
'tuya.m.device.member.opmode.pwd.validate',
|
25
|
-
'tuya.m.device.member.opmode.add',
|
26
|
-
'tuya.m.device.member.opmode.remove',
|
27
|
-
'tuya.m.device.user.verifycode.send',
|
28
|
-
'tuya.m.device.member.opmode.update',
|
29
|
-
'tuya.m.device.member.opmode.detail',
|
30
|
-
'tuya.m.device.dp.sn.get',
|
31
|
-
'tuya.m.device.lock.dynapwd.get',
|
32
|
-
'tuya.m.device.lock.temppwd.validate',
|
33
|
-
'tuya.m.device.lock.temppwd.validate_2.0',
|
34
|
-
'tuya.m.device.lock.temppwd.create',
|
35
|
-
'tuya.m.device.lock.temppwd.update',
|
36
|
-
'tuya.m.device.lock.temppwd.name',
|
37
|
-
'tuya.m.device.lock.temppwd.remove',
|
38
|
-
'tuya.m.device.lock.share.available',
|
39
|
-
'tuya.m.device.lock.offlinepwd.get',
|
40
|
-
'tuya.m.device.lock.offlinepwd.revoke',
|
41
|
-
'tuya.m.device.lock.offlinepwd.name.update',
|
42
|
-
'tuya.m.device.lock.offlinepwd.revocable',
|
43
|
-
'tuya.m.device.lock.auth.list',
|
44
|
-
'tuya.m.device.lock.auth.list.invalid',
|
45
|
-
'tuya.m.device.lock.auth.list.clear',
|
46
|
-
'tuya.m.device.lock.key.virtual.add',
|
47
|
-
'tuya.m.device.lock.key.virtual.update',
|
48
|
-
'tuya.m.device.lock.key.virtual.phase',
|
49
|
-
'tuya.m.device.lock.key.virtual.name',
|
50
|
-
'tuya.m.device.lock.key.virtual.remove',
|
51
|
-
'tuya.m.device.unlock.waitassign',
|
52
|
-
'tuya.m.device.unlock.assignlist',
|
53
|
-
'tuya.m.device.user.unlock.allocate',
|
54
|
-
'tuya.m.device.props.save',
|
55
|
-
'tuya.m.device.props.fetch',
|
56
|
-
'tuya.m.device.member.list',
|
57
|
-
'tuya.m.device.opmode.sync.rise',
|
58
|
-
'tuya.m.i18n.date.template.get',
|
59
|
-
'tuya.m.device.active.date',
|
60
|
-
'tuya.m.device.track.details'
|
61
|
-
]
|
62
|
-
````
|
@@ -1,323 +0,0 @@
|
|
1
|
-
## getLockAuthList
|
2
|
-
|
3
|
-
获取授权记录列表。
|
4
|
-
|
5
|
-
### 引入
|
6
|
-
|
7
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
8
|
-
|
9
|
-
```js
|
10
|
-
import { getLockAuthList } from '@ray-js/ray'
|
11
|
-
```
|
12
|
-
|
13
|
-
### 参数
|
14
|
-
|
15
|
-
**AuthListParams**
|
16
|
-
|
17
|
-
| 属性 | 类型 | 必填 | 说明 |
|
18
|
-
| --------- | --------------- | ---- | ------------ |
|
19
|
-
| devId | `string` | 是 | 设备 ID |
|
20
|
-
| authTypes | `Array<string>` | 是 | 授权类型数组 |
|
21
|
-
|
22
|
-
### 返回
|
23
|
-
|
24
|
-
**AuthListResult**
|
25
|
-
|
26
|
-
| 属性 | 类型 | 说明 |
|
27
|
-
| ---------- | ---------------------------- | ------------------------ |
|
28
|
-
| hasNext | `boolean` | 是否还有下一页 |
|
29
|
-
| totalCount | `number` | 总记录数 |
|
30
|
-
| datas | `Array<AuthListResultEntry>` | 授权记录列表结果条目数组 |
|
31
|
-
|
32
|
-
### 函数定义示例
|
33
|
-
|
34
|
-
```typescript
|
35
|
-
/**
|
36
|
-
* 获取授权记录列表
|
37
|
-
*/
|
38
|
-
export function getLockAuthList(params: AuthListParams): Promise<AuthListResult>
|
39
|
-
```
|
40
|
-
|
41
|
-
## getInvalidAuthList
|
42
|
-
|
43
|
-
获取已失效的授权记录列表。
|
44
|
-
|
45
|
-
### 引入
|
46
|
-
|
47
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
48
|
-
|
49
|
-
```js
|
50
|
-
import { getInvalidAuthList } from '@ray-js/ray'
|
51
|
-
```
|
52
|
-
|
53
|
-
### 参数
|
54
|
-
|
55
|
-
**InvalidAuthListParams**
|
56
|
-
|
57
|
-
| 属性 | 类型 | 必填 | 说明 |
|
58
|
-
| ------ | -------- | ---- | ---------- |
|
59
|
-
| devId | `string` | 是 | 设备 ID |
|
60
|
-
| offSet | `number` | 是 | 起始记录数 |
|
61
|
-
| limit | `number` | 是 | 每页个数 |
|
62
|
-
|
63
|
-
### 返回
|
64
|
-
|
65
|
-
**InvalidAuthListResult**
|
66
|
-
|
67
|
-
`Array<InvalidAuthListResultEntry>`,包含已失效的授权记录列表结果条目。
|
68
|
-
|
69
|
-
### 函数定义示例
|
70
|
-
|
71
|
-
```typescript
|
72
|
-
/**
|
73
|
-
* 获取已失效的授权记录列表
|
74
|
-
*/
|
75
|
-
export function getInvalidAuthList(params: InvalidAuthListParams): Promise<InvalidAuthListResult>
|
76
|
-
```
|
77
|
-
|
78
|
-
## clearInvalidAuthList
|
79
|
-
|
80
|
-
清空已失效的授权记录列表。
|
81
|
-
|
82
|
-
### 引入
|
83
|
-
|
84
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
85
|
-
|
86
|
-
```js
|
87
|
-
import { clearInvalidAuthList } from '@ray-js/ray'
|
88
|
-
```
|
89
|
-
|
90
|
-
### 参数
|
91
|
-
|
92
|
-
**ClearInvalidAuthListParams**
|
93
|
-
|
94
|
-
| 属性 | 类型 | 必填 | 说明 |
|
95
|
-
| ----- | -------- | ---- | ------- |
|
96
|
-
| devId | `string` | 是 | 设备 ID |
|
97
|
-
|
98
|
-
### 返回
|
99
|
-
|
100
|
-
**ClearInvalidAuthListResult**
|
101
|
-
|
102
|
-
`boolean`,表示是否成功清空列表。
|
103
|
-
|
104
|
-
### 函数定义示例
|
105
|
-
|
106
|
-
```typescript
|
107
|
-
/**
|
108
|
-
* 清空已失效的授权记录列表
|
109
|
-
*/
|
110
|
-
export function clearInvalidAuthList(
|
111
|
-
params: ClearInvalidAuthListParams
|
112
|
-
): Promise<ClearInvalidAuthListResult>
|
113
|
-
```
|
114
|
-
|
115
|
-
## addBluetoothAuth
|
116
|
-
|
117
|
-
添加蓝牙授权记录。
|
118
|
-
|
119
|
-
### 引入
|
120
|
-
|
121
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
122
|
-
|
123
|
-
```js
|
124
|
-
import { addBluetoothAuth } from '@ray-js/ray'
|
125
|
-
```
|
126
|
-
|
127
|
-
### 参数
|
128
|
-
|
129
|
-
**AddBluetoothAuthParams**
|
130
|
-
|
131
|
-
| 属性 | 类型 | 必填 | 说明 |
|
132
|
-
| ------------- | ---------- | ---- | ---------------- |
|
133
|
-
| devId | `string` | 是 | 设备 ID |
|
134
|
-
| timeSetType | `number` | 是 | 时效类型 |
|
135
|
-
| effectiveTime | `number` | 是 | 生效时间 |
|
136
|
-
| invalidTime | `number` | 是 | 失效时间 |
|
137
|
-
| availTime | `number` | 否 | 可用次数 |
|
138
|
-
| name | `string` | 是 | 名称 |
|
139
|
-
| schedule | `Schedule` | 否 | 周期设置 |
|
140
|
-
| countryCode | `string` | 是 | 国家码 |
|
141
|
-
| account | `string` | 是 | 账号 |
|
142
|
-
| offlineUnlock | `boolean` | 是 | 是否支持离线解锁 |
|
143
|
-
|
144
|
-
### 返回
|
145
|
-
|
146
|
-
**AddBluetoothAuthResult**
|
147
|
-
|
148
|
-
| 属性 | 类型 | 说明 |
|
149
|
-
| --------------- | --------- | ---------------------- |
|
150
|
-
| unlockBindingId | `string` | 临时蓝牙开锁对应的序号 |
|
151
|
-
| name | `string` | 名称 |
|
152
|
-
| userExist | `boolean` | 用户是否已注册涂鸦智能 |
|
153
|
-
|
154
|
-
### 函数定义示例
|
155
|
-
|
156
|
-
```typescript
|
157
|
-
/**
|
158
|
-
* 添加蓝牙授权记录
|
159
|
-
*/
|
160
|
-
export function addBluetoothAuth(params: AddBluetoothAuthParams): Promise<AddBluetoothAuthResult>
|
161
|
-
```
|
162
|
-
|
163
|
-
## updateBluetoothKey
|
164
|
-
|
165
|
-
修改蓝牙钥匙信息。
|
166
|
-
|
167
|
-
### 引入
|
168
|
-
|
169
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
170
|
-
|
171
|
-
```js
|
172
|
-
import { updateBluetoothKey } from '@ray-js/ray'
|
173
|
-
```
|
174
|
-
|
175
|
-
### 参数
|
176
|
-
|
177
|
-
**UpdateBluetoothKeyParams**
|
178
|
-
|
179
|
-
| 属性 | 类型 | 必填 | 说明 |
|
180
|
-
| --------------- | ---------------- | ---- | ---------------------- |
|
181
|
-
| devId | `string` | 是 | 设备 ID |
|
182
|
-
| unlockBindingId | `string` | 是 | 临时蓝牙开锁对应的序号 |
|
183
|
-
| offlineUnlock | `boolean` | 是 | 是否支持离线解锁 |
|
184
|
-
| timeSetType | `number` | 是 | 时效类型 |
|
185
|
-
| effectiveTime | `number` | 是 | 生效时间 |
|
186
|
-
| invalidTime | `number` | 是 | 失效时间 |
|
187
|
-
| availTime | `number` | 否 | 可用次数 |
|
188
|
-
| name | `string` | 否 | 名称 |
|
189
|
-
| phase | `number` | 否 | 状态 |
|
190
|
-
| schedule | `UpdateSchedule` | 否 | 周期设置 |
|
191
|
-
|
192
|
-
### 返回
|
193
|
-
|
194
|
-
**UpdateBluetoothKeyResult**
|
195
|
-
|
196
|
-
`boolean`,表示修改是否成功。
|
197
|
-
|
198
|
-
### 函数定义示例
|
199
|
-
|
200
|
-
```typescript
|
201
|
-
/**
|
202
|
-
* 修改蓝牙钥匙信息
|
203
|
-
*/
|
204
|
-
export function updateBluetoothKey(
|
205
|
-
params: UpdateBluetoothKeyParams
|
206
|
-
): Promise<UpdateBluetoothKeyResult>
|
207
|
-
```
|
208
|
-
|
209
|
-
## freezeUnfreezeBluetoothKey
|
210
|
-
|
211
|
-
冻结或解冻蓝牙钥匙。
|
212
|
-
|
213
|
-
### 引入
|
214
|
-
|
215
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
216
|
-
|
217
|
-
```js
|
218
|
-
import { freezeUnfreezeBluetoothKey } from '@ray-js/ray'
|
219
|
-
```
|
220
|
-
|
221
|
-
### 参数
|
222
|
-
|
223
|
-
**FreezeUnfreezeBluetoothKeyParams**
|
224
|
-
|
225
|
-
| 属性 | 类型 | 必填 | 说明 |
|
226
|
-
| --------------- | -------- | ---- | ---------------------- |
|
227
|
-
| devId | `string` | 是 | 设备 ID |
|
228
|
-
| unlockBindingId | `string` | 是 | 临时蓝牙开锁对应的序号 |
|
229
|
-
| phase | `number` | 否 | 状态:2. 正常 4. 冻结 |
|
230
|
-
|
231
|
-
### 返回
|
232
|
-
|
233
|
-
**FreezeUnfreezeBluetoothKeyResult**
|
234
|
-
|
235
|
-
`boolean`,表示冻结或解冻是否成功。
|
236
|
-
|
237
|
-
### 函数定义示例
|
238
|
-
|
239
|
-
```typescript
|
240
|
-
/**
|
241
|
-
* 冻结或解冻蓝牙钥匙
|
242
|
-
*/
|
243
|
-
export function freezeUnfreezeBluetoothKey(
|
244
|
-
params: FreezeUnfreezeBluetoothKeyParams
|
245
|
-
): Promise<FreezeUnfreezeBluetoothKeyResult>
|
246
|
-
```
|
247
|
-
|
248
|
-
## changeBluetoothKeyName
|
249
|
-
|
250
|
-
修改蓝牙钥匙名称。
|
251
|
-
|
252
|
-
### 引入
|
253
|
-
|
254
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
255
|
-
|
256
|
-
```js
|
257
|
-
import { changeBluetoothKeyName } from '@ray-js/ray'
|
258
|
-
```
|
259
|
-
|
260
|
-
### 参数
|
261
|
-
|
262
|
-
**ChangeBluetoothKeyNameParams**
|
263
|
-
|
264
|
-
| 属性 | 类型 | 必填 | 说明 |
|
265
|
-
| --------------- | -------- | ---- | ---------------------- |
|
266
|
-
| devId | `string` | 是 | 设备 ID |
|
267
|
-
| unlockBindingId | `string` | 是 | 临时蓝牙开锁对应的序号 |
|
268
|
-
| name | `string` | 是 | 新名称 |
|
269
|
-
|
270
|
-
### 返回
|
271
|
-
|
272
|
-
**ChangeBluetoothKeyNameResult**
|
273
|
-
|
274
|
-
`boolean`,表示修改名称是否成功。
|
275
|
-
|
276
|
-
### 函数定义示例
|
277
|
-
|
278
|
-
```typescript
|
279
|
-
/**
|
280
|
-
* 修改蓝牙钥匙名称
|
281
|
-
*/
|
282
|
-
export function changeBluetoothKeyName(
|
283
|
-
params: ChangeBluetoothKeyNameParams
|
284
|
-
): Promise<ChangeBluetoothKeyNameResult>
|
285
|
-
```
|
286
|
-
|
287
|
-
## removeBluetoothKeyAuthorization
|
288
|
-
|
289
|
-
删除蓝牙钥匙授权。
|
290
|
-
|
291
|
-
### 引入
|
292
|
-
|
293
|
-
> @ray-js/ray^1.5.0 以上版本可使用
|
294
|
-
|
295
|
-
```js
|
296
|
-
import { removeBluetoothKeyAuthorization } from '@ray-js/ray'
|
297
|
-
```
|
298
|
-
|
299
|
-
### 参数
|
300
|
-
|
301
|
-
**RemoveBluetoothKeyParams**
|
302
|
-
|
303
|
-
| 属性 | 类型 | 必填 | 说明 |
|
304
|
-
| --------------- | -------- | ---- | ---------------------- |
|
305
|
-
| devId | `string` | 是 | 设备 ID |
|
306
|
-
| unlockBindingId | `string` | 是 | 临时蓝牙开锁对应的序号 |
|
307
|
-
|
308
|
-
### 返回
|
309
|
-
|
310
|
-
**RemoveBluetoothKeyResult**
|
311
|
-
|
312
|
-
`boolean`,表示删除授权是否成功。
|
313
|
-
|
314
|
-
### 函数定义示例
|
315
|
-
|
316
|
-
```typescript
|
317
|
-
/**
|
318
|
-
* 删除蓝牙钥匙授权
|
319
|
-
*/
|
320
|
-
export function removeBluetoothKeyAuthorization(
|
321
|
-
params: RemoveBluetoothKeyParams
|
322
|
-
): Promise<RemoveBluetoothKeyResult>
|
323
|
-
```
|