zmp-sdk 2.13.0 → 2.15.0-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.
@@ -91,6 +91,7 @@ export declare const ACTION: {
91
91
  export declare const ACTION_HAVE_CALLBACK: string[];
92
92
  export declare const RESPONSE_CODE: {
93
93
  BAD_REQUEST: number;
94
+ INTERNAL_SERVER_ERROR: number;
94
95
  UNAUTHORIZED: number;
95
96
  FORBIDDEN: number;
96
97
  };
@@ -57,7 +57,7 @@ export declare abstract class SDKCreator {
57
57
  errorKeys: string[];
58
58
  }>;
59
59
  clearStorage(object: InputDataType.ClearStorageDataType): Promise<void>;
60
- getUserInfo(object?: InputDataType.CallbackType<CallbackDataType.GetUserInfoSuccessCallback>): Promise<CallbackDataType.GetUserInfoSuccessCallback>;
60
+ getUserInfo(object?: InputDataType.GetUserInfoDataType<CallbackDataType.GetUserInfoSuccessCallback>): Promise<CallbackDataType.GetUserInfoSuccessCallback>;
61
61
  getNetworkType(object: InputDataType.CallbackType): Promise<CallbackDataType.NetworkTypeSuccessCallback>;
62
62
  onNetworkStatusChange(callback: (res: InputDataType.OnNetworkStatusChangeCallback) => void): Promise<void>;
63
63
  startBeaconDiscovery(object: InputDataType.StartBeaconDiscoveryDataType): Promise<boolean>;
@@ -23,7 +23,7 @@ export interface SDKInterface {
23
23
  errorKeys: Array<string>;
24
24
  }>;
25
25
  clearStorage: (option?: InputDataType.ClearStorageDataType) => Promise<void>;
26
- getUserInfo: (object?: InputDataType.CallbackType<CallbackDataType.GetUserInfoSuccessCallback>) => Promise<CallbackDataType.GetUserInfoSuccessCallback>;
26
+ getUserInfo: (object?: InputDataType.GetUserInfoDataType<CallbackDataType.GetUserInfoSuccessCallback>) => Promise<CallbackDataType.GetUserInfoSuccessCallback>;
27
27
  getNetworkType: (object?: InputDataType.CallbackType | undefined) => Promise<CallbackDataType.NetworkTypeSuccessCallback>;
28
28
  onNetworkStatusChange: (callback: (res: InputDataType.OnNetworkStatusChangeCallback) => void) => Promise<void>;
29
29
  startBeaconDiscovery: (object: InputDataType.StartBeaconDiscoveryDataType) => Promise<boolean>;
@@ -17,7 +17,7 @@ export declare class OpenApi {
17
17
  * });
18
18
  *
19
19
  */
20
- static getUserInfo(this: ZaloMiniProgramSDK, object?: InputDataType.CallbackType<CallbackDataType.GetUserInfoSuccessCallback>): Promise<CallbackDataType.GetUserInfoSuccessCallback>;
20
+ static getUserInfo(this: ZaloMiniProgramSDK, object?: InputDataType.GetUserInfoDataType<CallbackDataType.GetUserInfoSuccessCallback>): Promise<CallbackDataType.GetUserInfoSuccessCallback>;
21
21
  /**
22
22
  * Gets user phone number.
23
23
  *
@@ -4,9 +4,9 @@
4
4
  export declare type userInfo = {
5
5
  id: string;
6
6
  name: string;
7
- birthday: string;
8
- gender: string;
9
7
  avatar: string;
8
+ birthday?: string;
9
+ gender?: string;
10
10
  };
11
11
  /**
12
12
  * iBeacon info
@@ -39,7 +39,8 @@ export declare enum ShareSheetType {
39
39
  gif = 11,
40
40
  video = 12,
41
41
  link = 4,
42
- oa = 5
42
+ oa = 5,
43
+ zmp = "zmp"
43
44
  }
44
45
  export declare enum OrientationType {
45
46
  auto = 1,
@@ -281,6 +281,9 @@ export declare type OpenShareSheet<T> = CallbackType<T> & {
281
281
  link: string;
282
282
  chatOnly: boolean;
283
283
  id: string;
284
+ title: string;
285
+ description: string;
286
+ thumbnail: string;
284
287
  };
285
288
  };
286
289
  /**
@@ -395,4 +398,10 @@ export declare type RedirectCallbackData = CallbackType & {
395
398
  export declare type OnCallbackData = {
396
399
  data: any;
397
400
  };
401
+ /**
402
+ * Get user info data type
403
+ */
404
+ export declare type GetUserInfoDataType<T> = CallbackType<T> & {
405
+ avatarType: 'small' | 'normal' | 'large';
406
+ };
398
407
  export {};
@@ -61,3 +61,4 @@ export declare const getAppUrl: (appId: string) => string;
61
61
  export declare const isSupportNativeStorage: () => boolean;
62
62
  export declare const stringifyData: (data: any) => string;
63
63
  export declare const stringToData: (data: string | null) => any;
64
+ export declare const showUserInfoPermissionModal: (acceptHandler?: (() => void) | undefined, denyHandler?: (() => void) | undefined) => void;
@@ -5,5 +5,7 @@ export declare const apiResponse: {
5
5
  loginRequired: () => CommonError;
6
6
  missingParam: (params: string[] | string) => CommonError;
7
7
  wrongTypeParam: (arg: string, expected: string, got: string) => CommonError;
8
+ cannotGetShareInfo: () => CommonError;
9
+ lengthInvalid: (arg: string) => CommonError;
8
10
  };
9
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmp-sdk",
3
- "version": "2.13.0",
3
+ "version": "2.15.0-0",
4
4
  "description": "Zalo Mini App SDK",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",