syttunnel 0.0.67 → 0.1.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.
- package/core/basic/appCommon.d.ts +75 -0
- package/core/{appFetch → basic/appFetch}/InterceptorManager.d.ts +0 -0
- package/core/{appFetch → basic/appFetch}/appFetch.d.ts +0 -0
- package/core/{appFetch → basic/appFetch}/defaults.d.ts +0 -0
- package/core/{appFetch → basic/appFetch}/dispatchRequest.d.ts +0 -0
- package/core/{appFetch → basic/appFetch}/index.d.ts +0 -0
- package/core/{appFetch → basic/appFetch}/mergeConfig.d.ts +0 -0
- package/core/{appFetch → basic/appFetch}/sytFetch.d.ts +0 -0
- package/core/{appFetch → basic/appFetch}/transform.d.ts +0 -0
- package/core/{appFetch → basic/appFetch}/types.d.ts +0 -0
- package/core/{appFetch → basic/appFetch}/utils.d.ts +0 -0
- package/core/{appNavigator.d.ts → basic/appNavigator.d.ts} +7 -44
- package/core/basic/appPay.d.ts +22 -0
- package/core/basic/appUser.d.ts +18 -0
- package/core/{bridge.d.ts → basic/bridge.d.ts} +9 -3
- package/core/basic/eventsName.d.ts +8 -0
- package/core/{tools.d.ts → basic/tools.d.ts} +0 -0
- package/core/{utils.d.ts → basic/utils.d.ts} +0 -0
- package/core/extension/appCommon.d.ts +28 -0
- package/core/extension/appNavigator.d.ts +32 -0
- package/core/{appPay.d.ts → extension/appPay.d.ts} +27 -26
- package/core/{appUser.d.ts → extension/appUser.d.ts} +19 -19
- package/core/extension/eventsName.d.ts +9 -0
- package/index.d.ts +9 -5
- package/indexsf.d.ts +14 -0
- package/package.json +3 -16
- package/syttunnel.js +839 -0
- package/core/FunctionCallBack.d.ts +0 -10
- package/core/FunctionCallBack.js +0 -15
- package/core/FunctionCallBack.js.map +0 -1
- package/core/appCommon.d.ts +0 -113
- package/core/appCommon.js +0 -441
- package/core/appCommon.js.map +0 -1
- package/core/appEvent.d.ts +0 -36
- package/core/appEvent.js +0 -41
- package/core/appEvent.js.map +0 -1
- package/core/appFetch/InterceptorManager.js +0 -29
- package/core/appFetch/InterceptorManager.js.map +0 -1
- package/core/appFetch/appFetch.js +0 -95
- package/core/appFetch/appFetch.js.map +0 -1
- package/core/appFetch/defaults.js +0 -13
- package/core/appFetch/defaults.js.map +0 -1
- package/core/appFetch/dispatchRequest.js +0 -136
- package/core/appFetch/dispatchRequest.js.map +0 -1
- package/core/appFetch/index.js +0 -19
- package/core/appFetch/index.js.map +0 -1
- package/core/appFetch/mergeConfig.js +0 -54
- package/core/appFetch/mergeConfig.js.map +0 -1
- package/core/appFetch/sytFetch.js +0 -75
- package/core/appFetch/sytFetch.js.map +0 -1
- package/core/appFetch/transform.js +0 -16
- package/core/appFetch/transform.js.map +0 -1
- package/core/appFetch/types.js +0 -3
- package/core/appFetch/types.js.map +0 -1
- package/core/appFetch/utils.js +0 -37
- package/core/appFetch/utils.js.map +0 -1
- package/core/appNavigator.js +0 -125
- package/core/appNavigator.js.map +0 -1
- package/core/appPay.js +0 -195
- package/core/appPay.js.map +0 -1
- package/core/appUser.js +0 -147
- package/core/appUser.js.map +0 -1
- package/core/bridge.js +0 -73
- package/core/bridge.js.map +0 -1
- package/core/tools.js +0 -15
- package/core/tools.js.map +0 -1
- package/core/types.d.ts +0 -25
- package/core/types.js +0 -22
- package/core/types.js.map +0 -1
- package/core/utils.js +0 -34
- package/core/utils.js.map +0 -1
- package/index.js +0 -17
- package/index.js.map +0 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
interface IOpenCodeScanParams {
|
|
2
|
+
isAPPHandle?: boolean;
|
|
3
|
+
}
|
|
4
|
+
interface IWXSendMessage {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
thumbData?: string;
|
|
8
|
+
}
|
|
9
|
+
interface IWXSendImageMessage extends IWXSendMessage {
|
|
10
|
+
mediaObject: string;
|
|
11
|
+
}
|
|
12
|
+
interface IWXSendMusicMessage extends IWXSendMessage {
|
|
13
|
+
musicUrl: string;
|
|
14
|
+
musicLowBandUrl?: string;
|
|
15
|
+
musicDataUrl?: string;
|
|
16
|
+
musicLowBandDataUrl?: string;
|
|
17
|
+
}
|
|
18
|
+
interface IWXSendVideoMessage extends IWXSendMessage {
|
|
19
|
+
videoUrl: string;
|
|
20
|
+
videoLowBandUrl?: string;
|
|
21
|
+
}
|
|
22
|
+
interface IWXSendWebpageMessage extends IWXSendMessage {
|
|
23
|
+
webpageUrl: string;
|
|
24
|
+
}
|
|
25
|
+
interface IWXSendMiniProgramMessage extends IWXSendWebpageMessage {
|
|
26
|
+
userName: string;
|
|
27
|
+
path: string;
|
|
28
|
+
withShareTicket: boolean;
|
|
29
|
+
miniProgramType?: 0 | 1 | 2;
|
|
30
|
+
hdImageData?: string;
|
|
31
|
+
}
|
|
32
|
+
interface IShareMsgToWXParams {
|
|
33
|
+
/**
|
|
34
|
+
* 微信分享类型 0 文本类型,1 图片类型, 2 音乐类型, 3 视频类型, 4 网页类型, 5 小程序类型
|
|
35
|
+
*/
|
|
36
|
+
type: 0 | 1 | 2 | 3 | 4 | 5;
|
|
37
|
+
/**
|
|
38
|
+
* 分享目标 0, 聊天界面 1, 朋友圈 2 收藏 3, 指定联系人
|
|
39
|
+
*/
|
|
40
|
+
scene: 0 | 1 | 2 | 3;
|
|
41
|
+
message: string | IWXSendImageMessage | IWXSendMusicMessage | IWXSendVideoMessage | IWXSendWebpageMessage | IWXSendMiniProgramMessage;
|
|
42
|
+
}
|
|
43
|
+
interface IShareMsgToWXResponse {
|
|
44
|
+
respCode?: number;
|
|
45
|
+
}
|
|
46
|
+
interface IGetLocationParams {
|
|
47
|
+
reGeocode: boolean;
|
|
48
|
+
networkState: boolean;
|
|
49
|
+
}
|
|
50
|
+
interface IGetAppVersionResponse {
|
|
51
|
+
clientVersion?: string;
|
|
52
|
+
clientVersionCode?: string;
|
|
53
|
+
}
|
|
54
|
+
interface IOnSelectContactResponse {
|
|
55
|
+
contacts?: any[];
|
|
56
|
+
errCode?: string;
|
|
57
|
+
errMessage?: string;
|
|
58
|
+
}
|
|
59
|
+
interface ISaveImageToLocalParams {
|
|
60
|
+
base64: string;
|
|
61
|
+
}
|
|
62
|
+
interface ISaveImageToLocalResponse {
|
|
63
|
+
errCode?: string;
|
|
64
|
+
errMessage?: string;
|
|
65
|
+
}
|
|
66
|
+
export declare class AppCommon {
|
|
67
|
+
openScan(params: IOpenCodeScanParams): Promise<string>;
|
|
68
|
+
shareMsgToWXAPI(params: IShareMsgToWXParams): Promise<IShareMsgToWXResponse>;
|
|
69
|
+
getLocation(params: IGetLocationParams): Promise<any>;
|
|
70
|
+
getAppVersion(): Promise<IGetAppVersionResponse>;
|
|
71
|
+
onSelectContacts(): Promise<IOnSelectContactResponse>;
|
|
72
|
+
onSaveImageToLocal(params: ISaveImageToLocalParams): Promise<ISaveImageToLocalResponse>;
|
|
73
|
+
getEnvironment(): Promise<string>;
|
|
74
|
+
}
|
|
75
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
canBack?: boolean;
|
|
3
|
-
}
|
|
4
|
-
interface NavigationParams {
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}
|
|
7
|
-
export interface ILoadUrlParams {
|
|
1
|
+
interface ILoadUrlParams {
|
|
8
2
|
/** 页面名称/主标题 - 通用场景 */
|
|
9
3
|
title: string;
|
|
10
4
|
/** 副标题 - 通用场景 */
|
|
@@ -44,18 +38,7 @@ export interface ILoadUrlParams {
|
|
|
44
38
|
/** 插入的js */
|
|
45
39
|
injectedJavaScript?: string;
|
|
46
40
|
}
|
|
47
|
-
|
|
48
|
-
routeName: string;
|
|
49
|
-
params?: NavigationParams;
|
|
50
|
-
needLogin?: boolean;
|
|
51
|
-
oneAndOnlyPage?: boolean;
|
|
52
|
-
replaceCurrentPage?: boolean;
|
|
53
|
-
allowMultipleJumps?: boolean;
|
|
54
|
-
shouldReload?: boolean;
|
|
55
|
-
type?: any;
|
|
56
|
-
userRegisterSourceChannelName?: string;
|
|
57
|
-
}
|
|
58
|
-
export interface INavigatorStyle {
|
|
41
|
+
interface INavigatorStyle {
|
|
59
42
|
titleStyle?: any;
|
|
60
43
|
leftTextStyle?: any;
|
|
61
44
|
leftImageColor?: string;
|
|
@@ -71,13 +54,10 @@ export interface INavigatorStyle {
|
|
|
71
54
|
contentMode?: "fullScreen" | "stateBar" | "navigationBar" | number;
|
|
72
55
|
themeMode?: "light" | "dark";
|
|
73
56
|
}
|
|
74
|
-
|
|
75
|
-
title?: string;
|
|
76
|
-
}
|
|
77
|
-
export interface ISetNavigatorStyleParams {
|
|
57
|
+
interface ISetNavigatorTitleParams {
|
|
78
58
|
title?: string;
|
|
79
59
|
}
|
|
80
|
-
|
|
60
|
+
interface INavigatorFrameResponse {
|
|
81
61
|
statusbar: {
|
|
82
62
|
x: number;
|
|
83
63
|
y: number;
|
|
@@ -91,21 +71,11 @@ export interface INavigatorFrameResponse {
|
|
|
91
71
|
height: number;
|
|
92
72
|
};
|
|
93
73
|
}
|
|
94
|
-
declare class AppNavigator {
|
|
74
|
+
export declare class AppNavigator {
|
|
95
75
|
/**
|
|
96
76
|
* 关闭当前h5应用
|
|
97
77
|
*/
|
|
98
78
|
closeH5App(): void;
|
|
99
|
-
/**
|
|
100
|
-
* 设置返回按钮是否可以返回
|
|
101
|
-
* @param canBack
|
|
102
|
-
*/
|
|
103
|
-
setNavigatorCanBack(canBack: boolean): void;
|
|
104
|
-
/**
|
|
105
|
-
* 页面跳转方法
|
|
106
|
-
* @param params
|
|
107
|
-
*/
|
|
108
|
-
navigate(params: INavigateParams): void;
|
|
109
79
|
/**
|
|
110
80
|
* 设置导航栏标题
|
|
111
81
|
* @param params
|
|
@@ -116,17 +86,10 @@ declare class AppNavigator {
|
|
|
116
86
|
* @param params
|
|
117
87
|
*/
|
|
118
88
|
setNavigatorStyle(params: INavigatorStyle): void;
|
|
119
|
-
/**
|
|
120
|
-
* 返回上一页
|
|
121
|
-
*/
|
|
122
|
-
onGoBack(): void;
|
|
123
|
-
getNavigatorFrame(): Promise<INavigatorFrameResponse>;
|
|
124
89
|
/**
|
|
125
90
|
* 获取导航页和状态栏的frame
|
|
126
|
-
* @param params
|
|
127
91
|
*/
|
|
128
|
-
|
|
92
|
+
getNavigatorFrame(): Promise<INavigatorFrameResponse>;
|
|
129
93
|
loadUrl(params: ILoadUrlParams): void;
|
|
130
94
|
}
|
|
131
|
-
|
|
132
|
-
export default appNavigator;
|
|
95
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface IPayByWeChatParams {
|
|
2
|
+
partnerId: string;
|
|
3
|
+
prepayId: string;
|
|
4
|
+
nonceStr: string;
|
|
5
|
+
timeStamp: string;
|
|
6
|
+
sign: string;
|
|
7
|
+
package: string;
|
|
8
|
+
}
|
|
9
|
+
interface IPayByAliParams {
|
|
10
|
+
orderStr: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IPayResult {
|
|
13
|
+
channelType: string;
|
|
14
|
+
status: string | number;
|
|
15
|
+
message: string;
|
|
16
|
+
channelResult: object;
|
|
17
|
+
}
|
|
18
|
+
export declare class AppPay {
|
|
19
|
+
payByWeChat(params: IPayByWeChatParams): Promise<IPayResult>;
|
|
20
|
+
payByAli(params: IPayByAliParams): Promise<IPayResult>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface IAuthorizeParams {
|
|
2
|
+
appid: string;
|
|
3
|
+
scope: string;
|
|
4
|
+
reserved: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IAuthorizeResponse {
|
|
7
|
+
errorCode: string;
|
|
8
|
+
code: string;
|
|
9
|
+
reserved: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class AppUser {
|
|
12
|
+
/**
|
|
13
|
+
* 调用OAuth2.0 授权接口
|
|
14
|
+
* @param params
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
authorize(params: IAuthorizeParams): Promise<IAuthorizeResponse>;
|
|
18
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import FunctionCallBack from "./FunctionCallBack";
|
|
2
1
|
export interface IPostParams {
|
|
3
2
|
method: string;
|
|
4
3
|
params?: any;
|
|
@@ -11,12 +10,19 @@ export interface IRequestCompletion<T> {
|
|
|
11
10
|
success?: (res: T) => void;
|
|
12
11
|
failure?: (err: IError) => void;
|
|
13
12
|
}
|
|
13
|
+
declare class FuncCallBack {
|
|
14
|
+
success?: (res: any) => void;
|
|
15
|
+
failure?: (err: IError) => void;
|
|
16
|
+
uId: string;
|
|
17
|
+
constructor(uId: string, suc?: (res: any) => void, fal?: (err: IError) => void);
|
|
18
|
+
}
|
|
14
19
|
declare class Bridge {
|
|
15
|
-
static cbArr:
|
|
20
|
+
static cbArr: FuncCallBack[];
|
|
16
21
|
static funCallCount: number;
|
|
17
22
|
constructor();
|
|
18
23
|
private onMessage;
|
|
19
|
-
postMessage(params: IPostParams
|
|
24
|
+
postMessage<T>(params: IPostParams): Promise<T>;
|
|
25
|
+
private dealPostMessage;
|
|
20
26
|
}
|
|
21
27
|
declare const bridge: Bridge;
|
|
22
28
|
export default bridge;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 基本的调用事件
|
|
3
|
+
*/
|
|
4
|
+
import { IPostParams } from "./bridge";
|
|
5
|
+
export declare type CommonEvents = "sytFetch" | "authorize" | "backToBefore" | "setTitle" | "setStyle" | "goBack" | "getNavigationFrame" | "loadUrl" | "payByWeChat" | "payByAli" | "startScanCode" | "shareMessageToWXReq" | "currentLocation" | "appVersion" | "selectContacts" | "saveImageToLocal" | "getEnvironment";
|
|
6
|
+
export interface IPostBasicParams extends IPostParams {
|
|
7
|
+
method: CommonEvents;
|
|
8
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AppCommon } from "../basic/appCommon";
|
|
2
|
+
interface IGetReducerDataParams {
|
|
3
|
+
reducerName: string;
|
|
4
|
+
attributes: string[];
|
|
5
|
+
}
|
|
6
|
+
interface ISyncCookieParams {
|
|
7
|
+
data: string;
|
|
8
|
+
}
|
|
9
|
+
interface IGetLocalSourceParams {
|
|
10
|
+
fileName: string;
|
|
11
|
+
}
|
|
12
|
+
interface IGetLocalSourceResponse {
|
|
13
|
+
sourcePath?: string;
|
|
14
|
+
}
|
|
15
|
+
interface ICodeAndMessageResponse {
|
|
16
|
+
code?: string;
|
|
17
|
+
message?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class SFAppCommon extends AppCommon {
|
|
20
|
+
getIMEICode(): Promise<string>;
|
|
21
|
+
getPushAuthStatus(): Promise<boolean>;
|
|
22
|
+
setPushState(): Promise<ICodeAndMessageResponse>;
|
|
23
|
+
getLocalSource(params: IGetLocalSourceParams): Promise<IGetLocalSourceResponse>;
|
|
24
|
+
getReducerData(params: IGetReducerDataParams): Promise<any>;
|
|
25
|
+
getDeviceId(): Promise<string>;
|
|
26
|
+
syncCookies(params: ISyncCookieParams): void;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AppNavigator } from "../basic/appNavigator";
|
|
2
|
+
interface NavigationParams {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
interface INavigateParams {
|
|
6
|
+
routeName: string;
|
|
7
|
+
params?: NavigationParams;
|
|
8
|
+
needLogin?: boolean;
|
|
9
|
+
oneAndOnlyPage?: boolean;
|
|
10
|
+
replaceCurrentPage?: boolean;
|
|
11
|
+
allowMultipleJumps?: boolean;
|
|
12
|
+
shouldReload?: boolean;
|
|
13
|
+
type?: any;
|
|
14
|
+
userRegisterSourceChannelName?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class SFAppNavigator extends AppNavigator {
|
|
17
|
+
/**
|
|
18
|
+
* 设置返回按钮是否可以返回
|
|
19
|
+
* @param canBack
|
|
20
|
+
*/
|
|
21
|
+
setNavigatorCanBack(canBack: boolean): void;
|
|
22
|
+
/**
|
|
23
|
+
* 页面跳转方法
|
|
24
|
+
* @param params
|
|
25
|
+
*/
|
|
26
|
+
navigate(params: INavigateParams): void;
|
|
27
|
+
/**
|
|
28
|
+
* 返回上一页
|
|
29
|
+
*/
|
|
30
|
+
onGoBack(): void;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { AppPay, IPayResult } from "../basic/appPay";
|
|
2
|
+
interface IPayBySVIPParams {
|
|
3
3
|
reqId: string;
|
|
4
4
|
amt: string;
|
|
5
5
|
requestIp: string;
|
|
@@ -9,7 +9,7 @@ export interface IPayBySVIPParams {
|
|
|
9
9
|
goodsDesc: string;
|
|
10
10
|
signedData: string;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
interface IPayBySDKParams {
|
|
13
13
|
amt: string;
|
|
14
14
|
mchNo: string;
|
|
15
15
|
mchOrderNo: string;
|
|
@@ -24,42 +24,43 @@ export interface IPayBySDKParams {
|
|
|
24
24
|
payMethod: number;
|
|
25
25
|
goodsTag?: string;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
interface IWxAutoPaySignParams {
|
|
28
28
|
entrustId: string;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
interface IWxAutoPaySignResponse {
|
|
31
31
|
respCode: number;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
interface IOnDigiCnyPayResultParams {
|
|
34
34
|
status: 0 | 1 | 2 | 3;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
interface IPayWaybillByPayIdParams {
|
|
37
37
|
payId: string;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
declare class PayParams {
|
|
40
|
+
amt: string;
|
|
41
|
+
payMethod: number;
|
|
42
|
+
mchNo: string;
|
|
43
|
+
mchOrderNo: string;
|
|
44
|
+
payURL: string;
|
|
45
|
+
signData: string;
|
|
46
|
+
signType?: string;
|
|
47
|
+
requestTime: string;
|
|
48
|
+
orderBeginTime: string;
|
|
49
|
+
goodsName: string;
|
|
50
|
+
goodsDesc: string;
|
|
51
|
+
businessCode: string;
|
|
52
|
+
goodsTag?: string;
|
|
53
|
+
specialExt?: any;
|
|
46
54
|
}
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
interface IPayResponse {
|
|
56
|
+
result: IPayResult;
|
|
57
|
+
payParams?: PayParams;
|
|
49
58
|
}
|
|
50
|
-
declare class AppPay {
|
|
59
|
+
export declare class SFAppPay extends AppPay {
|
|
51
60
|
payBySVIP(params: IPayBySVIPParams): Promise<IPayResponse>;
|
|
52
|
-
private _payBySVIP;
|
|
53
61
|
payBySDK(params: IPayBySDKParams): Promise<IPayResult>;
|
|
54
|
-
private _payBySDK;
|
|
55
62
|
wxAutoPaySignReq(params: IWxAutoPaySignParams): Promise<IWxAutoPaySignResponse>;
|
|
56
|
-
private _wxAutoPaySignReq;
|
|
57
63
|
onDigiCnyPayResult(params: IOnDigiCnyPayResultParams): void;
|
|
58
64
|
payWaybillByPayId(params: IPayWaybillByPayIdParams): void;
|
|
59
|
-
payByWeChat(params: IPayByWeChatParams): Promise<IPayResult>;
|
|
60
|
-
private _payByWeChat;
|
|
61
|
-
payByAli(params: IPayByAliParams): Promise<IPayResult>;
|
|
62
|
-
private _payByAli;
|
|
63
65
|
}
|
|
64
|
-
|
|
65
|
-
export default appPay;
|
|
66
|
+
export {};
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
+
import { AppUser } from "../basic/appUser";
|
|
1
2
|
export interface IGetUserInfoParams {
|
|
2
3
|
needLogin?: boolean;
|
|
3
4
|
domain?: string;
|
|
4
5
|
}
|
|
5
|
-
export interface IGetUserAvatarParams {
|
|
6
|
-
needLogin?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface IAuthorizeParams {
|
|
9
|
-
appid: string;
|
|
10
|
-
scope: string;
|
|
11
|
-
reserved: string;
|
|
12
|
-
}
|
|
13
6
|
export interface IGetUserBaseInfoParams {
|
|
14
7
|
needLogin?: boolean;
|
|
15
8
|
}
|
|
@@ -18,19 +11,26 @@ export interface IGetUserBaseInfoResponse {
|
|
|
18
11
|
birthday?: string;
|
|
19
12
|
sex?: string;
|
|
20
13
|
}
|
|
21
|
-
export interface
|
|
22
|
-
|
|
23
|
-
code: string;
|
|
24
|
-
reserved: string;
|
|
14
|
+
export interface IGetUserAvatarParams {
|
|
15
|
+
needLogin?: boolean;
|
|
25
16
|
}
|
|
26
|
-
declare class AppUser {
|
|
27
|
-
|
|
17
|
+
export declare class SFAppUser extends AppUser {
|
|
18
|
+
/**
|
|
19
|
+
* 老版本鉴权,获取用户数据,仅内部使用
|
|
20
|
+
* @param params
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
28
23
|
getUserInfo(params: IGetUserInfoParams): Promise<string>;
|
|
29
|
-
|
|
24
|
+
/**
|
|
25
|
+
* 获取用户基本信息
|
|
26
|
+
* @param params
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
30
29
|
getUserBaseInfo(params: IGetUserBaseInfoParams): Promise<IGetUserBaseInfoResponse>;
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* 获取用户头像
|
|
32
|
+
* @param params
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
32
35
|
getUserAvatar(params: IGetUserAvatarParams): Promise<string>;
|
|
33
|
-
private oGetUserAvatar;
|
|
34
36
|
}
|
|
35
|
-
declare const appUser: AppUser;
|
|
36
|
-
export default appUser;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPostParams } from "../basic/bridge";
|
|
2
|
+
import { CommonEvents } from "../basic/eventsName";
|
|
3
|
+
/**
|
|
4
|
+
* 顺丰内部使用的事件
|
|
5
|
+
*/
|
|
6
|
+
export declare type SFEvents = CommonEvents | "getUserInfo" | "getUserAvatar" | "getUserBaseInfo" | "payBySVIP" | "payBySDK" | "wxAutoPaySignReq" | "payWaybillByPayId" | "digiCnyPayResult" | "startGetIMEICode" | "getReducerData" | "getDeviceId" | "syncCookie" | "getPushAuthStatus" | "setStateToPush" | "getLocalWebSource" | "navigate" | "setCanBack" | "goBack";
|
|
7
|
+
export interface IPostSFParams extends IPostParams {
|
|
8
|
+
method: SFEvents;
|
|
9
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import appFetch from "./core/appFetch";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import appFetch from "./core/basic/appFetch";
|
|
2
|
+
import { AppCommon } from "./core/basic/appCommon";
|
|
3
|
+
import { AppNavigator } from "./core/basic/appNavigator";
|
|
4
|
+
import { AppPay } from "./core/basic/appPay";
|
|
5
|
+
import { AppUser } from "./core/basic/appUser";
|
|
6
|
+
declare const appCommon: AppCommon;
|
|
7
|
+
declare const appNavigator: AppNavigator;
|
|
8
|
+
declare const appPay: AppPay;
|
|
9
|
+
declare const appUser: AppUser;
|
|
6
10
|
export { appFetch };
|
|
7
11
|
export { appUser };
|
|
8
12
|
export { appPay };
|
package/indexsf.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import appFetch from "./core/basic/appFetch";
|
|
2
|
+
import { SFAppCommon } from "./core/extension/appCommon";
|
|
3
|
+
import { SFAppNavigator } from "./core/extension/appNavigator";
|
|
4
|
+
import { SFAppPay } from "./core/extension/appPay";
|
|
5
|
+
import { SFAppUser } from "./core/extension/appUser";
|
|
6
|
+
declare const appCommon: SFAppCommon;
|
|
7
|
+
declare const appNavigator: SFAppNavigator;
|
|
8
|
+
declare const appPay: SFAppPay;
|
|
9
|
+
declare const appUser: SFAppUser;
|
|
10
|
+
export { appFetch };
|
|
11
|
+
export { appUser };
|
|
12
|
+
export { appPay };
|
|
13
|
+
export { appCommon };
|
|
14
|
+
export { appNavigator };
|
package/package.json
CHANGED
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syttunnel",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "syttunel.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
9
|
},
|
|
10
|
-
"keywords": [],
|
|
11
10
|
"author": "",
|
|
12
|
-
"license": "ISC"
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"cross-env": "^7.0.3",
|
|
15
|
-
"html-webpack-plugin": "^5.3.1",
|
|
16
|
-
"ts-loader": "^8.1.0",
|
|
17
|
-
"typescript": "^4.2.3",
|
|
18
|
-
"webpack": "^5.30.0",
|
|
19
|
-
"webpack-cli": "^3.3.12",
|
|
20
|
-
"webpack-dev-server": "^3.11.2"
|
|
21
|
-
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"ts-md5": "^1.2.7"
|
|
24
|
-
}
|
|
11
|
+
"license": "ISC"
|
|
25
12
|
}
|