@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,131 @@
1
+ /**
2
+ * GetRecipeCollectionListQuery - 获取食谱收藏列表查询条件
3
+ */
4
+ type GetRecipeCollectionListQuery = {
5
+ pageNo?: number;
6
+ pageSize?: number;
7
+ };
8
+ /**
9
+ * GetRecipeCollectionListParams - 获取食谱收藏列表请求参数
10
+ */
11
+ type GetRecipeCollectionListParams = {
12
+ query: GetRecipeCollectionListQuery;
13
+ devId: string;
14
+ };
15
+ /**
16
+ * RecipeInfo - 食谱信息
17
+ */
18
+ type RecipeInfo = {
19
+ id: number;
20
+ mainImg: string;
21
+ lang: number;
22
+ langDesc: string;
23
+ desc: string;
24
+ cookType: number;
25
+ extInfo: string;
26
+ sourceType: number;
27
+ isMainShow: number;
28
+ isShowControl: number;
29
+ isControl: number;
30
+ name: string;
31
+ easyLevel: string;
32
+ easyLevelDesc: string;
33
+ taste: string;
34
+ tasteDesc: string;
35
+ foodType: string;
36
+ foodTypeDesc: string;
37
+ gmtCreate: number;
38
+ gmtModified: number;
39
+ };
40
+ /**
41
+ * GetRecipeCollectionListResult - 获取食谱收藏列表返回结果
42
+ */
43
+ type GetRecipeCollectionListResult = {
44
+ totalCount: number;
45
+ pageNo: number;
46
+ pageSize: number;
47
+ hasNext: boolean;
48
+ data: RecipeInfo[];
49
+ };
50
+ /**
51
+ * GetRecipeCollectionListResponse - 获取食谱收藏列表响应
52
+ */
53
+ type GetRecipeCollectionListResponse = GetRecipeCollectionListResult;
54
+ /**
55
+ * 获取食谱收藏列表
56
+ * @param {GetRecipeCollectionListParams} params - 获取食谱收藏列表请求参数
57
+ * @returns {Promise<GetRecipeCollectionListResponse>} - 获取食谱收藏列表响应的 Promise
58
+ */
59
+ export declare const getRecipeCollectionList: (params: GetRecipeCollectionListParams) => Promise<GetRecipeCollectionListResponse>;
60
+ /**
61
+ * AddRecipeToFavoritesParams - 添加食谱收藏参数
62
+ */
63
+ type AddRecipeToFavoritesParams = {
64
+ menuId: number;
65
+ devId: string;
66
+ };
67
+ /**
68
+ * AddRecipeToFavoritesResponse - 添加食谱收藏响应
69
+ */
70
+ type AddRecipeToFavoritesResponse = boolean;
71
+ /**
72
+ * 添加食谱收藏
73
+ * @param {AddRecipeToFavoritesParams} params - 添加食谱收藏参数
74
+ * @returns {Promise<AddRecipeToFavoritesResponse>} - 添加食谱收藏结果的 Promise
75
+ */
76
+ export declare const addRecipeToFavorites: (params: AddRecipeToFavoritesParams) => Promise<AddRecipeToFavoritesResponse>;
77
+ /**
78
+ * RemoveRecipeFromFavoritesParams - 取消食谱收藏参数
79
+ */
80
+ type RemoveRecipeFromFavoritesParams = {
81
+ menuId: number;
82
+ devId: string;
83
+ };
84
+ /**
85
+ * RemoveRecipeFromFavoritesResponse - 取消食谱收藏响应
86
+ */
87
+ type RemoveRecipeFromFavoritesResponse = boolean;
88
+ /**
89
+ * 取消食谱收藏
90
+ * @param {RemoveRecipeFromFavoritesParams} params - 取消食谱收藏参数
91
+ * @returns {Promise<RemoveRecipeFromFavoritesResponse>} - 取消食谱收藏结果的 Promise
92
+ */
93
+ export declare const removeRecipeFromFavorites: (params: RemoveRecipeFromFavoritesParams) => Promise<RemoveRecipeFromFavoritesResponse>;
94
+ /**
95
+ * CheckRecipeIsStarredParams - 查询食谱是否收藏参数
96
+ */
97
+ type CheckRecipeIsStarredParams = {
98
+ menuId: number;
99
+ devId: string;
100
+ };
101
+ /**
102
+ * CheckRecipeIsStarredResponse - 查询食谱是否收藏响应
103
+ */
104
+ type CheckRecipeIsStarredResponse = {
105
+ isStar: boolean;
106
+ };
107
+ /**
108
+ * 查询食谱是否收藏
109
+ * @param {CheckRecipeIsStarredParams} params - 查询食谱是否收藏参数
110
+ * @returns {Promise<CheckRecipeIsStarredResponse>} - 查询食谱是否收藏结果的 Promise
111
+ */
112
+ export declare const checkRecipeIsStarred: (params: CheckRecipeIsStarredParams) => Promise<CheckRecipeIsStarredResponse>;
113
+ /**
114
+ * GetRecipeStarCountParams - 查询食谱收藏数量参数
115
+ */
116
+ type GetRecipeStarCountParams = {
117
+ devId: string;
118
+ };
119
+ /**
120
+ * GetRecipeStarCountResponse - 查询食谱收藏数量响应
121
+ */
122
+ type GetRecipeStarCountResponse = {
123
+ count: number;
124
+ };
125
+ /**
126
+ * 查询用户已收藏的食谱数量
127
+ * @param {GetRecipeStarCountParams} params - 查询食谱收藏数量参数
128
+ * @returns {Promise<GetRecipeStarCountResponse>} - 查询食谱收藏数量结果的 Promise
129
+ */
130
+ export declare const getRecipeStarCount: (params: GetRecipeStarCountParams) => Promise<GetRecipeStarCountResponse>;
131
+ export {};
@@ -0,0 +1,151 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ const _excluded = ["query"];
4
+ import { THING } from '../../constants';
5
+ import requestCloud from '../../requestCloud';
6
+ // #region 获取食谱收藏列表
7
+
8
+ /**
9
+ * GetRecipeCollectionListQuery - 获取食谱收藏列表查询条件
10
+ */
11
+
12
+ /**
13
+ * GetRecipeCollectionListParams - 获取食谱收藏列表请求参数
14
+ */
15
+
16
+ /**
17
+ * RecipeInfo - 食谱信息
18
+ */
19
+
20
+ /**
21
+ * GetRecipeCollectionListResult - 获取食谱收藏列表返回结果
22
+ */
23
+
24
+ /**
25
+ * GetRecipeCollectionListResponse - 获取食谱收藏列表响应
26
+ */
27
+
28
+ /**
29
+ * 获取食谱收藏列表
30
+ * @param {GetRecipeCollectionListParams} params - 获取食谱收藏列表请求参数
31
+ * @returns {Promise<GetRecipeCollectionListResponse>} - 获取食谱收藏列表响应的 Promise
32
+ */
33
+ export const getRecipeCollectionList = params => {
34
+ const {
35
+ query
36
+ } = params,
37
+ rest = _objectWithoutProperties(params, _excluded);
38
+ return requestCloud({
39
+ api: "".concat(THING, ".m.menu.star.list"),
40
+ version: '2.0',
41
+ data: _objectSpread({
42
+ queryJson: JSON.stringify(query)
43
+ }, rest)
44
+ });
45
+ };
46
+
47
+ // #endregion
48
+
49
+ // #region 添加食谱收藏
50
+
51
+ /**
52
+ * AddRecipeToFavoritesParams - 添加食谱收藏参数
53
+ */
54
+
55
+ /**
56
+ * AddRecipeToFavoritesResponse - 添加食谱收藏响应
57
+ */
58
+
59
+ // 返回结果,是否添加成功
60
+
61
+ /**
62
+ * 添加食谱收藏
63
+ * @param {AddRecipeToFavoritesParams} params - 添加食谱收藏参数
64
+ * @returns {Promise<AddRecipeToFavoritesResponse>} - 添加食谱收藏结果的 Promise
65
+ */
66
+ export const addRecipeToFavorites = params => {
67
+ return requestCloud({
68
+ api: "".concat(THING, ".m.menu.star.add"),
69
+ version: '1.0',
70
+ data: params
71
+ });
72
+ };
73
+
74
+ // #endregion
75
+
76
+ // #region 取消食谱收藏
77
+
78
+ /**
79
+ * RemoveRecipeFromFavoritesParams - 取消食谱收藏参数
80
+ */
81
+
82
+ /**
83
+ * RemoveRecipeFromFavoritesResponse - 取消食谱收藏响应
84
+ */
85
+
86
+ // 返回结果,是否取消成功
87
+
88
+ /**
89
+ * 取消食谱收藏
90
+ * @param {RemoveRecipeFromFavoritesParams} params - 取消食谱收藏参数
91
+ * @returns {Promise<RemoveRecipeFromFavoritesResponse>} - 取消食谱收藏结果的 Promise
92
+ */
93
+ export const removeRecipeFromFavorites = params => {
94
+ return requestCloud({
95
+ api: "".concat(THING, ".m.menu.star.delete"),
96
+ version: '1.0',
97
+ data: params
98
+ });
99
+ };
100
+
101
+ // #endregion
102
+
103
+ // #region 食谱是否收藏
104
+
105
+ /**
106
+ * CheckRecipeIsStarredParams - 查询食谱是否收藏参数
107
+ */
108
+
109
+ /**
110
+ * CheckRecipeIsStarredResponse - 查询食谱是否收藏响应
111
+ */
112
+
113
+ /**
114
+ * 查询食谱是否收藏
115
+ * @param {CheckRecipeIsStarredParams} params - 查询食谱是否收藏参数
116
+ * @returns {Promise<CheckRecipeIsStarredResponse>} - 查询食谱是否收藏结果的 Promise
117
+ */
118
+ export const checkRecipeIsStarred = params => {
119
+ return requestCloud({
120
+ api: "".concat(THING, ".m.menu.star.check"),
121
+ version: '1.0',
122
+ data: params
123
+ });
124
+ };
125
+
126
+ // #endregion
127
+
128
+ // #region 食谱收藏数量
129
+
130
+ /**
131
+ * GetRecipeStarCountParams - 查询食谱收藏数量参数
132
+ */
133
+
134
+ /**
135
+ * GetRecipeStarCountResponse - 查询食谱收藏数量响应
136
+ */
137
+
138
+ /**
139
+ * 查询用户已收藏的食谱数量
140
+ * @param {GetRecipeStarCountParams} params - 查询食谱收藏数量参数
141
+ * @returns {Promise<GetRecipeStarCountResponse>} - 查询食谱收藏数量结果的 Promise
142
+ */
143
+ export const getRecipeStarCount = params => {
144
+ return requestCloud({
145
+ api: "".concat(THING, ".m.menu.star.count"),
146
+ version: '1.0',
147
+ data: params
148
+ });
149
+ };
150
+
151
+ // #endregion
@@ -0,0 +1,196 @@
1
+ ## getRecipeCollectionList
2
+
3
+ 获取食谱收藏列表。
4
+
5
+ ### 引入
6
+
7
+ > @ray-js/ray^1.5.0 以上版本可使用
8
+
9
+ ```js
10
+ import { getRecipeCollectionList } from '@ray-js/ray'
11
+ ```
12
+
13
+ **参数**
14
+
15
+ **GetRecipeCollectionListParams params**
16
+
17
+ 封装了获取食谱收藏列表的查询条件和设备 ID。
18
+
19
+ **参数属性 GetRecipeCollectionListParams**
20
+
21
+ | 属性 | 类型 | 默认值 | 必填 | 说明 |
22
+ | ----- | ------------------------------ | ------ | ---- | -------- |
23
+ | query | `GetRecipeCollectionListQuery` | | 是 | 查询条件 |
24
+ | devId | `string` | | 是 | 设备 ID |
25
+
26
+ **函数定义示例**
27
+
28
+ ```typescript
29
+ /**
30
+ * 获取食谱收藏列表
31
+ * @param {GetRecipeCollectionListParams} params - 获取食谱收藏列表请求参数
32
+ * @returns {Promise<GetRecipeCollectionListResponse>} - 获取食谱收藏列表响应的 Promise 对象
33
+ */
34
+ export const getRecipeCollectionList: (
35
+ params: GetRecipeCollectionListParams
36
+ ) => Promise<GetRecipeCollectionListResponse>
37
+ ```
38
+
39
+ ---
40
+
41
+ ## addRecipeToFavorites
42
+
43
+ 添加食谱收藏。
44
+
45
+ ### 引入
46
+
47
+ > @ray-js/ray^1.5.0 以上版本可使用
48
+
49
+ ```js
50
+ import { addRecipeToFavorites } from '@ray-js/ray'
51
+ ```
52
+
53
+ **参数**
54
+
55
+ **AddRecipeToFavoritesParams params**
56
+
57
+ 封装了食谱 ID 和设备 ID。
58
+
59
+ **参数属性 AddRecipeToFavoritesParams**
60
+
61
+ | 属性 | 类型 | 默认值 | 必填 | 说明 |
62
+ | ------ | -------- | ------ | ---- | ------- |
63
+ | menuId | `number` | | 是 | 食谱 ID |
64
+ | devId | `string` | | 是 | 设备 ID |
65
+
66
+ **函数定义示例**
67
+
68
+ ```typescript
69
+ /**
70
+ * 添加食谱收藏
71
+ * @param {AddRecipeToFavoritesParams} params - 添加食谱收藏参数
72
+ * @returns {Promise<AddRecipeToFavoritesResponse>} - 添加食谱收藏结果的 Promise 对象
73
+ */
74
+ export const addRecipeToFavorites: (
75
+ params: AddRecipeToFavoritesParams
76
+ ) => Promise<AddRecipeToFavoritesResponse>
77
+ ```
78
+
79
+ ---
80
+
81
+ ## removeRecipeFromFavorites
82
+
83
+ 取消食谱收藏。
84
+
85
+ ### 引入
86
+
87
+ > @ray-js/ray^1.5.0 以上版本可使用
88
+
89
+ ```js
90
+ import { removeRecipeFromFavorites } from '@ray-js/ray'
91
+ ```
92
+
93
+ **参数**
94
+
95
+ **RemoveRecipeFromFavoritesParams params**
96
+
97
+ 封装了食谱 ID 和设备 ID。
98
+
99
+ **参数属性 RemoveRecipeFromFavoritesParams**
100
+
101
+ | 属性 | 类型 | 默认值 | 必填 | 说明 |
102
+ | ------ | -------- | ------ | ---- | ------- |
103
+ | menuId | `number` | | 是 | 食谱 ID |
104
+ | devId | `string` | | 是 | 设备 ID |
105
+
106
+ **函数定义示例**
107
+
108
+ ```typescript
109
+ /**
110
+ * 取消食谱收藏
111
+ * @param {RemoveRecipeFromFavoritesParams} params - 取消食谱收藏参数
112
+ * @returns {Promise<RemoveRecipeFromFavoritesResponse>} - 取消食谱收藏结果的 Promise 对象
113
+ */
114
+ export const removeRecipeFromFavorites: (
115
+ params: RemoveRecipeFromFavoritesParams
116
+ ) => Promise<RemoveRecipeFromFavoritesResponse>
117
+ ```
118
+
119
+ ---
120
+
121
+ ## checkRecipeIsStarred
122
+
123
+ 查询食谱是否收藏。
124
+
125
+ ### 引入
126
+
127
+ > @ray-js/ray^1.5.0 以上版本可使用
128
+
129
+ ```js
130
+ import { checkRecipeIsStarred } from '@ray-js/ray'
131
+ ```
132
+
133
+ **参数**
134
+
135
+ **CheckRecipeIsStarredParams params**
136
+
137
+ 封装了食谱 ID 和设备 ID。
138
+
139
+ **参数属性 CheckRecipeIsStarredParams**
140
+
141
+ | 属性 | 类型 | 默认值 | 必填 | 说明 |
142
+ | ------ | -------- | ------ | ---- | ------- |
143
+ | menuId | `number` | | 是 | 食谱 ID |
144
+ | devId | `string` | | 是 | 设备 ID |
145
+
146
+ **函数定义示例**
147
+
148
+ ```typescript
149
+ /**
150
+ * 查询食谱是否收藏
151
+ * @param {CheckRecipeIsStarredParams} params - 查询食谱是否收藏参数
152
+ * @returns {Promise<CheckRecipeIsStarredResponse>} - 查询食谱是否收藏结果的 Promise 对象
153
+ */
154
+ export const checkRecipeIsStarred: (
155
+ params: CheckRecipeIsStarredParams
156
+ ) => Promise<CheckRecipeIsStarredResponse>
157
+ ```
158
+
159
+ ---
160
+
161
+ ## getRecipeStarCount
162
+
163
+ 查询用户已收藏的食谱数量。
164
+
165
+ ### 引入
166
+
167
+ > @ray-js/ray^1.5.0 以上版本可使用
168
+
169
+ ```js
170
+ import { getRecipeStarCount } from '@ray-js/ray'
171
+ ```
172
+
173
+ **参数**
174
+
175
+ **GetRecipeStarCountParams params**
176
+
177
+ 封装了设备 ID。
178
+
179
+ **参数属性 GetRecipeStarCountParams**
180
+
181
+ | 属性 | 类型 | 默认值 | 必填 | 说明 |
182
+ | ----- | -------- | ------ | ---- | ------- |
183
+ | devId | `string` | | 是 | 设备 ID |
184
+
185
+ **函数定义示例**
186
+
187
+ ```typescript
188
+ /**
189
+ * 查询用户已收藏的食谱数量
190
+ * @param {GetRecipeStarCountParams} params - 查询食谱收藏数量参数
191
+ * @returns {Promise<GetRecipeStarCountResponse>} - 查询食谱收藏数量结果的 Promise 对象
192
+ */
193
+ export const getRecipeStarCount: (
194
+ params: GetRecipeStarCountParams
195
+ ) => Promise<GetRecipeStarCountResponse>
196
+ ```
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 多语言信息
3
+ */
4
+ declare type LangInfo = {
5
+ lang: string;
6
+ name: string;
7
+ };
File without changes
@@ -0,0 +1,10 @@
1
+ import { IGetZigbeeLocalGroupDeviceList, IGetZigbeeLocalGroupRelation } from './interface';
2
+ /**
3
+ * 获取 Zigbee 遥控器群组 localId 列表
4
+ */
5
+ declare const getZigbeeLocalGroupRelation: (params: IGetZigbeeLocalGroupRelation) => Promise<string>;
6
+ /**
7
+ * 获取可以加入 Zigbee 遥控器群组的设备列表
8
+ */
9
+ declare const getZigbeeLocalGroupDeviceList: (params: IGetZigbeeLocalGroupDeviceList) => Promise<string>;
10
+ export { getZigbeeLocalGroupRelation, getZigbeeLocalGroupDeviceList };
@@ -0,0 +1,31 @@
1
+ // 遥控器群组接口
2
+ import { requestCloud } from '../';
3
+ import { THING } from '../constants';
4
+ /**
5
+ * 获取 Zigbee 遥控器群组 localId 列表
6
+ */
7
+ const getZigbeeLocalGroupRelation = params => {
8
+ return requestCloud({
9
+ api: "".concat(THING, ".p.remote.local.relation.get"),
10
+ version: '1.0',
11
+ data: {
12
+ devId: params.devId,
13
+ type: 0
14
+ }
15
+ });
16
+ };
17
+
18
+ /**
19
+ * 获取可以加入 Zigbee 遥控器群组的设备列表
20
+ */
21
+ const getZigbeeLocalGroupDeviceList = params => {
22
+ return requestCloud({
23
+ api: "".concat(THING, ".m.device.group.dev.list"),
24
+ version: '1.0',
25
+ data: params,
26
+ extData: {
27
+ gid: params.homeId
28
+ }
29
+ });
30
+ };
31
+ export { getZigbeeLocalGroupRelation, getZigbeeLocalGroupDeviceList };
package/lib/constants.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { decode } from 'base64-browser';
2
- const THING = decode('dHV5YQ==');
2
+ const THING = decode('dHV5YQ=='); // => 'tuya'
3
3
  export { THING };
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ NATIVE_ROUTER_ERROR_ENVIRONMENT: number;
3
+ };
4
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export default {
2
+ NATIVE_ROUTER_ERROR_ENVIRONMENT: 40016
3
+ };
@@ -1,2 +1,2 @@
1
- export default function getCdnUrl(path: string): string;
2
- export declare function getCdnUrlAsync(path: string): Promise<string>;
1
+ export default function getCdnUrl(path: string, cdnMap?: Record<string, string>, region?: string): string;
2
+ export declare function getCdnUrlAsync(path: string, cdnMap?: Record<string, string>, region?: string): Promise<string>;
@@ -1,8 +1,7 @@
1
1
  export default function getCdnUrl(path) {
2
- // 暂未实现获取cdn方法,将直接返回path
3
2
  return path;
4
3
  }
