syttunnel 0.1.5-5 → 0.1.5-6

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.
@@ -12,6 +12,17 @@ export interface IGetUserInfoParams {
12
12
  needLogin?: boolean;
13
13
  domain?: string;
14
14
  }
15
+ export interface IGetUserBaseInfoParams {
16
+ needLogin?: boolean;
17
+ }
18
+ export interface IGetUserBaseInfoResponse {
19
+ nickName?: string;
20
+ birthday?: string;
21
+ sex?: string;
22
+ }
23
+ export interface IGetUserAvatarParams {
24
+ needLogin?: boolean;
25
+ }
15
26
  export declare class AppUser {
16
27
  /**
17
28
  * 调用OAuth2.0 授权接口
@@ -25,4 +36,16 @@ export declare class AppUser {
25
36
  * @returns
26
37
  */
27
38
  getUserInfo(params: IGetUserInfoParams): Promise<string>;
39
+ /**
40
+ * 获取用户基本信息
41
+ * @param params
42
+ * @returns
43
+ */
44
+ getUserBaseInfo(params: IGetUserBaseInfoParams): Promise<IGetUserBaseInfoResponse>;
45
+ /**
46
+ * 获取用户头像
47
+ * @param params
48
+ * @returns
49
+ */
50
+ getUserAvatar(params: IGetUserAvatarParams): Promise<string>;
28
51
  }
@@ -2,7 +2,7 @@
2
2
  * 基本的调用事件
3
3
  */
4
4
  import { IPostParams } from "./bridge";
5
- export declare type CommonEvents = "getUserInfo" | "sytFetch" | "authorize" | "backToBefore" | "setTitle" | "setStyle" | "getNavigationFrame" | "loadUrl" | "payByWeChat" | "payByAli" | "startScanCode" | "shareMessageToWXReq" | "currentLocation" | "appVersion" | "selectContacts" | "saveImageToLocal" | "getEnvironment" | "goBack" | "selectAddress" | "pasteString";
5
+ export declare type CommonEvents = "getUserInfo" | "getUserAvatar" | "getUserBaseInfo" | "sytFetch" | "authorize" | "backToBefore" | "setTitle" | "setStyle" | "getNavigationFrame" | "loadUrl" | "payByWeChat" | "payByAli" | "startScanCode" | "shareMessageToWXReq" | "currentLocation" | "appVersion" | "selectContacts" | "saveImageToLocal" | "getEnvironment" | "goBack" | "selectAddress" | "pasteString";
6
6
  export interface IPostBasicParams extends IPostParams {
7
7
  method: CommonEvents;
8
8
  }
@@ -1,26 +1,3 @@
1
1
  import { AppUser } from "../basic/appUser";
2
- export interface IGetUserBaseInfoParams {
3
- needLogin?: boolean;
4
- }
5
- export interface IGetUserBaseInfoResponse {
6
- nickName?: string;
7
- birthday?: string;
8
- sex?: string;
9
- }
10
- export interface IGetUserAvatarParams {
11
- needLogin?: boolean;
12
- }
13
2
  export declare class SFAppUser extends AppUser {
14
- /**
15
- * 获取用户基本信息
16
- * @param params
17
- * @returns
18
- */
19
- getUserBaseInfo(params: IGetUserBaseInfoParams): Promise<IGetUserBaseInfoResponse>;
20
- /**
21
- * 获取用户头像
22
- * @param params
23
- * @returns
24
- */
25
- getUserAvatar(params: IGetUserAvatarParams): Promise<string>;
26
3
  }
@@ -3,7 +3,7 @@ import { CommonEvents } from "../basic/eventsName";
3
3
  /**
4
4
  * 顺丰内部使用的事件
5
5
  */
6
- export declare type SFEvents = CommonEvents | "getUserAvatar" | "getUserBaseInfo" | "payBySVIP" | "payBySDK" | "wxAutoPaySignReq" | "payWaybillByPayId" | "digiCnyPayResult" | "startGetIMEICode" | "getReducerData" | "getDeviceId" | "syncCookie" | "getPushAuthStatus" | "setStateToPush" | "setStateToPushNoTimeLimit" | "getLocalWebSource" | "navigate" | "setCanBack" | "payByWXMiniProgram";
6
+ export declare type SFEvents = CommonEvents | "payBySVIP" | "payBySDK" | "wxAutoPaySignReq" | "payWaybillByPayId" | "digiCnyPayResult" | "startGetIMEICode" | "getReducerData" | "getDeviceId" | "syncCookie" | "getPushAuthStatus" | "setStateToPush" | "setStateToPushNoTimeLimit" | "getLocalWebSource" | "navigate" | "setCanBack" | "payByWXMiniProgram";
7
7
  export interface IPostSFParams extends IPostParams {
8
8
  method: SFEvents;
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "syttunnel",
3
- "version": "0.1.5-5",
3
+ "version": "0.1.5-6",
4
4
  "description": "",
5
5
  "main": "syttunnel.js",
6
6
  "types": "index.d.ts",
package/syttunnel.js CHANGED
@@ -914,6 +914,36 @@ var AppUser = /** @class */ (function () {
914
914
  };
915
915
  return bridge_1.default.postMessage(appFunc);
916
916
  };
917
+ /**
918
+ * 获取用户基本信息
919
+ * @param params
920
+ * @returns
921
+ */
922
+ AppUser.prototype.getUserBaseInfo = function (params) {
923
+ var data = {
924
+ needLogin: params.needLogin || true,
925
+ };
926
+ var appFunc = {
927
+ method: "getUserBaseInfo",
928
+ params: data,
929
+ };
930
+ return bridge_1.default.postMessage(appFunc);
931
+ };
932
+ /**
933
+ * 获取用户头像
934
+ * @param params
935
+ * @returns
936
+ */
937
+ AppUser.prototype.getUserAvatar = function (params) {
938
+ var data = {
939
+ needLogin: params.needLogin || true,
940
+ };
941
+ var appFunc = {
942
+ method: "getUserAvatar",
943
+ params: data,
944
+ };
945
+ return bridge_1.default.postMessage(appFunc);
946
+ };
917
947
  return AppUser;
918
948
  }());
919
949
  exports.AppUser = AppUser;