@ray-js/api 0.6.29 → 0.7.1-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.
- package/lib/DeviceKit-3.0.0.d.ts +1 -1
- package/lib/DeviceKit-3.0.0.js +2 -3
- package/lib/getCdnUrl/index.d.ts +1 -0
- package/lib/getCdnUrl/index.js +4 -0
- package/lib/getCdnUrl/index.thing.d.ts +1 -0
- package/lib/getCdnUrl/index.thing.js +28 -0
- package/lib/getCdnUrl/index.wechat.d.ts +1 -0
- package/lib/getCdnUrl/index.wechat.js +4 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/panel/index.thing.d.ts +2 -2
- package/lib/panel/index.thing.js +2 -2
- package/package.json +5 -5
package/lib/DeviceKit-3.0.0.d.ts
CHANGED
@@ -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
|
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;
|
package/lib/DeviceKit-3.0.0.js
CHANGED
@@ -158,9 +158,8 @@ export var getSubDeviceInfoList = factory('getSubDeviceInfoList', {
|
|
158
158
|
});
|
159
159
|
export var validDeviceOnlineType = factory('validDeviceOnlineType', {
|
160
160
|
"namespace": "device"
|
161
|
-
});
|
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 @@
|
|
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;
|
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,
|
4
|
-
export { initPanelEnvironment,
|
3
|
+
declare const initPanelEnvironment: typeof kit.initPanelEnvironment, sendDps: typeof kit.publishDps, I18N: typeof kit.I18N;
|
4
|
+
export { initPanelEnvironment, sendDps, I18N };
|
package/lib/panel/index.thing.js
CHANGED
@@ -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
|
-
|
4
|
+
sendDps = kit.publishDps,
|
5
5
|
I18N = kit.I18N;
|
6
|
-
export { initPanelEnvironment,
|
6
|
+
export { initPanelEnvironment, sendDps, I18N };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.7.1-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.
|
29
|
+
"@ray-js/framework": "^0.7.1-beta-1",
|
30
30
|
"@ray-js/panel-sdk": "^1.2.2",
|
31
|
-
"@ray-js/router": "^0.
|
31
|
+
"@ray-js/router": "^0.7.1-beta-1"
|
32
32
|
},
|
33
33
|
"devDependencies": {
|
34
|
-
"@ray-js/cli": "^0.
|
34
|
+
"@ray-js/cli": "^0.7.1-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": "
|
49
|
+
"gitHead": "2640de2036353f044299b13254feab39544e6336",
|
50
50
|
"repository": {}
|
51
51
|
}
|