@ray-js/api 1.7.53 → 1.7.55

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 (48) hide show
  1. package/lib/cloud/alarm.js +2 -2
  2. package/lib/cloud/core.js +1 -1
  3. package/lib/cloud/device.js +8 -7
  4. package/lib/cloud/deviceFile.js +5 -5
  5. package/lib/cloud/doorlock/auth.js +8 -8
  6. package/lib/cloud/doorlock/device.js +13 -13
  7. package/lib/cloud/doorlock/fittings.js +4 -4
  8. package/lib/cloud/doorlock/log.js +7 -7
  9. package/lib/cloud/doorlock/member-opmode.js +6 -6
  10. package/lib/cloud/doorlock/member.js +13 -13
  11. package/lib/cloud/doorlock/offline-pwd.js +4 -4
  12. package/lib/cloud/doorlock/sence.js +3 -3
  13. package/lib/cloud/doorlock/service.js +1 -1
  14. package/lib/cloud/doorlock/setting.js +11 -11
  15. package/lib/cloud/doorlock/temp-pwd.js +7 -7
  16. package/lib/cloud/doorlock/unlock-method.js +3 -3
  17. package/lib/cloud/doorlock/unlock.js +3 -3
  18. package/lib/cloud/electrician/tariffService.js +2 -2
  19. package/lib/cloud/highlights.js +8 -7
  20. package/lib/cloud/linkage.js +17 -17
  21. package/lib/cloud/outdoor.js +9 -9
  22. package/lib/cloud/recipe/basket.js +11 -10
  23. package/lib/cloud/recipe/category-list.js +2 -2
  24. package/lib/cloud/recipe/custom.js +5 -4
  25. package/lib/cloud/recipe/menu.js +6 -5
  26. package/lib/cloud/recipe/query.js +4 -3
  27. package/lib/cloud/recipe/record.js +3 -3
  28. package/lib/cloud/recipe/score.js +4 -3
  29. package/lib/cloud/recipe/star.js +6 -5
  30. package/lib/cloud/remoteGroup.js +2 -2
  31. package/lib/cloud/statistic.js +9 -9
  32. package/lib/cloud/timer.js +14 -14
  33. package/lib/getBoundingClientRect/index.thing.js +1 -0
  34. package/lib/getBoundingClientRect/index.wechat.js +1 -0
  35. package/lib/getCdnUrl/index.d.ts +1 -0
  36. package/lib/getCdnUrl/index.js +1 -0
  37. package/lib/getCdnUrl/index.thing.d.ts +1 -1
  38. package/lib/getCdnUrl/index.thing.js +25 -20
  39. package/lib/getCdnUrl/index.wechat.js +5 -5
  40. package/lib/getElementById/index.thing.js +1 -1
  41. package/lib/getElementById/index.wechat.js +1 -1
  42. package/lib/panel/i18n/index.js +16 -12
  43. package/lib/panel/i18n/index.wechat.js +16 -12
  44. package/lib/panel/publishDps.js +1 -1
  45. package/lib/redirectTo/index.js +2 -0
  46. package/lib/utils.js +9 -9
  47. package/lib/utils.wechat.js +6 -5
  48. package/package.json +5 -5
@@ -2,6 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  const _excluded = ["query"],
4
4
  _excluded2 = ["like"];
5
+ import "core-js/modules/es.json.stringify.js";
5
6
  import { THING } from '../../constants';
6
7
  import requestCloud from '../../requestCloud';
7
8
  // #region 食谱列表
@@ -33,7 +34,7 @@ export const getRecipeList = params => {
33
34
  } = params,
34
35
  rest = _objectWithoutProperties(params, _excluded);
