zmp-sdk 2.16.7 → 2.16.8

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.
@@ -35281,6 +35281,7 @@
35281
35281
  }
35282
35282
  };
35283
35283
  const RESPONSE_CODE = {
35284
+ SUCCESS: 0,
35284
35285
  BAD_REQUEST: -1400,
35285
35286
  INTERNAL_SERVER_ERROR: -1500,
35286
35287
  UNAUTHORIZED: -1401,
@@ -35288,6 +35289,7 @@
35288
35289
  CLIENT_NOT_SUPPORT: -1404
35289
35290
  };
35290
35291
  const MESSAGES = {
35292
+ SUCCESS: 'Success',
35291
35293
  READ_MORE: 'Read more at: https://miniapp.zalo.me/docs/api',
35292
35294
  LOGIN_REQUIRED: 'Please login before to call this api. Read more at: https://miniapp.zalo.me/docs/api/login',
35293
35295
  LOGIN_FAILED: 'Login failed.',
@@ -35524,6 +35526,11 @@
35524
35526
  };
35525
35527
 
35526
35528
  const apiResponse = {
35529
+ success: (data, message) => ({
35530
+ code: RESPONSE_CODE.SUCCESS,
35531
+ message: message || MESSAGES.SUCCESS,
35532
+ data: data || {}
35533
+ }),
35527
35534
  error: {
35528
35535
  badRequest: (message) => new CommonError(RESPONSE_CODE.BAD_REQUEST, message),
35529
35536
  loginFailed: () => new CommonError(RESPONSE_CODE.BAD_REQUEST, MESSAGES.LOGIN_FAILED),
@@ -36740,7 +36747,7 @@
36740
36747
  }
36741
36748
  _ZJSBridgeProvider_bridge = new WeakMap();
36742
36749
 
36743
- var version = "2.16.7";
36750
+ var version = "2.16.8";
36744
36751
 
36745
36752
  class Basics {
36746
36753
  /**
@@ -40860,10 +40867,12 @@
40860
40867
  searchParams.append('appName', title);
40861
40868
  searchParams.append('appIcon', iconURL);
40862
40869
  const iosShortcutURL = `https://mini.zalo.me/shortcut.html?${searchParams.toString()}`;
40863
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openOutApp(encodeURI(iosShortcutURL));
40870
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openOutApp(encodeURI(iosShortcutURL));
40864
40871
  }
40865
- else
40872
+ else {
40866
40873
  yield __classPrivateFieldGet(this, _SDKCreator_sdkService).createShortcut(`${MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40874
+ }
40875
+ return apiResponse.success();
40867
40876
  });
40868
40877
  }
40869
40878
  openBioAuthentication(object) {
package/dist/index.es.js CHANGED
@@ -35278,6 +35278,7 @@ const ACTION = {
35278
35278
  }
35279
35279
  };
35280
35280
  const RESPONSE_CODE = {
35281
+ SUCCESS: 0,
35281
35282
  BAD_REQUEST: -1400,
35282
35283
  INTERNAL_SERVER_ERROR: -1500,
35283
35284
  UNAUTHORIZED: -1401,
@@ -35285,6 +35286,7 @@ const RESPONSE_CODE = {
35285
35286
  CLIENT_NOT_SUPPORT: -1404
35286
35287
  };
35287
35288
  const MESSAGES = {
35289
+ SUCCESS: 'Success',
35288
35290
  READ_MORE: 'Read more at: https://miniapp.zalo.me/docs/api',
35289
35291
  LOGIN_REQUIRED: 'Please login before to call this api. Read more at: https://miniapp.zalo.me/docs/api/login',
35290
35292
  LOGIN_FAILED: 'Login failed.',
@@ -35521,6 +35523,11 @@ const handleErrorSync = (target, key, descriptor) => {
35521
35523
  };
35522
35524
 
35523
35525
  const apiResponse = {
35526
+ success: (data, message) => ({
35527
+ code: RESPONSE_CODE.SUCCESS,
35528
+ message: message || MESSAGES.SUCCESS,
35529
+ data: data || {}
35530
+ }),
35524
35531
  error: {
35525
35532
  badRequest: (message) => new CommonError(RESPONSE_CODE.BAD_REQUEST, message),
35526
35533
  loginFailed: () => new CommonError(RESPONSE_CODE.BAD_REQUEST, MESSAGES.LOGIN_FAILED),
@@ -36737,7 +36744,7 @@ class ZJSBridgeProvider {
36737
36744
  }
36738
36745
  _ZJSBridgeProvider_bridge = new WeakMap();
36739
36746
 
36740
- var version = "2.16.7";
36747
+ var version = "2.16.8";
36741
36748
 
36742
36749
  class Basics {
36743
36750
  /**
@@ -40857,10 +40864,12 @@ class SDKCreator {
40857
40864
  searchParams.append('appName', title);
40858
40865
  searchParams.append('appIcon', iconURL);
40859
40866
  const iosShortcutURL = `https://mini.zalo.me/shortcut.html?${searchParams.toString()}`;
40860
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openOutApp(encodeURI(iosShortcutURL));
40867
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openOutApp(encodeURI(iosShortcutURL));
40861
40868
  }
40862
- else
40869
+ else {
40863
40870
  yield __classPrivateFieldGet(this, _SDKCreator_sdkService).createShortcut(`${MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40871
+ }
40872
+ return apiResponse.success();
40864
40873
  });
40865
40874
  }
40866
40875
  openBioAuthentication(object) {