@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,76 @@
1
+ import { THING } from '../../constants';
2
+ import requestCloud from '../../requestCloud';
3
+
4
+ // 1.1. RemoteOpenParams - 远程免密开门的参数类型
5
+
6
+ // RemoteOpenResponse - 远程免密开门的响应类型
7
+
8
+ /**
9
+ * 远程免密开门
10
+ * @param {RemoteOpenParams} params - 包含设备Id和开门状态的参数
11
+ * @returns {Promise<RemoteOpenResponse>} - 包含执行结果和状态的响应
12
+ */
13
+ export const remoteOpenDoor = params => {
14
+ return requestCloud({
15
+ api: "".concat(THING, ".m.zigbee.lock.remotepwd.execute"),
16
+ version: '1.0',
17
+ data: params
18
+ });
19
+ };
20
+
21
+ // 1.2. Unlock - 远程免密开门的参数和响应类型
22
+
23
+ /**
24
+ * 远程免密解锁
25
+ * @param {UnlockParams} params - 包含设备Id、开门状态和确认状态的参数
26
+ * @returns {Promise<UnlockResponse>} - 包含请求结果和状态的响应
27
+ */
28
+ export const remoteUnlockDoor = params => {
29
+ return requestCloud({
30
+ api: "".concat(THING, ".m.device.lock.remote.unlock"),
31
+ version: '2.0',
32
+ data: params
33
+ });
34
+ };
35
+
36
+ // 1.3. 判断用户是否可以远程开门
37
+
38
+ /**
39
+ * 判断用户是否可以远程开门
40
+ * @param {CanUnlockRemoteResponse} params - 包含设备Id的参数
41
+ * @returns {Promise<CanUnlockRemoteResponse>} - 包含请求结果和状态的响应
42
+ */
43
+ export const checkCanRemoteUnlock = params => {
44
+ return requestCloud({
45
+ api: "".concat(THING, ".m.device.lock.remote.unlock.available"),
46
+ version: '1.0',
47
+ data: params
48
+ });
49
+ };
50
+ /**
51
+ * 获取最近一条记录的信息
52
+ * @param {GetLatestRecordInfoParams} params - 包含设备Id的参数
53
+ * @returns {Promise<GetLatestRecordInfoResponse>} - 包含请求结果和状态的响应
54
+ */
55
+ export const getLatestUnlockRecord = params => {
56
+ return requestCloud({
57
+ api: "".concat(THING, ".m.device.lock.history.latest"),
58
+ version: '1.0',
59
+ data: params
60
+ });
61
+ };
62
+
63
+ // 1.5. 查询开门记录
64
+
65
+ /**
66
+ * 查询开门记录
67
+ * @param { QueryRecordInfoParams} params - 包含设备Id的参数
68
+ * @returns {Promise<QueryRecordInfoResponse[]>} - 包含请求结果和状态的响应
69
+ */
70
+ export const queryUnlockRecord = params => {
71
+ return requestCloud({
72
+ api: "".concat(THING, ".m.device.lock.history.list"),
73
+ version: '2.0',
74
+ data: params
75
+ });
76
+ };
@@ -0,0 +1,222 @@
1
+ ## remoteOpenDoor
2
+
3
+ 远程免密开门功能。
4
+
5
+ ### 引入
6
+
7
+ > @ray-js/ray^1.5.0 以上版本可使用
8
+
9
+ ```js
10
+ import { remoteOpenDoor } from '@ray-js/ray'
11
+ ```
12
+
13
+ ### 参数
14
+
15
+ **RemoteOpenParams**
16
+
17
+ | 属性 | 类型 | 必填 | 说明 |
18
+ | ----- | --------- | ---- | -------- |
19
+ | devId | `string` | 是 | 设备 Id |
20
+ | open | `boolean` | 是 | 是否开门 |
21
+
22
+ ### 返回
23
+
24
+ **RemoteOpenResponse**
25
+
26
+ `boolean`,远程免密开门的响应结果。
27
+
28
+ ### 函数定义示例
29
+
30
+ ```typescript
31
+ /**
32
+ * 远程免密开门
33
+ */
34
+ export function remoteOpenDoor(params: RemoteOpenParams): Promise<RemoteOpenResponse>
35
+ ```
36
+
37
+ ## remoteUnlockDoor
38
+
39
+ 远程免密解锁功能。
40
+
41
+ ### 引入
42
+
43
+ > @ray-js/ray^1.5.0 以上版本可使用
44
+
45
+ ```js
46
+ import { remoteUnlockDoor } from '@ray-js/ray'
47
+ ```
48
+
49
+ ### 参数
50
+
51
+ **UnlockParams**
52
+
53
+ | 属性 | 类型 | 必填 | 说明 |
54
+ | ------- | --------- | ---- | ------------------------------ |
55
+ | devId | `string` | 是 | 设备 Id |
56
+ | open | `boolean` | 是 | 是否开门 |
57
+ | confirm | `boolean` | 是 | 是否确认,蓝牙门锁固定传 false |
58
+
59
+ ### 返回
60
+
61
+ **UnlockResponse**
62
+
63
+ `boolean`,远程免密解锁的响应结果。
64
+
65
+ ### 函数定义示例
66
+
67
+ ```typescript
68
+ /**
69
+ * 远程免密解锁
70
+ */
71
+ export function remoteUnlockDoor(params: UnlockParams): Promise<UnlockResponse>
72
+ ```
73
+
74
+ ## checkCanRemoteUnlock
75
+
76
+ 判断用户是否可以远程开门功能。
77
+
78
+ ### 引入
79
+
80
+ > @ray-js/ray^1.5.0 以上版本可使用
81
+
82
+ ```js
83
+ import { checkCanRemoteUnlock } from '@ray-js/ray'
84
+ ```
85
+
86
+ ### 参数
87
+
88
+ **CanUnlockRemoteParams**
89
+
90
+ | 属性 | 类型 | 必填 | 说明 |
91
+ | ----- | -------- | ---- | ------- |
92
+ | devId | `string` | 是 | 设备 Id |
93
+
94
+ ### 返回
95
+
96
+ **CanUnlockRemoteResponse**
97
+
98
+ `boolean`,判断用户是否可以远程开门的响应结果。
99
+
100
+ ### 函数定义示例
101
+
102
+ ```typescript
103
+ /**
104
+ * 判断用户是否可以远程开门
105
+ */
106
+ export function checkCanRemoteUnlock(
107
+ params: CanUnlockRemoteParams
108
+ ): Promise<CanUnlockRemoteResponse>
109
+ ```
110
+
111
+ ## getLatestUnlockRecord
112
+
113
+ 获取最近一条记录的信息。
114
+
115
+ ### 引入
116
+
117
+ > @ray-js/ray^1.5.0 以上版本可使用
118
+
119
+ ```js
120
+ import { getLatestUnlockRecord } from '@ray-js/ray'
121
+ ```
122
+
123
+ ### 参数
124
+
125
+ **GetLatestRecordInfoParams**
126
+
127
+ | 属性 | 类型 | 必填 | 说明 |
128
+ | ----- | -------- | ---- | ------- |
129
+ | devId | `string` | 是 | 设备 Id |
130
+
131
+ ### 返回
132
+
133
+ **GetLatestRecordInfoResponse**
134
+
135
+ | 属性 | 类型 | 说明 |
136
+ | --------------- | ---------------- | ----------------- |
137
+ | dpId | `number` | 类型(门锁端 dpId) |
138
+ | dpValue | `string` | dp 值 |
139
+ | recordType | `number` | 记录类型 |
140
+ | userName | `string` | 用户名称 |
141
+ | time | `number` | 时间 |
142
+ | unionUnlockInfo | `UnlockRecord[]` | 组合开锁信息 |
143
+ | unReadCount | `number` | 未读记录数 |
144
+
145
+ **UnlockRecord**
146
+
147
+ | 属性 | 类型 | 说明 |
148
+ | ---------- | -------- | ---------------------- |
149
+ | userName | `string` | 组合开锁的用户名称 |
150
+ | opMode | `string` | 组合开锁的解锁方式 |
151
+ | unlockName | `string` | 组合开锁的解锁方式名称 |
152
+
153
+ ### 函数定义示例
154
+
155
+ ```typescript
156
+ /**
157
+ * 获取最近一条记录的信息
158
+ */
159
+ export function getLatestUnlockRecord(
160
+ params: GetLatestRecordInfoParams
161
+ ): Promise<GetLatestRecordInfoResponse>
162
+ ```
163
+
164
+ ## queryUnlockRecord
165
+
166
+ 查询开门记录功能。
167
+
168
+ ### 引入
169
+
170
+ > @ray-js/ray^1.5.0 以上版本可使用
171
+
172
+ ```js
173
+ import { queryUnlockRecord } from '@ray-js/ray'
174
+ ```
175
+
176
+ ### 参数
177
+
178
+ **QueryRecordInfoParams**
179
+
180
+ | 属性 | 类型 | 必填 | 说明 |
181
+ | --------- | ---------- | ---- | -------------------- |
182
+ | devId | `string` | 是 | 门锁编号 |
183
+ | dpIds | `string[]` | 是 | dpId 列表 |
184
+ | offset | `number` | 否 | 起始页 |
185
+ | limit | `number` | 否 | 每页数据大小 |
186
+ | startTime | `number` | 否 | 开始时间 |
187
+ | endTime | `number` | 否 | 结束时间 |
188
+ | nameless | `boolean` | 否 | 是否仅查询匿名的记录 |
189
+
190
+ ### 返回
191
+
192
+ **QueryRecordInfoResponse**
193
+
194
+ | 属性 | 类型 | 说明 |
195
+ | --------------- | --------------------- | -------------------- |
196
+ | id | `number` | 绑定的编号 |
197
+ | dpId | `number` | 类型(门锁端 dpId) |
198
+ | userId | `string` | 开门的用户编号 |
199
+ | unlockName | `string` | 解锁方式名称(如果有) |
200
+ | userName | `string` | 用户名称 |
201
+ | avatarUrl | `string` | 用户头像 |
202
+ | time | `number` | 时间 |
203
+ | relateDevName | `string` | 关联设备的名称 |
204
+ | relateOpMode | `number` | 关联设备的解锁方式 |
205
+ | unionUnlockInfo | `QueryUnlockRecord[]` | 组合开锁信息 |
206
+
207
+ **QueryUnlockRecord**
208
+
209
+ | 属性 | 类型 | 说明 |
210
+ | ---------- | -------- | ---------------------- |
211
+ | userName | `string` | 组合开锁的用户名称 |
212
+ | opMode | `string` | 组合开锁的解锁方式 |
213
+ | unlockName | `string` | 组合开锁的解锁方式名称 |
214
+
215
+ ### 函数定义示例
216
+
217
+ ```typescript
218
+ /**
219
+ * 查询开门记录
220
+ */
221
+ export function queryUnlockRecord(params: QueryRecordInfoParams): Promise<QueryRecordInfoResponse[]>
222
+ ```
@@ -4,3 +4,7 @@ export * from './alarm';
4
4
  export * from './statistic';
