@ray-js/api 0.6.29 → 0.6.32-beta-1

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.
@@ -52,7 +52,7 @@ export declare const getDeviceInfo: typeof ty.device.getDeviceInfo;
52
52
  export declare const getProductInfo: typeof ty.device.getProductInfo;
53
53
  export declare const getSubDeviceInfoList: typeof ty.device.getSubDeviceInfoList;
54
54
  export declare const validDeviceOnlineType: typeof ty.device.validDeviceOnlineType;
55
- export declare const publishCommonDps: typeof ty.device.publishDps;
55
+ export declare const publishDps: typeof ty.device.publishDps;
56
56
  export declare const publishCommands: typeof ty.device.publishCommands;
57
57
  export declare const publishDpsWithPipeType: typeof ty.device.publishDpsWithPipeType;
58
58
  export declare const queryDps: typeof ty.device.queryDps;
@@ -158,9 +158,8 @@ export var getSubDeviceInfoList = factory('getSubDeviceInfoList', {
158
158
  });
159
159
  export var validDeviceOnlineType = factory('validDeviceOnlineType', {
160
160
  "namespace": "device"
161
- }); // Note: v1.0.0 由于Panel-sdk中封装,所以废弃原有DeviceKit中提供的 publishDps,别名为 publishCommonDps, Panel-sdk中封装的publishDps兼容原有publishDps。
162
-
163
- export var publishCommonDps = factory('publishDps', {
161
+ });
162
+ export var publishDps = factory('publishDps', {
164
163
  "namespace": "device"
165
164
  });
166
165
  export var publishCommands = factory('publishCommands', {
@@ -0,0 +1 @@
1
+ export default function getCdnUrl(path: string): string;
@@ -0,0 +1,4 @@
1
+ export default function getCdnUrl(path) {
2
+ // 暂未实现获取cdn方法,将直接返回path
3
+ return path;
4
+ }
@@ -0,0 +1 @@
1
+ export default function getCdnUrl(path: string, cdnMap?: Record<string, string>): string;
@@ -0,0 +1,28 @@
1
+ export default function getCdnUrl(path, cdnMap) {
2
+ if (!cdnMap) {
3
+ console.warn('请传入cdnMap');
4
+ return path;
5
+ }
6
+
7
+ var regionCode = 'EU';
8
+ ty.getAppInfo().then(function (res) {
9
+ regionCode = res.regionCode;
10
+ });
11
+ var region = {
12
+ AY: 'images.tuyacn.com',
13
+ AZ: 'usimagesd1448c85ulz2o4.cdn5th.com',
14
+ EU: 'euimagesd2h2yqnfpu4gl5.cdn5th.com',
15
+ IN: 'inimagesd1jqokb9wptk2t.cdn5th.com',
16
+ RU: 'euimagesd2h2yqnfpu4gl5.cdn5th.com',
17
+ WE: 'd2h2yqnfpu4gl5.cdn5th.com',
18
+ UE: 'usimagesd1448c85ulz2o4.cdn5th.com'
19
+ }[regionCode];
20
+ var cdnShortPath = cdnMap[path];
21
+
22
+ if (!cdnShortPath) {
23
+ console.warn('[App] cdn "' + path + '" is not exist.');
24
+ return path;
25
+ }
26
+
27
+ return 'https://' + region + '/' + cdnShortPath;
28
+ }
@@ -0,0 +1 @@
1
+ export default function getCdnUrl(path: string): string;
@@ -0,0 +1,4 @@
1
+ export default function getCdnUrl(path) {
2
+ // 暂未实现获取cdn方法,将直接返回path
3
+ return path;
4
+ }
package/lib/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export { default as showTabBar } from './showTabBar';
20
20
  export { default as switchTab } from './switchTab';
21
21
  export { default as onNavigationBarBack } from './onNavigationBarBack';
22
22
  export { default as setNavigationBarBack } from './setNavigationBarBack';
23
+ export { default as getCdnUrl } from './getCdnUrl';
23
24
  /**
24
25
  * 提供 glboal-api 将 wx / ty 对象暴露出去,供给业务在Ray为显示导出api时进行快速响应开发。
25
26
  */
package/lib/index.js CHANGED
@@ -20,6 +20,7 @@ export { default as showTabBar } from './showTabBar';
20
20
  export { default as switchTab } from './switchTab';
21
21
  export { default as onNavigationBarBack } from './onNavigationBarBack';
22
22
  export { default as setNavigationBarBack } from './setNavigationBarBack';
23
+ export { default as getCdnUrl } from './getCdnUrl';
23
24
  /**
24
25
  * 提供 glboal-api 将 wx / ty 对象暴露出去,供给业务在Ray为显示导出api时进行快速响应开发。
25
26
  */
@@ -1,4 +1,4 @@
1
1
  import { kit } from '@ray-js/panel-sdk';
2
2
  export * from '@ray-js/panel-cloud';
3
- declare const initPanelEnvironment: typeof kit.initPanelEnvironment, publishDps: typeof kit.publishDps, I18N: typeof kit.I18N;
4
- export { initPanelEnvironment, publishDps, I18N };
3
+ declare const initPanelEnvironment: typeof kit.initPanelEnvironment, sendDps: typeof kit.publishDps, I18N: typeof kit.I18N;
4
+ export { initPanelEnvironment, sendDps, I18N };
@@ -1,6 +1,6 @@
1
1
  import { kit } from '@ray-js/panel-sdk';
2
2
  export * from '@ray-js/panel-cloud';
3
3
  var initPanelEnvironment = kit.initPanelEnvironment,
4
- publishDps = kit.publishDps,
4
+ sendDps = kit.publishDps,
5
5
  I18N = kit.I18N;
6
- export { initPanelEnvironment, publishDps, I18N };
6
+ export { initPanelEnvironment, sendDps, I18N };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/api",
3
- "version": "0.6.29",
3
+ "version": "0.6.32-beta-1",
4
4
  "description": "Ray universal api",
5
5
  "keywords": [
6
6
  "ray"
@@ -26,12 +26,12 @@
26
26
  "build:kit:api": "node scripts/api-creator.mjs"
27
27
  },
28
28
  "dependencies": {
29
- "@ray-js/framework": "^0.6.29",
29
+ "@ray-js/framework": "^0.6.32-beta-1",
30
30
  "@ray-js/panel-sdk": "^1.2.2",
31
- "@ray-js/router": "^0.6.29"
31
+ "@ray-js/router": "^0.6.32-beta-1"
32
32
  },
33
33
  "devDependencies": {
34
- "@ray-js/cli": "^0.6.29",
34
+ "@ray-js/cli": "^0.6.32-beta-1",
35
35
  "art-template": "^4.13.2",
36
36
  "fs-extra": "^10.1.0",
37
37
  "miniprogram-api-typings": "^3.4.3",
@@ -46,6 +46,6 @@
46
46
  "email": "tuyafe@tuya.com"
47
47
  }
48
48
  ],
49
- "gitHead": "8fd0011cd6c72804fdf29a0e6bd487038f67f0d9",
49
+ "gitHead": "c9caf2f1a430648e4fa0ee1cdf85b6067b780d8c",
50
50
  "repository": {}
51
51
  }