@smartico/public-api 0.0.139 → 0.0.140

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.
@@ -1,8 +1,13 @@
1
1
  interface JackPotWinner {
2
+ /** Flag indicating that this winner is the currently logged in user */
2
3
  is_me: boolean;
4
+ /** Name of the winner, note that for all users except is_me, the name is masked by default, but masking can be disabled by request to Smartico AM team */
3
5
  public_username: string;
6
+ /** Won amount in the Jackpot currency */
4
7
  winning_amount_jp_currency: number;
8
+ /** Won amount in the user Wallet currency */
5
9
  winning_amount_wallet_currency: number;
10
+ /** Position of the winner. Relevant for jackpots where there could be multiple winners */
6
11
  winning_position: number;
7
12
  }
8
13
  export { JackPotWinner };
@@ -4,5 +4,6 @@ export declare enum AchievementStatus {
4
4
  AvailableLocked = 3,
5
5
  Archived = 4,
6
6
  FeaturedManually = 5,
7
- FeaturedAI = 6
7
+ FeaturedAI = 6,
8
+ Recurring = 7
8
9
  }
package/dist/index.js CHANGED
@@ -757,6 +757,7 @@ exports.AchievementStatus = void 0;
757
757
  AchievementStatus[AchievementStatus["Archived"] = 4] = "Archived";
758
758
  AchievementStatus[AchievementStatus["FeaturedManually"] = 5] = "FeaturedManually";
759
759
  AchievementStatus[AchievementStatus["FeaturedAI"] = 6] = "FeaturedAI";
760
+ AchievementStatus[AchievementStatus["Recurring"] = 7] = "Recurring";
760
761
  })(exports.AchievementStatus || (exports.AchievementStatus = {}));
761
762
 
762
763
  exports.AchievementTaskType = void 0;
@@ -1173,6 +1174,12 @@ var WSAPI = /*#__PURE__*/function () {
1173
1174
  on(exports.ClassId.JP_WIN_PUSH, function (data) {
1174
1175
  return _this.jackpotClearCache();
1175
1176
  });
1177
+ on(exports.ClassId.JP_OPTOUT_RESPONSE, function (data) {
1178
+ return _this.jackpotClearCache();
1179
+ });
1180
+ on(exports.ClassId.JP_OPTIN_RESPONSE, function (data) {
1181
+ return _this.jackpotClearCache();
1182
+ });
1176
1183
  }
1177
1184
  /** Returns information about current user
1178
1185
  * Example usage:
@@ -1836,10 +1843,7 @@ var WSAPI = /*#__PURE__*/function () {
1836
1843
  throw new Error('jp_template_id is required in jackpotOptIn');
1837
1844
  }
1838
1845
  ;
1839
- return Promise.resolve(_this37.api.jackpotOptIn(null, filter)).then(function (result) {
1840
- _this37.jackpotClearCache();
1841
- return result;
1842
- });
1846
+ return Promise.resolve(_this37.api.jackpotOptIn(null, filter));
1843
1847
  } catch (e) {
1844
1848
  return Promise.reject(e);
1845
1849
  }
@@ -1861,10 +1865,7 @@ var WSAPI = /*#__PURE__*/function () {
1861
1865
  throw new Error('jp_template_id is required in jackpotOptOut');
1862
1866
  }
1863
1867
  ;
1864
- return Promise.resolve(_this38.api.jackpotOptOut(null, filter)).then(function (result) {
1865
- _this38.jackpotClearCache();
1866
- return result;
1867
- });
1868
+ return Promise.resolve(_this38.api.jackpotOptOut(null, filter));
1868
1869
  } catch (e) {
1869
1870
  return Promise.reject(e);
1870
1871
  }
@@ -2066,6 +2067,8 @@ var SmarticoAPI = /*#__PURE__*/function () {
2066
2067
  payload = {};
2067
2068
  }
2068
2069
  var message = _extends({
2070
+ // AA: in fact we need api and brand keys and ext_user_id only in the context of HTTP
2071
+ // its not needed in WebSocket and can be deleted
2069
2072
  api_key: this.label_api_key,
2070
2073
  brand_key: this.brand_api_key,
2071
2074
  ext_user_id: user_ext_id,