@ray-js/api 1.5.0-beta.12 → 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 (145) 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/alarm.js +2 -2
  27. package/lib/cloud/core.js +1 -1
  28. package/lib/cloud/device.d.ts +25 -1
  29. package/lib/cloud/device.js +20 -6
  30. package/lib/cloud/doorlock/README.md +62 -0
  31. package/lib/cloud/doorlock/auth.d.ts +235 -0
  32. package/lib/cloud/doorlock/auth.js +223 -0
  33. package/lib/cloud/doorlock/auth.md +323 -0
  34. package/lib/cloud/doorlock/device.d.ts +137 -0
  35. package/lib/cloud/doorlock/device.js +187 -0
  36. package/lib/cloud/doorlock/device.md +265 -0
  37. package/lib/cloud/doorlock/index.d.ts +10 -0
  38. package/lib/cloud/doorlock/index.js +20 -0
  39. package/lib/cloud/doorlock/log.d.ts +113 -0
  40. package/lib/cloud/doorlock/log.js +53 -0
  41. package/lib/cloud/doorlock/log.md +153 -0
  42. package/lib/cloud/doorlock/member-opmode.d.ts +121 -0
  43. package/lib/cloud/doorlock/member-opmode.js +104 -0
  44. package/lib/cloud/doorlock/member-opmode.md +279 -0
  45. package/lib/cloud/doorlock/member.d.ts +110 -0
  46. package/lib/cloud/doorlock/member.js +72 -0
  47. package/lib/cloud/doorlock/member.md +276 -0
  48. package/lib/cloud/doorlock/offline-pwd.d.ts +61 -0
  49. package/lib/cloud/doorlock/offline-pwd.js +67 -0
  50. package/lib/cloud/doorlock/offline-pwd.md +155 -0
  51. package/lib/cloud/doorlock/old.d.ts +36 -0
  52. package/lib/cloud/doorlock/old.js +102 -0
  53. package/lib/cloud/doorlock/temp-pwd.d.ts +194 -0
  54. package/lib/cloud/doorlock/temp-pwd.js +193 -0
  55. package/lib/cloud/doorlock/temp-pwd.md +362 -0
  56. package/lib/cloud/doorlock/unlock-method.d.ts +62 -0
  57. package/lib/cloud/doorlock/unlock-method.js +85 -0
  58. package/lib/cloud/doorlock/unlock-method.md +121 -0
  59. package/lib/cloud/doorlock/unlock.d.ts +89 -0
  60. package/lib/cloud/doorlock/unlock.js +76 -0
  61. package/lib/cloud/doorlock/unlock.md +222 -0
  62. package/lib/cloud/index.d.ts +4 -0
  63. package/lib/cloud/index.js +10 -1
  64. package/lib/cloud/interface.d.ts +39 -2
  65. package/lib/cloud/linkage.d.ts +8 -5
  66. package/lib/cloud/linkage.js +38 -17
  67. package/lib/cloud/outdoor.d.ts +15 -0
  68. package/lib/cloud/outdoor.js +25 -0
  69. package/lib/cloud/recipe/README.md +36 -0
  70. package/lib/cloud/recipe/basket.d.ts +220 -0
  71. package/lib/cloud/recipe/basket.js +328 -0
  72. package/lib/cloud/recipe/basket.md +431 -0
  73. package/lib/cloud/recipe/category-list.d.ts +71 -0
  74. package/lib/cloud/recipe/category-list.js +65 -0
  75. package/lib/cloud/recipe/category-list.md +132 -0
  76. package/lib/cloud/recipe/custom.d.ts +177 -0
  77. package/lib/cloud/recipe/custom.js +171 -0
  78. package/lib/cloud/recipe/custom.md +265 -0
  79. package/lib/cloud/recipe/index.d.ts +8 -0
  80. package/lib/cloud/recipe/index.js +8 -0
  81. package/lib/cloud/recipe/menu.d.ts +170 -0
  82. package/lib/cloud/recipe/menu.js +76 -0
  83. package/lib/cloud/recipe/menu.md +276 -0
  84. package/lib/cloud/recipe/query.d.ts +87 -0
  85. package/lib/cloud/recipe/query.js +101 -0
  86. package/lib/cloud/recipe/query.md +112 -0
  87. package/lib/cloud/recipe/record.d.ts +54 -0
  88. package/lib/cloud/recipe/record.js +87 -0
  89. package/lib/cloud/recipe/record.md +115 -0
  90. package/lib/cloud/recipe/score.d.ts +69 -0
  91. package/lib/cloud/recipe/score.js +106 -0
  92. package/lib/cloud/recipe/score.md +112 -0
  93. package/lib/cloud/recipe/star.d.ts +131 -0
  94. package/lib/cloud/recipe/star.js +151 -0
  95. package/lib/cloud/recipe/star.md +196 -0
  96. package/lib/cloud/recipe/types.d.ts +7 -0
  97. package/lib/cloud/recipe/types.js +0 -0
  98. package/lib/cloud/remoteGroup.d.ts +10 -0
  99. package/lib/cloud/remoteGroup.js +31 -0
  100. package/lib/cloud/statistic.js +9 -9
  101. package/lib/cloud/timer.js +14 -14
  102. package/lib/constants.js +1 -1
  103. package/lib/errorCode.d.ts +4 -0
  104. package/lib/errorCode.js +3 -0
  105. package/lib/getCdnUrl/index.d.ts +2 -2
  106. package/lib/getCdnUrl/index.js +1 -2
  107. package/lib/getCdnUrl/index.wechat.d.ts +2 -2
  108. package/lib/getCdnUrl/index.wechat.js +1 -2
  109. package/lib/getElementById/index.thing.js +1 -1
  110. package/lib/getElementById/index.wechat.js +1 -1
  111. package/lib/index.d.ts +1 -0
  112. package/lib/index.js +1 -0
  113. package/lib/nativeRouters/common.d.ts +15 -0
  114. package/lib/nativeRouters/common.js +38 -0
  115. package/lib/nativeRouters/device.d.ts +59 -0
  116. package/lib/nativeRouters/device.js +69 -0
  117. package/lib/nativeRouters/gw.d.ts +23 -0
  118. package/lib/nativeRouters/gw.js +27 -0
  119. package/lib/nativeRouters/index.d.ts +6 -1
  120. package/lib/nativeRouters/index.js +6 -1
  121. package/lib/nativeRouters/ipc.d.ts +30 -0
  122. package/lib/nativeRouters/ipc.js +44 -0
  123. package/lib/nativeRouters/outdoors.d.ts +47 -0
  124. package/lib/nativeRouters/outdoors.js +41 -0
  125. package/lib/nativeRouters/remoteGroup.d.ts +22 -0
  126. package/lib/nativeRouters/remoteGroup.js +11 -0
  127. package/lib/nativeRouters/root.d.ts +41 -0
  128. package/lib/nativeRouters/root.js +53 -0
  129. package/lib/openGroupCreate/index.js +3 -3
  130. package/lib/panel/i18n/index.d.ts +7 -6
  131. package/lib/panel/i18n/index.js +39 -23
  132. package/lib/panel/i18n/index.wechat.js +13 -12
  133. package/lib/panel/normalizeNetwork.js +1 -1
  134. package/lib/panel/publishDps.js +1 -1
  135. package/lib/redirectTo/index.js +1 -0
  136. package/lib/utils.d.ts +5 -2
  137. package/lib/utils.js +46 -20
  138. package/lib/utils.wechat.d.ts +3 -0
  139. package/lib/utils.wechat.js +22 -6
  140. package/lib/viewAPI.d.ts +1 -0
  141. package/lib/viewAPI.js +4 -3
  142. package/package.json +8 -7
  143. package/@types/PlayNetKit.d.ts +0 -444
  144. package/lib/nativeRouters/scene.d.ts +0 -34
  145. package/lib/nativeRouters/scene.js +0 -60
