syttunnel 0.1.1-0 → 0.1.2-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.
@@ -8,6 +8,10 @@ export interface IAuthorizeResponse {
8
8
  code: string;
9
9
  reserved: string;
10
10
  }
11
+ export interface IGetUserInfoParams {
12
+ needLogin?: boolean;
13
+ domain?: string;
14
+ }
11
15
  export declare class AppUser {
12
16
  /**
13
17
  * 调用OAuth2.0 授权接口
@@ -15,4 +19,10 @@ export declare class AppUser {
15
19
  * @returns
16
20
  */
17
21
  authorize(params: IAuthorizeParams): Promise<IAuthorizeResponse>;
22
+ /**
23
+ * 老版本鉴权,获取用户数据,仅内部使用
24
+ * @param params
25
+ * @returns
26
+ */
27
+ getUserInfo(params: IGetUserInfoParams): Promise<string>;
18
28
  }
@@ -2,7 +2,7 @@
2
2
  * 基本的调用事件
3
3
  */
4
4
  import { IPostParams } from "./bridge";
5
- export declare type CommonEvents = "sytFetch" | "authorize" | "backToBefore" | "setTitle" | "setStyle" | "getNavigationFrame" | "loadUrl" | "payByWeChat" | "payByAli" | "startScanCode" | "shareMessageToWXReq" | "currentLocation" | "appVersion" | "selectContacts" | "saveImageToLocal" | "getEnvironment" | "goBack";
5
+ export declare type CommonEvents = "getUserInfo" | "sytFetch" | "authorize" | "backToBefore" | "setTitle" | "setStyle" | "getNavigationFrame" | "loadUrl" | "payByWeChat" | "payByAli" | "startScanCode" | "shareMessageToWXReq" | "currentLocation" | "appVersion" | "selectContacts" | "saveImageToLocal" | "getEnvironment" | "goBack";
6
6
  export interface IPostBasicParams extends IPostParams {
7
7
  method: CommonEvents;
8
8
  }
@@ -15,12 +15,6 @@ export interface IGetUserAvatarParams {
15
15
  needLogin?: boolean;
16
16
  }
17
17
  export declare class SFAppUser extends AppUser {
18
- /**
19
- * 老版本鉴权,获取用户数据,仅内部使用
20
- * @param params
21
- * @returns
22
- */
23
- getUserInfo(params: IGetUserInfoParams): Promise<string>;
24
18
  /**
25
19
  * 获取用户基本信息
26
20
  * @param params
@@ -3,7 +3,7 @@ import { CommonEvents } from "../basic/eventsName";
3
3
  /**
4
4
  * 顺丰内部使用的事件
5
5
  */
6
- export declare type SFEvents = CommonEvents | "getUserInfo" | "getUserAvatar" | "getUserBaseInfo" | "payBySVIP" | "payBySDK" | "wxAutoPaySignReq" | "payWaybillByPayId" | "digiCnyPayResult" | "startGetIMEICode" | "getReducerData" | "getDeviceId" | "syncCookie" | "getPushAuthStatus" | "setStateToPush" | "getLocalWebSource" | "navigate" | "setCanBack";
6
+ export declare type SFEvents = CommonEvents | "getUserAvatar" | "getUserBaseInfo" | "payBySVIP" | "payBySDK" | "wxAutoPaySignReq" | "payWaybillByPayId" | "digiCnyPayResult" | "startGetIMEICode" | "getReducerData" | "getDeviceId" | "syncCookie" | "getPushAuthStatus" | "setStateToPush" | "getLocalWebSource" | "navigate" | "setCanBack";
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.1-0",
3
+ "version": "0.1.2-0",
4
4
  "description": "",
5
5
  "main": "syttunel.js",
6
6
  "types": "index.d.ts",
package/syttunnel.js CHANGED
@@ -803,6 +803,22 @@ var AppUser = /** @class */ (function () {
803
803
  };
804
804
  return bridge_1.default.postMessage(appFunc);
805
805
  };
806
+ /**
807
+ * 老版本鉴权,获取用户数据,仅内部使用
808
+ * @param params
809
+ * @returns
810
+ */
811
+ AppUser.prototype.getUserInfo = function (params) {
812
+ var data = {
813
+ needLogin: params.needLogin || true,
814
+ domain: params.domain,
815
+ };
816
+ var appFunc = {
817
+ method: "getUserInfo",
818
+ params: data,
819
+ };
820
+ return bridge_1.default.postMessage(appFunc);
821
+ };
806
822
  return AppUser;
807
823
  }());
808
824
  exports.AppUser = AppUser;