zmp-sdk 2.23.2 → 2.23.4-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.
@@ -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
+ };
@@ -5,8 +5,7 @@ export declare type userInfo = {
5
5
  id: string;
6
6
  name: string;
7
7
  avatar: string;
8
- birthday?: string;
9
- gender?: string;
8
+ idByOA?: string;
10
9
  };
11
10
  /**
12
11
  * iBeacon info
@@ -484,4 +484,7 @@ export declare type ConfigCloseButtonRequest<T> = CallbackType<T> & {
484
484
  confirmToExit?: boolean;
485
485
  onExit?: () => void;
486
486
  };
487
+ export declare type OpenOutApp = CallbackType & {
488
+ url: string;
489
+ };
487
490
  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>;
@@ -31,6 +31,7 @@ export default class ZaloJSBridge extends EventEmitter {
31
31
  action: string;
32
32
  error: number;
33
33
  message: string;
34
+ data: any;
34
35
  }[]): void;
35
36
  onJSCall(key: string, data: any): void;
36
37
  onMultiJSCall(key: string, data: any): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmp-sdk",
3
- "version": "2.23.2",
3
+ "version": "2.23.4-0",
4
4
  "description": "Zalo Mini App SDK",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- module.exports = function (Handlebars) {
4
- Handlebars.registerHelper('validTag', function (tag, commits, options) {
5
- if (!tag || tag.indexOf('-') >= 0 || commits.length <= 0) return false;
6
- var version = tag.split('v')[1];
7
- return version.localeCompare('2.21.2', undefined, {
8
- numeric: true,
9
- sensitivity: 'base'
10
- }) > 0;
11
- });
12
- Handlebars.registerHelper('commitFormat', function (options) {
13
- var string = options.fn(this);
14
- var mapObj = {
15
- 'breaking change:': '',
16
- 'fix:': '',
17
- 'feat:': ''
18
- };
19
- return string.replace(/('breaking change:|fix:|feat:)(.*)/gi, function (matched, a, b) {
20
- var g2 = b.trim();
21
- return "".concat(mapObj[a]).concat(g2.charAt(0).toUpperCase() + g2.slice(1));
22
- });
23
- });
24
- };