zmp-sdk 2.21.0 → 2.22.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.
@@ -0,0 +1,20 @@
1
+ module.exports = function (Handlebars) {
2
+ Handlebars.registerHelper('validTag', function (tag, options) {
3
+ if (!tag) return false;
4
+ var version = tag.split('v')[1];
5
+ return version.localeCompare('2.21.2', undefined, { numeric: true, sensitivity: 'base' }) > 0;
6
+ });
7
+
8
+ Handlebars.registerHelper('commitFormat', function (options) {
9
+ const string = options.fn(this);
10
+ var mapObj = {
11
+ 'breaking change:': '',
12
+ 'fix:': '',
13
+ 'feat:': ''
14
+ };
15
+ return string.replace(/('breaking change:|fix:|feat:)(.*)/gi, function (matched, a, b) {
16
+ const g2 = b.trim()
17
+ return `${mapObj[a]}${g2.charAt(0).toUpperCase() + g2.slice(1)}`;
18
+ });
19
+ });
20
+ };
@@ -0,0 +1,30 @@
1
+ [npm history][1]
2
+
3
+ [1]: https://www.npmjs.com/package/zmp-sdk?activeTab=versions
4
+
5
+ {{#each releases}}
6
+ {{#if (validTag tag)}}
7
+ ## {{title}} ({{date}})
8
+
9
+ {{! List commits with `Breaking change: ` somewhere in the message }}
10
+ {{#commit-list commits heading='### ⚠ BREAKING CHANGES' message='breaking change: '}}
11
+ * {{#commitFormat}}{{subject}}{{/commitFormat}}
12
+ {{/commit-list}}
13
+
14
+ {{#commit-list commits heading='### Features' message='feat: '}}
15
+ * {{#commitFormat}}{{subject}}{{/commitFormat}}
16
+ {{/commit-list}}
17
+
18
+ {{#commit-list commits heading='### Bug Fixes' exclude='feat: ' exclude='breaking change: '}}
19
+ * {{#commitFormat}}{{subject}}{{/commitFormat}}
20
+ {{/commit-list}}
21
+
22
+ {{/if}}
23
+
24
+ {{/each}}
25
+
26
+ ## v2.21.2 (14-07-2022)
27
+
28
+ ### Bug Fixes
29
+
30
+ * **openShareSheet**: error when share image (Zalo iOS version 22.06.02)
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ module.exports = function (Handlebars) {
4
+ Handlebars.registerHelper('validTag', function (tag, options) {
5
+ if (!tag) return false;
6
+ var version = tag.split('v')[1];
7
+ return version.localeCompare('2.21.2', undefined, {
8
+ numeric: true,
9
+ sensitivity: 'base'
10
+ }) > 0;
11
+ });
12
+ Handlebars.registerHelper('commitFormat', function (options) {
13
+ var string = options.fn(this);
14
+ var mapObj = {
15
+ 'breaking change:': '',
16
+ 'fix:': '',
17
+ 'feat:': ''
18
+ };
19
+ return string.replace(/('breaking change:|fix:|feat:)(.*)/gi, function (matched, a, b) {
20
+ var g2 = b.trim();
21
+ return "".concat(mapObj[a]).concat(g2.charAt(0).toUpperCase() + g2.slice(1));
22
+ });
23
+ });
24
+ };
@@ -2143,6 +2143,7 @@
2143
2143
  ShareSheetType[ShareSheetType["link"] = 4] = "link";
2144
2144
  ShareSheetType[ShareSheetType["oa"] = 5] = "oa";
2145
2145
  ShareSheetType[ShareSheetType["zmp"] = 20] = "zmp";
2146
+ ShareSheetType[ShareSheetType["multi_image"] = 21] = "multi_image";
2146
2147
  })(ShareSheetType || (ShareSheetType = {}));
2147
2148
  var OrientationType;
2148
2149
  (function (OrientationType) {
@@ -2242,7 +2243,9 @@
2242
2243
  ZACC_SESSiON: `h5.zdn.vn_zacc_session`,
2243
2244
  JS_TOKEN: `h5.zdn.vn_zlink3rd`,
2244
2245
  ZOAUTH_VRF: `h5.zdn.vn_zoauth_vrf`,
2245
- DEVICE_ID: `h5.zdn.vn_deviceID`
2246
+ DEVICE_ID: `h5.zdn.vn_deviceID`,
2247
+ CONTEXT_ID: `h5.zdn.vn_contextID`,
2248
+ CONTEXT_TYPE: `h5.zdn.vn_contextType`,
2246
2249
  };
2247
2250
  const APIS = {
2248
2251
  GET_USER_INFO: 'https://graph.zalo.me/v2.0/me',
@@ -2779,6 +2782,12 @@
2779
2782
  wp: 0,
2780
2783
  unknown: 0
2781
2784
  };
2785
+ const ZALO_SUPPORT_SHARE_MULTI_IMAGE_VERSION = {
2786
+ android: 12100641,
2787
+ iOS: 460,
2788
+ wp: 0,
2789
+ unknown: 0
2790
+ };
2782
2791
  // List actions supported before support action action.get.supported.actions
2783
2792
  const ZALO_IOS_ACTIONS_SUPPORTED_BEFORE_VER_402 = [
2784
2793
  ACTION.GET_DOWNLOADED_STICKER.name,
@@ -3734,7 +3743,7 @@
3734
3743
  }
3735
3744
  }
3736
3745
 
3737
- var version = "2.21.0";
3746
+ var version = "2.22.0";
3738
3747
 
3739
3748
  class Basics {
3740
3749
  /**
@@ -5963,9 +5972,15 @@
5963
5972
  static openShareSheet(object) {
5964
5973
  return __awaiter(this, void 0, void 0, function* () {
5965
5974
  let reqData = {};
5975
+ let type = object.type;
5966
5976
  switch (object.type) {
5967
5977
  case 'image':
5968
5978
  let photoUrls = [];
5979
+ const zaloVersion = getZaloVersion();
5980
+ const platform = getPlatform();
5981
+ if (zaloVersion >= ZALO_SUPPORT_SHARE_MULTI_IMAGE_VERSION[platform]) {
5982
+ type = 'multi_image';
5983
+ }
5969
5984
  if (Array.isArray(object.data.imageUrls) &&
5970
5985
  object.data.imageUrls.length > 0) {
5971
5986
  photoUrls = object.data.imageUrls;
@@ -6035,7 +6050,7 @@
6035
6050
  }
6036
6051
  }
6037
6052
  return yield this.getJSBridge()
6038
- .callNative(ACTION.OPEN_SHARESHEET, Object.assign(Object.assign({ type: ShareSheetType[object.type] }, reqData), { zapp: this.getZAppId() }), {
6053
+ .callNative(ACTION.OPEN_SHARESHEET, Object.assign(Object.assign({ type: ShareSheetType[type] }, reqData), { zapp: this.getZAppId() }), {
6039
6054
  haveTimeout: false
6040
6055
  })
6041
6056
  .then((res) => {
@@ -6228,7 +6243,7 @@
6228
6243
  }
6229
6244
  }
6230
6245
 
6231
- var _ZaloMiniProgramSDKService_zAppId, _ZaloMiniProgramSDKService_appId, _ZaloMiniProgramSDKService_appConfig, _ZaloMiniProgramSDKService_zOAuth, _ZaloMiniProgramSDKService_zOAuthVrf, _ZaloMiniProgramSDKService_accessToken, _ZaloMiniProgramSDKService_refreshToken, _ZaloMiniProgramSDKService_cache, _ZaloMiniProgramSDKService_bridge, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, _ZaloMiniProgramSDKService_tokenExpiresIn, _ZaloMiniProgramSDKService_deviceId, _ZaloMiniProgramSDKService_actionBarConfig, _ZaloMiniProgramSDKService_getActionsSupported;
6246
+ var _ZaloMiniProgramSDKService_zAppId, _ZaloMiniProgramSDKService_appId, _ZaloMiniProgramSDKService_appConfig, _ZaloMiniProgramSDKService_zOAuth, _ZaloMiniProgramSDKService_zOAuthVrf, _ZaloMiniProgramSDKService_accessToken, _ZaloMiniProgramSDKService_refreshToken, _ZaloMiniProgramSDKService_cache, _ZaloMiniProgramSDKService_bridge, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, _ZaloMiniProgramSDKService_tokenExpiresIn, _ZaloMiniProgramSDKService_deviceId, _ZaloMiniProgramSDKService_context, _ZaloMiniProgramSDKService_actionBarConfig, _ZaloMiniProgramSDKService_getActionsSupported;
6232
6247
  class ZaloMiniProgramSDKService {
6233
6248
  constructor() {
6234
6249
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
@@ -6248,6 +6263,7 @@
6248
6263
  _ZaloMiniProgramSDKService_prevGetTokenTimestamp.set(this, void 0);
6249
6264
  _ZaloMiniProgramSDKService_tokenExpiresIn.set(this, void 0);
6250
6265
  _ZaloMiniProgramSDKService_deviceId.set(this, void 0);
6266
+ _ZaloMiniProgramSDKService_context.set(this, void 0);
6251
6267
  this.events = ZMPEEmitter.getInstance();
6252
6268
  this.isIOS = checkPlatform().isIOS;
6253
6269
  _ZaloMiniProgramSDKService_actionBarConfig.set(this, void 0);
@@ -6327,6 +6343,7 @@
6327
6343
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, 0, "f");
6328
6344
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, 0, "f");
6329
6345
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_deviceId, '', "f");
6346
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_context, null, "f");
6330
6347
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_bridge, ZaloJSBridge.getInstance(), "f");
6331
6348
  const showHomeButton = ((_b = (_a = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig, "f")) === null || _a === void 0 ? void 0 : _a.app) === null || _b === void 0 ? void 0 : _b.leftButton) === 'home' ||
6332
6349
  ((_d = (_c = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig, "f")) === null || _c === void 0 ? void 0 : _c.app) === null || _d === void 0 ? void 0 : _d.leftButton) === 'both'
@@ -6374,6 +6391,9 @@
6374
6391
  getDeviceId() {
6375
6392
  return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_deviceId, "f");
6376
6393
  }
6394
+ getContext() {
6395
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_context, "f");
6396
+ }
6377
6397
  getJSBridge() {
6378
6398
  return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_bridge, "f");
6379
6399
  }
@@ -6381,9 +6401,17 @@
6381
6401
  return __awaiter(this, void 0, void 0, function* () {
6382
6402
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_bridge, "f").jump();
6383
6403
  const deviceId = cookies.find((cookie) => cookie.name === COOKIE_NAME.DEVICE_ID);
6404
+ const contextID = cookies.find((cookie) => cookie.name === COOKIE_NAME.CONTEXT_ID);
6405
+ const contextType = cookies.find((cookie) => cookie.name === COOKIE_NAME.CONTEXT_TYPE);
6384
6406
  if (deviceId) {
6385
6407
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_deviceId, deviceId.value, "f");
6386
6408
  }
6409
+ if (contextID && contextType) {
6410
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_context, {
6411
+ id: contextID.value,
6412
+ type: contextType.value
6413
+ }, "f");
6414
+ }
6387
6415
  const zOAuthCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH);
6388
6416
  const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH_VRF);
6389
6417
  if (!_.isUndefined(zOAuthCookie) &&
@@ -6474,7 +6502,7 @@
6474
6502
  });
6475
6503
  }
6476
6504
  }
6477
- _ZaloMiniProgramSDKService_zAppId = new WeakMap(), _ZaloMiniProgramSDKService_appId = new WeakMap(), _ZaloMiniProgramSDKService_appConfig = new WeakMap(), _ZaloMiniProgramSDKService_zOAuth = new WeakMap(), _ZaloMiniProgramSDKService_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDKService_accessToken = new WeakMap(), _ZaloMiniProgramSDKService_refreshToken = new WeakMap(), _ZaloMiniProgramSDKService_cache = new WeakMap(), _ZaloMiniProgramSDKService_bridge = new WeakMap(), _ZaloMiniProgramSDKService_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDKService_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDKService_deviceId = new WeakMap(), _ZaloMiniProgramSDKService_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDKService_getActionsSupported = new WeakMap();
6505
+ _ZaloMiniProgramSDKService_zAppId = new WeakMap(), _ZaloMiniProgramSDKService_appId = new WeakMap(), _ZaloMiniProgramSDKService_appConfig = new WeakMap(), _ZaloMiniProgramSDKService_zOAuth = new WeakMap(), _ZaloMiniProgramSDKService_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDKService_accessToken = new WeakMap(), _ZaloMiniProgramSDKService_refreshToken = new WeakMap(), _ZaloMiniProgramSDKService_cache = new WeakMap(), _ZaloMiniProgramSDKService_bridge = new WeakMap(), _ZaloMiniProgramSDKService_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDKService_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDKService_deviceId = new WeakMap(), _ZaloMiniProgramSDKService_context = new WeakMap(), _ZaloMiniProgramSDKService_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDKService_getActionsSupported = new WeakMap();
6478
6506
 
6479
6507
  var _MockSDKService_appId, _MockSDKService_appConfig, _MockSDKService_zOAuth, _MockSDKService_accessToken, _MockSDKService_cache, _MockSDKService_loggedId;
6480
6508
  class MockSDKService {
@@ -6799,6 +6827,9 @@
6799
6827
  return Promise.resolve();
6800
6828
  };
6801
6829
  }
6830
+ getContext() {
6831
+ return null;
6832
+ }
6802
6833
  on(event, fn, context) {
6803
6834
  throw new Error('Method not implemented.');
6804
6835
  }
@@ -6814,10 +6845,9 @@
6814
6845
  openMediaPicker(type, serverUpload, maxItemSize, editView, silentRequest, maxSelectItem) {
6815
6846
  console.warn('This api only works on zalo app');
6816
6847
  return Promise.resolve({
6817
- data: ""
6848
+ data: ''
6818
6849
  });
6819
6850
  }
6820
- ;
6821
6851
  }
6822
6852
  _MockSDKService_appId = new WeakMap(), _MockSDKService_appConfig = new WeakMap(), _MockSDKService_zOAuth = new WeakMap(), _MockSDKService_accessToken = new WeakMap(), _MockSDKService_cache = new WeakMap(), _MockSDKService_loggedId = new WeakMap();
6823
6853
 
@@ -7505,6 +7535,9 @@
7505
7535
  getDeviceId() {
7506
7536
  return __classPrivateFieldGet(this, _SDKCreator_sdkService, "f").getDeviceId();
7507
7537
  }
7538
+ getContext() {
7539
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService, "f").getContext();
7540
+ }
7508
7541
  };
7509
7542
  _SDKCreator_sdkService = new WeakMap();
7510
7543
  __decorate([
package/dist/index.es.js CHANGED
@@ -2140,6 +2140,7 @@ var ShareSheetType;
2140
2140
  ShareSheetType[ShareSheetType["link"] = 4] = "link";
2141
2141
  ShareSheetType[ShareSheetType["oa"] = 5] = "oa";
2142
2142
  ShareSheetType[ShareSheetType["zmp"] = 20] = "zmp";
2143
+ ShareSheetType[ShareSheetType["multi_image"] = 21] = "multi_image";
2143
2144
  })(ShareSheetType || (ShareSheetType = {}));
2144
2145
  var OrientationType;
2145
2146
  (function (OrientationType) {
@@ -2239,7 +2240,9 @@ const COOKIE_NAME = {
2239
2240
  ZACC_SESSiON: `h5.zdn.vn_zacc_session`,
2240
2241
  JS_TOKEN: `h5.zdn.vn_zlink3rd`,
2241
2242
  ZOAUTH_VRF: `h5.zdn.vn_zoauth_vrf`,
2242
- DEVICE_ID: `h5.zdn.vn_deviceID`
2243
+ DEVICE_ID: `h5.zdn.vn_deviceID`,
2244
+ CONTEXT_ID: `h5.zdn.vn_contextID`,
2245
+ CONTEXT_TYPE: `h5.zdn.vn_contextType`,
2243
2246
  };
2244
2247
  const APIS = {
2245
2248
  GET_USER_INFO: 'https://graph.zalo.me/v2.0/me',
@@ -2776,6 +2779,12 @@ const ZALO_SUPPORT_STORAGE_VERSION = {
2776
2779
  wp: 0,
2777
2780
  unknown: 0
2778
2781
  };
2782
+ const ZALO_SUPPORT_SHARE_MULTI_IMAGE_VERSION = {
2783
+ android: 12100641,
2784
+ iOS: 460,
2785
+ wp: 0,
2786
+ unknown: 0
2787
+ };
2779
2788
  // List actions supported before support action action.get.supported.actions
2780
2789
  const ZALO_IOS_ACTIONS_SUPPORTED_BEFORE_VER_402 = [
2781
2790
  ACTION.GET_DOWNLOADED_STICKER.name,
@@ -3731,7 +3740,7 @@ class ZMPEEmitter extends eventemitter3 {
3731
3740
  }
3732
3741
  }
3733
3742
 
3734
- var version$1 = "2.21.0";
3743
+ var version$1 = "2.22.0";
3735
3744
 
3736
3745
  class Basics {
3737
3746
  /**
@@ -5960,9 +5969,15 @@ class Zalo {
5960
5969
  static openShareSheet(object) {
5961
5970
  return __awaiter(this, void 0, void 0, function* () {
5962
5971
  let reqData = {};
5972
+ let type = object.type;
5963
5973
  switch (object.type) {
5964
5974
  case 'image':
5965
5975
  let photoUrls = [];
5976
+ const zaloVersion = getZaloVersion();
5977
+ const platform = getPlatform();
5978
+ if (zaloVersion >= ZALO_SUPPORT_SHARE_MULTI_IMAGE_VERSION[platform]) {
5979
+ type = 'multi_image';
5980
+ }
5966
5981
  if (Array.isArray(object.data.imageUrls) &&
5967
5982
  object.data.imageUrls.length > 0) {
5968
5983
  photoUrls = object.data.imageUrls;
@@ -6032,7 +6047,7 @@ class Zalo {
6032
6047
  }
6033
6048
  }
6034
6049
  return yield this.getJSBridge()
6035
- .callNative(ACTION.OPEN_SHARESHEET, Object.assign(Object.assign({ type: ShareSheetType[object.type] }, reqData), { zapp: this.getZAppId() }), {
6050
+ .callNative(ACTION.OPEN_SHARESHEET, Object.assign(Object.assign({ type: ShareSheetType[type] }, reqData), { zapp: this.getZAppId() }), {
6036
6051
  haveTimeout: false
6037
6052
  })
6038
6053
  .then((res) => {
@@ -6225,7 +6240,7 @@ class Routing {
6225
6240
  }
6226
6241
  }
6227
6242
 
6228
- var _ZaloMiniProgramSDKService_zAppId, _ZaloMiniProgramSDKService_appId, _ZaloMiniProgramSDKService_appConfig, _ZaloMiniProgramSDKService_zOAuth, _ZaloMiniProgramSDKService_zOAuthVrf, _ZaloMiniProgramSDKService_accessToken, _ZaloMiniProgramSDKService_refreshToken, _ZaloMiniProgramSDKService_cache, _ZaloMiniProgramSDKService_bridge, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, _ZaloMiniProgramSDKService_tokenExpiresIn, _ZaloMiniProgramSDKService_deviceId, _ZaloMiniProgramSDKService_actionBarConfig, _ZaloMiniProgramSDKService_getActionsSupported;
6243
+ var _ZaloMiniProgramSDKService_zAppId, _ZaloMiniProgramSDKService_appId, _ZaloMiniProgramSDKService_appConfig, _ZaloMiniProgramSDKService_zOAuth, _ZaloMiniProgramSDKService_zOAuthVrf, _ZaloMiniProgramSDKService_accessToken, _ZaloMiniProgramSDKService_refreshToken, _ZaloMiniProgramSDKService_cache, _ZaloMiniProgramSDKService_bridge, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, _ZaloMiniProgramSDKService_tokenExpiresIn, _ZaloMiniProgramSDKService_deviceId, _ZaloMiniProgramSDKService_context, _ZaloMiniProgramSDKService_actionBarConfig, _ZaloMiniProgramSDKService_getActionsSupported;
6229
6244
  class ZaloMiniProgramSDKService {
6230
6245
  constructor() {
6231
6246
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
@@ -6245,6 +6260,7 @@ class ZaloMiniProgramSDKService {
6245
6260
  _ZaloMiniProgramSDKService_prevGetTokenTimestamp.set(this, void 0);
6246
6261
  _ZaloMiniProgramSDKService_tokenExpiresIn.set(this, void 0);
6247
6262
  _ZaloMiniProgramSDKService_deviceId.set(this, void 0);
6263
+ _ZaloMiniProgramSDKService_context.set(this, void 0);
6248
6264
  this.events = ZMPEEmitter.getInstance();
6249
6265
  this.isIOS = checkPlatform().isIOS;
6250
6266
  _ZaloMiniProgramSDKService_actionBarConfig.set(this, void 0);
@@ -6324,6 +6340,7 @@ class ZaloMiniProgramSDKService {
6324
6340
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, 0, "f");
6325
6341
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, 0, "f");
6326
6342
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_deviceId, '', "f");
6343
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_context, null, "f");
6327
6344
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_bridge, ZaloJSBridge.getInstance(), "f");
6328
6345
  const showHomeButton = ((_b = (_a = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig, "f")) === null || _a === void 0 ? void 0 : _a.app) === null || _b === void 0 ? void 0 : _b.leftButton) === 'home' ||
6329
6346
  ((_d = (_c = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig, "f")) === null || _c === void 0 ? void 0 : _c.app) === null || _d === void 0 ? void 0 : _d.leftButton) === 'both'
@@ -6371,6 +6388,9 @@ class ZaloMiniProgramSDKService {
6371
6388
  getDeviceId() {
6372
6389
  return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_deviceId, "f");
6373
6390
  }
6391
+ getContext() {
6392
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_context, "f");
6393
+ }
6374
6394
  getJSBridge() {
6375
6395
  return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_bridge, "f");
6376
6396
  }
@@ -6378,9 +6398,17 @@ class ZaloMiniProgramSDKService {
6378
6398
  return __awaiter(this, void 0, void 0, function* () {
6379
6399
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_bridge, "f").jump();
6380
6400
  const deviceId = cookies.find((cookie) => cookie.name === COOKIE_NAME.DEVICE_ID);
6401
+ const contextID = cookies.find((cookie) => cookie.name === COOKIE_NAME.CONTEXT_ID);
6402
+ const contextType = cookies.find((cookie) => cookie.name === COOKIE_NAME.CONTEXT_TYPE);
6381
6403
  if (deviceId) {
6382
6404
  __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_deviceId, deviceId.value, "f");
6383
6405
  }
6406
+ if (contextID && contextType) {
6407
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_context, {
6408
+ id: contextID.value,
6409
+ type: contextType.value
6410
+ }, "f");
6411
+ }
6384
6412
  const zOAuthCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH);
6385
6413
  const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH_VRF);
6386
6414
  if (!_.isUndefined(zOAuthCookie) &&
@@ -6471,7 +6499,7 @@ class ZaloMiniProgramSDKService {
6471
6499
  });
6472
6500
  }
6473
6501
  }
6474
- _ZaloMiniProgramSDKService_zAppId = new WeakMap(), _ZaloMiniProgramSDKService_appId = new WeakMap(), _ZaloMiniProgramSDKService_appConfig = new WeakMap(), _ZaloMiniProgramSDKService_zOAuth = new WeakMap(), _ZaloMiniProgramSDKService_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDKService_accessToken = new WeakMap(), _ZaloMiniProgramSDKService_refreshToken = new WeakMap(), _ZaloMiniProgramSDKService_cache = new WeakMap(), _ZaloMiniProgramSDKService_bridge = new WeakMap(), _ZaloMiniProgramSDKService_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDKService_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDKService_deviceId = new WeakMap(), _ZaloMiniProgramSDKService_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDKService_getActionsSupported = new WeakMap();
6502
+ _ZaloMiniProgramSDKService_zAppId = new WeakMap(), _ZaloMiniProgramSDKService_appId = new WeakMap(), _ZaloMiniProgramSDKService_appConfig = new WeakMap(), _ZaloMiniProgramSDKService_zOAuth = new WeakMap(), _ZaloMiniProgramSDKService_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDKService_accessToken = new WeakMap(), _ZaloMiniProgramSDKService_refreshToken = new WeakMap(), _ZaloMiniProgramSDKService_cache = new WeakMap(), _ZaloMiniProgramSDKService_bridge = new WeakMap(), _ZaloMiniProgramSDKService_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDKService_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDKService_deviceId = new WeakMap(), _ZaloMiniProgramSDKService_context = new WeakMap(), _ZaloMiniProgramSDKService_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDKService_getActionsSupported = new WeakMap();
6475
6503
 
6476
6504
  var _MockSDKService_appId, _MockSDKService_appConfig, _MockSDKService_zOAuth, _MockSDKService_accessToken, _MockSDKService_cache, _MockSDKService_loggedId;
6477
6505
  class MockSDKService {
@@ -6796,6 +6824,9 @@ class MockSDKService {
6796
6824
  return Promise.resolve();
6797
6825
  };
6798
6826
  }
6827
+ getContext() {
6828
+ return null;
6829
+ }
6799
6830
  on(event, fn, context) {
6800
6831
  throw new Error('Method not implemented.');
6801
6832
  }
@@ -6811,10 +6842,9 @@ class MockSDKService {
6811
6842
  openMediaPicker(type, serverUpload, maxItemSize, editView, silentRequest, maxSelectItem) {
6812
6843
  console.warn('This api only works on zalo app');
6813
6844
  return Promise.resolve({
6814
- data: ""
6845
+ data: ''
6815
6846
  });
6816
6847
  }
6817
- ;
6818
6848
  }
6819
6849
  _MockSDKService_appId = new WeakMap(), _MockSDKService_appConfig = new WeakMap(), _MockSDKService_zOAuth = new WeakMap(), _MockSDKService_accessToken = new WeakMap(), _MockSDKService_cache = new WeakMap(), _MockSDKService_loggedId = new WeakMap();
6820
6850
 
@@ -8860,6 +8890,9 @@ let SDKCreator = class SDKCreator {
8860
8890
  getDeviceId() {
8861
8891
  return __classPrivateFieldGet(this, _SDKCreator_sdkService, "f").getDeviceId();
8862
8892
  }
8893
+ getContext() {
8894
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService, "f").getContext();
8895
+ }
8863
8896
  };
8864
8897
  _SDKCreator_sdkService = new WeakMap();
8865
8898
  __decorate([