zmp-sdk 2.23.3 → 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
+ };
@@ -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-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
- };