zmp-sdk 2.14.0 → 2.14.4

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.
@@ -21810,7 +21810,7 @@
21810
21810
  return null;
21811
21811
  }
21812
21812
  catch (error) {
21813
- console.log(error);
21813
+ debug$2(error);
21814
21814
  return data;
21815
21815
  }
21816
21816
  };
@@ -34674,38 +34674,54 @@
34674
34674
  'default': zlib$1
34675
34675
  });
34676
34676
 
34677
- var name = "axios";
34678
- var version$1 = "0.21.1";
34679
- var description = "Promise based HTTP client for the browser and node.js";
34680
- var main = "index.js";
34681
- var scripts = {
34682
- test: "grunt test && bundlesize",
34683
- start: "node ./sandbox/server.js",
34684
- build: "NODE_ENV=production grunt build",
34685
- preversion: "npm test",
34686
- version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",
34687
- postversion: "git push && git push --tags",
34688
- examples: "node ./examples/server.js",
34689
- coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
34690
- fix: "eslint --fix lib/**/*.js"
34677
+ var _args = [
34678
+ [
34679
+ "axios@0.21.1",
34680
+ "/Users/nguyentuankiet/Work/Zalo/Projects/ZaloMiniProgram/TestNewFunction"
34681
+ ]
34682
+ ];
34683
+ var _from = "axios@0.21.1";
34684
+ var _id = "axios@0.21.1";
34685
+ var _inBundle = false;
34686
+ var _integrity = "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==";
34687
+ var _location = "/zmp-sdk/axios";
34688
+ var _phantomChildren = {
34691
34689
  };
34692
- var repository = {
34693
- type: "git",
34694
- url: "https://github.com/axios/axios.git"
34690
+ var _requested = {
34691
+ type: "version",
34692
+ registry: true,
34693
+ raw: "axios@0.21.1",
34694
+ name: "axios",
34695
+ escapedName: "axios",
34696
+ rawSpec: "0.21.1",
34697
+ saveSpec: null,
34698
+ fetchSpec: "0.21.1"
34695
34699
  };
34696
- var keywords = [
34697
- "xhr",
34698
- "http",
34699
- "ajax",
34700
- "promise",
34701
- "node"
34700
+ var _requiredBy = [
34701
+ "/zmp-sdk"
34702
34702
  ];
34703
- var author = "Matt Zabriskie";
34704
- var license = "MIT";
34703
+ var _resolved = "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz";
34704
+ var _spec = "0.21.1";
34705
+ var _where = "/Users/nguyentuankiet/Work/Zalo/Projects/ZaloMiniProgram/TestNewFunction";
34706
+ var author = {
34707
+ name: "Matt Zabriskie"
34708
+ };
34709
+ var browser = {
34710
+ "./lib/adapters/http.js": "./lib/adapters/xhr.js"
34711
+ };
34705
34712
  var bugs = {
34706
34713
  url: "https://github.com/axios/axios/issues"
34707
34714
  };
34708
- var homepage = "https://github.com/axios/axios";
34715
+ var bundlesize = [
34716
+ {
34717
+ path: "./dist/axios.min.js",
34718
+ threshold: "5kB"
34719
+ }
34720
+ ];
34721
+ var dependencies = {
34722
+ "follow-redirects": "^1.10.0"
34723
+ };
34724
+ var description = "Promise based HTTP client for the browser and node.js";
34709
34725
  var devDependencies = {
34710
34726
  bundlesize: "^0.17.0",
34711
34727
  coveralls: "^3.0.0",
@@ -34743,62 +34759,101 @@
34743
34759
  webpack: "^1.13.1",
34744
34760
  "webpack-dev-server": "^1.14.1"
34745
34761
  };
34746
- var browser = {
34747
- "./lib/adapters/http.js": "./lib/adapters/xhr.js"
34748
- };
34762
+ var homepage = "https://github.com/axios/axios";
34749
34763
  var jsdelivr = "dist/axios.min.js";
34750
- var unpkg = "dist/axios.min.js";
34751
- var typings = "./index.d.ts";
34752
- var dependencies = {
34753
- "follow-redirects": "^1.10.0"
34754
- };
34755
- var bundlesize = [
34756
- {
34757
- path: "./dist/axios.min.js",
34758
- threshold: "5kB"
34759
- }
34764
+ var keywords = [
34765
+ "xhr",
34766
+ "http",
34767
+ "ajax",
34768
+ "promise",
34769
+ "node"
34760
34770
  ];
34771
+ var license = "MIT";
34772
+ var main = "index.js";
34773
+ var name = "axios";
34774
+ var repository = {
34775
+ type: "git",
34776
+ url: "git+https://github.com/axios/axios.git"
34777
+ };
34778
+ var scripts = {
34779
+ build: "NODE_ENV=production grunt build",
34780
+ coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
34781
+ examples: "node ./examples/server.js",
34782
+ fix: "eslint --fix lib/**/*.js",
34783
+ postversion: "git push && git push --tags",
34784
+ preversion: "npm test",
34785
+ start: "node ./sandbox/server.js",
34786
+ test: "grunt test && bundlesize",
34787
+ version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"
34788
+ };
34789
+ var typings = "./index.d.ts";
34790
+ var unpkg = "dist/axios.min.js";
34791
+ var version$1 = "0.21.1";
34761
34792
  var _package = {
34762
- name: name,
34763
- version: version$1,
34764
- description: description,
34765
- main: main,
34766
- scripts: scripts,
34767
- repository: repository,
34768
- keywords: keywords,
34793
+ _args: _args,
34794
+ _from: _from,
34795
+ _id: _id,
34796
+ _inBundle: _inBundle,
34797
+ _integrity: _integrity,
34798
+ _location: _location,
34799
+ _phantomChildren: _phantomChildren,
34800
+ _requested: _requested,
34801
+ _requiredBy: _requiredBy,
34802
+ _resolved: _resolved,
34803
+ _spec: _spec,
34804
+ _where: _where,
34769
34805
  author: author,
34770
- license: license,
34806
+ browser: browser,
34771
34807
  bugs: bugs,
34772
- homepage: homepage,
34808
+ bundlesize: bundlesize,
34809
+ dependencies: dependencies,
34810
+ description: description,
34773
34811
  devDependencies: devDependencies,
34774
- browser: browser,
34812
+ homepage: homepage,
34775
34813
  jsdelivr: jsdelivr,
34776
- unpkg: unpkg,
34814
+ keywords: keywords,
34815
+ license: license,
34816
+ main: main,
34817
+ name: name,
34818
+ repository: repository,
34819
+ scripts: scripts,
34777
34820
  typings: typings,
34778
- dependencies: dependencies,
34779
- bundlesize: bundlesize
34821
+ unpkg: unpkg,
34822
+ version: version$1
34780
34823
  };
34781
34824
 
34782
34825
  var _package$1 = /*#__PURE__*/Object.freeze({
34783
34826
  __proto__: null,
34784
- name: name,
34785
- version: version$1,
34786
- description: description,
34787
- main: main,
34788
- scripts: scripts,
34789
- repository: repository,
34790
- keywords: keywords,
34827
+ _args: _args,
34828
+ _from: _from,
34829
+ _id: _id,
34830
+ _inBundle: _inBundle,
34831
+ _integrity: _integrity,
34832
+ _location: _location,
34833
+ _phantomChildren: _phantomChildren,
34834
+ _requested: _requested,
34835
+ _requiredBy: _requiredBy,
34836
+ _resolved: _resolved,
34837
+ _spec: _spec,
34838
+ _where: _where,
34791
34839
  author: author,
34792
- license: license,
34840
+ browser: browser,
34793
34841
  bugs: bugs,
34794
- homepage: homepage,
34842
+ bundlesize: bundlesize,
34843
+ dependencies: dependencies,
34844
+ description: description,
34795
34845
  devDependencies: devDependencies,
34796
- browser: browser,
34846
+ homepage: homepage,
34797
34847
  jsdelivr: jsdelivr,
34798
- unpkg: unpkg,
34848
+ keywords: keywords,
34849
+ license: license,
34850
+ main: main,
34851
+ name: name,
34852
+ repository: repository,
34853
+ scripts: scripts,
34799
34854
  typings: typings,
34800
- dependencies: dependencies,
34801
- bundlesize: bundlesize,
34855
+ unpkg: unpkg,
34856
+ version: version$1,
34802
34857
  'default': _package
34803
34858
  });
34804
34859
 
@@ -36098,6 +36153,16 @@
36098
36153
  }
36099
36154
  }
36100
36155
  catch (error) {
36156
+ if ((error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.UNAUTHORIZED ||
36157
+ (error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.FORBIDDEN) {
36158
+ let loggedIn = false;
36159
+ if (this instanceof SDKCreator) {
36160
+ loggedIn = this.getLoginStatus();
36161
+ }
36162
+ if (!loggedIn) {
36163
+ error = new CommonError(RESPONSE_CODE.UNAUTHORIZED, MESSAGES.LOGIN_REQUIRED);
36164
+ }
36165
+ }
36101
36166
  const { handler } = catchDecoratorStore;
36102
36167
  const errorParsed = handler.call(null, propertyName, error, this);
36103
36168
  window.zmpSentry && window.zmpSentry.throwError(errorParsed.toString());
@@ -36120,6 +36185,16 @@
36120
36185
  return fn.apply(this, args);
36121
36186
  }
36122
36187
  catch (error) {
36188
+ if ((error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.UNAUTHORIZED ||
36189
+ (error === null || error === void 0 ? void 0 : error.code) === RESPONSE_CODE.FORBIDDEN) {
36190
+ let loggedIn = false;
36191
+ if (this instanceof SDKCreator) {
36192
+ loggedIn = this.getLoginStatus();
36193
+ }
36194
+ if (!loggedIn) {
36195
+ error = new CommonError(RESPONSE_CODE.UNAUTHORIZED, MESSAGES.LOGIN_REQUIRED);
36196
+ }
36197
+ }
36123
36198
  const { handler } = catchDecoratorStore;
36124
36199
  if (!lodash.isNull(handler) && lodash.isFunction(handler)) {
36125
36200
  handler.call(null, key, error, this);
@@ -36148,31 +36223,71 @@
36148
36223
  }
36149
36224
  callNative(action, data, option) {
36150
36225
  return new Promise((resolve, reject) => {
36151
- const fn = (cb) => {
36152
- if (cb && cb.error_code >= 0 && cb.action == action) {
36153
- resolve(cb.data || {});
36154
- if (option === null || option === void 0 ? void 0 : option.callback) {
36155
- option.callback(cb, null);
36156
- }
36157
- }
36158
- else if (cb && cb.error_code < 0) {
36226
+ const fn = (cb) => __awaiter(this, void 0, void 0, function* () {
36227
+ try {
36159
36228
  const error = new NativeError(cb.error_code, `${cb.action}: ${cb.error_message}`);
36160
- try {
36161
- window.zmpSentry &&
36162
- window.zmpSentry.captureMessage(`${action}: call native fail`, {
36163
- extra: {
36164
- data: data,
36165
- rs: cb
36229
+ if (cb.action === action) {
36230
+ if (option === null || option === void 0 ? void 0 : option.callback) {
36231
+ const res = yield option.callback(cb, error);
36232
+ resolve(res);
36233
+ }
36234
+ else {
36235
+ if (cb && cb.error_code >= 0) {
36236
+ resolve(cb.data || {});
36237
+ }
36238
+ else if (cb && cb.error_code < 0) {
36239
+ try {
36240
+ window.zmpSentry &&
36241
+ window.zmpSentry.captureMessage(`${action}: call native fail`, {
36242
+ extra: {
36243
+ data: data,
36244
+ rs: cb
36245
+ }
36246
+ });
36166
36247
  }
36167
- });
36248
+ catch (error) { }
36249
+ reject(error);
36250
+ }
36251
+ }
36168
36252
  }
36169
- catch (error) { }
36253
+ }
36254
+ catch (error) {
36170
36255
  reject(error);
36171
- if (option === null || option === void 0 ? void 0 : option.callback) {
36172
- option.callback(cb, error);
36173
- }
36174
36256
  }
36175
- };
36257
+ // if (cb && cb.error_code >= 0 && cb.action == action) {
36258
+ // resolve(cb.data || {});
36259
+ // if (option?.callback) {
36260
+ // try {
36261
+ // await option.callback(cb, null);
36262
+ // } catch (error) {
36263
+ // reject(error);
36264
+ // }
36265
+ // }
36266
+ // } else if (cb && cb.error_code < 0) {
36267
+ // const error = new NativeError(
36268
+ // cb.error_code,
36269
+ // `${cb.action}: ${cb.error_message}`
36270
+ // );
36271
+ // try {
36272
+ // window.zmpSentry &&
36273
+ // window.zmpSentry.captureMessage(`${action}: call native fail`, {
36274
+ // extra: {
36275
+ // data: data,
36276
+ // rs: cb
36277
+ // }
36278
+ // });
36279
+ // } catch (error) {}
36280
+ // if (option?.callback) {
36281
+ // try {
36282
+ // await option.callback(cb, error);
36283
+ // } catch (error) {
36284
+ // reject(error);
36285
+ // }
36286
+ // } else {
36287
+ // reject(error);
36288
+ // }
36289
+ // }
36290
+ });
36176
36291
  __classPrivateFieldGet(this, _ZJSBridgeProvider_bridge).jsCall(action, data, fn, option === null || option === void 0 ? void 0 : option.isMultiCallback, option === null || option === void 0 ? void 0 : option.nRetry, option === null || option === void 0 ? void 0 : option.haveTimeout);
36177
36292
  });
36178
36293
  }
@@ -36188,7 +36303,7 @@
36188
36303
  }
36189
36304
  };
36190
36305
 
36191
- var version = "2.14.0";
36306
+ var version = "v2.14.4";
36192
36307
 
36193
36308
  class Basics {
36194
36309
  /**
@@ -37657,10 +37772,14 @@
37657
37772
  static getUserInfo(object) {
37658
37773
  return __awaiter(this, void 0, void 0, function* () {
37659
37774
  const accessToken = yield this.getAccessToken();
37775
+ let fields = 'id,name,picture';
37776
+ if (object === null || object === void 0 ? void 0 : object.avatarType) {
37777
+ fields = `${fields}.type(${object === null || object === void 0 ? void 0 : object.avatarType})`;
37778
+ }
37660
37779
  const userInfo = yield axios
37661
37780
  .get(CONT.APIS.GET_USER_INFO, {
37662
37781
  params: {
37663
- fields: 'id,name,picture',
37782
+ fields: fields,
37664
37783
  access_token: accessToken
37665
37784
  }
37666
37785
  })
@@ -37669,8 +37788,8 @@
37669
37788
  const userInfo = {
37670
37789
  id: resData.id,
37671
37790
  name: resData.name,
37672
- birthday: "",
37673
- gender: "",
37791
+ birthday: '',
37792
+ gender: '',
37674
37793
  avatar: resData.picture && resData.picture.data && resData.picture.data.url
37675
37794
  };
37676
37795
  console.warn("'birthday' and 'gender' are deprecated");
@@ -37690,17 +37809,18 @@
37690
37809
  *
37691
37810
  */
37692
37811
  static getPhoneNumber(object) {
37693
- return new Promise((resolve, reject) => {
37694
- this.callNative(ACTION.MP_GET_NUMBER, {}, {
37812
+ return __awaiter(this, void 0, void 0, function* () {
37813
+ return yield this.callNative(ACTION.MP_GET_NUMBER, {}, {
37695
37814
  isMultiCallback: true,
37696
37815
  callback: (nativeData, error) => {
37697
- if (error)
37698
- reject(error);
37699
37816
  if (nativeData.error_code === 0) {
37700
37817
  const res = {
37701
37818
  number: nativeData.data
37702
37819
  };
37703
- resolve(res);
37820
+ return Promise.resolve(res);
37821
+ }
37822
+ else {
37823
+ return Promise.reject(error);
37704
37824
  }
37705
37825
  }
37706
37826
  });
@@ -37781,16 +37901,14 @@
37781
37901
  *
37782
37902
  */
37783
37903
  static getLocation(object) {
37784
- return new Promise((resolve, reject) => {
37785
- this.callNative(ACTION.GET_LOCATION, {
37904
+ return __awaiter(this, void 0, void 0, function* () {
37905
+ return yield this.callNative(ACTION.GET_LOCATION, {
37786
37906
  silent_request: false,
37787
37907
  permission_description: 'Cho phép Zalo truy cập vào vị trí của thiết bị này?'
37788
37908
  }, {
37789
37909
  isMultiCallback: true,
37790
37910
  haveTimeout: false,
37791
37911
  callback: (nativeData, error) => {
37792
- if (error)
37793
- reject(error);
37794
37912
  if (nativeData.error_code === 0) {
37795
37913
  const data = nativeData.data;
37796
37914
  const res = {
@@ -37803,7 +37921,10 @@
37803
37921
  /** provider */
37804
37922
  provider: data.provider
37805
37923
  };
37806
- resolve(res);
37924
+ return Promise.resolve(res);
37925
+ }
37926
+ else {
37927
+ return Promise.reject(error);
37807
37928
  }
37808
37929
  }
37809
37930
  });
@@ -37838,17 +37959,17 @@
37838
37959
  *
37839
37960
  */
37840
37961
  static requestCameraPermission(object) {
37841
- return new Promise((resolve, reject) => {
37842
- this.callNative(ACTION.REQUEST_PERMISSION_CAMERA, {}, {
37962
+ return __awaiter(this, void 0, void 0, function* () {
37963
+ return yield this.callNative(ACTION.REQUEST_PERMISSION_CAMERA, {}, {
37843
37964
  callback: (nativeData, error) => {
37844
37965
  if (nativeData.error_code === -2 || nativeData.error_code >= 0) {
37845
- resolve({
37966
+ return Promise.resolve({
37846
37967
  userAllow: nativeData.error_code === -2 ? false : true,
37847
37968
  message: nativeData.error_message
37848
37969
  });
37849
37970
  }
37850
37971
  else {
37851
- reject(error);
37972
+ return Promise.reject(error);
37852
37973
  }
37853
37974
  }
37854
37975
  });
@@ -38142,7 +38263,7 @@
38142
38263
  }
38143
38264
  }
38144
38265
 
38145
- var _ZaloMiniProgramSDK_zAppId, _ZaloMiniProgramSDK_appId, _ZaloMiniProgramSDK_appConfig, _ZaloMiniProgramSDK_zOAuth, _ZaloMiniProgramSDK_accessToken, _ZaloMiniProgramSDK_cache, _ZaloMiniProgramSDK_configWindow, _ZaloMiniProgramSDK_configApp, _ZaloMiniProgramSDK_callJump, _ZaloMiniProgramSDK_setNavigationBarRightButton;
38266
+ var _ZaloMiniProgramSDK_zAppId, _ZaloMiniProgramSDK_appId, _ZaloMiniProgramSDK_appConfig, _ZaloMiniProgramSDK_zOAuth, _ZaloMiniProgramSDK_accessToken, _ZaloMiniProgramSDK_cache, _ZaloMiniProgramSDK_loggedIn, _ZaloMiniProgramSDK_configWindow, _ZaloMiniProgramSDK_configApp, _ZaloMiniProgramSDK_callJump, _ZaloMiniProgramSDK_setNavigationBarRightButton;
38146
38267
  class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38147
38268
  constructor() {
38148
38269
  super();
@@ -38156,6 +38277,7 @@
38156
38277
  getToken: 0
38157
38278
  }
38158
38279
  });
38280
+ _ZaloMiniProgramSDK_loggedIn.set(this, false);
38159
38281
  this.events = ZMPEEmitter.getInstance();
38160
38282
  _ZaloMiniProgramSDK_configWindow.set(this, () => {
38161
38283
  const appConfig = __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig).app || null;
@@ -38285,6 +38407,9 @@
38285
38407
  }
38286
38408
  return ZaloMiniProgramSDK.instance;
38287
38409
  }
38410
+ getLoginStatus() {
38411
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_loggedIn);
38412
+ }
38288
38413
  getAppId() {
38289
38414
  return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId);
38290
38415
  }
@@ -38323,11 +38448,13 @@
38323
38448
  if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken) {
38324
38449
  __classPrivateFieldGet(this, _ZaloMiniProgramSDK_cache).timer.getToken = window.setInterval(runTimer, expiredIn);
38325
38450
  }
38451
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, true);
38326
38452
  this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
38327
38453
  window.ZJSBridge.setZAccSession &&
38328
38454
  window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
38329
38455
  return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
38330
38456
  }
38457
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDK_loggedIn, false);
38331
38458
  return null;
38332
38459
  });
38333
38460
  });
@@ -38346,9 +38473,9 @@
38346
38473
  });
38347
38474
  }
38348
38475
  }
38349
- _ZaloMiniProgramSDK_zAppId = new WeakMap(), _ZaloMiniProgramSDK_appId = new WeakMap(), _ZaloMiniProgramSDK_appConfig = new WeakMap(), _ZaloMiniProgramSDK_zOAuth = new WeakMap(), _ZaloMiniProgramSDK_accessToken = new WeakMap(), _ZaloMiniProgramSDK_cache = new WeakMap(), _ZaloMiniProgramSDK_configWindow = new WeakMap(), _ZaloMiniProgramSDK_configApp = new WeakMap(), _ZaloMiniProgramSDK_callJump = new WeakMap(), _ZaloMiniProgramSDK_setNavigationBarRightButton = new WeakMap();
38476
+ _ZaloMiniProgramSDK_zAppId = new WeakMap(), _ZaloMiniProgramSDK_appId = new WeakMap(), _ZaloMiniProgramSDK_appConfig = new WeakMap(), _ZaloMiniProgramSDK_zOAuth = new WeakMap(), _ZaloMiniProgramSDK_accessToken = new WeakMap(), _ZaloMiniProgramSDK_cache = new WeakMap(), _ZaloMiniProgramSDK_loggedIn = new WeakMap(), _ZaloMiniProgramSDK_configWindow = new WeakMap(), _ZaloMiniProgramSDK_configApp = new WeakMap(), _ZaloMiniProgramSDK_callJump = new WeakMap(), _ZaloMiniProgramSDK_setNavigationBarRightButton = new WeakMap();
38350
38477
 
38351
- var _MockSDK_appId, _MockSDK_appConfig, _MockSDK_zOAuth, _MockSDK_accessToken, _MockSDK_cache;
38478
+ var _MockSDK_appId, _MockSDK_appConfig, _MockSDK_zOAuth, _MockSDK_accessToken, _MockSDK_cache, _MockSDK_loggedId;
38352
38479
  class MockSDK {
38353
38480
  constructor() {
38354
38481
  _MockSDK_appId.set(this, window.zAppID);
@@ -38360,10 +38487,15 @@
38360
38487
  getToken: 0
38361
38488
  }
38362
38489
  });
38490
+ _MockSDK_loggedId.set(this, false);
38491
+ this.getLoginStatus = () => {
38492
+ return __classPrivateFieldGet(this, _MockSDK_loggedId);
38493
+ };
38363
38494
  this.getAppId = () => {
38364
38495
  return __classPrivateFieldGet(this, _MockSDK_appId);
38365
38496
  };
38366
38497
  this.login = () => {
38498
+ __classPrivateFieldSet(this, _MockSDK_loggedId, true);
38367
38499
  return Promise.resolve(__classPrivateFieldGet(this, _MockSDK_zOAuth));
38368
38500
  };
38369
38501
  this.getAccessToken = () => {
@@ -38409,7 +38541,7 @@
38409
38541
  return yield storage.clearStorage();
38410
38542
  });
38411
38543
  this.getUserInfo = () => {
38412
- console.warn("birthday and gender are deprecated");
38544
+ console.warn('birthday and gender are deprecated');
38413
38545
  return Promise.resolve({
38414
38546
  userInfo: {
38415
38547
  id: '3368637342326461234',
@@ -38658,7 +38790,7 @@
38658
38790
  throw new Error('Method not implemented.');
38659
38791
  }
38660
38792
  }
38661
- _MockSDK_appId = new WeakMap(), _MockSDK_appConfig = new WeakMap(), _MockSDK_zOAuth = new WeakMap(), _MockSDK_accessToken = new WeakMap(), _MockSDK_cache = new WeakMap();
38793
+ _MockSDK_appId = new WeakMap(), _MockSDK_appConfig = new WeakMap(), _MockSDK_zOAuth = new WeakMap(), _MockSDK_accessToken = new WeakMap(), _MockSDK_cache = new WeakMap(), _MockSDK_loggedId = new WeakMap();
38662
38794
 
38663
38795
  /*! *****************************************************************************
38664
38796
  Copyright (C) Microsoft. All rights reserved.
@@ -39899,7 +40031,6 @@
39899
40031
  _SDKCreator_sdkManager.set(this, void 0);
39900
40032
  __classPrivateFieldSet(this, _SDKCreator_sdkManager, this.getInstance());
39901
40033
  this.events.addListener = (event, fn, context) => {
39902
- console.log(123123);
39903
40034
  const stringifyEventName = event;
39904
40035
  return this.events.addListener(Events[stringifyEventName], fn, context);
39905
40036
  };
@@ -39924,6 +40055,9 @@
39924
40055
  return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).login(object);
39925
40056
  });
39926
40057
  }
40058
+ getLoginStatus() {
40059
+ return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getLoginStatus();
40060
+ }
39927
40061
  /**
39928
40062
  * Get Access Token.
39929
40063
  *
@@ -40296,13 +40430,18 @@
40296
40430
  });
40297
40431
  }
40298
40432
  getPhoneNumber(object) {
40299
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getPhoneNumber();
40433
+ return __awaiter(this, void 0, void 0, function* () {
40434
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getPhoneNumber();
40435
+ });
40300
40436
  }
40301
40437
  }
40302
40438
  _SDKCreator_sdkManager = new WeakMap();
40303
40439
  __decorate([
40304
40440
  handleError
40305
40441
  ], SDKCreator.prototype, "login", null);
40442
+ __decorate([
40443
+ handleErrorSync
40444
+ ], SDKCreator.prototype, "getLoginStatus", null);
40306
40445
  __decorate([
40307
40446
  handleError
40308
40447
  ], SDKCreator.prototype, "getAccessToken", null);
@@ -40386,7 +40525,11 @@
40386
40525
  handleError
40387
40526
  ], SDKCreator.prototype, "clearStorage", null);
40388
40527
  __decorate([
40389
- handleError
40528
+ handleError,
40529
+ validate,
40530
+ __param(0, checkType('object', {
40531
+ avatarType: ['small', 'normal', 'large']
40532
+ }))
40390
40533
  ], SDKCreator.prototype, "getUserInfo", null);
40391
40534
  __decorate([
40392
40535
  handleError