zmp-sdk 2.22.0 → 2.22.1

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,
@@ -3743,7 +3743,7 @@
3743
3743
  }
3744
3744
  }
3745
3745
 
3746
- var version = "2.22.0";
3746
+ var version = "2.22.1";
3747
3747
 
3748
3748
  class Basics {
3749
3749
  /**
@@ -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
@@ -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.1";
3744
3744
 
3745
3745
  class Basics {
3746
3746
  /**
@@ -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);