zmp-sdk 2.23.3 → 2.23.4

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.
@@ -14,7 +14,7 @@ import ZJSBridge from '../zaloJsBridge';
14
14
  import { SDKServiceInterface } from '../types/interface';
15
15
  import { ZMPEEmitter } from '../event-emitter';
16
16
  import { contextInfo } from '../types/entity';
17
- import { GetAuthCodeSuccessCallback } from '../types/callbackData';
17
+ import { GetAuthCodeSuccessCallback, GetZPITokenSuccessCallback } from '../types/callbackData';
18
18
  export default class ZaloMiniProgramSDKService implements SDKServiceInterface {
19
19
  #private;
20
20
  events: ZMPEEmitter;
@@ -33,6 +33,7 @@ export default class ZaloMiniProgramSDKService implements SDKServiceInterface {
33
33
  getContext(): Promise<contextInfo | null>;
34
34
  getContextSync(): contextInfo | null;
35
35
  getAuthCode: () => Promise<GetAuthCodeSuccessCallback>;
36
+ getZPIToken: () => Promise<GetZPITokenSuccessCallback>;
36
37
  getJSBridge(): ZJSBridge;
37
38
  login(object?: InputDataType.CallbackType): Promise<string>;
38
39
  loginZaloV3(): Promise<string | null>;
@@ -182,3 +182,15 @@ export declare type GetAuthCodeSuccessCallback = {
182
182
  /** authCodeVrf */
183
183
  authCodeVerify: string;
184
184
  };
185
+ /**
186
+ * Request auth code
187
+ * @typedef GetZPITokenSuccessCallback
188
+ */
189
+ export declare type GetZPITokenSuccessCallback = {
190
+ /** utoken */
191
+ utoken: string;
192
+ /** gtoken */
193
+ gtoken: string;
194
+ /** zpp */
195
+ zpp: string;
196
+ };
@@ -487,4 +487,9 @@ export declare type ConfigCloseButtonRequest<T> = CallbackType<T> & {
487
487
  export declare type OpenOutApp = CallbackType & {
488
488
  url: string;
489
489
  };
490
+ export declare type ChooseImage = CallbackType & {
491
+ count?: number;
492
+ sourceType?: Array<'camera' | 'album'>;
493
+ cameraType?: 'front' | 'back';
494
+ };
490
495
  export {};
@@ -10,6 +10,7 @@ export interface SDKServiceInterface {
10
10
  getContext: () => Promise<contextInfo | null>;
11
11
  getContextSync: () => contextInfo | null;
12
12
  getAuthCode: () => Promise<CallbackDataType.GetAuthCodeSuccessCallback>;
13
+ getZPIToken: () => Promise<CallbackDataType.GetZPITokenSuccessCallback>;
13
14
  login: (object?: InputDataType.CallbackType) => Promise<string>;
14
15
  getLoginStatus: () => boolean;
15
16
  getAccessToken: (object?: InputDataType.CallbackType) => Promise<string | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmp-sdk",
3
- "version": "2.23.3",
3
+ "version": "2.23.4",
4
4
  "description": "Zalo Mini App SDK",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",