zmp-sdk 2.17.4 → 2.17.6-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.
@@ -35475,8 +35475,9 @@
35475
35475
  }
35476
35476
  }
35477
35477
  catch (error) {
35478
- if ((error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.UNAUTHORIZED ||
35479
- (error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.FORBIDDEN) {
35478
+ if ((error === null || error === void 0 ? void 0 : error.api) !== 'login' && // login is not error
35479
+ ((error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.UNAUTHORIZED ||
35480
+ (error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.FORBIDDEN)) {
35480
35481
  let loggedIn = false;
35481
35482
  if (this instanceof SDKCreator) {
35482
35483
  loggedIn = this.getLoginStatus();
@@ -35507,8 +35508,9 @@
35507
35508
  return fn.apply(this, args);
35508
35509
  }
35509
35510
  catch (error) {
35510
- if ((error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.UNAUTHORIZED ||
35511
- (error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.FORBIDDEN) {
35511
+ if ((error === null || error === void 0 ? void 0 : error.api) !== 'login' && // login is not error
35512
+ ((error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.UNAUTHORIZED ||
35513
+ (error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.FORBIDDEN)) {
35512
35514
  let loggedIn = false;
35513
35515
  if (this instanceof SDKCreator) {
35514
35516
  loggedIn = this.getLoginStatus();
@@ -36751,7 +36753,7 @@
36751
36753
  }
36752
36754
  _ZJSBridgeProvider_bridge = new WeakMap();
36753
36755
 
36754
- var version = "2.17.4";
36756
+ var version = "2.17.6-1";
36755
36757
 
36756
36758
  class Basics {
36757
36759
  /**
@@ -38833,7 +38835,12 @@
38833
38835
  resolve(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_cookies));
38834
38836
  }
38835
38837
  else {
38836
- this.callNative(ACTION.JUMP_LOGIN, {})
38838
+ // const onLine = navigator.onLine;
38839
+ // if (!onLine) {
38840
+ // reject(new Error('Network is offline'));
38841
+ // } else {
38842
+ // }
38843
+ this.callNative(ACTION.JUMP_LOGIN, {}, { haveTimeout: true })
38837
38844
  .then((data) => {
38838
38845
  const cookies = (data && data.cookiesOAuthLogins) || [];
38839
38846
  const jsToken = cookies.find((cookie) => cookie.name === COOKIE_NAME.JS_TOKEN);
@@ -38965,12 +38972,17 @@
38965
38972
  }
38966
38973
  login(object) {
38967
38974
  return __awaiter(this, void 0, void 0, function* () {
38975
+ const onlyJump = object === null || object === void 0 ? void 0 : object.onlyJump;
38968
38976
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_callJump).call(this);
38969
38977
  const zOAuthCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH);
38970
38978
  const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH_VRF);
38971
38979
  if (!lodash.isUndefined(zOAuthCookie) &&
38972
38980
  !lodash.isNull(zOAuthCookie) &&
38973
38981
  lodash.isString(zOAuthCookie.value)) {
38982
+ if (onlyJump) {
38983
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_accessToken, 'default');
38984
+ return 'Jump success';
38985
+ }
38974
38986
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuth, zOAuthCookie.value);
38975
38987
  if (!lodash.isUndefined(zOAuthVrfCookie) &&
38976
38988
  !lodash.isNull(zOAuthVrfCookie) &&
package/dist/index.es.js CHANGED
@@ -35472,8 +35472,9 @@ const handleError = (target, propertyName, descriptor) => {
35472
35472
  }
35473
35473
  }
35474
35474
  catch (error) {
35475
- if ((error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.UNAUTHORIZED ||
35476
- (error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.FORBIDDEN) {
35475
+ if ((error === null || error === void 0 ? void 0 : error.api) !== 'login' && // login is not error
35476
+ ((error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.UNAUTHORIZED ||
35477
+ (error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.FORBIDDEN)) {
35477
35478
  let loggedIn = false;
35478
35479
  if (this instanceof SDKCreator) {
35479
35480
  loggedIn = this.getLoginStatus();
@@ -35504,8 +35505,9 @@ const handleErrorSync = (target, key, descriptor) => {
35504
35505
  return fn.apply(this, args);
35505
35506
  }
35506
35507
  catch (error) {
35507
- if ((error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.UNAUTHORIZED ||
35508
- (error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.FORBIDDEN) {
35508
+ if ((error === null || error === void 0 ? void 0 : error.api) !== 'login' && // login is not error
35509
+ ((error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.UNAUTHORIZED ||
35510
+ (error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.FORBIDDEN)) {
35509
35511
  let loggedIn = false;
35510
35512
  if (this instanceof SDKCreator) {
35511
35513
  loggedIn = this.getLoginStatus();
@@ -36748,7 +36750,7 @@ class ZJSBridgeProvider {
36748
36750
  }
36749
36751
  _ZJSBridgeProvider_bridge = new WeakMap();
36750
36752
 
36751
- var version = "2.17.4";
36753
+ var version = "2.17.6-1";
36752
36754
 
36753
36755
  class Basics {
36754
36756
  /**
@@ -38830,7 +38832,12 @@ class ZaloMiniProgramSDKService extends ZJSBridgeProvider {
38830
38832
  resolve(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_cookies));
38831
38833
  }
38832
38834
  else {
38833
- this.callNative(ACTION.JUMP_LOGIN, {})
38835
+ // const onLine = navigator.onLine;
38836
+ // if (!onLine) {
38837
+ // reject(new Error('Network is offline'));
38838
+ // } else {
38839
+ // }
38840
+ this.callNative(ACTION.JUMP_LOGIN, {}, { haveTimeout: true })
38834
38841
  .then((data) => {
38835
38842
  const cookies = (data && data.cookiesOAuthLogins) || [];
38836
38843
  const jsToken = cookies.find((cookie) => cookie.name === COOKIE_NAME.JS_TOKEN);
@@ -38962,12 +38969,17 @@ class ZaloMiniProgramSDKService extends ZJSBridgeProvider {
38962
38969
  }
38963
38970
  login(object) {
38964
38971
  return __awaiter(this, void 0, void 0, function* () {
38972
+ const onlyJump = object === null || object === void 0 ? void 0 : object.onlyJump;
38965
38973
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_callJump).call(this);
38966
38974
  const zOAuthCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH);
38967
38975
  const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH_VRF);
38968
38976
  if (!lodash.isUndefined(zOAuthCookie) &&
38969
38977
  !lodash.isNull(zOAuthCookie) &&
38970
38978
  lodash.isString(zOAuthCookie.value)) {
38979
+ if (onlyJump) {
38980
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_accessToken, 'default');
38981
+ return 'Jump success';
38982
+ }
38971
38983
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuth, zOAuthCookie.value);
38972
38984
  if (!lodash.isUndefined(zOAuthVrfCookie) &&
38973
38985
  !lodash.isNull(zOAuthVrfCookie) &&