35
36
  return requestCloud({
36
- api: `${THING}.m.menu.lang.list`,
37
+ api: "".concat(THING, ".m.menu.lang.list"),
37
38
  version: '2.0',
38
39
  data: _objectSpread({
39
40
  queryJson: JSON.stringify(query)
@@ -67,7 +68,7 @@ export const getRecipeList = params => {
67
68
  // 获取食谱详情的函数
68
69
  export const getRecipeDetail = params => {
69
70
  return requestCloud({
70
- api: `${THING}.m.menu.get`,
71
+ api: "".concat(THING, ".m.menu.get"),
71
72
  version: '1.0',
72
73
  data: params
73
74
  });
@@ -92,7 +93,7 @@ export const operateRecipeLike = params => {
92
93
  } = params,
93
94
  rest = _objectWithoutProperties(params, _excluded2);
94
95
  return requestCloud({
95
- api: `m.ha.recipe.operate.like`,
96
+ api: "m.ha.recipe.operate.like",
96
97
  version: '1.0',
97
98
  data: _objectSpread({
98
99
  likeJson: JSON.stringify(like)
@@ -119,7 +120,7 @@ export const getPanelRecipeList = params => {
119
120
  query
120
121
  } = params;
121
122
  return requestCloud({
122
- api: `m.ha.recipe.panel.list`,
123
+ api: "m.ha.recipe.panel.list",
123
124
  version: '1.0',
124
125
  data: {
125
126
  devId,
@@ -142,7 +143,7 @@ export const getPanelRecipeList = params => {
142
143
  */
143
144
  export const getPanelRecipeDetail = params => {
144
145
  return requestCloud({
145
- api: `m.ha.recipe.panel.get`,
146
+ api: "m.ha.recipe.panel.get",
146
147
  version: '1.0',
147
148
  data: params
148
149
  });
@@ -1,6 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  const _excluded = ["query"];
4
+ import "core-js/modules/es.json.stringify.js";
4
5
  import { THING } from '../../constants';
5
6
  import requestCloud from '../../requestCloud';
6
7
 
@@ -24,7 +25,7 @@ import requestCloud from '../../requestCloud';
24
25
  */
25
26
  export const getAllLanguages = () => {
26
27
  return requestCloud({
27
- api: `${THING}.m.cookbook.all.lang`,
28
+ api: "".concat(THING, ".m.cookbook.all.lang"),
28
29
  version: '1.0',
29
30
  data: {}
30
31
  });
@@ -57,7 +58,7 @@ export const getAllLanguages = () => {
57
58
  */
58
59
  export const getSearchModel = params => {
59
60
  return requestCloud({
60
- api: `${THING}.m.menu.query.model.list`,
61
+ api: "".concat(THING, ".m.menu.query.model.list"),
61
62
  version: '1.0',
62
63
  data: params
63
64
  });
@@ -90,7 +91,7 @@ export const getCookingTimeCondition = params => {
90
91
  } = params,
91
92
  rest = _objectWithoutProperties(params, _excluded);
92
93
  return requestCloud({
93
- api: `${THING}.m.menu.search.condition`,
94
+ api: "".concat(THING, ".m.menu.search.condition"),
94
95
  version: '1.0',
95
96
  data: _objectSpread({
96
97
  queryJson: JSON.stringify(query)
@@ -24,7 +24,7 @@ import requestCloud from '../../requestCloud';
24
24
  */
25
25
  export function getSearchHistoryList(params) {
26
26
  return requestCloud({
27
- api: `${THING}.m.menu.query.history.list`,
27
+ api: "".concat(THING, ".m.menu.query.history.list"),
28
28
  version: '1.0',
29
29
  data: params
30
30
  });
@@ -51,7 +51,7 @@ export function getSearchHistoryList(params) {
51
51
  */
52
52
  export function deleteSearchHistory(params) {
53
53
  return requestCloud({
54
- api: `${THING}.m.menu.query.history.delete`,
54
+ api: "".concat(THING, ".m.menu.query.history.delete"),
55
55
  version: '1.0',
56
56
  data: params
57
57
  });
@@ -78,7 +78,7 @@ export function deleteSearchHistory(params) {
78
78
  */
79
79
  export function cleanSearchHistory(params) {
80
80
  return requestCloud({
81
- api: `${THING}.m.menu.query.history.clean`,
81
+ api: "".concat(THING, ".m.menu.query.history.clean"),
82
82
  version: '1.0',
83
83
  data: params
84
84
  });
@@ -2,6 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  const _excluded = ["scoreInfo"],
4
4
  _excluded2 = ["query"];
5
+ import "core-js/modules/es.json.stringify.js";
5
6
  import { THING } from '../../constants';
6
7
  import requestCloud from '../../requestCloud';
7
8
  // #region 用户添加评分
@@ -31,7 +32,7 @@ export const addRecipeScore = params => {
31
32
  } = params,
32
33
  rest = _objectWithoutProperties(params, _excluded);
33
34
  return requestCloud({
34
- api: `${THING}.m.menu.score.add`,
35
+ api: "".concat(THING, ".m.menu.score.add"),
35
36
  version: '1.0',
36
37
  data: _objectSpread({
37
38
  scoreJson: JSON.stringify(scoreInfo)
@@ -62,7 +63,7 @@ export const addRecipeScore = params => {
62
63
  */
63
64
  export const getRecipeScoreByMenuId = params => {
64
65
  return requestCloud({
65
- api: `${THING}.m.menu.score.get`,
66
+ api: "".concat(THING, ".m.menu.score.get"),
66
67
  version: '1.0',
67
68
  data: params
68
69
  });
@@ -95,7 +96,7 @@ export const getRecipeScoresByMenuIds = params => {
95
96
  } = params,
96
97
  rest = _objectWithoutProperties(params, _excluded2);
97
98
  return requestCloud({
98
- api: `${THING}.m.menu.score.bat.get`,
99
+ api: "".concat(THING, ".m.menu.score.bat.get"),
99
100
  version: '1.0',
100
101
  data: _objectSpread({
101
102
  queryJson: JSON.stringify(query)
@@ -1,6 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  const _excluded = ["query"];
4
+ import "core-js/modules/es.json.stringify.js";
4
5
  import { THING } from '../../constants';
5
6
  import requestCloud from '../../requestCloud';
6
7
  // #region 获取食谱收藏列表
@@ -36,7 +37,7 @@ export const getRecipeCollectionList = params => {
36
37
  } = params,
37
38
  rest = _objectWithoutProperties(params, _excluded);
38
39
  return requestCloud({
39
- api: `${THING}.m.menu.star.list`,
40
+ api: "".concat(THING, ".m.menu.star.list"),
40
41
  version: '2.0',
41
42
  data: _objectSpread({
42
43
  queryJson: JSON.stringify(query)
@@ -65,7 +66,7 @@ export const getRecipeCollectionList = params => {
65
66
  */
66
67
  export const addRecipeToFavorites = params => {
67
68
  return requestCloud({
68
- api: `${THING}.m.menu.star.add`,
69
+ api: "".concat(THING, ".m.menu.star.add"),
69
70
  version: '1.0',
70
71
  data: params
71
72
  });
@@ -92,7 +93,7 @@ export const addRecipeToFavorites = params => {
92
93
  */
93
94
  export const removeRecipeFromFavorites = params => {
94
95
  return requestCloud({
95
- api: `${THING}.m.menu.star.delete`,
96
+ api: "".concat(THING, ".m.menu.star.delete"),
96
97
  version: '1.0',
97
98
  data: params
98
99
  });
@@ -117,7 +118,7 @@ export const removeRecipeFromFavorites = params => {
117
118
  */
118
119
  export const checkRecipeIsStarred = params => {
119
120
  return requestCloud({
120
- api: `${THING}.m.menu.star.check`,
121
+ api: "".concat(THING, ".m.menu.star.check"),
121
122
  version: '1.0',
122
123
  data: params
123
124
  });
@@ -142,7 +143,7 @@ export const checkRecipeIsStarred = params => {
142
143
  */
143
144
  export const getRecipeStarCount = params => {
144
145
  return requestCloud({
145
- api: `${THING}.m.menu.star.count`,
146
+ api: "".concat(THING, ".m.menu.star.count"),
146
147
  version: '1.0',
147
148
  data: params
148
149
  });
@@ -6,7 +6,7 @@ import { THING } from '../constants';
6
6
  */
7
7
  const getZigbeeLocalGroupRelation = params => {
8
8
  return requestCloud({
9
- api: `${THING}.p.remote.local.relation.get`,
9
+ api: "".concat(THING, ".p.remote.local.relation.get"),
10
10
  version: '1.0',
11
11
  data: {
12
12
  devId: params.devId,
@@ -20,7 +20,7 @@ const getZigbeeLocalGroupRelation = params => {
20
20
  */
21
21
  const getZigbeeLocalGroupDeviceList = params => {
22
22
  return requestCloud({
23
- api: `${THING}.m.device.group.dev.list`,
23
+ api: "".concat(THING, ".m.device.group.dev.list"),
24
24
  version: '1.0',
25
25
  data: params,
26
26
  extData: {
@@ -14,7 +14,7 @@ import { THING } from '../constants';
14
14
  */
15
15
  const getLogInSpecifiedTime = params => {
16
16
  return requestCloud({
17
- api: `${THING}.m.smart.operate.all.log`,
17
+ api: "".concat(THING, ".m.smart.operate.all.log"),
18
18
  version: '1.0',
19
19
  data: _objectSpread({}, params)
20
20
  });
@@ -62,7 +62,7 @@ const getLogUserAction = params => {
62
62
  */
63
63
  const getDpLogDays = params => {
64
64
  return requestCloud({
65
- api: `${THING}.m.dp.stat.days.list`,
65
+ api: "".concat(THING, ".m.dp.stat.days.list"),
66
66
  version: '1.0',
67
67
  data: _objectSpread({}, params)
68
68
  });
@@ -76,7 +76,7 @@ const getDpLogDays = params => {
76
76
  */
77
77
  const getDpResultByMonth = params => {
78
78
  return requestCloud({
79
- api: `${THING}.m.dp.stat.month.list`,
79
+ api: "".concat(THING, ".m.dp.stat.month.list"),
80
80
  version: '1.0',
81
81
  data: _objectSpread({}, params)
82
82
  });
@@ -93,7 +93,7 @@ const getDpResultByMonth = params => {
93
93
  */
94
94
  const getDpResultByHour = params => {
95
95
  return requestCloud({
96
- api: `${THING}.m.dp.rang.stat.hour.list`,
96
+ api: "".concat(THING, ".m.dp.rang.stat.hour.list"),
97
97
  version: '1.0',
98
98
  data: _objectSpread({}, params)
99
99
  });
@@ -111,7 +111,7 @@ const getDpResultByHour = params => {
111
111
  */
112
112
  const getDataWithSpecified = params => {
113
113
  return requestCloud({
114
- api: `${THING}.m.dp.rang.stat.day.list`,
114
+ api: "".concat(THING, ".m.dp.rang.stat.day.list"),
115
115
  version: '2.0',
116
116
  data: _objectSpread({}, params)
117
117
  });
@@ -127,7 +127,7 @@ const getDataWithSpecified = params => {
127
127
  */
128
128
  const getWeekWithSpecified = params => {
129
129
  return requestCloud({
130
- api: `${THING}.m.dp.rang.stat.week.list`,
130
+ api: "".concat(THING, ".m.dp.rang.stat.week.list"),
131
131
  version: '1.0',
132
132
  data: _objectSpread({}, params)
133
133
  });
@@ -145,7 +145,7 @@ const getWeekWithSpecified = params => {
145
145
  */
146
146
  const getMonthWithSpecified = params => {
147
147
  return requestCloud({
148
- api: `${THING}.m.dp.rang.stat.month.list`,
148
+ api: "".concat(THING, ".m.dp.rang.stat.month.list"),
149
149
  version: '2.0',
150
150
  data: _objectSpread({}, params)
151
151
  });
@@ -159,7 +159,7 @@ const getMonthWithSpecified = params => {
159
159
  */
160
160
  const getDpAllStatistResult = params => {
161
161
  return requestCloud({
162
- api: `${THING}.m.dp.stat.total`,
162
+ api: "".concat(THING, ".m.dp.stat.total"),
163
163
  version: '1.0',
164
164
  data: _objectSpread({}, params)
165
165
  });
@@ -179,7 +179,7 @@ const getDpAllStatistResult = params => {
179
179
  */
180
180
  const getMultiDpsAllResult = params => {
181
181
  return requestCloud({
182
- api: `${THING}.m.device.query.device.log`,
182
+ api: "".concat(THING, ".m.device.query.device.log"),
183
183
  version: '1.0',
184
184
  data: _objectSpread({}, params)
185
185
  });
@@ -15,7 +15,7 @@ import { THING } from '../constants';
15
15
  */
16
16
  const addSingleTimer = params => {
17
17
  return requestCloud({
18
- api: `${THING}.m.clock.dps.add`,
18
+ api: "".concat(THING, ".m.clock.dps.add"),
19
19
  version: '1.0',
20
20
  data: _objectSpread({}, params)
21
21
  });
@@ -29,7 +29,7 @@ const addSingleTimer = params => {
29
29
  */
30
30
  const queryTimerTasks = params => {
31
31
  return requestCloud({
32
- api: `${THING}.m.clock.dps.list`,
32
+ api: "".concat(THING, ".m.clock.dps.list"),
33
33
  version: '1.0',
34
34
  data: _objectSpread({}, params)
35
35
  });
@@ -48,7 +48,7 @@ const queryTimerTasks = params => {
48
48
  */
49
49
  const modifySingleTimer = params => {
50
50
  return requestCloud({
51
- api: `${THING}.m.clock.dps.update`,
51
+ api: "".concat(THING, ".m.clock.dps.update"),
52
52
  version: '1.0',
53
53
  data: _objectSpread({}, params)
54
54
  });
@@ -67,7 +67,7 @@ const modifySingleTimer = params => {
67
67
  */
68
68
  const addGroupTimer = params => {
69
69
  return requestCloud({
70
- api: `${THING}.m.clock.dps.group.add`,
70
+ api: "".concat(THING, ".m.clock.dps.group.add"),
71
71
  version: '1.0',
72
72
  data: _objectSpread({}, params)
73
73
  });
@@ -81,7 +81,7 @@ const addGroupTimer = params => {
81
81
  */
82
82
  const queryGroupTimerTasks = params => {
83
83
  return requestCloud({
84
- api: `${THING}.m.clock.dps.group.list`,
84
+ api: "".concat(THING, ".m.clock.dps.group.list"),
85
85
  version: '1.0',
86
86
  data: _objectSpread({}, params)
87
87
  });
@@ -99,7 +99,7 @@ const queryGroupTimerTasks = params => {
99
99
  */
100
100
  const modifyGroupTimer = params => {
101
101
  return requestCloud({
102
- api: `${THING}.m.clock.dps.group.update`,
102
+ api: "".concat(THING, ".m.clock.dps.group.update"),
103
103
  version: '1.0',
104
104
  data: _objectSpread({}, params)
105
105
  });
@@ -114,7 +114,7 @@ const modifyGroupTimer = params => {
114
114
  */
115
115
  const modDeleteTaskByIds = params => {
116
116
  return requestCloud({
117
- api: `${THING}.m.clock.batch.status.update`,
117
+ api: "".concat(THING, ".m.clock.batch.status.update"),
118
118
  version: '1.0',
119
119
  data: _objectSpread({}, params)
120
120
  });
@@ -129,7 +129,7 @@ const modDeleteTaskByIds = params => {
129
129
  */
130
130
  const modDeleteTaskByCategory = params => {
131
131
  return requestCloud({
132
- api: `${THING}.m.clock.category.status.update`,
132
+ api: "".concat(THING, ".m.clock.category.status.update"),
133
133
  version: '1.0',
134
134
  data: _objectSpread({}, params)
135
135
  });
@@ -170,7 +170,7 @@ const getDpsLastTimer = params => {
170
170
  */
171
171
  const getLastTimerPeriod = params => {
172
172
  return requestCloud({
173
- api: `${THING}.m.timer.nearest.get`,
173
+ api: "".concat(THING, ".m.timer.nearest.get"),
174
174
  version: '1.0',
175
175
  data: _objectSpread({}, params)
176
176
  });
@@ -181,7 +181,7 @@ const getLastTimerPeriod = params => {
181
181
  */
182
182
  const getAstronomicalList = params => {
183
183
  return requestCloud({
184
- api: `${THING}.m.timer.astronomical.list`,
184
+ api: "".concat(THING, ".m.timer.astronomical.list"),
185
185
  version: '1.0',
186
186
  data: _objectSpread({}, params)
187
187
  });
@@ -203,7 +203,7 @@ const getAstronomicalList = params => {
203
203
  */
204
204
  const addAstronomical = params => {
205
205
  return requestCloud({
206
- api: `${THING}.m.timer.astronomical.add`,
206
+ api: "".concat(THING, ".m.timer.astronomical.add"),
207
207
  version: '1.0',
208
208
  data: _objectSpread({}, params)
209
209
  });
@@ -225,7 +225,7 @@ const addAstronomical = params => {
225
225
  */
226
226
  const updateAstronomical = params => {
227
227
  return requestCloud({
228
- api: `${THING}.m.timer.astronomical.update`,
228
+ api: "".concat(THING, ".m.timer.astronomical.update"),
229
229
  version: '1.0',
230
230
  data: _objectSpread({}, params)
231
231
  });
@@ -238,7 +238,7 @@ const updateAstronomical = params => {
238
238
  */
239
239
  const updateAstronomicalStatus = params => {
240
240
  return requestCloud({
241
- api: `${THING}.m.timer.astronomical.status.update`,
241
+ api: "".concat(THING, ".m.timer.astronomical.status.update"),
242
242
  version: '1.0',
243
243
  data: _objectSpread({}, params)
244
244
  });
@@ -250,7 +250,7 @@ const updateAstronomicalStatus = params => {
250
250
  */
251
251
  const removeAstronomical = params => {
252
252
  return requestCloud({
253
- api: `${THING}.m.timer.astronomical.remove`,
253
+ api: "".concat(THING, ".m.timer.astronomical.remove"),
254
254
  version: '1.0',
255
255
  data: _objectSpread({}, params)
256
256
  });
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.regexp.exec.js";
1
2
  export default function getBoundingClientRect(ref) {
2
3
  return new Promise(resolve => {
3
4
  ref.boundingClientRect(rect => {
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.regexp.exec.js";
1
2
  export default function getBoundingClientRect(ref) {
2
3
  return new Promise(resolve => {
3
4
  ref.boundingClientRect(rect => {
@@ -25,6 +25,7 @@ interface IImageProcessOptions {
25
25
  * @param path - 图片路径
26
26
  * @param cdnMap - CDN 地址映射表,若未提供,则使用内置 regionMap 直接与 path 进行拼接
27
27
  * @param region - 区域代码,若未提供,则使用内置方法获取,EU 兜底
28
+ * @param process - 图片处理参数对象
28
29
  * @returns CDN 完整地址
29
30
  */
30
31
  export default function getCdnUrl(path: string, cdnMap?: ICdnMap, region?: IRegionCode, process?: IImageProcessOptions): string;
@@ -5,6 +5,7 @@
5
5
  * @param path - 图片路径
6
6
  * @param cdnMap - CDN 地址映射表,若未提供,则使用内置 regionMap 直接与 path 进行拼接
7
7
  * @param region - 区域代码,若未提供,则使用内置方法获取,EU 兜底
8
+ * @param process - 图片处理参数对象
8
9
  * @returns CDN 完整地址
9
10
  */
10
11
  export default function getCdnUrl(path) {
@@ -26,7 +26,7 @@ export declare function getRegionCode(): Promise<IRegionCode>;
26
26
  * @param path - 图片路径
27
27
  * @param cdnMap - CDN 地址映射表,若未提供,则使用内置 regionMap 直接与 path 进行拼接
28
28
  * @param region - 区域代码,若未提供,则使用内置方法获取,EU 兜底
29
- * @param process - 图片处理参数对象(可选)
29
+ * @param process - 图片处理参数对象
30
30
  * @returns CDN 完整地址
31
31
  */
32
32
  export default function getCdnUrl(path: string, cdnMap?: ICdnMap, region?: IRegionCode, process?: IImageProcessOptions): string;
@@ -1,3 +1,5 @@
1
+ import "core-js/modules/es.regexp.exec.js";
2
+ import "core-js/modules/es.string.replace.js";
1
3
  import get from 'lodash/get';
2
4
  const regionMap = {
3
5
  AY: 'https://images.tuyacn.com',
@@ -12,6 +14,8 @@ const regionMap = {
12
14
 
13
15
  // 国外有处理参数时统一使用该域名
14
16
  const unifiedProcessDomain = 'https://d395y9yyizm1zb.cdn5th.com';
17
+ // 西欧区不接受 aws 相关服务,有处理参数时使用该域名
18
+ const weProcessDomain = 'https://weimagedq8qoz7.cdn5th.com';
15
19
  let _globalRegionCode;
16
20
  const getInternalRegionCode = () => {
17
21
  if (!_globalRegionCode) {
@@ -46,9 +50,9 @@ export function getRegionCode() {
46
50
  const concatRegionOrigin = (regionCode, path) => {
47
51
  const regionOrigin = get(regionMap, [regionCode]) || get(regionMap, ['EU']);
48
52
  if (path.indexOf('/') === 0) {
49
- return `${regionOrigin}${path}`;
53
+ return "".concat(regionOrigin).concat(path);
50
54
  }
51
- return `${regionOrigin}/${path}`;
55
+ return "".concat(regionOrigin, "/").concat(path);
52
56
  };
53
57
  const isEmptyOrUndefined = obj => {
54
58
  return !obj || Object.keys(obj).length === 0;
@@ -66,10 +70,10 @@ const buildOperationChain = opts => {
66
70
  y
67
71
  } = opts.crop;
68
72
  const cropParts = ['crop'];
69
- if (w != null) cropParts.push(`w_${w}`);
70
- if (h != null) cropParts.push(`h_${h}`);
71
- if (x != null) cropParts.push(`x_${x}`);
72
- if (y != null) cropParts.push(`y_${y}`);
73
+ if (w != null) cropParts.push("w_".concat(w));
74
+ if (h != null) cropParts.push("h_".concat(h));
75
+ if (x != null) cropParts.push("x_".concat(x));
76
+ if (y != null) cropParts.push("y_".concat(y));
73
77
  seg.push(cropParts.join(','));
74
78
  }
75
79
  if (opts.resize && !isEmptyOrUndefined(opts.resize)) {
@@ -78,15 +82,15 @@ const buildOperationChain = opts => {
78
82
  h
79
83
  } = opts.resize;
80
84
  const resizeParts = ['resize'];
81
- if (w != null) resizeParts.push(`w_${w}`);
82
- if (h != null) resizeParts.push(`h_${h}`);
85
+ if (w != null) resizeParts.push("w_".concat(w));
86
+ if (h != null) resizeParts.push("h_".concat(h));
83
87
  seg.push(resizeParts.join(','));
84
88
  }
85
89
  if (opts.rotate && opts.rotate.value) {
86
- seg.push(`rotate,${opts.rotate.value}`);
90
+ seg.push("rotate,".concat(opts.rotate.value));
87
91
  }
88
92
  if (opts.format && opts.format.value) {
89
- seg.push(`format,${opts.format.value}`);
93
+ seg.push("format,".concat(opts.format.value));
90
94
  }
91
95
  if (seg.length === 1) return '';
92
96
  return seg.join('/');
@@ -98,12 +102,12 @@ const buildProcessQuery = (regionCode, opts) => {
98
102
  const chain = buildOperationChain(opts);
99
103
  if (!chain) return '';
100
104
  const key = regionCode === 'AY' ? 'x-oss-process' : 'process';
101
- return `${key}=${chain}`;
105
+ return "".concat(key, "=").concat(chain);
102
106
  };
103
107
  const appendQuery = (url, query) => {
104
108
  if (!query) return url;
105
- if (url.indexOf('?') === -1) return `${url}?${query}`;
106
- return url.endsWith('?') || url.endsWith('&') ? `${url}${query}` : `${url}&${query}`;
109
+ if (url.indexOf('?') === -1) return "".concat(url, "?").concat(query);
110
+ return url.endsWith('?') || url.endsWith('&') ? "".concat(url).concat(query) : "".concat(url, "&").concat(query);
107
111
  };
108
112
 
109
113
  /**
@@ -113,16 +117,17 @@ const appendQuery = (url, query) => {
113
117
  * @param path - 图片路径
114
118
  * @param cdnMap - CDN 地址映射表,若未提供,则使用内置 regionMap 直接与 path 进行拼接
115
119
  * @param region - 区域代码,若未提供,则使用内置方法获取,EU 兜底
116
- * @param process - 图片处理参数对象(可选)
120
+ * @param process - 图片处理参数对象
117
121
  * @returns CDN 完整地址
118
122
  */
119
123
  export default function getCdnUrl(path, cdnMap, region, process) {
120
124
  const regionCode = region || getInternalRegionCode();
121
125
  const hasProcess = !!process && !isEmptyOrUndefined(process);
122
126
  const queryPart = buildProcessQuery(regionCode, process);
127
+ const processDomain = regionCode === 'WE' ? weProcessDomain : unifiedProcessDomain;
123
128
  if (isEmptyOrUndefined(cdnMap)) {
124
129
  if (hasProcess && regionCode !== 'AY') {
125
- const url = path.indexOf('/') === 0 ? `${unifiedProcessDomain}${path}` : `${unifiedProcessDomain}/${path}`;
130
+ const url = path.indexOf('/') === 0 ? "".concat(processDomain).concat(path) : "".concat(processDomain, "/").concat(path);
126
131
  return appendQuery(url, queryPart);
127
132
  }
128
133
  return appendQuery(concatRegionOrigin(regionCode, path), queryPart);
@@ -131,9 +136,9 @@ export default function getCdnUrl(path, cdnMap, region, process) {
131
136
  // 总是使用 EU 进行兜底
132
137
  const cdnShortPath = get(cdnMap, [regionCode, path]) || get(cdnMap, ['EU', path]) || get(cdnMap, [path]);
133
138
  if (!cdnShortPath) {
134
- console.warn(`[App] cdn "${path}" is not exist.`);
139
+ console.warn("[App] cdn \"".concat(path, "\" is not exist."));
135
140
  if (hasProcess && regionCode !== 'AY') {
136
- const url = path.indexOf('/') === 0 ? `${unifiedProcessDomain}${path}` : `${unifiedProcessDomain}/${path}`;
141
+ const url = path.indexOf('/') === 0 ? "".concat(processDomain).concat(path) : "".concat(processDomain, "/").concat(path);
137
142
  return appendQuery(url, queryPart);
138
143
  }
139
144
  return appendQuery(path, queryPart);
@@ -142,14 +147,14 @@ export default function getCdnUrl(path, cdnMap, region, process) {
142
147
  if (cdnShortPath.indexOf('http') === 0 || cdnShortPath.indexOf('//') === 0) {
143
148
  finalUrl = cdnShortPath;
144
149
  } else if (cdnShortPath.indexOf('/') === 0) {
145
- finalUrl = `${regionMap[regionCode]}${cdnShortPath}`;
150
+ finalUrl = "".concat(regionMap[regionCode]).concat(cdnShortPath);
146
151
  } else {
147
- finalUrl = `${regionMap[regionCode]}/${cdnShortPath}`;
152
+ finalUrl = "".concat(regionMap[regionCode], "/").concat(cdnShortPath);
148
153
  }
149
154
  if (hasProcess && regionCode !== 'AY') {
150
155
  const originPrefix = regionMap[regionCode];
151
156
  if (finalUrl.startsWith(originPrefix)) {
152
- finalUrl = finalUrl.replace(originPrefix, unifiedProcessDomain);
157
+ finalUrl = finalUrl.replace(originPrefix, processDomain);
153
158
  }
154
159
  }
155
160
  return appendQuery(finalUrl, queryPart);
@@ -5,9 +5,9 @@ const regionMap = {
5
5
  const concatRegionOrigin = (regionCode, path) => {
6
6
  const regionOrigin = get(regionMap, [regionCode]) || get(regionMap, ['EU']);
7
7
  if (path.indexOf('/') === 0) {
8
- return `${regionOrigin}${path}`;
8
+ return "".concat(regionOrigin).concat(path);
9
9
  }
10
- return `${regionOrigin}/${path}`;
10
+ return "".concat(regionOrigin, "/").concat(path);
11
11
  };
12
12
  const isEmptyOrUndefined = obj => {
13
13
  return !obj || Object.keys(obj).length === 0;
@@ -32,16 +32,16 @@ export default function getCdnUrl(path, cdnMap) {
32
32
  // 总是使用 EU 进行兜底
33
33
  const cdnShortPath = get(cdnMap, [regionCode, path]) || get(cdnMap, ['AY', path]) || get(cdnMap, [path]);
34
34
  if (!cdnShortPath) {
35
- console.warn(`[App] cdn "${path}" is not exist.`);
35
+ console.warn("[App] cdn \"".concat(path, "\" is not exist."));
36
36
  return path;
37
37
  }
38
38
  if (cdnShortPath.indexOf('http') === 0 || cdnShortPath.indexOf('//') === 0) {
39
39
  return cdnShortPath;
40
40
  }
41
41
  if (cdnShortPath.indexOf('/') === 0) {
42
- return `${regionMap[regionCode]}${cdnShortPath}`;
42
+ return "".concat(regionMap[regionCode]).concat(cdnShortPath);
43
43
  }
44
- return `${regionMap[regionCode]}/${cdnShortPath}`;
44
+ return "".concat(regionMap[regionCode], "/").concat(cdnShortPath);
45
45
  }
46
46
 
47
47
  /**
@@ -1,6 +1,6 @@
1
1
  export default function getElementById(id) {
2
2
  return new Promise(resolve => {
3
- const nodeRef = ty.createSelectorQuery().select(`#${id}`);
3
+ const nodeRef = ty.createSelectorQuery().select("#".concat(id));
4
4
  resolve(nodeRef);
5
5
  });
6
6
  }
@@ -1,6 +1,6 @@
1
1
  export default function getElementById(id) {
2
2
  return new Promise(resolve => {
3
- const nodeRef = wx.createSelectorQuery().select(`#${id}`);
3
+ const nodeRef = wx.createSelectorQuery().select("#".concat(id));
4
4
  resolve(nodeRef);
5
5
  });
6
6
  }