zmp-sdk 2.17.0-rc.0 → 2.17.0-rc.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.
@@ -35284,6 +35284,7 @@
35284
35284
  }
35285
35285
  };
35286
35286
  const RESPONSE_CODE = {
35287
+ SUCCESS: 0,
35287
35288
  BAD_REQUEST: -1400,
35288
35289
  INTERNAL_SERVER_ERROR: -1500,
35289
35290
  UNAUTHORIZED: -1401,
@@ -35291,6 +35292,7 @@
35291
35292
  CLIENT_NOT_SUPPORT: -1404
35292
35293
  };
35293
35294
  const MESSAGES = {
35295
+ SUCCESS: 'Success',
35294
35296
  READ_MORE: 'Read more at: https://miniapp.zalo.me/docs/api',
35295
35297
  LOGIN_REQUIRED: 'Please login before to call this api. Read more at: https://miniapp.zalo.me/docs/api/login',
35296
35298
  LOGIN_FAILED: 'Login failed.',
@@ -35527,6 +35529,11 @@
35527
35529
  };
35528
35530
 
35529
35531
  const apiResponse = {
35532
+ success: (data, message) => ({
35533
+ code: RESPONSE_CODE.SUCCESS,
35534
+ message: message || MESSAGES.SUCCESS,
35535
+ data: data || {}
35536
+ }),
35530
35537
  error: {
35531
35538
  badRequest: (message) => new CommonError(RESPONSE_CODE.BAD_REQUEST, message),
35532
35539
  loginFailed: () => new CommonError(RESPONSE_CODE.BAD_REQUEST, MESSAGES.LOGIN_FAILED),
@@ -36743,7 +36750,7 @@
36743
36750
  }
36744
36751
  _ZJSBridgeProvider_bridge = new WeakMap();
36745
36752
 
36746
- var version = "2.17.0-rc.0";
36753
+ var version = "2.17.0-rc.1";
36747
36754
 
36748
36755
  class Basics {
36749
36756
  /**
@@ -40884,10 +40891,12 @@
40884
40891
  searchParams.append('appName', title);
40885
40892
  searchParams.append('appIcon', iconURL);
40886
40893
  const iosShortcutURL = `https://mini.zalo.me/shortcut.html?${searchParams.toString()}`;
40887
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openOutApp(encodeURI(iosShortcutURL));
40894
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openOutApp(encodeURI(iosShortcutURL));
40888
40895
  }
40889
- else
40896
+ else {
40890
40897
  yield __classPrivateFieldGet(this, _SDKCreator_sdkService).createShortcut(`${MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40898
+ }
40899
+ return apiResponse.success();
40891
40900
  });
40892
40901
  }
40893
40902
  openBioAuthentication(object) {
package/dist/index.es.js CHANGED
@@ -35281,6 +35281,7 @@ const ACTION = {
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 @@ const RESPONSE_CODE = {
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 @@ const handleErrorSync = (target, key, descriptor) => {
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 @@ class ZJSBridgeProvider {
36740
36747
  }
36741
36748
  _ZJSBridgeProvider_bridge = new WeakMap();
36742
36749
 
36743
- var version = "2.17.0-rc.0";
36750
+ var version = "2.17.0-rc.1";
36744
36751
 
36745
36752
  class Basics {
36746
36753
  /**
@@ -40881,10 +40888,12 @@ class SDKCreator {
40881
40888
  searchParams.append('appName', title);
40882
40889
  searchParams.append('appIcon', iconURL);
40883
40890
  const iosShortcutURL = `https://mini.zalo.me/shortcut.html?${searchParams.toString()}`;
40884
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openOutApp(encodeURI(iosShortcutURL));
40891
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openOutApp(encodeURI(iosShortcutURL));
40885
40892
  }
40886
- else
40893
+ else {
40887
40894
  yield __classPrivateFieldGet(this, _SDKCreator_sdkService).createShortcut(`${MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40895
+ }
40896
+ return apiResponse.success();
40888
40897
  });
40889
40898
  }
40890
40899
  openBioAuthentication(object) {