zmp-sdk 2.19.0-rc.7 → 2.19.0

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.
package/dist/index.es.js CHANGED
@@ -4058,7 +4058,7 @@ class ZJSBridgeProvider {
4058
4058
  }
4059
4059
  _ZJSBridgeProvider_bridge = new WeakMap();
4060
4060
 
4061
- var version$1 = "2.19.0-rc.7";
4061
+ var version$1 = "2.19.0";
4062
4062
 
4063
4063
  class Basics {
4064
4064
  /**
@@ -5009,6 +5009,18 @@ class Device {
5009
5009
  });
5010
5010
  });
5011
5011
  }
5012
+ /**
5013
+ * Open App Store.
5014
+ * @async
5015
+ * @function openAppStore
5016
+ * @category Device
5017
+ *
5018
+ */
5019
+ static openAppStore(object) {
5020
+ return __awaiter(this, void 0, void 0, function* () {
5021
+ return yield this.callNative(ACTION.OPEN_APPSTORE, object);
5022
+ });
5023
+ }
5012
5024
  }
5013
5025
 
5014
5026
  var _LocalResourceStorage_storage, _LocalResourceStorage_prefix, _LocalResourceStorage_resourceInfo;
@@ -6031,11 +6043,10 @@ class Zalo {
6031
6043
  }, {
6032
6044
  isMultiCallback: true,
6033
6045
  callback: (nativeData, error) => {
6034
- var _a, _b;
6046
+ var _a;
6035
6047
  if (nativeData.error_code === 0) {
6036
- const resultContent = stringToData((_a = nativeData.data) === null || _a === void 0 ? void 0 : _a.result_content);
6037
6048
  const res = {
6038
- urls: (_b = resultContent === null || resultContent === void 0 ? void 0 : resultContent.data) === null || _b === void 0 ? void 0 : _b.urls
6049
+ data: (_a = nativeData.data) === null || _a === void 0 ? void 0 : _a.result_content
6039
6050
  };
6040
6051
  return Promise.resolve(res);
6041
6052
  }
@@ -6234,6 +6245,7 @@ class ZaloMiniProgramSDKService extends ZJSBridgeProvider {
6234
6245
  this.openMediaPicker = Zalo.openMediaPicker;
6235
6246
  this.openOutApp = Zalo.openOutApp;
6236
6247
  this.closeLoading = Window.closeLoading;
6248
+ this.openAppStore = Device.openAppStore;
6237
6249
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuth, null, "f");
6238
6250
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuthVrf, null, "f");
6239
6251
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_accessToken, null, "f");
@@ -6694,6 +6706,9 @@ class MockSDKService {
6694
6706
  this.closeLoading = (when) => {
6695
6707
  return Promise.resolve();
6696
6708
  };
6709
+ this.openAppStore = (data) => {
6710
+ return Promise.resolve();
6711
+ };
6697
6712
  }