5
5
  export * from './device';
6
6
  export * from './linkage';
7
+ export * from './remoteGroup';
8
+ export * from './outdoor';
9
+ export * from './doorlock';
10
+ export * from './recipe';
@@ -3,4 +3,13 @@ export * from './timer';
3
3
  export * from './alarm';
4
4
  export * from './statistic';
5
5
  export * from './device';
6
- export * from './linkage';
6
+ export * from './linkage';
7
+ export * from './remoteGroup';
8
+
9
+ // 仅用于出行产品
10
+ export * from './outdoor';
11
+
12
+ // 门锁
13
+ export * from './doorlock';
14
+ // 菜谱
15
+ export * from './recipe';
@@ -581,6 +581,14 @@ export interface IGetWeathersResponse {
581
581
  * 二氧化氮
582
582
  */
583
583
  tlow: number;
584
+ /**
585
+ * 降雨概率,单位%
586
+ */
587
+ pop: number;
588
+ /**
589
+ * 降水量,单位毫米
590
+ */
591
+ qpf: number;
584
592
  /**
585
593
  * 日落时间戳
586
594
  */
@@ -903,8 +911,10 @@ export interface IBindRuleResponse {
903
911
  }
904
912
  export interface IGetBindRuleList {
905
913
  bizDomain: string;
906
- sourceEntityId: string;
914
+ devId: string;
915
+ sourceEntityId?: string;
907
916
  entityType: number;
917
+ gid: string;
908
918
  }
909
919
  export type IGetBindRuleListResponse = Array<{
910
920
  associativeEntityId: string;
@@ -914,7 +924,8 @@ export type IGetBindRuleListResponse = Array<{
914
924
  }>;
915
925
  export interface IRemoveRule {
916
926
  bizDomain: string;
917
- sourceEntityId: string;
927
+ sourceEntityId?: string;
928
+ devId: string;
918
929
  associativeEntityId: string;
919
930
  associativeEntityValue: string;
920
931
  }
@@ -958,3 +969,29 @@ export interface DeviceProperty {
958
969
  value: string;
959
970
  }
960
971
  export type ISaveDevPropertyResponse = boolean;
972
+ export interface IGetZigbeeLocalGroupRelation {
973
+ /**
974
+ * 遥控器设备 ID
975
+ */
976
+ devId: string;
977
+ }
978
+ export interface IGetZigbeeLocalGroupDeviceList {
979
+ /**
980
+ * 遥控器的设备 ID
981
+ */
982
+ devId: string;
983
+ /**
984
+ * 遥控器的网关 id
985
+ */
986
+ meshId: string;
987
+ /**
988
+ * 分组 Code,遥控器可支持多个群组,与 localId 匹配范围为 7001-7008;
989
+ * localId 为云端分配,步长为 8,因此一个遥控器内部最多支持关联 8 个群组,localId 为初始值依次+1,与之匹配的 categoryCode 从 7001 依次 +1。
990
+ * 可以通过 getZigbeeLocalGroupRelation 获取
991
+ */
992
+ categoryCode: string;
993
+ /**
994
+ * 家庭 id,可以通过 getCurrentHomeInfo 获取
995
+ */
996
+ homeId: string;
997
+ }
@@ -6,17 +6,20 @@ import { IGetLinkageDeviceList, IBindRule, IGetBindRuleList, IRemoveRule, IGetLi
6
6
  */
7
7
  declare const getLinkageDeviceList: (params: IGetLinkageDeviceList) => Promise<IGetLinkageDeviceListResponse>;
8
8
  /**
9
- * 查询一键执行场景列表
9
+ * 查询家庭下一键执行场景列表
10
10
  * @param {number} devId 设备id
11
+ * @param {number} gid 家庭Id
11
12
  */
12
- declare const getSceneList: ({ devId }: {
13
+ declare const getSceneList: ({ devId, gid }: {
13
14
  devId: string;
15
+ gid: string;
14
16
  }) => Promise<IGetSceneListResponse>;
15
17
  /**
16
- * 查询已绑定的列表
18
+ * 查询家庭下已绑定的列表
17
19
  * @param {string} bizDomain 业务范围
18
- * @param {string} sourceEntityId 设备id
20
+ * @param {string} devId 设备id
19
21
  * @param {number} entityType 实体类型
22
+ * @param {string} gid 家庭Id
20
23
  */
21
24
  declare const getBindRuleList: (params: IGetBindRuleList) => Promise<IGetBindRuleListResponse>;
22
25
  /**
@@ -32,7 +35,7 @@ declare const bindRule: ({ devId, associativeEntityId, ruleId, entitySubIds, exp
32
35
  /**
33
36
  * 解除联动
34
37
  * @param {string} bizDomain 业务范围
35
- * @param {string} sourceEntityId 设备id
38
+ * @param {string} devId 设备id
36
39
  * @param {string} associativeEntityId 关联dp组合
37
40
  * @param {string} associativeEntityValue 规则id
38
41
  */
@@ -1,4 +1,6 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
1
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ const _excluded = ["gid", "devId", "sourceEntityId"];
2
4
  import { requestCloud } from '../';
3
5
  import { THING } from '../constants';
4
6
  /**
@@ -8,41 +10,60 @@ import { THING } from '../constants';
8
10
  */
9
11
  const getLinkageDeviceList = params => {
10
12
  return requestCloud({
11
- api: `${THING}.m.linkage.dev.list`,
13
+ api: "".concat(THING, ".m.linkage.dev.list"),
12
14
  version: '3.0',
13
- data: _objectSpread({}, params)
15
+ data: _objectSpread({}, params),
16
+ extData: {
17
+ gid: params.gid
18
+ }
14
19
  });
15
20
  };
16
21
 
17
22
  /**
18
- * 查询一键执行场景列表
23
+ * 查询家庭下一键执行场景列表
19
24
  * @param {number} devId 设备id
25
+ * @param {number} gid 家庭Id
20
26
  */
21
27
  const getSceneList = _ref => {
22
28
  let {
23
- devId
29
+ devId,
30
+ gid
24
31
  } = _ref;
25
32
  return requestCloud({
26
- api: `${THING}.m.linkage.rule.brief.query`,
33
+ api: "".concat(THING, ".m.linkage.rule.brief.query"),
27
34
  version: '1.0',
28
35
  data: {
29
36
  devId
37
+ },
38
+ extData: {
39
+ gid
30
40
  }
31
41
  });
32
42
  };
33
43
 
34
44
  /**
35
- * 查询已绑定的列表
45
+ * 查询家庭下已绑定的列表
36
46
  * @param {string} bizDomain 业务范围
37
- * @param {string} sourceEntityId 设备id
47
+ * @param {string} devId 设备id
38
48
  * @param {number} entityType 实体类型
49
+ * @param {string} gid 家庭Id
39
50
  */
40
-
41
- const getBindRuleList = params => {
51
+ const getBindRuleList = async params => {
52
+ const {
53
+ gid,
54
+ devId,
55
+ sourceEntityId
56
+ } = params,
57
+ rest = _objectWithoutProperties(params, _excluded);
42
58
  return requestCloud({
43
- api: `${THING}.m.linkage.associative.entity.id.category.query`,
59
+ api: "".concat(THING, ".m.linkage.associative.entity.id.category.query"),
44
60
  version: '1.0',
45
- data: _objectSpread({}, params)
61
+ data: _objectSpread(_objectSpread({}, rest), {}, {
62
+ sourceEntityId: sourceEntityId || devId
63
+ }),
64
+ extData: {
65
+ gid
66
+ }
46
67
  });
47
68
  };
48
69
 
@@ -65,7 +86,7 @@ const bindRule = _ref2 => {
65
86
  bizDomain
66
87
  } = _ref2;
67
88
  return requestCloud({
68
- api: `${THING}.m.linkage.associative.entity.bind`,
89
+ api: "".concat(THING, ".m.linkage.associative.entity.bind"),
69
90
  version: '1.0',
70
91
  data: {
71
92
  relationExpr: {
@@ -96,13 +117,13 @@ const bindRule = _ref2 => {
96
117
  /**
97
118
  * 解除联动
98
119
  * @param {string} bizDomain 业务范围
99
- * @param {string} sourceEntityId 设备id
120
+ * @param {string} devId 设备id
100
121
  * @param {string} associativeEntityId 关联dp组合
101
122
  * @param {string} associativeEntityValue 规则id
102
123
  */
103
124
  const removeRule = params => {
104
125
  return requestCloud({
105
- api: `${THING}.m.linkage.associative.entity.remove`,
126
+ api: "".concat(THING, ".m.linkage.associative.entity.remove"),
106
127
  version: '1.0',
107
128
  data: _objectSpread({}, params)
108
129
  });
@@ -117,7 +138,7 @@ const triggerRule = _ref3 => {
117
138
  ruleId
118
139
  } = _ref3;
119
140
  return requestCloud({
120
- api: `${THING}.m.linkage.rule.trigger`,
141
+ api: "".concat(THING, ".m.linkage.rule.trigger"),
121
142
  version: '1.0',
122
143
  data: {
123
144
  ruleId
@@ -134,7 +155,7 @@ const enableRule = _ref4 => {
134
155
  ruleId
135
156
  } = _ref4;
136
157
  return requestCloud({
137
- api: `${THING}.m.linkage.rule.enable`,
158
+ api: "".concat(THING, ".m.linkage.rule.enable"),
138
159
  version: '1.0',
139
160
  data: {
140
161
  ruleId
@@ -151,7 +172,7 @@ const disableRule = _ref5 => {
151
172
  ruleId
152
173
  } = _ref5;
153
174
  return requestCloud({
154
- api: `${THING}.m.linkage.rule.disable`,
175
+ api: "".concat(THING, ".m.linkage.rule.disable"),
155
176
  version: '1.0',
156
177
  data: {
157
178
  ruleId
@@ -0,0 +1,15 @@
1
+ type ProductIconVOMap = {
2
+ [productId: string]: {
3
+ icon: string;
4
+ smallIcon: string;
5
+ };
6
+ };
7
+ /**
8
+ * 根据设备ids获取出行产品图片
9
+ * @param params {deviceIds: string[]}
10
+ * @returns ProductIconVOMap
11
+ */
12
+ export declare const getOutdoorDeviceIcon: (params: {
13
+ deviceIds: string[];
14
+ }) => Promise<ProductIconVOMap>;
15
+ export {};
@@ -0,0 +1,25 @@
1
+ import { THING } from '../constants';
2
+ import requestCloud from '../requestCloud';
3
+ /**
4
+ * 根据设备ids获取出行产品图片
5
+ * @param params {deviceIds: string[]}
6
+ * @returns ProductIconVOMap
7
+ */
8
+ export const getOutdoorDeviceIcon = params => {
9
+ return new Promise((resolve, reject) => {
10
+ requestCloud({
11
+ api: "".concat(THING, ".m.trip.outdoors.device.icon.get"),
12
+ version: '1.0',
13
+ data: {
14
+ deviceIds: params.deviceIds.join(',')
15
+ },
16
+ success(res) {
17
+ // @ts-ignore
18
+ resolve(res.productIconVOMap);
19
+ },
20
+ fail(err) {
21
+ reject(err);
22
+ }
23
+ });
24
+ });
25
+ };
@@ -0,0 +1,36 @@
1
+ ```
2
+ let apis = [
3
+ `tuya.m.menu.basket.status`,
4
+ `tuya.m.menu.basket.list`,
5
+ `tuya.m.menu.basket.food.add`,
6
+ `tuya.m.menu.basket.food.update`,
7
+ `tuya.m.menu.basket.food.delete`,
8
+ `tuya.m.menu.basket.food.own`,
9
+ `tuya.m.menu.basket.food.want`,
10
+ `tuya.m.menu.basket.food.clean`,
11
+ `tuya.m.menu.basket.food.nutrition`,
12
+ `tuya.m.menu.basket.menu.exist`,
13
+ `tuya.m.menu.category.list`,
14
+ `tuya.m.menu.category.list`,
15
+ `tuya.m.menu.custom.lang.list`,
16
+ `tuya.m.menu.diy.add`,
17
+ `tuya.m.menu.diy.update`,
18
+ `tuya.m.menu.diy.delete`,
19
+ `tuya.m.menu.lang.list`,
20
+ `tuya.m.menu.get`,
21
+ `tuya.m.cookbook.all.lang`,
22
+ `tuya.m.menu.query.model.list`,
23
+ `tuya.m.menu.search.condition`,
24
+ `tuya.m.menu.query.history.list`,
25
+ `tuya.m.menu.query.history.delete`,
26
+ `tuya.m.menu.query.history.clean`,
27
+ `tuya.m.menu.score.add`,
28
+ `tuya.m.menu.score.get`,
29
+ `tuya.m.menu.score.bat.get`,
30
+ `tuya.m.menu.star.list`,
31
+ `tuya.m.menu.star.add`,
32
+ `tuya.m.menu.star.delete`,
33
+ `tuya.m.menu.star.check`,
34
+ `tuya.m.menu.star.count`,
35
+ ]
36
+ ```