@@ -0,0 +1,121 @@
1
+ type ValidatePwdMemberResult = {
2
+ valid: boolean;
3
+ errorCode?: string;
4
+ errorMsg?: string;
5
+ };
6
+ type ValidatePwdMemberParams = {
7
+ devId: string;
8
+ opModeId?: number;
9
+ password: string;
10
+ };
11
+ /**
12
+ * 校验成员密码是否存在(包括临时密码)
13
+ * @param {ValidatePwdMemberParams} params
14
+ * @returns {Promise<ValidatePwdMemberResult>}
15
+ */
16
+ export declare const validatePasswordForMember: (params: ValidatePwdMemberParams) => Promise<ValidatePwdMemberResult>;
17
+ type AddMemberUnlockMethodResult = {
18
+ opModeId: string;
19
+ unlockName: string;
20
+ };
21
+ type NotifyInfo = {
22
+ appSend?: boolean;
23
+ msgPhone?: string;
24
+ countryCode?: string;
25
+ msgPhoneVerifyCode?: string;
26
+ };
27
+ type AddMemberUnlockMethodParams = {
28
+ devId: string;
29
+ userId: string;
30
+ unlockId: number;
31
+ unlockName?: string;
32
+ unlockAttr: number;
33
+ notifyInfo?: NotifyInfo;
34
+ unlockDetail?: string;
35
+ };
36
+ /**
37
+ * 添加解锁方式
38
+ * @param {AddMemberUnlockMethodParams} params
39
+ * @returns {Promise<AddMemberUnlockMethodResult>}
40
+ */
41
+ export declare const addMemberUnlockMethod: (params: AddMemberUnlockMethodParams) => Promise<AddMemberUnlockMethodResult>;
42
+ type RemoveMemberUnlockMethodResult = boolean;
43
+ type RemoveMemberUnlockMethodParams = {
44
+ devId: string;
45
+ opmodeId: number;
46
+ };
47
+ /**
48
+ * 删除解锁方式
49
+ * @param {RemoveMemberUnlockMethodParams} params
50
+ * @returns {Promise<RemoveMemberUnlockMethodResult>}
51
+ */
52
+ export declare const removeMemberUnlockMethod: (params: RemoveMemberUnlockMethodParams) => Promise<RemoveMemberUnlockMethodResult>;
53
+ type SendSpecialUnlockVerifyCodeResult = boolean;
54
+ type SendSpecialUnlockVerifyCodeParams = {
55
+ account: string;
56
+ };
57
+ /**
58
+ * 发送设置特殊解锁方式的验证码
59
+ * @param {SendSpecialUnlockVerifyCodeParams} params
60
+ * @returns {Promise<SendSpecialUnlockVerifyCodeResult>}
61
+ */
62
+ export declare const sendSpecialUnlockVerifyCode: (params: SendSpecialUnlockVerifyCodeParams) => Promise<SendSpecialUnlockVerifyCodeResult>;
63
+ type UpdateMemberUnlockModeResult = boolean;
64
+ type UpdateMemberUnlockModeParams = {
65
+ devId: string;
66
+ opModeId: number;
67
+ unlockName?: string;
68
+ unlockAttr: number;
69
+ unlockDetail: string;
70
+ notifyInfo?: NotifyInfo;
71
+ };
72
+ /**
73
+ * 更新成员的解锁方式
74
+ * @param {UpdateMemberUnlockModeParams} params
75
+ * @returns {Promise<UpdateMemberUnlockModeResult>}
76
+ */
77
+ export declare const updateMemberUnlockMode: (params: UpdateMemberUnlockModeParams) => Promise<UpdateMemberUnlockModeResult>;
78
+ type UnlockMethodDetailResult = {
79
+ phase: number;
80
+ opmode: string;
81
+ unlockAttr: number;
82
+ unlockName: string;
83
+ userId: string;
84
+ opmodeValue: string;
85
+ unlockId: string;
86
+ lockUserId: number;
87
+ opmodeId: string;
88
+ voiceAttr: number;
89
+ userTimeSet: string;
90
+ userType: number;
91
+ sourceAttribute: number;
92
+ notifyInfo?: NotifyInfoDetail;
93
+ };
94
+ type NotifyInfoDetail = {
95
+ appSend?: boolean;
96
+ msgPhone?: string;
97
+ countryCode?: string;
98
+ targetUserId?: number;
99
+ };
100
+ type UnlockMethodDetailParams = {
101
+ devId: string;
102
+ opModeId: number;
103
+ };
104
+ /**
105
+ * 查询某个解锁方式的详情
106
+ * @param {UnlockMethodDetailParams} params
107
+ * @returns {Promise<UnlockMethodDetailResult>}
108
+ */
109
+ export declare const getUnlockMethodDetail: (params: UnlockMethodDetailParams) => Promise<UnlockMethodDetailResult>;
110
+ type GetPasswordSNResult = number;
111
+ type GetPasswordSNParams = {
112
+ devId: string;
113
+ dpId: number;
114
+ };
115
+ /**
116
+ * 获取创建密码时的序号
117
+ * @param {GetPasswordSNParams} params
118
+ * @returns {Promise<GetPasswordSNResult>}
119
+ */
120
+ export declare const getCreatePasswordSN: (params: GetPasswordSNParams) => Promise<GetPasswordSNResult>;
121
+ export {};
@@ -0,0 +1,104 @@
1
+ import { THING } from '../../constants';
2
+ import requestCloud from '../../requestCloud';
3
+
4
+ // 4.1. 校验成员密码是否存在(包括临时密码)
5
+
6
+ /**
7
+ * 校验成员密码是否存在(包括临时密码)
8
+ * @param {ValidatePwdMemberParams} params
9
+ * @returns {Promise<ValidatePwdMemberResult>}
10
+ */
11
+ export const validatePasswordForMember = params => {
12
+ return requestCloud({
13
+ api: "".concat(THING, ".m.device.member.opmode.pwd.validate"),
14
+ version: '1.0',
15
+ data: params
16
+ });
17
+ };
18
+
19
+ // 通知信息
20
+
21
+ /**
22
+ * 添加解锁方式
23
+ * @param {AddMemberUnlockMethodParams} params
24
+ * @returns {Promise<AddMemberUnlockMethodResult>}
25
+ */
26
+ export const addMemberUnlockMethod = params => {
27
+ return requestCloud({
28
+ api: "".concat(THING, ".m.device.member.opmode.add"),
29
+ version: '5.0',
30
+ data: params
31
+ });
32
+ };
33
+
34
+ // 4.3. 删除解锁方式
35
+
36
+ /**
37
+ * 删除解锁方式
38
+ * @param {RemoveMemberUnlockMethodParams} params
39
+ * @returns {Promise<RemoveMemberUnlockMethodResult>}
40
+ */
41
+ export const removeMemberUnlockMethod = params => {
42
+ return requestCloud({
43
+ api: "".concat(THING, ".m.device.member.opmode.remove"),
44
+ version: '2.0',
45
+ data: params
46
+ });
47
+ };
48
+ /**
49
+ * 发送设置特殊解锁方式的验证码
50
+ * @param {SendSpecialUnlockVerifyCodeParams} params
51
+ * @returns {Promise<SendSpecialUnlockVerifyCodeResult>}
52
+ */
53
+ export const sendSpecialUnlockVerifyCode = params => {
54
+ return requestCloud({
55
+ api: "".concat(THING, ".m.device.user.verifycode.send"),
56
+ version: '1.0',
57
+ data: params
58
+ });
59
+ };
60
+
61
+ // 4.5. 更新成员的解锁方式
62
+
63
+ /**
64
+ * 更新成员的解锁方式
65
+ * @param {UpdateMemberUnlockModeParams} params
66
+ * @returns {Promise<UpdateMemberUnlockModeResult>}
67
+ */
68
+ export const updateMemberUnlockMode = params => {
69
+ return requestCloud({
70
+ api: "".concat(THING, ".m.device.member.opmode.update"),
71
+ version: '5.0',
72
+ data: params
73
+ });
74
+ };
75
+
76
+ // 4.6. 查询某个解锁方式的详情
77
+
78
+ /**
79
+ * 查询某个解锁方式的详情
80
+ * @param {UnlockMethodDetailParams} params
81
+ * @returns {Promise<UnlockMethodDetailResult>}
82
+ */
83
+ export const getUnlockMethodDetail = params => {
84
+ return requestCloud({
85
+ api: "".concat(THING, ".m.device.member.opmode.detail"),
86
+ version: '1.0',
87
+ data: params
88
+ });
89
+ };
90
+
91
+ // 4.7. 获取创建密码时的序号
92
+
93
+ /**
94
+ * 获取创建密码时的序号
95
+ * @param {GetPasswordSNParams} params
96
+ * @returns {Promise<GetPasswordSNResult>}
97
+ */
98
+ export const getCreatePasswordSN = params => {
99
+ return requestCloud({
100
+ api: "".concat(THING, ".m.device.dp.sn.get"),
101
+ version: '1.0',
102
+ data: params
103
+ });
104
+ };
@@ -0,0 +1,279 @@
1
+ ## validatePasswordForMember
2
+
3
+ 校验成员密码是否存在(包括临时密码)。
4
+
5
+ ### 引入
6
+
7
+ > @ray-js/ray^1.5.0 以上版本可使用
8
+
9
+ ```js
10
+ import { validatePasswordForMember } from '@ray-js/ray'
11
+ ```
12
+
13
+ ### 参数
14
+
15
+ **ValidatePwdMemberParams**
16
+
17
+ | 属性 | 类型 | 必填 | 说明 |
18
+ | -------- | -------- | ---- | ----------- |
19
+ | devId | `string` | 是 | 设备 ID |
20
+ | opModeId | `number` | 否 | 操作模式 ID |
21
+ | password | `string` | 是 | 密码 |
22
+
23
+ ### 返回
24
+
25
+ **ValidatePwdMemberResult**
26
+
27
+ | 属性 | 类型 | 说明 |
28
+ | --------- | --------- | ---------------- |
29
+ | valid | `boolean` | 是否有效 |
30
+ | errorCode | `string` | 错误代码(可选) |
31
+ | errorMsg | `string` | 错误信息(可选) |
32
+
33
+ ### 函数定义示例
34
+
35
+ ```typescript
36
+ /**
37
+ * 校验成员密码是否存在(包括临时密码)
38
+ */
39
+ export function validatePasswordForMember(
40
+ params: ValidatePwdMemberParams
41
+ ): Promise<ValidatePwdMemberResult>
42
+ ```
43
+
44
+ ## addMemberUnlockMethod
45
+
46
+ 添加解锁方式。
47
+
48
+ ### 引入
49
+
50
+ > @ray-js/ray^1.5.0 以上版本可使用
51
+
52
+ ```js
53
+ import { addMemberUnlockMethod } from '@ray-js/ray'
54
+ ```
55
+
56
+ ### 参数
57
+
58
+ **AddMemberUnlockMethodParams**
59
+
60
+ | 属性 | 类型 | 必填 | 说明 |
61
+ | ------------ | ------------ | ---- | ------------ |
62
+ | devId | `string` | 是 | 设备 ID |
63
+ | userId | `string` | 是 | 用户 ID |
64
+ | unlockId | `number` | 是 | 解锁 ID |
65
+ | unlockName | `string` | 否 | 解锁名称 |
66
+ | unlockAttr | `number` | 是 | 解锁属性 |
67
+ | notifyInfo | `NotifyInfo` | 否 | 通知信息 |
68
+ | unlockDetail | `string` | 否 | 解锁详细信息 |
69
+
70
+ ### 返回
71
+
72
+ **AddMemberUnlockMethodResult**
73
+
74
+ | 属性 | 类型 | 说明 |
75
+ | ---------- | -------- | ----------- |
76
+ | opModeId | `string` | 操作模式 ID |
77
+ | unlockName | `string` | 解锁名称 |
78
+
79
+ ### 函数定义示例
80
+
81
+ ```typescript
82
+ /**
83
+ * 添加解锁方式
84
+ */
85
+ export function addMemberUnlockMethod(
86
+ params: AddMemberUnlockMethodParams
87
+ ): Promise<AddMemberUnlockMethodResult>
88
+ ```
89
+
90
+ ## removeMemberUnlockMethod
91
+
92
+ 删除解锁方式。
93
+
94
+ ### 引入
95
+
96
+ > @ray-js/ray^1.5.0 以上版本可使用
97
+
98
+ ```js
99
+ import { removeMemberUnlockMethod } from '@ray-js/ray'
100
+ ```
101
+
102
+ ### 参数
103
+
104
+ **RemoveMemberUnlockMethodParams**
105
+
106
+ | 属性 | 类型 | 必填 | 说明 |
107
+ | -------- | -------- | ---- | ----------- |
108
+ | devId | `string` | 是 | 设备 ID |
109
+ | opmodeId | `number` | 是 | 操作模式 ID |
110
+
111
+ ### 返回
112
+
113
+ **RemoveMemberUnlockMethodResult**
114
+
115
+ `boolean`,表示操作是否成功。
116
+
117
+ ### 函数定义示例
118
+
119
+ ```typescript
120
+ /**
121
+ * 删除解锁方式
122
+ */
123
+ export function removeMemberUnlockMethod(
124
+ params: RemoveMemberUnlockMethodParams
125
+ ): Promise<RemoveMemberUnlockMethodResult>
126
+ ```
127
+
128
+ ## sendSpecialUnlockVerifyCode
129
+
130
+ 发送设置特殊解锁方式的验证码。
131
+
132
+ ### 引入
133
+
134
+ > @ray-js/ray^1.5.0 以上版本可使用
135
+
136
+ ```js
137
+ import { sendSpecialUnlockVerifyCode } from '@ray-js/ray'
138
+ ```
139
+
140
+ ### 参数
141
+
142
+ **SendSpecialUnlockVerifyCodeParams**
143
+
144
+ | 属性 | 类型 | 必填 | 说明 |
145
+ | ------- | -------- | ---- | -------- |
146
+ | account | `string` | 是 | 用户账号 |
147
+
148
+ ### 返回
149
+
150
+ **SendSpecialUnlockVerifyCodeResult**
151
+
152
+ `boolean`,表示操作是否成功。
153
+
154
+ ### 函数定义示例
155
+
156
+ ```typescript
157
+ /**
158
+ * 发送设置特殊解锁方式的验证码
159
+ */
160
+ export function sendSpecialUnlockVerifyCode(
161
+ params: SendSpecialUnlockVerifyCodeParams
162
+ ): Promise<SendSpecialUnlockVerifyCodeResult>
163
+ ```
164
+
165
+ ## updateMemberUnlockMode
166
+
167
+ 更新成员的解锁方式。
168
+
169
+ ### 引入
170
+
171
+ > @ray-js/ray^1.5.0 以上版本可使用
172
+
173
+ ```js
174
+ import { updateMemberUnlockMode } from '@ray-js/ray'
175
+ ```
176
+
177
+ ### 参数
178
+
179
+ **UpdateMemberUnlockModeParams**
180
+
181
+ | 属性 | 类型 | 必填 | 说明 |
182
+ | ------------ | ------------ | ---- | ------------ |
183
+ | devId | `string` | 是 | 设备 ID |
184
+ | opModeId | `number` | 是 | 操作模式 ID |
185
+ | unlockName | `string` | 否 | 解锁名称 |
186
+ | unlockAttr | `number` | 是 | 解锁属性 |
187
+ | unlockDetail | `string` | 是 | 解锁详细信息 |
188
+ | notifyInfo | `NotifyInfo` | 否 | 通知信息 |
189
+
190
+ ### 返回
191
+
192
+ **UpdateMemberUnlockModeResult**
193
+
194
+ `boolean`,表示操作是否成功。
195
+
196
+ ### 函数定义示例
197
+
198
+ ```typescript
199
+ /**
200
+ * 更新成员的解锁方式
201
+ */
202
+ export function updateMemberUnlockMode(
203
+ params: UpdateMemberUnlockModeParams
204
+ ): Promise<UpdateMemberUnlockModeResult>
205
+ ```
206
+
207
+ ## getUnlockMethodDetail
208
+
209
+ 查询某个解锁方式的详情。
210
+
211
+ ### 引入
212
+
213
+ > @ray-js/ray^1.5.0 以上版本可使用
214
+
215
+ ```js
216
+ import { getUnlockMethodDetail } from '@ray-js/ray'
217
+ ```
218
+
219
+ ### 参数
220
+
221
+ **UnlockMethodDetailParams**
222
+
223
+ | 属性 | 类型 | 必填 | 说明 |
224
+ | -------- | -------- | ---- | ----------- |
225
+ | devId | `string` | 是 | 设备 ID |
226
+ | opModeId | `number` | 是 | 操作模式 ID |
227
+
228
+ ### 返回
229
+
230
+ **UnlockMethodDetailResult**
231
+
232
+ 结构包含解锁方式的详细信息。
233
+
234
+ ### 函数定义示例
235
+
236
+ ```typescript
237
+ /**
238
+ * 查询某个解锁方式的详情
239
+ */
240
+ export function getUnlockMethodDetail(
241
+ params: UnlockMethodDetailParams
242
+ ): Promise<UnlockMethodDetailResult>
243
+ ```
244
+
245
+ ## getCreatePasswordSN
246
+
247
+ 获取创建密码时的序号。
248
+
249
+ ### 引入
250
+
251
+ > @ray-js/ray^1.5.0 以上版本可使用
252
+
253
+ ```js
254
+ import { getCreatePasswordSN } from '@ray-js/ray'
255
+ ```
256
+
257
+ ### 参数
258
+
259
+ **GetPasswordSNParams**
260
+
261
+ | 属性 | 类型 | 必填 | 说明 |
262
+ | ----- | -------- | ---- | --------- |
263
+ | devId | `string` | 是 | 设备 ID |
264
+ | dpId | `number` | 是 | 数据点 ID |
265
+
266
+ ### 返回
267
+
268
+ **GetPasswordSNResult**
269
+
270
+ `number`,表示创建密码时的序号。
271
+
272
+ ### 函数定义示例
273
+
274
+ ```typescript
275
+ /**
276
+ * 获取创建密码时的序号
277
+ */
278
+ export function getCreatePasswordSN(params: GetPasswordSNParams): Promise<GetPasswordSNResult>
279
+ ```
@@ -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
+ };