@ray-js/api 1.5.0-beta.11 → 1.5.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.
Files changed (136) hide show
  1. package/@types/BaseKit.d.ts +246 -126
  2. package/@types/BizKit.d.ts +1 -1
  3. package/@types/MapKit.d.ts +237 -1
  4. package/@types/MiniKit.d.ts +1 -1
  5. package/@types/OutdoorKit.d.ts +232 -0
  6. package/@types/P2PKit.d.ts +24 -2
  7. package/@types/all-kits.d.ts +1 -0
  8. package/@types/api-extend.d.ts +8 -2
  9. package/@types/index.d.ts +87 -0
  10. package/lib/{BaseKit-3.3.10.d.ts → BaseKit-3.11.0.d.ts} +1 -0
  11. package/lib/{BaseKit-3.3.10.js → BaseKit-3.11.0.js} +6 -2
  12. package/lib/BizKit-3.2.7.js +2 -1
  13. package/lib/DeviceKit-3.3.1.js +2 -1
  14. package/lib/HomeKit-3.1.4.js +2 -1
  15. package/lib/{MapKit-3.0.7.d.ts → MapKit-3.4.13.d.ts} +5 -0
  16. package/lib/{MapKit-3.0.7.js → MapKit-3.4.13.js} +19 -1
  17. package/lib/MiniKit-3.1.0.js +3 -2
  18. package/lib/OutdoorKit-1.0.4.d.ts +14 -0
  19. package/lib/OutdoorKit-1.0.4.js +39 -0
  20. package/lib/P2PKit-2.0.3.d.ts +1 -0
  21. package/lib/P2PKit-2.0.3.js +5 -1
  22. package/lib/PlayNetKit-1.1.3.d.ts +24 -25
  23. package/lib/PlayNetKit-1.1.3.js +2 -1
  24. package/lib/all-kits.d.ts +3 -2
  25. package/lib/all-kits.js +3 -2
  26. package/lib/cloud/device.d.ts +25 -1
  27. package/lib/cloud/device.js +15 -1
  28. package/lib/cloud/doorlock/README.md +62 -0
  29. package/lib/cloud/doorlock/auth.d.ts +235 -0
  30. package/lib/cloud/doorlock/auth.js +223 -0
  31. package/lib/cloud/doorlock/auth.md +323 -0
  32. package/lib/cloud/doorlock/device.d.ts +137 -0
  33. package/lib/cloud/doorlock/device.js +187 -0
  34. package/lib/cloud/doorlock/device.md +265 -0
  35. package/lib/cloud/doorlock/index.d.ts +10 -0
  36. package/lib/cloud/doorlock/index.js +20 -0
  37. package/lib/cloud/doorlock/log.d.ts +113 -0
  38. package/lib/cloud/doorlock/log.js +53 -0
  39. package/lib/cloud/doorlock/log.md +153 -0
  40. package/lib/cloud/doorlock/member-opmode.d.ts +121 -0
  41. package/lib/cloud/doorlock/member-opmode.js +104 -0
  42. package/lib/cloud/doorlock/member-opmode.md +279 -0
  43. package/lib/cloud/doorlock/member.d.ts +110 -0
  44. package/lib/cloud/doorlock/member.js +72 -0
  45. package/lib/cloud/doorlock/member.md +276 -0
  46. package/lib/cloud/doorlock/offline-pwd.d.ts +61 -0
  47. package/lib/cloud/doorlock/offline-pwd.js +67 -0
  48. package/lib/cloud/doorlock/offline-pwd.md +155 -0
  49. package/lib/cloud/doorlock/old.d.ts +36 -0
  50. package/lib/cloud/doorlock/old.js +102 -0
  51. package/lib/cloud/doorlock/temp-pwd.d.ts +194 -0
  52. package/lib/cloud/doorlock/temp-pwd.js +193 -0
  53. package/lib/cloud/doorlock/temp-pwd.md +362 -0
  54. package/lib/cloud/doorlock/unlock-method.d.ts +62 -0
  55. package/lib/cloud/doorlock/unlock-method.js +85 -0
  56. package/lib/cloud/doorlock/unlock-method.md +121 -0
  57. package/lib/cloud/doorlock/unlock.d.ts +89 -0
  58. package/lib/cloud/doorlock/unlock.js +76 -0
  59. package/lib/cloud/doorlock/unlock.md +222 -0
  60. package/lib/cloud/index.d.ts +4 -0
  61. package/lib/cloud/index.js +10 -1
  62. package/lib/cloud/interface.d.ts +39 -2
  63. package/lib/cloud/linkage.d.ts +8 -5
  64. package/lib/cloud/linkage.js +30 -9
  65. package/lib/cloud/outdoor.d.ts +15 -0
  66. package/lib/cloud/outdoor.js +25 -0
  67. package/lib/cloud/recipe/README.md +36 -0
  68. package/lib/cloud/recipe/basket.d.ts +220 -0
  69. package/lib/cloud/recipe/basket.js +328 -0
  70. package/lib/cloud/recipe/basket.md +431 -0
  71. package/lib/cloud/recipe/category-list.d.ts +71 -0
  72. package/lib/cloud/recipe/category-list.js +65 -0
  73. package/lib/cloud/recipe/category-list.md +132 -0
  74. package/lib/cloud/recipe/custom.d.ts +177 -0
  75. package/lib/cloud/recipe/custom.js +171 -0
  76. package/lib/cloud/recipe/custom.md +265 -0
  77. package/lib/cloud/recipe/index.d.ts +8 -0
  78. package/lib/cloud/recipe/index.js +8 -0
  79. package/lib/cloud/recipe/menu.d.ts +170 -0
  80. package/lib/cloud/recipe/menu.js +76 -0
  81. package/lib/cloud/recipe/menu.md +276 -0
  82. package/lib/cloud/recipe/query.d.ts +87 -0
  83. package/lib/cloud/recipe/query.js +101 -0
  84. package/lib/cloud/recipe/query.md +112 -0
  85. package/lib/cloud/recipe/record.d.ts +54 -0
  86. package/lib/cloud/recipe/record.js +87 -0
  87. package/lib/cloud/recipe/record.md +115 -0
  88. package/lib/cloud/recipe/score.d.ts +69 -0
  89. package/lib/cloud/recipe/score.js +106 -0
  90. package/lib/cloud/recipe/score.md +112 -0
  91. package/lib/cloud/recipe/star.d.ts +131 -0
  92. package/lib/cloud/recipe/star.js +151 -0
  93. package/lib/cloud/recipe/star.md +196 -0
  94. package/lib/cloud/recipe/types.d.ts +7 -0
  95. package/lib/cloud/recipe/types.js +0 -0
  96. package/lib/cloud/remoteGroup.d.ts +10 -0
  97. package/lib/cloud/remoteGroup.js +31 -0
  98. package/lib/constants.js +1 -1
  99. package/lib/errorCode.d.ts +4 -0
  100. package/lib/errorCode.js +3 -0
  101. package/lib/getCdnUrl/index.d.ts +2 -2
  102. package/lib/getCdnUrl/index.js +1 -2
  103. package/lib/getCdnUrl/index.wechat.d.ts +2 -2
  104. package/lib/getCdnUrl/index.wechat.js +1 -2
  105. package/lib/index.d.ts +1 -0
  106. package/lib/index.js +1 -0
  107. package/lib/nativeRouters/common.d.ts +15 -0
  108. package/lib/nativeRouters/common.js +38 -0
  109. package/lib/nativeRouters/device.d.ts +59 -0
  110. package/lib/nativeRouters/device.js +69 -0
  111. package/lib/nativeRouters/gw.d.ts +23 -0
  112. package/lib/nativeRouters/gw.js +27 -0
  113. package/lib/nativeRouters/index.d.ts +6 -1
  114. package/lib/nativeRouters/index.js +6 -1
  115. package/lib/nativeRouters/ipc.d.ts +30 -0
  116. package/lib/nativeRouters/ipc.js +44 -0
  117. package/lib/nativeRouters/outdoors.d.ts +47 -0
  118. package/lib/nativeRouters/outdoors.js +41 -0
  119. package/lib/nativeRouters/remoteGroup.d.ts +22 -0
  120. package/lib/nativeRouters/remoteGroup.js +11 -0
  121. package/lib/nativeRouters/root.d.ts +41 -0
  122. package/lib/nativeRouters/root.js +53 -0
  123. package/lib/openGroupCreate/index.js +3 -3
  124. package/lib/panel/i18n/index.d.ts +7 -6
  125. package/lib/panel/i18n/index.js +26 -11
  126. package/lib/panel/normalizeNetwork.js +1 -1
  127. package/lib/utils.d.ts +5 -2
  128. package/lib/utils.js +46 -20
  129. package/lib/utils.wechat.d.ts +3 -0
  130. package/lib/utils.wechat.js +17 -1
  131. package/lib/viewAPI.d.ts +1 -0
  132. package/lib/viewAPI.js +4 -3
  133. package/package.json +9 -8
  134. package/@types/PlayNetKit.d.ts +0 -444
  135. package/lib/nativeRouters/scene.d.ts +0 -34
  136. package/lib/nativeRouters/scene.js +0 -60