5
- export function getCdnUrlAsync(path) {
4
+ export async function getCdnUrlAsync(path) {
6
5
  // 暂未实现获取cdn方法,将直接返回path
7
6
  return Promise.resolve(path);
8
7
  }
@@ -1,2 +1,2 @@
1
- export default function getCdnUrl(path: string): string;
2
- export declare function getCdnUrlAsync(path: string): Promise<string>;
1
+ export default function getCdnUrl(path: string, cdnMap?: Record<string, string>, region?: string): string;
2
+ export declare function getCdnUrlAsync(path: string, cdnMap?: Record<string, string>, region?: string): Promise<string>;
@@ -1,8 +1,7 @@
1
1
  export default function getCdnUrl(path) {
2
- // 暂未实现获取cdn方法,将直接返回path
3
2
  return path;
4
3
  }
5
- export function getCdnUrlAsync(path) {
4
+ export async function getCdnUrlAsync(path) {
6
5
  // 暂未实现获取cdn方法,将直接返回path
7
6
  return Promise.resolve(path);
8
7
  }
package/lib/index.d.ts CHANGED
@@ -35,5 +35,6 @@ export * from './openGroupCreate';
35
35
  /**
36
36
  * 新增跳转Native路由
37
37
  * 1.4.23 openSceneCreate/openSceneEdit
38
+ * 1.4.32 openCreateScene/openEditScene/openGuideScene/openAppScan/openConfigDevice/openUniversalCreateScene
38
39
  */
39
40
  export * from './nativeRouters';
package/lib/index.js CHANGED
@@ -39,5 +39,6 @@ export * from './openGroupCreate';
39
39
  /**
40
40
  * 新增跳转Native路由
41
41
  * 1.4.23 openSceneCreate/openSceneEdit
42
+ * 1.4.32 openCreateScene/openEditScene/openGuideScene/openAppScan/openConfigDevice/openUniversalCreateScene
42
43
  */
43
44
  export * from './nativeRouters';
@@ -0,0 +1,15 @@
1
+ export type ICommon = {
2
+ success?: () => void;
3
+ fail?: (err?: {
4
+ errorMsg: string;
5
+ errorCode: string | number;
6
+ innerError: {
7
+ errorCode: string | number;
8
+ errorMsg: string;
9
+ };
10
+ }) => void;
11
+ complete?: () => void;
12
+ } & {
13
+ [key: string]: string | boolean | number;
14
+ };
15
+ export declare function nativeRouter<T extends ICommon>(uri: string, params?: T): Promise<void>;
@@ -0,0 +1,38 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
+ const _excluded = ["success", "fail", "complete"];
3
+ import { stringifyUrl } from '../utils';
4
+ import ErrorCode from '../errorCode';
5
+ export function nativeRouter(uri, params) {
6
+ const _ref = params || {},
7
+ {
8
+ success,
9
+ fail,
10
+ complete
11
+ } = _ref,
12
+ rest = _objectWithoutProperties(_ref, _excluded);
13
+ return new Promise((resolve, reject) => {
14
+ ty.router({
15
+ url: stringifyUrl({
16
+ url: uri,
17
+ query: rest
18
+ }),
19
+ success() {
20
+ success === null || success === void 0 || success();
21
+ resolve();
22
+ },
23
+ fail(err) {
24
+ if (+err.errorCode === ErrorCode.NATIVE_ROUTER_ERROR_ENVIRONMENT) {
25
+ const errMsg = 'Cannot use in this environment. Please use real device preview.';
26
+ console.warn(errMsg);
27
+ // 该环境不可使用,请使用真机预览和线上包
28
+ err.errorMsg = errMsg;
29
+ }
30
+ fail === null || fail === void 0 || fail(err);
31
+ reject(err);
32
+ },
33
+ complete() {
34
+ complete === null || complete === void 0 || complete();
35
+ }
36
+ });
37
+ });
38
+ }