6698
6713
  on(event, fn, context) {
6699
6714
  throw new Error('Method not implemented.');
@@ -6710,9 +6725,10 @@ class MockSDKService {
6710
6725
  openMediaPicker(type, serverUpload, maxItemSize, editView, silentRequest, maxSelectItem) {
6711
6726
  console.warn('This api only works on zalo app');
6712
6727
  return Promise.resolve({
6713
- urls: []
6728
+ data: ""
6714
6729
  });
6715
6730
  }
6731
+ ;
6716
6732
  }
6717
6733
  _MockSDKService_appId = new WeakMap(), _MockSDKService_appConfig = new WeakMap(), _MockSDKService_zOAuth = new WeakMap(), _MockSDKService_accessToken = new WeakMap(), _MockSDKService_cache = new WeakMap(), _MockSDKService_loggedId = new WeakMap();
6718
6734
 
@@ -6942,8 +6958,6 @@ var browser$1 = {
6942
6958
  uptime: uptime
6943
6959
  };
6944
6960
 
6945
- var process$1 = browser$1;
6946
-
6947
6961
  /*! *****************************************************************************
6948
6962
  Copyright (C) Microsoft. All rights reserved.
6949
6963
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -7009,7 +7023,7 @@ var Reflect$1;
7009
7023
  };
7010
7024
  // Load global or shim versions of Map, Set, and WeakMap
7011
7025
  var functionPrototype = Object.getPrototypeOf(Function);
7012
- var usePolyfill = typeof process$1 === "object" && process$1.env && process$1.env["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
7026
+ var usePolyfill = typeof browser$1 === "object" && browser$1.env && browser$1.env["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
7013
7027
  var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
7014
7028
  var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
7015
7029
  var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
@@ -8525,9 +8539,9 @@ class SDKCreator {
8525
8539
  openWebview(object) {
8526
8540
  return __awaiter(this, void 0, void 0, function* () {
8527
8541
  const url = new URL(object.url);
8528
- const typeInapp = url.searchParams.get("typeInapp");
8542
+ const typeInapp = url.searchParams.get('typeInapp');
8529
8543
  if (_.isEmpty(typeInapp)) {
8530
- url.searchParams.set("typeInapp", "1");
8544
+ url.searchParams.set('typeInapp', '1');
8531
8545
  }
8532
8546
  yield __classPrivateFieldGet(this, _SDKCreator_sdkService, "f").openWebview(url.href);
8533
8547
  });
@@ -8587,7 +8601,7 @@ class SDKCreator {
8587
8601
  users = uIds.map((item) => {
8588
8602
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
8589
8603
  return {
8590
- id: ((_b = (_a = resData.data[item]) === null || _a === void 0 ? void 0 : _a.user_info) === null || _b === void 0 ? void 0 : _b.user_id_by_app) || "",
8604
+ id: ((_b = (_a = resData.data[item]) === null || _a === void 0 ? void 0 : _a.user_info) === null || _b === void 0 ? void 0 : _b.user_id_by_app) || '',
8591
8605
  profile: {
8592
8606
  name: (_d = (_c = resData.data[item]) === null || _c === void 0 ? void 0 : _c.user_info) === null || _d === void 0 ? void 0 : _d.name,
8593
8607
  avatar: (_h = (_g = (_f = (_e = resData.data[item]) === null || _e === void 0 ? void 0 : _e.user_info) === null || _f === void 0 ? void 0 : _f.picture) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.url
@@ -8655,6 +8669,14 @@ class SDKCreator {
8655
8669
  return yield __classPrivateFieldGet(this, _SDKCreator_sdkService, "f").closeLoading('user action');
8656
8670
  });
8657
8671
  }
8672
+ requestUpdateZalo(object) {
8673
+ return __awaiter(this, void 0, void 0, function* () {
8674
+ const appStoreURL = checkPlatform().isIOS
8675
+ ? 'https://apps.apple.com/vn/app/zalo/id579523206'
8676
+ : 'https://play.google.com/store/apps/details?id=com.zing.zalo';
8677
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService, "f").openOutApp(appStoreURL);
8678
+ });
8679
+ }
8658
8680
  }
8659
8681
  _SDKCreator_sdkService = new WeakMap();
8660
8682
  __decorate([
@@ -9042,9 +9064,9 @@ __decorate([
9042
9064
  validate,
9043
9065
  __param(0, checkType('object', {
9044
9066
  type: checkData('string', {
9045
- values: ['photo', 'video', 'file', 'multi_photo', 'multi_video']
9067
+ values: ['photo', 'video', 'file']
9046
9068
  }),
9047
- 'serverUploadUrl': checkData('url'),
9069
+ serverUploadUrl: checkData('url'),
9048
9070
  'maxItemSize?': checkData('number', { min: 0 }),
9049
9071
  'editView?': checkData('object'),
9050
9072
  'editView.enable?': checkData('boolean'),
@@ -9069,6 +9091,10 @@ __decorate([
9069
9091
  handleError,
9070
9092
  validate
9071
9093
  ], SDKCreator.prototype, "closeLoading", null);
9094
+ __decorate([
9095
+ handleError,
9096
+ validate
9097
+ ], SDKCreator.prototype, "requestUpdateZalo", null);
9072
9098
  class ZaloMiniAppSDKCreator extends SDKCreator {
9073
9099
  getServiceInstance() {
9074
9100
  return ZaloMiniProgramSDKService.getInstance();
@@ -9348,4 +9374,5 @@ else {
9348
9374
  }
9349
9375
  window.ZaloMiniAppSDK = app;
9350
9376
 
9351
- export { ChatType, Events, MediaPickerType, NativeCode, NetworkType, OrientationType, payment as Payment, PlatformType, PostFeedType, ProfileType, SDKCreator, ShareSheetType, VibrateType, app as default };
9377
+ export default app;
9378
+ export { ChatType, Events, MediaPickerType, NativeCode, NetworkType, OrientationType, payment as Payment, PlatformType, PostFeedType, ProfileType, SDKCreator, ShareSheetType, VibrateType };