@@ -0,0 +1,110 @@
1
+ type CurrentMemberInfoResult = {
2
+ userId: number;
3
+ lockUserId: number;
4
+ userType: number;
5
+ allOpenDps: string;
6
+ allOpenType: Array<number>;
7
+ productAttribute: number;
8
+ phase: number;
9
+ expireTime: number;
10
+ expireDate: number;
11
+ };
12
+ type CurrentMemberInfoParams = {
13
+ devId: string;
14
+ dpIds: string;
15
+ };
16
+ export declare const getCurrentMemberInfo: (params: CurrentMemberInfoParams) => Promise<CurrentMemberInfoResult>;
17
+ type UnlockDetail = {
18
+ dpId: number;
19
+ count: number;
20
+ unlockList: Array<{
21
+ unlockId: string;
22
+ opModeId: number;
23
+ unlockName: string;
24
+ unlockAttr: number;
25
+ admin: boolean;
26
+ }>;
27
+ };
28
+ type ScheduleDetails = {
29
+ effectiveTime: number;
30
+ invalidTime: number;
31
+ workingDay: number;
32
+ timeZoneId: string;
33
+ allDay: boolean;
34
+ };
35
+ type TimeScheduleInfo = {
36
+ permanent: boolean;
37
+ timeSetShifted: boolean;
38
+ userTimeSet: string;
39
+ effectiveTime: number;
40
+ expiredTime: number;
41
+ scheduleDetails: Array<ScheduleDetails>;
42
+ };
43
+ type FamilyMemberWithUnlockDetail = {
44
+ avatarUrl: string;
45
+ lockUserId: number;
46
+ nickName: string;
47
+ userType: number;
48
+ backHomeNotifyAttr: number;
49
+ userContact: string;
50
+ offlineUnlock: boolean;
51
+ userId: string;
52
+ unlockDetail: UnlockDetail[];
53
+ timeScheduleInfo: TimeScheduleInfo;
54
+ };
55
+ type FamilyMemberListWithUnlockCountResult = Array<FamilyMemberWithUnlockDetail>;
56
+ type FamilyMemberListWithUnlockCountParams = {
57
+ devId: string;
58
+ dpIds: Array<number>;
59
+ };
60
+ export declare const getFamilyMemberListWithUnlockCount: (params: FamilyMemberListWithUnlockCountParams) => Promise<FamilyMemberListWithUnlockCountResult>;
61
+ type FamilyMemberRemovalResult = boolean;
62
+ type FamilyMemberRemovalParams = {
63
+ devId: string;
64
+ userId: string;
65
+ };
66
+ export declare const removeFamilyMember: (params: FamilyMemberRemovalParams) => Promise<FamilyMemberRemovalResult>;
67
+ type UserDeletionQueryResult = Array<{
68
+ userId: number;
69
+ lockUserId: number;
70
+ }>;
71
+ type UserDeletionQueryParams = {
72
+ devId: string;
73
+ };
74
+ export declare const queryUserDeletion: (params: UserDeletionQueryParams) => Promise<UserDeletionQueryResult>;
75
+ type LockSyncBatchResult = {
76
+ lockRandom: {
77
+ devUnlockId: string;
78
+ distributed: boolean;
79
+ ins: string;
80
+ };
81
+ lockFitting: {
82
+ dpId: number;
83
+ distributed: boolean;
84
+ ins: Array<any>;
85
+ };
86
+ lockRecord: string;
87
+ removedUser: Array<{
88
+ userId: number;
89
+ lockUserId: number;
90
+ }>;
91
+ };
92
+ type LockSyncBatchParams = {
93
+ devId: string;
94
+ };
95
+ export declare const syncLockBatch: (params: LockSyncBatchParams) => Promise<LockSyncBatchResult>;
96
+ type UpdateUserTimeScheduleResult = boolean;
97
+ type UpdateUserTimeScheduleParams = {
98
+ devId: string;
99
+ userId: string;
100
+ timeScheduleInfo: TimeScheduleInfo;
101
+ };
102
+ export declare const updateUserTimeSchedule: (params: UpdateUserTimeScheduleParams) => Promise<UpdateUserTimeScheduleResult>;
103
+ type OpenCloseOfflineUnlockResult = boolean;
104
+ type OpenCloseOfflineUnlockParams = {
105
+ devId: string;
106
+ userId: string;
107
+ enable: boolean;
108
+ };
109
+ export declare const openCloseOfflineUnlock: (params: OpenCloseOfflineUnlockParams) => Promise<OpenCloseOfflineUnlockResult>;
110
+ export {};
@@ -0,0 +1,72 @@
1
+ import { THING } from '../../constants';
2
+ import requestCloud from '../../requestCloud';
3
+
4
+ // 3.1. 获取当前登陆用户信息
5
+
6
+ export const getCurrentMemberInfo = params => {
7
+ return requestCloud({
8
+ api: "".concat(THING, ".m.device.member.get"),
9
+ version: '3.0',
10
+ data: params
11
+ });
12
+ };
13
+
14
+ // 3.2. 获取家庭成员列表(带解锁方式个数)
15
+
16
+ export const getFamilyMemberListWithUnlockCount = params => {
17
+ return requestCloud({
18
+ api: "".concat(THING, ".m.device.member.detail.list"),
19
+ version: '2.0',
20
+ data: params
21
+ });
22
+ };
23
+
24
+ // 3.3. 家庭成员移除成功通知
25
+
26
+ export const removeFamilyMember = params => {
27
+ return requestCloud({
28
+ api: "".concat(THING, ".m.device.member.remove"),
29
+ version: '2.0',
30
+ data: params
31
+ });
32
+ };
33
+
34
+ // 3.4. 查询是否有家庭里已删除但是门锁端未删除且有设置硬件解锁方式的成员
35
+
36
+ export const queryUserDeletion = params => {
37
+ return requestCloud({
38
+ api: "".concat(THING, ".m.device.member.removed"),
39
+ version: '1.0',
40
+ data: params
41
+ });
42
+ };
43
+
44
+ // 3.5. 门锁批量同步
45
+
46
+ export const syncLockBatch = params => {
47
+ return requestCloud({
48
+ api: "".concat(THING, ".m.device.lock.sync.batch"),
49
+ version: '1.0',
50
+ data: params
51
+ });
52
+ };
53
+
54
+ // 3.6. 更新用户时效
55
+
56
+ export const updateUserTimeSchedule = params => {
57
+ return requestCloud({
58
+ api: "".concat(THING, ".m.device.user.time.schedule.update"),
59
+ version: '1.0',
60
+ data: params
61
+ });
62
+ };
63
+
64
+ // 3.7. 打开/关闭离线解锁开关
65
+
66
+ export const openCloseOfflineUnlock = params => {
67
+ return requestCloud({
68
+ api: "".concat(THING, ".m.device.user.unlock.offline"),
69
+ version: '1.0',
70
+ data: params
71
+ });
72
+ };
@@ -0,0 +1,276 @@
1
+ ## getCurrentMemberInfo
2
+
3
+ 获取当前登录用户信息。
4
+
5
+ ### 引入
6
+
7
+ > @ray-js/ray^1.5.0 以上版本可使用
8
+
9
+ ```js
10
+ import { getCurrentMemberInfo } from '@ray-js/ray'
11
+ ```
12
+
13
+ ### 参数
14
+
15
+ **CurrentMemberInfoParams**
16
+
17
+ | 属性 | 类型 | 必填 | 说明 |
18
+ | ----- | -------- | ---- | --------- |
19
+ | devId | `string` | 是 | 设备 ID |
20
+ | dpIds | `string` | 是 | 数据点 ID |
21
+
22
+ ### 返回
23
+
24
+ **CurrentMemberInfoResult**
25
+
26
+ | 属性 | 类型 | 说明 |
27
+ | ---------------- | --------------- | ------------------ |
28
+ | userId | `number` | 用户 ID |
29
+ | lockUserId | `number` | 锁用户 ID |
30
+ | userType | `number` | 用户类型 |
31
+ | allOpenDps | `string` | 所有开放的数据点 |
32
+ | allOpenType | `Array<number>` | 所有开放类型的数组 |
33
+ | productAttribute | `number` | 产品属性 |
34
+ | phase | `number` | 阶段 |
35
+ | expireTime | `number` | 过期时间 |
36
+ | expireDate | `number` | 过期日期 |
37
+
38
+ ### 函数定义示例
39
+
40
+ ```typescript
41
+ /**
42
+ * 获取当前登录用户信息
43
+ */
44
+ export function getCurrentMemberInfo(
45
+ params: CurrentMemberInfoParams
46
+ ): Promise<CurrentMemberInfoResult>
47
+ ```
48
+
49
+ ## getFamilyMemberListWithUnlockCount
50
+
51
+ 获取家庭成员列表(带解锁方式个数)。
52
+
53
+ ### 引入
54
+
55
+ > @ray-js/ray^1.5.0 以上版本可使用
56
+
57
+ ```js
58
+ import { getFamilyMemberListWithUnlockCount } from '@ray-js/ray'
59
+ ```
60
+
61
+ ### 参数
62
+
63
+ **FamilyMemberListWithUnlockCountParams**
64
+
65
+ | 属性 | 类型 | 必填 | 说明 |
66
+ | ----- | --------------- | ---- | -------------- |
67
+ | devId | `string` | 是 | 设备 ID |
68
+ | dpIds | `Array<number>` | 是 | 数据点 ID 数组 |
69
+
70
+ ### 返回
71
+
72
+ **FamilyMemberListWithUnlockCountResult**
73
+
74
+ `Array<FamilyMemberWithUnlockDetail>`,家庭成员列表数组。
75
+
76
+ ### 函数定义示例
77
+
78
+ ```typescript
79
+ /**
80
+ * 获取家庭成员列表(带解锁方式个数)
81
+ */
82
+ export function getFamilyMemberListWithUnlockCount(
83
+ params: FamilyMemberListWithUnlockCountParams
84
+ ): Promise<FamilyMemberListWithUnlockCountResult>
85
+ ```
86
+
87
+ ## removeFamilyMember
88
+
89
+ 家庭成员移除成功通知。
90
+
91
+ ### 引入
92
+
93
+ > @ray-js/ray^1.5.0 以上版本可使用
94
+
95
+ ```js
96
+ import { removeFamilyMember } from '@ray-js/ray'
97
+ ```
98
+
99
+ ### 参数
100
+
101
+ **FamilyMemberRemovalParams**
102
+
103
+ | 属性 | 类型 | 必填 | 说明 |
104
+ | ------ | -------- | ---- | ------- |
105
+ | devId | `string` | 是 | 设备 ID |
106
+ | userId | `string` | 是 | 用户 ID |
107
+
108
+ ### 返回
109
+
110
+ **FamilyMemberRemovalResult**
111
+
112
+ `boolean`,表示操作是否成功。
113
+
114
+ ### 函数定义示例
115
+
116
+ ```typescript
117
+ /**
118
+ * 家庭成员移除成功通知
119
+ */
120
+ export function removeFamilyMember(
121
+ params: FamilyMemberRemovalParams
122
+ ): Promise<FamilyMemberRemovalResult>
123
+ ```
124
+
125
+ ## queryUserDeletion
126
+
127
+ 查询是否有家庭里已删除但是门锁端未删除且有设置硬件解锁方式的成员。
128
+
129
+ ### 引入
130
+
131
+ > @ray-js/ray^1.5.0 以上版本可使用
132
+
133
+ ```js
134
+ import { queryUserDeletion } from '@ray-js/ray'
135
+ ```
136
+
137
+ ### 参数
138
+
139
+ **UserDeletionQueryParams**
140
+
141
+ | 属性 | 类型 | 必填 | 说明 |
142
+ | ----- | -------- | ---- | ------- |
143
+ | devId | `string` | 是 | 设备 ID |
144
+
145
+ ### 返回
146
+
147
+ **UserDeletionQueryResult**
148
+
149
+ `Array<{ userId: number, lockUserId: number }>`,数组包含已删除用户的 ID 和锁用户 ID。
150
+
151
+ ### 函数定义示例
152
+
153
+ ```typescript
154
+ /**
155
+ * 查询是否有家庭里已删除但是门锁端未删除且有设置硬件解锁方式的成员
156
+ */
157
+ export function queryUserDeletion(params: UserDeletionQueryParams): Promise<UserDeletionQueryResult>
158
+ ```
159
+
160
+ ## syncLockBatch
161
+
162
+ 门锁批量同步。
163
+
164
+ ### 引入
165
+
166
+ > @ray-js/ray^1.5.0 以上版本可使用
167
+
168
+ ```js
169
+ import { syncLockBatch } from '@ray-js/ray'
170
+ ```
171
+
172
+ ### 参数
173
+
174
+ **LockSyncBatchParams**
175
+
176
+ | 属性 | 类型 | 必填 | 说明 |
177
+ | ----- | -------- | ---- | ------- |
178
+ | devId | `string` | 是 | 设备 ID |
179
+
180
+ ### 返回
181
+
182
+ **LockSyncBatchResult**
183
+
184
+ | 属性 | 类型 | 说明 |
185
+ | ----------- | -------- | -------------- |
186
+ | lockRandom | `object` | 随机锁信息 |
187
+ | lockFitting | `object` | 锁具信息 |
188
+ | lockRecord | `string` | 锁记录 |
189
+ | removedUser | `Array` | 已移除用户信息 |
190
+
191
+ ### 函数定义示例
192
+
193
+ ```typescript
194
+ /**
195
+ * 门锁批量同步
196
+ */
197
+ export function syncLockBatch(params: LockSyncBatchParams): Promise<LockSyncBatchResult>
198
+ ```
199
+
200
+ ## updateUserTimeSchedule
201
+
202
+ 更新用户时效。
203
+
204
+ ### 引入
205
+
206
+ > @ray-js/ray^1.5.0 以上版本可使用
207
+
208
+ ```js
209
+ import { updateUserTimeSchedule } from '@ray-js/ray'
210
+ ```
211
+
212
+ ### 参数
213
+
214
+ **UpdateUserTimeScheduleParams**
215
+
216
+ | 属性 | 类型 | 必填 | 说明 |
217
+ | ---------------- | ------------------ | ---- | -------- |
218
+ | devId | `string` | 是 | 设备 ID |
219
+ | userId | `string` | 是 | 用户 ID |
220
+ | timeScheduleInfo | `TimeScheduleInfo` | 是 | 时效信息 |
221
+
222
+ ### 返回
223
+
224
+ **UpdateUserTimeScheduleResult**
225
+
226
+ `boolean`,表示操作是否成功。
227
+
228
+ ### 函数定义示例
229
+
230
+ ```typescript
231
+ /**
232
+ * 更新用户时效
233
+ */
234
+ export function updateUserTimeSchedule(
235
+ params: UpdateUserTimeScheduleParams
236
+ ): Promise<UpdateUserTimeScheduleResult>
237
+ ```
238
+
239
+ ## openCloseOfflineUnlock
240
+
241
+ 打开/关闭离线解锁开关。
242
+
243
+ ### 引入
244
+
245
+ > @ray-js/ray^1.5.0 以上版本可使用
246
+
247
+ ```js
248
+ import { openCloseOfflineUnlock } from '@ray-js/ray'
249
+ ```
250
+
251
+ ### 参数
252
+
253
+ **OpenCloseOfflineUnlockParams**
254
+
255
+ | 属性 | 类型 | 必填 | 说明 |
256
+ | ------ | --------- | ---- | -------- |
257
+ | devId | `string` | 是 | 设备 ID |
258
+ | userId | `string` | 是 | 用户 ID |
259
+ | enable | `boolean` | 是 | 是否启用 |
260
+
261
+ ### 返回
262
+
263
+ **OpenCloseOfflineUnlockResult**
264
+
265
+ `boolean`,表示操作是否成功。
266
+
267
+ ### 函数定义示例
268
+
269
+ ```typescript
270
+ /**
271
+ * 打开/关闭离线解锁开关
272
+ */
273
+ export function openCloseOfflineUnlock(
274
+ params: OpenCloseOfflineUnlockParams
275
+ ): Promise<OpenCloseOfflineUnlockResult>
276
+ ```
@@ -0,0 +1,61 @@
1
+ type OfflinePwdParams = {
2
+ devId: string;
3
+ pwdType: string;
4
+ gmtStart: number;
5
+ gmtExpired: number;
6
+ pwdName?: string;
7
+ countryCode?: string;
8
+ mobile?: string;
9
+ };
10
+ type OfflinePwdResult = {
11
+ pwd: string;
12
+ pwdId: string;
13
+ unlockBindingId: string;
14
+ };
15
+ /**
16
+ * 获取离线临时密码
17
+ * @param {OfflinePwdParams} params - 请求参数
18
+ * @returns {Promise<OfflinePwdResult>} - 响应结果的 Promise
19
+ */
20
+ export declare const getOfflinePassword: (params: OfflinePwdParams) => Promise<OfflinePwdResult>;
21
+ type PwdRevokeParams = {
22
+ devId: string;
23
+ unlockBindingId: string;
24
+ name?: string;
25
+ };
26
+ type PwdRevokeResult = string;
27
+ /**
28
+ * 删除离线临时密码
29
+ * @param {PwdRevokeParams} params - 请求参数
30
+ * @returns {Promise<PwdRevokeResult>} - 响应结果的 Promise
31
+ */
32
+ export declare const revokeOfflinePassword: (params: PwdRevokeParams) => Promise<PwdRevokeResult>;
33
+ type PwdNameUpdateParams = {
34
+ devId: string;
35
+ unlockBindingId: string;
36
+ pwdName: string;
37
+ };
38
+ type PwdNameUpdateResult = string;
39
+ /**
40
+ * 更新离线密码名称
41
+ * @param {PwdNameUpdateParams} params - 请求参数
42
+ * @returns {Promise<PwdNameUpdateResult>} - 响应结果的 Promise
43
+ */
44
+ export declare const updateOfflinePasswordName: (params: PwdNameUpdateParams) => Promise<PwdNameUpdateResult>;
45
+ type RevocablePwdParams = {
46
+ devId: string;
47
+ };
48
+ type RevocablePwdResultEntry = {
49
+ gmtExpired: string;
50
+ pwdName: string;
51
+ pwdId: string;
52
+ gmtStart: string;
53
+ };
54
+ type RevocablePwdResult = RevocablePwdResultEntry[];
55
+ /**
56
+ * 获取可清空的多次离线临时密码
57
+ * @param {RevocablePwdParams} params - 请求参数
58
+ * @returns {Promise<RevocablePwdResult>} - 响应结果的 Promise
59
+ */
60
+ export declare const getRevocableOfflinePasswords: (params: RevocablePwdParams) => Promise<RevocablePwdResult>;
61
+ export {};
@@ -0,0 +1,67 @@
1
+ import { THING } from '../../constants';
2
+ import requestCloud from '../../requestCloud';
3
+ // 6.1. 获取离线临时密码
4
+
5
+ /**
6
+ * 获取离线临时密码
7
+ * @param {OfflinePwdParams} params - 请求参数
8
+ * @returns {Promise<OfflinePwdResult>} - 响应结果的 Promise
9
+ */
10
+ export const getOfflinePassword = params => {
11
+ return requestCloud({
12
+ api: "".concat(THING, ".m.device.lock.offlinepwd.get"),
13
+ version: '3.0',
14
+ data: params
15
+ });
16
+ };
17
+
18
+ // 6.2. 获取某个离线临时密码的删除密码
19
+
20
+ // 离线删除密码
21
+
22
+ /**
23
+ * 删除离线临时密码
24
+ * @param {PwdRevokeParams} params - 请求参数
25
+ * @returns {Promise<PwdRevokeResult>} - 响应结果的 Promise
26
+ */
27
+ export const revokeOfflinePassword = params => {
28
+ return requestCloud({
29
+ api: "".concat(THING, ".m.device.lock.offlinepwd.revoke"),
30
+ version: '2.0',
31
+ data: params
32
+ });
33
+ };
34
+
35
+ // 6.3. 设置某个密码的名称
36
+
37
+ // 更新结果
38
+
39
+ /**
40
+ * 更新离线密码名称
41
+ * @param {PwdNameUpdateParams} params - 请求参数
42
+ * @returns {Promise<PwdNameUpdateResult>} - 响应结果的 Promise
43
+ */
44
+ export const updateOfflinePasswordName = params => {
45
+ return requestCloud({
46
+ api: "".concat(THING, ".m.device.lock.offlinepwd.name.update"),
47
+ version: '2.0',
48
+ data: params
49
+ });
50
+ };
51
+
52
+ // 6.4. 获取生效中的,可以被清空的多次离线临时密码
53
+
54
+ // 结果的数组
55
+
56
+ /**
57
+ * 获取可清空的多次离线临时密码
58
+ * @param {RevocablePwdParams} params - 请求参数
59
+ * @returns {Promise<RevocablePwdResult>} - 响应结果的 Promise
60
+ */
61
+ export const getRevocableOfflinePasswords = params => {
62
+ return requestCloud({
63
+ api: "".concat(THING, ".m.device.lock.offlinepwd.revocable"),
64
+ version: '1.0',
65
+ data: params
66
+ });
67
+ };