zmp-sdk 2.22.0 → 2.22.3

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.
@@ -1,6 +1,6 @@
1
1
  module.exports = function (Handlebars) {
2
- Handlebars.registerHelper('validTag', function (tag, options) {
3
- if (!tag) return false;
2
+ Handlebars.registerHelper('validTag', function (tag, commits, options) {
3
+ if (!tag || tag.indexOf('-') >=0 || commits.length <= 0) return false;
4
4
  var version = tag.split('v')[1];
5
5
  return version.localeCompare('2.21.2', undefined, { numeric: true, sensitivity: 'base' }) > 0;
6
6
  });
@@ -3,7 +3,7 @@
3
3
  [1]: https://www.npmjs.com/package/zmp-sdk?activeTab=versions
4
4
 
5
5
  {{#each releases}}
6
- {{#if (validTag tag)}}
6
+ {{#if (validTag tag commits)}}
7
7
  ## {{title}} ({{date}})
8
8
 
9
9
  {{! List commits with `Breaking change: ` somewhere in the message }}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  module.exports = function (Handlebars) {
4
- Handlebars.registerHelper('validTag', function (tag, options) {
5
- if (!tag) return false;
4
+ Handlebars.registerHelper('validTag', function (tag, commits, options) {
5
+ if (!tag || tag.indexOf('-') >= 0 || commits.length <= 0) return false;
6
6
  var version = tag.split('v')[1];
7
7
  return version.localeCompare('2.21.2', undefined, {
8
8
  numeric: true,
@@ -2783,7 +2783,7 @@
2783
2783
  unknown: 0
2784
2784
  };
2785
2785
  const ZALO_SUPPORT_SHARE_MULTI_IMAGE_VERSION = {
2786
- android: 12100641,
2786
+ android: 12100615,
2787
2787
  iOS: 460,
2788
2788
  wp: 0,
2789
2789
  unknown: 0
@@ -3743,7 +3743,7 @@
3743
3743
  }
3744
3744
  }
3745
3745
 
3746
- var version = "2.22.0";
3746
+ var version = "2.22.3";
3747
3747
 
3748
3748
  class Basics {
3749
3749
  /**
@@ -5789,10 +5789,10 @@
5789
5789
  static requestCameraPermission(object) {
5790
5790
  return __awaiter(this, void 0, void 0, function* () {
5791
5791
  return yield this.getJSBridge().callNative(ACTION.REQUEST_PERMISSION_CAMERA, {}, {
5792
- successCallback: () => {
5792
+ successCallback: (data) => {
5793
5793
  return Promise.resolve({
5794
- userAllow: true,
5795
- message: 'User Allow'
5794
+ userAllow: (data === null || data === void 0 ? void 0 : data['error_code']) >= 0,
5795
+ message: data === null || data === void 0 ? void 0 : data['error_message']
5796
5796
  });
5797
5797
  }
5798
5798
  });
@@ -6399,6 +6399,10 @@
6399
6399
  }
6400
6400
  login(object) {
6401
6401
  return __awaiter(this, void 0, void 0, function* () {
6402
+ const deltaTime = new Date().getTime() - __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, "f");
6403
+ if (__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken, "f") && deltaTime < __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, "f")) {
6404
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken, "f");
6405
+ }
6402
6406
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_bridge, "f").jump();
6403
6407
  const deviceId = cookies.find((cookie) => cookie.name === COOKIE_NAME.DEVICE_ID);
6404
6408
  const contextID = cookies.find((cookie) => cookie.name === COOKIE_NAME.CONTEXT_ID);
package/dist/index.es.js CHANGED
@@ -2780,7 +2780,7 @@ const ZALO_SUPPORT_STORAGE_VERSION = {
2780
2780
  unknown: 0
2781
2781
  };
2782
2782
  const ZALO_SUPPORT_SHARE_MULTI_IMAGE_VERSION = {
2783
- android: 12100641,
2783
+ android: 12100615,
2784
2784
  iOS: 460,
2785
2785
  wp: 0,
2786
2786
  unknown: 0
@@ -3740,7 +3740,7 @@ class ZMPEEmitter extends eventemitter3 {
3740
3740
  }
3741
3741
  }
3742
3742
 
3743
- var version$1 = "2.22.0";
3743
+ var version$1 = "2.22.3";
3744
3744
 
3745
3745
  class Basics {
3746
3746
  /**
@@ -5786,10 +5786,10 @@ class Media {
5786
5786
  static requestCameraPermission(object) {
5787
5787
  return __awaiter(this, void 0, void 0, function* () {
5788
5788
  return yield this.getJSBridge().callNative(ACTION.REQUEST_PERMISSION_CAMERA, {}, {
5789
- successCallback: () => {
5789
+ successCallback: (data) => {
5790
5790
  return Promise.resolve({
5791
- userAllow: true,
5792
- message: 'User Allow'
5791
+ userAllow: (data === null || data === void 0 ? void 0 : data['error_code']) >= 0,
5792
+ message: data === null || data === void 0 ? void 0 : data['error_message']
5793
5793
  });
5794
5794
  }
5795
5795
  });
@@ -6396,6 +6396,10 @@ class ZaloMiniProgramSDKService {
6396
6396
  }
6397
6397
  login(object) {
6398
6398
  return __awaiter(this, void 0, void 0, function* () {
6399
+ const deltaTime = new Date().getTime() - __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, "f");
6400
+ if (__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken, "f") && deltaTime < __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, "f")) {
6401
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken, "f");
6402
+ }
6399
6403
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_bridge, "f").jump();
6400
6404
  const deviceId = cookies.find((cookie) => cookie.name === COOKIE_NAME.DEVICE_ID);
6401
6405
  const contextID = cookies.find((cookie) => cookie.name === COOKIE_NAME.CONTEXT_ID);