@smartico/public-api 0.0.56 → 0.0.57

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.
@@ -6,7 +6,7 @@ export declare class WSAPI {
6
6
  /** @private */
7
7
  constructor(api: SmarticoAPI);
8
8
  /** Returns information about current user */
9
- getUserProfile(): Promise<TUserProfile>;
9
+ getUserProfile(): TUserProfile;
10
10
  /** Returns all the levels available the current user */
11
11
  getLevels(): Promise<TLevel[]>;
12
12
  /** Returns all the missions available the current user */
package/dist/index.js CHANGED
@@ -809,79 +809,75 @@ var WSAPI = /*#__PURE__*/function () {
809
809
  /** Returns information about current user */
810
810
  var _proto = WSAPI.prototype;
811
811
  _proto.getUserProfile = function getUserProfile() {
812
- try {
813
- var _this = this;
814
- if (_this.api.tracker) {
815
- var o = Object.assign({}, _this.api.tracker.userPublicProps);
816
- o.avatar_url = CoreUtils.avatarUrl(_this.api.tracker.userPublicProps.avatar_id, _this.api.avatarDomain);
817
- return Promise.resolve(o);
818
- } else {
819
- throw new Error('Tracker is not initialized, cannot getUserProfile');
820
- }
821
- } catch (e) {
822
- return Promise.reject(e);
812
+ if (this.api.tracker) {
813
+ var o = Object.assign({}, this.api.tracker.userPublicProps);
814
+ o.avatar_url = CoreUtils.avatarUrl(this.api.tracker.userPublicProps.avatar_id, this.api.avatarDomain);
815
+ return o;
816
+ } else {
817
+ throw new Error('Tracker is not initialized, cannot getUserProfile');
823
818
  }
824
- } /** Returns all the levels available the current user */;
819
+ }
820
+ /** Returns all the levels available the current user */;
825
821
  _proto.getLevels = function getLevels() {
826
822
  try {
827
- var _this2 = this;
828
- return Promise.resolve(_this2.api.levelsGetT(null));
823
+ var _this = this;
824
+ return Promise.resolve(_this.api.levelsGetT(null));
829
825
  } catch (e) {
830
826
  return Promise.reject(e);
831
827
  }
832
828
  } /** Returns all the missions available the current user */;
833
829
  _proto.getMissions = function getMissions() {
834
830
  try {
835
- var _this3 = this;
836
- return Promise.resolve(_this3.api.missionsGetItemsT(null));
831
+ var _this2 = this;
832
+ return Promise.resolve(_this2.api.missionsGetItemsT(null));
837
833
  } catch (e) {
838
834
  return Promise.reject(e);
839
835
  }
840
836
  } /** Returns all the badges available the current user */;
841
837
  _proto.getBadges = function getBadges() {
842
838
  try {
843
- var _this4 = this;
844
- return Promise.resolve(_this4.api.badgetsGetItemsT(null));
839
+ var _this3 = this;
840
+ return Promise.resolve(_this3.api.badgetsGetItemsT(null));
845
841
  } catch (e) {
846
842
  return Promise.reject(e);
847
843
  }
848
844
  } /** Returns all the store items available the current user */;
849
845
  _proto.getStoreItems = function getStoreItems() {
850
846
  try {
851
- var _this5 = this;
852
- return Promise.resolve(_this5.api.storeGetItemsT(null));
847
+ var _this4 = this;
848
+ return Promise.resolve(_this4.api.storeGetItemsT(null));
853
849
  } catch (e) {
854
850
  return Promise.reject(e);
855
851
  }
856
852
  } /** Returns store categories */;
857
853
  _proto.getStoreCategories = function getStoreCategories() {
858
854
  try {
859
- var _this6 = this;
860
- return Promise.resolve(_this6.api.storeGetItemsT(null));
855
+ var _this5 = this;
856
+ return Promise.resolve(_this5.api.storeGetItemsT(null));
861
857
  } catch (e) {
862
858
  return Promise.reject(e);
863
859
  }
864
860
  } /** Returns the list of mini-games available for user */;
865
861
  _proto.getMiniGames = function getMiniGames() {
866
862
  try {
867
- var _this7 = this;
868
- return Promise.resolve(_this7.api.sawGetTemplatesT(null));
863
+ var _this6 = this;
864
+ return Promise.resolve(_this6.api.sawGetTemplatesT(null));
869
865
  } catch (e) {
870
866
  return Promise.reject(e);
871
867
  }
872
868
  } /** Returns all the active instances of tournaments */;
873
869
  _proto.getTournamentsList = function getTournamentsList() {
874
870
  try {
875
- var _this8 = this;
876
- return Promise.resolve(_this8.api.tournamentsGetLobbyT(null));
871
+ var _this7 = this;
872
+ return Promise.resolve(_this7.api.tournamentsGetLobbyT(null));
877
873
  } catch (e) {
878
874
  return Promise.reject(e);
879
875
  }
880
876
  } /** Returns details information of specific tournament instance, the response will includ tournamnet info and the leaderboard of players */;
881
877
  _proto.getTournamentInstanceInfo = function getTournamentInstanceInfo(tournamentInstanceId) {
882
878
  try {
883
- var _this9 = this;
884
- return Promise.resolve(_this9.api.tournamentsGetInfoT(null, tournamentInstanceId));
879
+ var _this8 = this;
880
+ return Promise.resolve(_this8.api.tournamentsGetInfoT(null, tournamentInstanceId));
885
881
  } catch (e) {
886
882
  return Promise.reject(e);
887
883
  }