@ray-js/api 1.4.45 → 1.4.47
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/nativeRouters/common.d.ts +15 -0
- package/lib/nativeRouters/common.js +31 -0
- package/lib/nativeRouters/device.d.ts +78 -52
- package/lib/nativeRouters/device.js +89 -137
- package/lib/nativeRouters/outdoors.d.ts +6 -65
- package/lib/nativeRouters/outdoors.js +6 -135
- package/lib/nativeRouters/root.d.ts +45 -13
- package/lib/nativeRouters/root.js +64 -29
- package/package.json +5 -5
@@ -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,31 @@
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2
|
+
const _excluded = ["success", "fail", "complete"];
|
3
|
+
import { stringifyUrl } from '../utils';
|
4
|
+
export function nativeRouter(uri, params) {
|
5
|
+
const _ref = params || {},
|
6
|
+
{
|
7
|
+
success,
|
8
|
+
fail,
|
9
|
+
complete
|
10
|
+
} = _ref,
|
11
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
12
|
+
return new Promise((resolve, reject) => {
|
13
|
+
ty.router({
|
14
|
+
url: stringifyUrl({
|
15
|
+
url: uri,
|
16
|
+
query: rest
|
17
|
+
}),
|
18
|
+
success() {
|
19
|
+
success === null || success === void 0 || success();
|
20
|
+
resolve();
|
21
|
+
},
|
22
|
+
fail(err) {
|
23
|
+
fail === null || fail === void 0 || fail(err);
|
24
|
+
reject(err);
|
25
|
+
},
|
26
|
+
complete() {
|
27
|
+
complete === null || complete === void 0 || complete();
|
28
|
+
}
|
29
|
+
});
|
30
|
+
});
|
31
|
+
}
|
@@ -1,54 +1,19 @@
|
|
1
|
+
import { ICommon } from './common';
|
1
2
|
type OpenSceneCreateParams = {
|
2
3
|
devId?: string;
|
3
|
-
|
4
|
-
fail?: (err?: {
|
5
|
-
errorMsg: string;
|
6
|
-
errorCode: string | number;
|
7
|
-
innerError: {
|
8
|
-
errorCode: string | number;
|
9
|
-
errorMsg: string;
|
10
|
-
};
|
11
|
-
}) => void;
|
12
|
-
complete?: () => void;
|
13
|
-
} & {
|
14
|
-
[key: string]: string | boolean | number;
|
15
|
-
};
|
4
|
+
} & ICommon;
|
16
5
|
export declare function openSceneCreate(params?: OpenSceneCreateParams): Promise<void>;
|
17
6
|
export declare const openCreateScene: typeof openSceneCreate;
|
18
7
|
export declare function openUniversalCreateScene(params?: OpenSceneCreateParams): Promise<void>;
|
19
8
|
type OpenSceneEdit = {
|
20
9
|
devId?: string;
|
21
10
|
sceneId?: string;
|
22
|
-
|
23
|
-
fail?: (err?: {
|
24
|
-
errorMsg: string;
|
25
|
-
errorCode: string | number;
|
26
|
-
innerError: {
|
27
|
-
errorCode: string | number;
|
28
|
-
errorMsg: string;
|
29
|
-
};
|
30
|
-
}) => void;
|
31
|
-
complete?: () => void;
|
32
|
-
} & {
|
33
|
-
[key: string]: string | boolean | number;
|
34
|
-
};
|
11
|
+
} & ICommon;
|
35
12
|
export declare function openSceneEdit(params?: OpenSceneEdit): Promise<void>;
|
36
13
|
export declare const openEditScene: typeof openSceneEdit;
|
37
14
|
type OpenGuideScene = {
|
38
15
|
action?: 'add' | 'edit';
|
39
|
-
|
40
|
-
fail?: (err?: {
|
41
|
-
errorMsg: string;
|
42
|
-
errorCode: string | number;
|
43
|
-
innerError: {
|
44
|
-
errorCode: string | number;
|
45
|
-
errorMsg: string;
|
46
|
-
};
|
47
|
-
}) => void;
|
48
|
-
complete?: () => void;
|
49
|
-
} & {
|
50
|
-
[key: string]: string | boolean | number;
|
51
|
-
};
|
16
|
+
} & ICommon;
|
52
17
|
/**
|
53
18
|
* 打开APP引导场景页
|
54
19
|
* @param params { action?: 'add' | 'edit', success?: () => void, fail?: (err?: { errorMsg: string, errorCode: string | number, innerError: { errorCode: string | number, errorMsg: string } }) => void, complete?: () => void, [key: string]: string | boolean | number }
|
@@ -58,23 +23,84 @@ export declare function openGuideScene(params?: OpenGuideScene): Promise<void>;
|
|
58
23
|
type OpenConfigDevice = {
|
59
24
|
devId?: string;
|
60
25
|
sceneId?: string;
|
61
|
-
|
62
|
-
fail?: (err?: {
|
63
|
-
errorMsg: string;
|
64
|
-
errorCode: string | number;
|
65
|
-
innerError: {
|
66
|
-
errorCode: string | number;
|
67
|
-
errorMsg: string;
|
68
|
-
};
|
69
|
-
}) => void;
|
70
|
-
complete?: () => void;
|
71
|
-
} & {
|
72
|
-
[key: string]: string | boolean | number;
|
73
|
-
};
|
26
|
+
} & ICommon;
|
74
27
|
/**
|
75
28
|
* 打开编辑场景页面
|
76
29
|
* @param params { devId?: string, sceneId?: string, success?: () => void, fail?: (err?: { errorMsg: string, errorCode: string | number, innerError: { errorCode: string | number, errorMsg: string } }) => void, complete?: () => void, [key: string]: string | boolean | number }
|
77
30
|
* @returns
|
78
31
|
*/
|
79
32
|
export declare function openConfigDevice(params?: OpenConfigDevice): Promise<void>;
|
33
|
+
type OpenFamilyAddMember = {
|
34
|
+
/**
|
35
|
+
* 家庭 ID
|
36
|
+
*/
|
37
|
+
homeId?: string;
|
38
|
+
} & ICommon;
|
39
|
+
/**
|
40
|
+
* 跳转到app家庭成员添加页面
|
41
|
+
* @param params { homeId?: string }
|
42
|
+
* @returns
|
43
|
+
*/
|
44
|
+
export declare function openFamilyAddMember(params?: OpenFamilyAddMember): Promise<void>;
|
45
|
+
type OpenDeviceDetail = {
|
46
|
+
/**
|
47
|
+
* 设备 Id
|
48
|
+
*/
|
49
|
+
devId: string;
|
50
|
+
} & ICommon;
|
51
|
+
/**
|
52
|
+
* 跳转设备详情
|
53
|
+
* @param params { devId?: string }
|
54
|
+
* @returns
|
55
|
+
*/
|
56
|
+
export declare function openDeviceDetail(params?: OpenDeviceDetail): Promise<void>;
|
57
|
+
type OpenDeviceOnlySearchConfigGwSub = {
|
58
|
+
gwId?: string;
|
59
|
+
} & ICommon;
|
60
|
+
/**
|
61
|
+
* 搜索子设备
|
62
|
+
* @param params {gwId?: string}
|
63
|
+
* @returns
|
64
|
+
*/
|
65
|
+
export declare function openDeviceOnlySearchConfigGwSub(params?: OpenDeviceOnlySearchConfigGwSub): Promise<void>;
|
66
|
+
type OpenDevNetworkCheck = {} & ICommon;
|
67
|
+
/**
|
68
|
+
* 检测设备网络
|
69
|
+
* @param params { }
|
70
|
+
* @returns
|
71
|
+
*/
|
72
|
+
export declare function openDevNetworkCheck(params?: OpenDevNetworkCheck): Promise<void>;
|
73
|
+
type OpenDeviceGwSubDeviceHelpList = {
|
74
|
+
gwId?: string;
|
75
|
+
} & ICommon;
|
76
|
+
/**
|
77
|
+
* 跳转配网帮助列表
|
78
|
+
*/
|
79
|
+
export declare function openDeviceGwSubDeviceHelpList(params?: OpenDeviceGwSubDeviceHelpList): Promise<void>;
|
80
|
+
type OpenUpgradeDetail = {
|
81
|
+
devId?: string;
|
82
|
+
} & ICommon;
|
83
|
+
/**
|
84
|
+
* 跳转设备升级详情
|
85
|
+
*/
|
86
|
+
export declare function openUpgradeDetail(params?: OpenUpgradeDetail): Promise<void>;
|
87
|
+
type OpenSmartScene = {} & ICommon;
|
88
|
+
/**
|
89
|
+
* 跳转场景
|
90
|
+
*/
|
91
|
+
export declare function openSmartScene(params?: OpenSmartScene): Promise<void>;
|
92
|
+
type OpenDeviceOfflineReconnect = {
|
93
|
+
device_id?: string;
|
94
|
+
} & ICommon;
|
95
|
+
/**
|
96
|
+
* 面板设备离线-重新连接
|
97
|
+
*/
|
98
|
+
export declare function openDeviceOfflineReconnect(params?: OpenDeviceOfflineReconnect): Promise<void>;
|
99
|
+
type OpenDevManualAndSmart = {
|
100
|
+
devId?: string;
|
101
|
+
} & ICommon;
|
102
|
+
/**
|
103
|
+
* 打开 “一键执行”和“自动化”
|
104
|
+
*/
|
105
|
+
export declare function openDevManualAndSmart(params?: OpenDevManualAndSmart): Promise<void>;
|
80
106
|
export {};
|
@@ -1,97 +1,16 @@
|
|
1
|
-
import
|
2
|
-
const _excluded = ["success", "fail", "complete"],
|
3
|
-
_excluded2 = ["success", "fail", "complete"],
|
4
|
-
_excluded3 = ["success", "fail", "complete"],
|
5
|
-
_excluded4 = ["success", "fail", "complete"],
|
6
|
-
_excluded5 = ["success", "fail", "complete"];
|
7
|
-
import { stringifyUrl } from '../utils';
|
1
|
+
import { nativeRouter } from './common';
|
8
2
|
export function openSceneCreate(params) {
|
9
|
-
|
10
|
-
{
|
11
|
-
success,
|
12
|
-
fail,
|
13
|
-
complete
|
14
|
-
} = _ref,
|
15
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
16
|
-
return new Promise((resolve, reject) => {
|
17
|
-
ty.router({
|
18
|
-
url: stringifyUrl({
|
19
|
-
url: 'createScene',
|
20
|
-
query: rest
|
21
|
-
}),
|
22
|
-
success() {
|
23
|
-
success === null || success === void 0 || success();
|
24
|
-
resolve();
|
25
|
-
},
|
26
|
-
fail(err) {
|
27
|
-
fail === null || fail === void 0 || fail(err);
|
28
|
-
reject(err);
|
29
|
-
},
|
30
|
-
complete() {
|
31
|
-
complete === null || complete === void 0 || complete();
|
32
|
-
}
|
33
|
-
});
|
34
|
-
});
|
3
|
+
return nativeRouter('createScene', params);
|
35
4
|
}
|
36
5
|
export const openCreateScene = openSceneCreate;
|
37
6
|
|
38
7
|
// 兼容Android 端仅支持 Zigbee 本地场景, Android使用createSmartScene
|
39
8
|
export function openUniversalCreateScene(params) {
|
40
|
-
const _ref2 = params || {},
|
41
|
-
{
|
42
|
-
success,
|
43
|
-
fail,
|
44
|
-
complete
|
45
|
-
} = _ref2,
|
46
|
-
rest = _objectWithoutProperties(_ref2, _excluded2);
|
47
9
|
const url = ty.getSystemInfoSync().platform === 'android' ? 'createSmartScene' : 'createScene';
|
48
|
-
return
|
49
|
-
ty.router({
|
50
|
-
url: stringifyUrl({
|
51
|
-
url,
|
52
|
-
query: rest
|
53
|
-
}),
|
54
|
-
success() {
|
55
|
-
success === null || success === void 0 || success();
|
56
|
-
resolve();
|
57
|
-
},
|
58
|
-
fail(err) {
|
59
|
-
fail === null || fail === void 0 || fail(err);
|
60
|
-
reject(err);
|
61
|
-
},
|
62
|
-
complete() {
|
63
|
-
complete === null || complete === void 0 || complete();
|
64
|
-
}
|
65
|
-
});
|
66
|
-
});
|
10
|
+
return nativeRouter(url, params);
|
67
11
|
}
|
68
12
|
export function openSceneEdit(params) {
|
69
|
-
|
70
|
-
{
|
71
|
-
success,
|
72
|
-
fail,
|
73
|
-
complete
|
74
|
-
} = _ref3,
|
75
|
-
rest = _objectWithoutProperties(_ref3, _excluded3);
|
76
|
-
return new Promise((resolve, reject) => {
|
77
|
-
ty.router({
|
78
|
-
url: stringifyUrl({
|
79
|
-
url: 'editScene',
|
80
|
-
query: rest
|
81
|
-
}),
|
82
|
-
success() {
|
83
|
-
success === null || success === void 0 || success();
|
84
|
-
resolve();
|
85
|
-
},
|
86
|
-
fail(err) {
|
87
|
-
fail === null || fail === void 0 || fail(err);
|
88
|
-
reject(err);
|
89
|
-
},
|
90
|
-
complete() {
|
91
|
-
complete === null || complete === void 0 || complete();
|
92
|
-
}
|
93
|
-
});
|
94
|
-
});
|
13
|
+
return nativeRouter('editScene', params);
|
95
14
|
}
|
96
15
|
export const openEditScene = openSceneEdit;
|
97
16
|
/**
|
@@ -100,32 +19,7 @@ export const openEditScene = openSceneEdit;
|
|
100
19
|
* @returns
|
101
20
|
*/
|
102
21
|
export function openGuideScene(params) {
|
103
|
-
|
104
|
-
{
|
105
|
-
success,
|
106
|
-
fail,
|
107
|
-
complete
|
108
|
-
} = _ref4,
|
109
|
-
rest = _objectWithoutProperties(_ref4, _excluded4);
|
110
|
-
return new Promise((resolve, reject) => {
|
111
|
-
ty.router({
|
112
|
-
url: stringifyUrl({
|
113
|
-
url: 'thing_add_scene',
|
114
|
-
query: rest
|
115
|
-
}),
|
116
|
-
success() {
|
117
|
-
success === null || success === void 0 || success();
|
118
|
-
resolve();
|
119
|
-
},
|
120
|
-
fail(err) {
|
121
|
-
fail === null || fail === void 0 || fail(err);
|
122
|
-
reject(err);
|
123
|
-
},
|
124
|
-
complete() {
|
125
|
-
complete === null || complete === void 0 || complete();
|
126
|
-
}
|
127
|
-
});
|
128
|
-
});
|
22
|
+
return nativeRouter('thing_add_scene', params);
|
129
23
|
}
|
130
24
|
/**
|
131
25
|
* 打开编辑场景页面
|
@@ -133,30 +27,88 @@ export function openGuideScene(params) {
|
|
133
27
|
* @returns
|
134
28
|
*/
|
135
29
|
export function openConfigDevice(params) {
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
30
|
+
return nativeRouter('config_device', params);
|
31
|
+
}
|
32
|
+
/**
|
33
|
+
* 跳转到app家庭成员添加页面
|
34
|
+
* @param params { homeId?: string }
|
35
|
+
* @returns
|
36
|
+
*/
|
37
|
+
export function openFamilyAddMember(params) {
|
38
|
+
return nativeRouter('tysh_family_add_member_rn', params);
|
39
|
+
}
|
40
|
+
/**
|
41
|
+
* 跳转设备详情
|
42
|
+
* @param params { devId?: string }
|
43
|
+
* @returns
|
44
|
+
*/
|
45
|
+
export function openDeviceDetail(params) {
|
46
|
+
return nativeRouter('device_detail', params);
|
47
|
+
}
|
48
|
+
|
49
|
+
// 搜索子设备 device_only_search_config_gw_sub
|
50
|
+
|
51
|
+
/**
|
52
|
+
* 搜索子设备
|
53
|
+
* @param params {gwId?: string}
|
54
|
+
* @returns
|
55
|
+
*/
|
56
|
+
export function openDeviceOnlySearchConfigGwSub(params) {
|
57
|
+
return nativeRouter('device_only_search_config_gw_sub', params);
|
58
|
+
}
|
59
|
+
|
60
|
+
// dev_network_check
|
61
|
+
|
62
|
+
/**
|
63
|
+
* 检测设备网络
|
64
|
+
* @param params { }
|
65
|
+
* @returns
|
66
|
+
*/
|
67
|
+
export function openDevNetworkCheck(params) {
|
68
|
+
return nativeRouter('dev_network_check', params);
|
69
|
+
}
|
70
|
+
|
71
|
+
// device_gw_sub_device_help_list
|
72
|
+
|
73
|
+
/**
|
74
|
+
* 跳转配网帮助列表
|
75
|
+
*/
|
76
|
+
export function openDeviceGwSubDeviceHelpList(params) {
|
77
|
+
return nativeRouter('device_gw_sub_device_help_list', params);
|
78
|
+
}
|
79
|
+
|
80
|
+
// upgrade_detail
|
81
|
+
|
82
|
+
/**
|
83
|
+
* 跳转设备升级详情
|
84
|
+
*/
|
85
|
+
export function openUpgradeDetail(params) {
|
86
|
+
return nativeRouter('upgrade_detail', params);
|
87
|
+
}
|
88
|
+
|
89
|
+
// 跳转场景 smartScene
|
90
|
+
|
91
|
+
/**
|
92
|
+
* 跳转场景
|
93
|
+
*/
|
94
|
+
export function openSmartScene(params) {
|
95
|
+
return nativeRouter('smartScene', params);
|
96
|
+
}
|
97
|
+
|
98
|
+
// 面板设备离线-重新连接 device_offline_reconnect
|
99
|
+
|
100
|
+
/**
|
101
|
+
* 面板设备离线-重新连接
|
102
|
+
*/
|
103
|
+
export function openDeviceOfflineReconnect(params) {
|
104
|
+
return nativeRouter('device_offline_reconnect', params);
|
105
|
+
}
|
106
|
+
|
107
|
+
// 打开 “一键执行”和“自动化” devManualAndSmart
|
108
|
+
|
109
|
+
/**
|
110
|
+
* 打开 “一键执行”和“自动化”
|
111
|
+
*/
|
112
|
+
export function openDevManualAndSmart(params) {
|
113
|
+
return nativeRouter('devManualAndSmart', params);
|
162
114
|
}
|
@@ -1,18 +1,7 @@
|
|
1
|
+
import { ICommon } from './common';
|
1
2
|
type OpenOutdoorCyclingNavigationParams = {
|
2
3
|
devId?: string;
|
3
|
-
|
4
|
-
fail?: (err?: {
|
5
|
-
errorMsg: string;
|
6
|
-
errorCode: string | number;
|
7
|
-
innerError: {
|
8
|
-
errorCode: string | number;
|
9
|
-
errorMsg: string;
|
10
|
-
};
|
11
|
-
}) => void;
|
12
|
-
complete?: () => void;
|
13
|
-
} & {
|
14
|
-
[key: string]: string | boolean | number;
|
15
|
-
};
|
4
|
+
} & ICommon;
|
16
5
|
/**
|
17
6
|
* 打开骑行导航页面
|
18
7
|
* @param params {devId: string}
|
@@ -21,19 +10,7 @@ type OpenOutdoorCyclingNavigationParams = {
|
|
21
10
|
export declare function openOutdoorCyclingNavigation(params?: OpenOutdoorCyclingNavigationParams): Promise<void>;
|
22
11
|
type OpenAdditionalUnlockMethodsParams = {
|
23
12
|
devId?: string;
|
24
|
-
|
25
|
-
fail?: (err?: {
|
26
|
-
errorMsg: string;
|
27
|
-
errorCode: string | number;
|
28
|
-
innerError: {
|
29
|
-
errorCode: string | number;
|
30
|
-
errorMsg: string;
|
31
|
-
};
|
32
|
-
}) => void;
|
33
|
-
complete?: () => void;
|
34
|
-
} & {
|
35
|
-
[key: string]: string | boolean | number;
|
36
|
-
};
|
13
|
+
} & ICommon;
|
37
14
|
/**
|
38
15
|
* 打开氛围灯页面
|
39
16
|
* @param params {devId: string}
|
@@ -42,19 +19,7 @@ type OpenAdditionalUnlockMethodsParams = {
|
|
42
19
|
export declare function openAdditionalUnlockMethods(params: OpenAdditionalUnlockMethodsParams): Promise<void>;
|
43
20
|
type OpenOutdoorAmbientLightingParams = {
|
44
21
|
devId?: string;
|
45
|
-
|
46
|
-
fail?: (err?: {
|
47
|
-
errorMsg: string;
|
48
|
-
errorCode: string | number;
|
49
|
-
innerError: {
|
50
|
-
errorCode: string | number;
|
51
|
-
errorMsg: string;
|
52
|
-
};
|
53
|
-
}) => void;
|
54
|
-
complete?: () => void;
|
55
|
-
} & {
|
56
|
-
[key: string]: string | boolean | number;
|
57
|
-
};
|
22
|
+
} & ICommon;
|
58
23
|
/**
|
59
24
|
* 打开氛围灯页面
|
60
25
|
* @param params {devId: string}
|
@@ -63,19 +28,7 @@ type OpenOutdoorAmbientLightingParams = {
|
|
63
28
|
export declare function openOutdoorAmbientLighting(params?: OpenOutdoorAmbientLightingParams): Promise<void>;
|
64
29
|
type OpenOutdoorShortcutSiriParams = {
|
65
30
|
devId?: string;
|
66
|
-
|
67
|
-
fail?: (err?: {
|
68
|
-
errorMsg: string;
|
69
|
-
errorCode: string | number;
|
70
|
-
innerError: {
|
71
|
-
errorCode: string | number;
|
72
|
-
errorMsg: string;
|
73
|
-
};
|
74
|
-
}) => void;
|
75
|
-
complete?: () => void;
|
76
|
-
} & {
|
77
|
-
[key: string]: string | boolean | number;
|
78
|
-
};
|
31
|
+
} & ICommon;
|
79
32
|
/**
|
80
33
|
* 打开Siri页面,仅iOS
|
81
34
|
* @param params {devId: string}
|
@@ -84,19 +37,7 @@ type OpenOutdoorShortcutSiriParams = {
|
|
84
37
|
export declare function openOutdoorShortcutSiri(params: OpenOutdoorShortcutSiriParams): Promise<void>;
|
85
38
|
type OpenOutdoorConfigDeviceHomeParams = {
|
86
39
|
productId?: string;
|
87
|
-
|
88
|
-
fail?: (err?: {
|
89
|
-
errorMsg: string;
|
90
|
-
errorCode: string | number;
|
91
|
-
innerError: {
|
92
|
-
errorCode: string | number;
|
93
|
-
errorMsg: string;
|
94
|
-
};
|
95
|
-
}) => void;
|
96
|
-
complete?: () => void;
|
97
|
-
} & {
|
98
|
-
[key: string]: string | boolean | number;
|
99
|
-
};
|
40
|
+
} & ICommon;
|
100
41
|
/**
|
101
42
|
* 打开配网
|
102
43
|
* @param params {devId: string}
|
@@ -1,42 +1,11 @@
|
|
1
|
-
import
|
2
|
-
const _excluded = ["success", "fail", "complete"],
|
3
|
-
_excluded2 = ["success", "fail", "complete"],
|
4
|
-
_excluded3 = ["success", "fail", "complete"],
|
5
|
-
_excluded4 = ["success", "fail", "complete"],
|
6
|
-
_excluded5 = ["success", "fail", "complete"];
|
7
|
-
import { stringifyUrl } from '../utils';
|
1
|
+
import { nativeRouter } from './common';
|
8
2
|
/**
|
9
3
|
* 打开骑行导航页面
|
10
4
|
* @param params {devId: string}
|
11
5
|
* @returns
|
12
6
|
*/
|
13
7
|
export function openOutdoorCyclingNavigation(params) {
|
14
|
-
|
15
|
-
{
|
16
|
-
success,
|
17
|
-
fail,
|
18
|
-
complete
|
19
|
-
} = _ref,
|
20
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
21
|
-
return new Promise((resolve, reject) => {
|
22
|
-
ty.router({
|
23
|
-
url: stringifyUrl({
|
24
|
-
url: 'tsod_outdoor_cycling_navigation',
|
25
|
-
query: rest
|
26
|
-
}),
|
27
|
-
success() {
|
28
|
-
success === null || success === void 0 || success();
|
29
|
-
resolve();
|
30
|
-
},
|
31
|
-
fail(err) {
|
32
|
-
fail === null || fail === void 0 || fail(err);
|
33
|
-
reject(err);
|
34
|
-
},
|
35
|
-
complete() {
|
36
|
-
complete === null || complete === void 0 || complete();
|
37
|
-
}
|
38
|
-
});
|
39
|
-
});
|
8
|
+
return nativeRouter('tsod_outdoor_cycling_navigation', params);
|
40
9
|
}
|
41
10
|
/**
|
42
11
|
* 打开氛围灯页面
|
@@ -44,31 +13,7 @@ export function openOutdoorCyclingNavigation(params) {
|
|
44
13
|
* @returns
|
45
14
|
*/
|
46
15
|
export function openAdditionalUnlockMethods(params) {
|
47
|
-
|
48
|
-
success,
|
49
|
-
fail,
|
50
|
-
complete
|
51
|
-
} = params,
|
52
|
-
rest = _objectWithoutProperties(params, _excluded2);
|
53
|
-
return new Promise((resolve, reject) => {
|
54
|
-
ty.router({
|
55
|
-
url: stringifyUrl({
|
56
|
-
url: 'tsod_additional_unlock_methods',
|
57
|
-
query: rest
|
58
|
-
}),
|
59
|
-
success() {
|
60
|
-
success === null || success === void 0 || success();
|
61
|
-
resolve();
|
62
|
-
},
|
63
|
-
fail(err) {
|
64
|
-
fail === null || fail === void 0 || fail(err);
|
65
|
-
reject(err);
|
66
|
-
},
|
67
|
-
complete() {
|
68
|
-
complete === null || complete === void 0 || complete();
|
69
|
-
}
|
70
|
-
});
|
71
|
-
});
|
16
|
+
return nativeRouter('tsod_additional_unlock_methods', params);
|
72
17
|
}
|
73
18
|
/**
|
74
19
|
* 打开氛围灯页面
|
@@ -76,32 +21,7 @@ export function openAdditionalUnlockMethods(params) {
|
|
76
21
|
* @returns
|
77
22
|
*/
|
78
23
|
export function openOutdoorAmbientLighting(params) {
|
79
|
-
|
80
|
-
{
|
81
|
-
success,
|
82
|
-
fail,
|
83
|
-
complete
|
84
|
-
} = _ref2,
|
85
|
-
rest = _objectWithoutProperties(_ref2, _excluded3);
|
86
|
-
return new Promise((resolve, reject) => {
|
87
|
-
ty.router({
|
88
|
-
url: stringifyUrl({
|
89
|
-
url: 'tsod_outdoor_ambient_lighting',
|
90
|
-
query: rest
|
91
|
-
}),
|
92
|
-
success() {
|
93
|
-
success === null || success === void 0 || success();
|
94
|
-
resolve();
|
95
|
-
},
|
96
|
-
fail(err) {
|
97
|
-
fail === null || fail === void 0 || fail(err);
|
98
|
-
reject(err);
|
99
|
-
},
|
100
|
-
complete() {
|
101
|
-
complete === null || complete === void 0 || complete();
|
102
|
-
}
|
103
|
-
});
|
104
|
-
});
|
24
|
+
return nativeRouter('tsod_outdoor_ambient_lighting', params);
|
105
25
|
}
|
106
26
|
/**
|
107
27
|
* 打开Siri页面,仅iOS
|
@@ -109,31 +29,7 @@ export function openOutdoorAmbientLighting(params) {
|
|
109
29
|
* @returns
|
110
30
|
*/
|
111
31
|
export function openOutdoorShortcutSiri(params) {
|
112
|
-
|
113
|
-
success,
|
114
|
-
fail,
|
115
|
-
complete
|
116
|
-
} = params,
|
117
|
-
rest = _objectWithoutProperties(params, _excluded4);
|
118
|
-
return new Promise((resolve, reject) => {
|
119
|
-
ty.router({
|
120
|
-
url: stringifyUrl({
|
121
|
-
url: 'tsod_outdoor_shortcut_siri',
|
122
|
-
query: rest
|
123
|
-
}),
|
124
|
-
success() {
|
125
|
-
success === null || success === void 0 || success();
|
126
|
-
resolve();
|
127
|
-
},
|
128
|
-
fail(err) {
|
129
|
-
fail === null || fail === void 0 || fail(err);
|
130
|
-
reject(err);
|
131
|
-
},
|
132
|
-
complete() {
|
133
|
-
complete === null || complete === void 0 || complete();
|
134
|
-
}
|
135
|
-
});
|
136
|
-
});
|
32
|
+
return nativeRouter('tsod_outdoor_shortcut_siri', params);
|
137
33
|
}
|
138
34
|
/**
|
139
35
|
* 打开配网
|
@@ -141,30 +37,5 @@ export function openOutdoorShortcutSiri(params) {
|
|
141
37
|
* @returns
|
142
38
|
*/
|
143
39
|
export function openOutdoorConfigDeviceHome(params) {
|
144
|
-
|
145
|
-
{
|
146
|
-
success,
|
147
|
-
fail,
|
148
|
-
complete
|
149
|
-
} = _ref3,
|
150
|
-
rest = _objectWithoutProperties(_ref3, _excluded5);
|
151
|
-
return new Promise((resolve, reject) => {
|
152
|
-
ty.router({
|
153
|
-
url: stringifyUrl({
|
154
|
-
url: 'tsod_outdoor_config_device_home',
|
155
|
-
query: rest
|
156
|
-
}),
|
157
|
-
success() {
|
158
|
-
success === null || success === void 0 || success();
|
159
|
-
resolve();
|
160
|
-
},
|
161
|
-
fail(err) {
|
162
|
-
fail === null || fail === void 0 || fail(err);
|
163
|
-
reject(err);
|
164
|
-
},
|
165
|
-
complete() {
|
166
|
-
complete === null || complete === void 0 || complete();
|
167
|
-
}
|
168
|
-
});
|
169
|
-
});
|
40
|
+
return nativeRouter('tsod_outdoor_config_device_home', params);
|
170
41
|
}
|
@@ -1,23 +1,55 @@
|
|
1
|
+
import { ICommon } from './common';
|
1
2
|
type OpenAppScanParams = {
|
2
3
|
gwId?: string;
|
3
4
|
source?: string;
|
4
|
-
|
5
|
-
fail?: (err?: {
|
6
|
-
errorMsg: string;
|
7
|
-
errorCode: string | number;
|
8
|
-
innerError: {
|
9
|
-
errorCode: string | number;
|
10
|
-
errorMsg: string;
|
11
|
-
};
|
12
|
-
}) => void;
|
13
|
-
complete?: () => void;
|
14
|
-
} & {
|
15
|
-
[key: string]: string | boolean | number;
|
16
|
-
};
|
5
|
+
} & ICommon;
|
17
6
|
/**
|
18
7
|
* 打开APP扫码
|
19
8
|
* @param params {gwId: string, source: string}
|
20
9
|
* @returns
|
21
10
|
*/
|
22
11
|
export declare function openAppScan(params?: OpenAppScanParams): Promise<void>;
|
12
|
+
type OpenHelpAndFeedback = {} & ICommon;
|
13
|
+
/**
|
14
|
+
* 打开帮助与反馈
|
15
|
+
* @param params { }
|
16
|
+
* @returns
|
17
|
+
*/
|
18
|
+
export declare function openHelpAndFeedback(params?: OpenHelpAndFeedback): Promise<void>;
|
19
|
+
type OpenMoreService = {} & ICommon;
|
20
|
+
/**
|
21
|
+
* 跳转到更多服务
|
22
|
+
*/
|
23
|
+
export declare function openMoreService(params?: OpenMoreService): Promise<void>;
|
24
|
+
type OpenHelpCenter = {
|
25
|
+
devId?: string;
|
26
|
+
} & ICommon;
|
27
|
+
/**
|
28
|
+
* 跳转到帮助中心
|
29
|
+
*/
|
30
|
+
export declare function openAppHelpCenter(params?: OpenHelpCenter): Promise<void>;
|
31
|
+
type OpenUserSetting = {} & ICommon;
|
32
|
+
/**
|
33
|
+
* 跳转到用户设置
|
34
|
+
*/
|
35
|
+
export declare function openUserSetting(params?: OpenUserSetting): Promise<void>;
|
36
|
+
type OpenFamilySetting = {
|
37
|
+
homeId: string;
|
38
|
+
} & ICommon;
|
39
|
+
/**
|
40
|
+
* 跳转到家庭设置
|
41
|
+
*/
|
42
|
+
export declare function openFamilySetting(params?: OpenFamilySetting): Promise<void>;
|
43
|
+
type OpenJumpHome = {} & ICommon;
|
44
|
+
/**
|
45
|
+
* 跳转到家庭首页
|
46
|
+
*/
|
47
|
+
export declare function openJumpHome(params?: OpenJumpHome): Promise<void>;
|
48
|
+
type OpenMessageCenter = {
|
49
|
+
category?: 0 | 1 | 2;
|
50
|
+
} & ICommon;
|
51
|
+
/**
|
52
|
+
* 跳转到消息中心
|
53
|
+
*/
|
54
|
+
export declare function openMessageCenter(params?: OpenMessageCenter): Promise<void>;
|
23
55
|
export {};
|
@@ -1,36 +1,71 @@
|
|
1
|
-
import
|
2
|
-
const _excluded = ["success", "fail", "complete"];
|
3
|
-
import { stringifyUrl } from '../utils';
|
1
|
+
import { nativeRouter } from './common';
|
4
2
|
/**
|
5
3
|
* 打开APP扫码
|
6
4
|
* @param params {gwId: string, source: string}
|
7
5
|
* @returns
|
8
6
|
*/
|
9
7
|
export function openAppScan(params) {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
8
|
+
return nativeRouter('scan', params);
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* 打开帮助与反馈
|
12
|
+
* @param params { }
|
13
|
+
* @returns
|
14
|
+
*/
|
15
|
+
export function openHelpAndFeedback(params) {
|
16
|
+
return nativeRouter('helpAndFeedBack', params);
|
17
|
+
}
|
18
|
+
|
19
|
+
// more_service
|
20
|
+
|
21
|
+
/**
|
22
|
+
* 跳转到更多服务
|
23
|
+
*/
|
24
|
+
export function openMoreService(params) {
|
25
|
+
return nativeRouter('more_service', params);
|
26
|
+
}
|
27
|
+
|
28
|
+
// helpCenter
|
29
|
+
|
30
|
+
/**
|
31
|
+
* 跳转到帮助中心
|
32
|
+
*/
|
33
|
+
export function openAppHelpCenter(params) {
|
34
|
+
return nativeRouter('helpCenter', params);
|
35
|
+
}
|
36
|
+
|
37
|
+
// ty_user_setting
|
38
|
+
|
39
|
+
/**
|
40
|
+
* 跳转到用户设置
|
41
|
+
*/
|
42
|
+
export function openUserSetting(params) {
|
43
|
+
return nativeRouter('ty_user_setting', params);
|
44
|
+
}
|
45
|
+
|
46
|
+
// tysh_family_setting
|
47
|
+
|
48
|
+
/**
|
49
|
+
* 跳转到家庭设置
|
50
|
+
*/
|
51
|
+
export function openFamilySetting(params) {
|
52
|
+
return nativeRouter('tysh_family_setting', params);
|
53
|
+
}
|
54
|
+
|
55
|
+
// jumpHome
|
56
|
+
|
57
|
+
/**
|
58
|
+
* 跳转到家庭首页
|
59
|
+
*/
|
60
|
+
export function openJumpHome(params) {
|
61
|
+
return nativeRouter('jumpHome', params);
|
62
|
+
}
|
63
|
+
|
64
|
+
// messageCenter
|
65
|
+
|
66
|
+
/**
|
67
|
+
* 跳转到消息中心
|
68
|
+
*/
|
69
|
+
export function openMessageCenter(params) {
|
70
|
+
return nativeRouter('messageCenter', params);
|
36
71
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.47",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,14 +29,14 @@
|
|
29
29
|
"watch": "ray start --type=component"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@ray-js/framework": "1.4.
|
33
|
-
"@ray-js/router": "1.4.
|
32
|
+
"@ray-js/framework": "1.4.47",
|
33
|
+
"@ray-js/router": "1.4.47",
|
34
34
|
"@ray-js/wechat": "^0.0.33",
|
35
35
|
"base64-browser": "^1.0.1",
|
36
36
|
"query-string": "^7.1.3"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@ray-js/cli": "1.4.
|
39
|
+
"@ray-js/cli": "1.4.47",
|
40
40
|
"art-template": "^4.13.2",
|
41
41
|
"fs-extra": "^10.1.0",
|
42
42
|
"miniprogram-api-typings": "^3.12.2",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.org"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "aff8c7e09d9166412b41104b7dc31f2d7dda18a5"
|
50
50
|
}
|