@smartico/public-api 0.0.291 → 0.0.293
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/Inbox/GetInboxMessagesResponse.d.ts +1 -0
- package/dist/WSAPI/WSAPI.d.ts +9 -1
- package/dist/index.js +100 -79
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +19 -2
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +1 -0
- package/docs/classes/WSAPI.md +11 -1
- package/docs/enums/AchCustomSectionType.md +6 -0
- package/docs/enums/LiquidEntityData.md +61 -0
- package/docs/interfaces/TUICustomSection.md +32 -0
- package/package.json +1 -1
- package/src/Inbox/GetInboxMessagesResponse.ts +1 -0
- package/src/WSAPI/WSAPI.ts +18 -2
|
@@ -3,5 +3,6 @@ import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
|
3
3
|
import { InboxMessage } from './InboxMessage';
|
|
4
4
|
export interface GetInboxMessagesResponse extends ProtocolResponse {
|
|
5
5
|
log: InboxMessage[];
|
|
6
|
+
unread_count: number;
|
|
6
7
|
}
|
|
7
8
|
export declare const InboxMessagesTransform: (items: InboxMessage[]) => TInboxMessage[];
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -141,6 +141,9 @@ export declare class WSAPI {
|
|
|
141
141
|
/**
|
|
142
142
|
*
|
|
143
143
|
* Returns all the store items available the current user
|
|
144
|
+
* The returned store items are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
145
|
+
* Note that each time you call getStoreItems with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
146
|
+
* The onUpdate callback will be called on purchase of the store item.
|
|
144
147
|
*
|
|
145
148
|
* **Example**:
|
|
146
149
|
* ```
|
|
@@ -155,8 +158,12 @@ export declare class WSAPI {
|
|
|
155
158
|
* console.log(result);
|
|
156
159
|
* });
|
|
157
160
|
* ```
|
|
161
|
+
* @param params
|
|
162
|
+
* @param params.onUpdate - callback function that will be called when the store items are updated
|
|
158
163
|
*/
|
|
159
|
-
getStoreItems(
|
|
164
|
+
getStoreItems({ onUpdate }?: {
|
|
165
|
+
onUpdate?: (data: TStoreItem[]) => void;
|
|
166
|
+
}): Promise<TStoreItem[]>;
|
|
160
167
|
/** Buy the specific shop item by item_id. Returns the err_code in case of success or error.
|
|
161
168
|
* **Example**:
|
|
162
169
|
* ```
|
|
@@ -482,6 +489,7 @@ export declare class WSAPI {
|
|
|
482
489
|
private updateBonuses;
|
|
483
490
|
private updateTournaments;
|
|
484
491
|
private updateStorePurchasedItems;
|
|
492
|
+
private updateStoreItems;
|
|
485
493
|
private updateInboxMessages;
|
|
486
494
|
private updateRaffles;
|
|
487
495
|
private updateEntity;
|
package/dist/index.js
CHANGED
|
@@ -1934,7 +1934,8 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
1934
1934
|
return _this.updateTournaments();
|
|
1935
1935
|
});
|
|
1936
1936
|
on(exports.ClassId.BUY_SHOP_ITEM_RESPONSE, function () {
|
|
1937
|
-
|
|
1937
|
+
_this.updateStorePurchasedItems();
|
|
1938
|
+
_this.updateStoreItems();
|
|
1938
1939
|
});
|
|
1939
1940
|
on(exports.ClassId.CLIENT_ENGAGEMENT_EVENT_NEW, function () {
|
|
1940
1941
|
return _this.updateInboxMessages();
|
|
@@ -2213,6 +2214,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2213
2214
|
/**
|
|
2214
2215
|
*
|
|
2215
2216
|
* Returns all the store items available the current user
|
|
2217
|
+
* The returned store items are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
2218
|
+
* Note that each time you call getStoreItems with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
2219
|
+
* The onUpdate callback will be called on purchase of the store item.
|
|
2216
2220
|
*
|
|
2217
2221
|
* **Example**:
|
|
2218
2222
|
* ```
|
|
@@ -2227,11 +2231,18 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2227
2231
|
* console.log(result);
|
|
2228
2232
|
* });
|
|
2229
2233
|
* ```
|
|
2234
|
+
* @param params
|
|
2235
|
+
* @param params.onUpdate - callback function that will be called when the store items are updated
|
|
2230
2236
|
*/
|
|
2231
2237
|
;
|
|
2232
|
-
_proto.getStoreItems = function getStoreItems() {
|
|
2238
|
+
_proto.getStoreItems = function getStoreItems(_temp3) {
|
|
2239
|
+
var _ref3 = _temp3 === void 0 ? {} : _temp3,
|
|
2240
|
+
onUpdate = _ref3.onUpdate;
|
|
2233
2241
|
try {
|
|
2234
2242
|
var _this11 = this;
|
|
2243
|
+
if (onUpdate) {
|
|
2244
|
+
_this11.onUpdateCallback.set(onUpdateContextKey.StoreItems, onUpdate);
|
|
2245
|
+
}
|
|
2235
2246
|
return Promise.resolve(OCache.use(onUpdateContextKey.StoreItems, exports.ECacheContext.WSAPI, function () {
|
|
2236
2247
|
return _this11.api.storeGetItemsT(null);
|
|
2237
2248
|
}, CACHE_DATA_SEC));
|
|
@@ -2311,11 +2322,11 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2311
2322
|
* **Visitor mode: not supported**
|
|
2312
2323
|
*/
|
|
2313
2324
|
;
|
|
2314
|
-
_proto.getStorePurchasedItems = function getStorePurchasedItems(
|
|
2315
|
-
var
|
|
2316
|
-
limit =
|
|
2317
|
-
offset =
|
|
2318
|
-
onUpdate =
|
|
2325
|
+
_proto.getStorePurchasedItems = function getStorePurchasedItems(_temp4) {
|
|
2326
|
+
var _ref4 = _temp4 === void 0 ? {} : _temp4,
|
|
2327
|
+
limit = _ref4.limit,
|
|
2328
|
+
offset = _ref4.offset,
|
|
2329
|
+
onUpdate = _ref4.onUpdate;
|
|
2319
2330
|
try {
|
|
2320
2331
|
var _this14 = this;
|
|
2321
2332
|
if (onUpdate) {
|
|
@@ -2407,9 +2418,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2407
2418
|
*
|
|
2408
2419
|
*/
|
|
2409
2420
|
;
|
|
2410
|
-
_proto.getMiniGames = function getMiniGames(
|
|
2411
|
-
var
|
|
2412
|
-
onUpdate =
|
|
2421
|
+
_proto.getMiniGames = function getMiniGames(_temp5) {
|
|
2422
|
+
var _ref5 = _temp5 === void 0 ? {} : _temp5,
|
|
2423
|
+
onUpdate = _ref5.onUpdate;
|
|
2413
2424
|
try {
|
|
2414
2425
|
var _this17 = this;
|
|
2415
2426
|
if (onUpdate) {
|
|
@@ -2438,10 +2449,10 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2438
2449
|
* **Visitor mode: not supported**
|
|
2439
2450
|
*/
|
|
2440
2451
|
;
|
|
2441
|
-
_proto.getMiniGamesHistory = function getMiniGamesHistory(
|
|
2442
|
-
var limit =
|
|
2443
|
-
offset =
|
|
2444
|
-
saw_template_id =
|
|
2452
|
+
_proto.getMiniGamesHistory = function getMiniGamesHistory(_ref6) {
|
|
2453
|
+
var limit = _ref6.limit,
|
|
2454
|
+
offset = _ref6.offset,
|
|
2455
|
+
saw_template_id = _ref6.saw_template_id;
|
|
2445
2456
|
try {
|
|
2446
2457
|
var _this18 = this;
|
|
2447
2458
|
return Promise.resolve(OCache.use(onUpdateContextKey.SAWHistory, exports.ECacheContext.WSAPI, function () {
|
|
@@ -2466,9 +2477,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2466
2477
|
* **Visitor mode: not supported**
|
|
2467
2478
|
*/
|
|
2468
2479
|
;
|
|
2469
|
-
_proto.playMiniGame = function playMiniGame(template_id,
|
|
2470
|
-
var
|
|
2471
|
-
onUpdate =
|
|
2480
|
+
_proto.playMiniGame = function playMiniGame(template_id, _temp6) {
|
|
2481
|
+
var _ref7 = _temp6 === void 0 ? {} : _temp6,
|
|
2482
|
+
onUpdate = _ref7.onUpdate;
|
|
2472
2483
|
try {
|
|
2473
2484
|
var _this19 = this;
|
|
2474
2485
|
if (onUpdate) {
|
|
@@ -2519,9 +2530,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2519
2530
|
* **Visitor mode: not supported**
|
|
2520
2531
|
*/
|
|
2521
2532
|
;
|
|
2522
|
-
_proto.playMiniGameBatch = function playMiniGameBatch(template_id, spin_count,
|
|
2523
|
-
var
|
|
2524
|
-
onUpdate =
|
|
2533
|
+
_proto.playMiniGameBatch = function playMiniGameBatch(template_id, spin_count, _temp7) {
|
|
2534
|
+
var _ref8 = _temp7 === void 0 ? {} : _temp7,
|
|
2535
|
+
onUpdate = _ref8.onUpdate;
|
|
2525
2536
|
try {
|
|
2526
2537
|
var _this21 = this;
|
|
2527
2538
|
if (onUpdate) {
|
|
@@ -2606,9 +2617,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2606
2617
|
* ```
|
|
2607
2618
|
* */
|
|
2608
2619
|
;
|
|
2609
|
-
_proto.getTournamentsList = function getTournamentsList(
|
|
2610
|
-
var
|
|
2611
|
-
onUpdate =
|
|
2620
|
+
_proto.getTournamentsList = function getTournamentsList(_temp8) {
|
|
2621
|
+
var _ref9 = _temp8 === void 0 ? {} : _temp8,
|
|
2622
|
+
onUpdate = _ref9.onUpdate;
|
|
2612
2623
|
try {
|
|
2613
2624
|
var _this24 = this;
|
|
2614
2625
|
if (onUpdate) {
|
|
@@ -2717,13 +2728,13 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2717
2728
|
* @param params
|
|
2718
2729
|
*/
|
|
2719
2730
|
;
|
|
2720
|
-
_proto.getInboxMessages = function getInboxMessages(
|
|
2721
|
-
var
|
|
2722
|
-
from =
|
|
2723
|
-
to =
|
|
2724
|
-
onlyFavorite =
|
|
2725
|
-
categoryId =
|
|
2726
|
-
onUpdate =
|
|
2731
|
+
_proto.getInboxMessages = function getInboxMessages(_temp9) {
|
|
2732
|
+
var _ref10 = _temp9 === void 0 ? {} : _temp9,
|
|
2733
|
+
from = _ref10.from,
|
|
2734
|
+
to = _ref10.to,
|
|
2735
|
+
onlyFavorite = _ref10.onlyFavorite,
|
|
2736
|
+
categoryId = _ref10.categoryId,
|
|
2737
|
+
onUpdate = _ref10.onUpdate;
|
|
2727
2738
|
try {
|
|
2728
2739
|
var _this28 = this;
|
|
2729
2740
|
if (onUpdate) {
|
|
@@ -2925,31 +2936,41 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2925
2936
|
return Promise.reject(e);
|
|
2926
2937
|
}
|
|
2927
2938
|
};
|
|
2928
|
-
_proto.
|
|
2939
|
+
_proto.updateStoreItems = function updateStoreItems() {
|
|
2929
2940
|
try {
|
|
2930
2941
|
var _this42 = this;
|
|
2931
|
-
return Promise.resolve(_this42.api.
|
|
2932
|
-
_this42.updateEntity(onUpdateContextKey.
|
|
2942
|
+
return Promise.resolve(_this42.api.storeGetItemsT(null)).then(function (payload) {
|
|
2943
|
+
_this42.updateEntity(onUpdateContextKey.StoreItems, payload);
|
|
2933
2944
|
});
|
|
2934
2945
|
} catch (e) {
|
|
2935
2946
|
return Promise.reject(e);
|
|
2936
2947
|
}
|
|
2937
2948
|
};
|
|
2938
|
-
_proto.
|
|
2949
|
+
_proto.updateInboxMessages = function updateInboxMessages() {
|
|
2939
2950
|
try {
|
|
2940
2951
|
var _this43 = this;
|
|
2941
|
-
return Promise.resolve(_this43.api.
|
|
2942
|
-
_this43.updateEntity(onUpdateContextKey.
|
|
2952
|
+
return Promise.resolve(_this43.api.getInboxMessagesT(null)).then(function (payload) {
|
|
2953
|
+
_this43.updateEntity(onUpdateContextKey.InboxMessages, payload);
|
|
2943
2954
|
});
|
|
2944
2955
|
} catch (e) {
|
|
2945
2956
|
return Promise.reject(e);
|
|
2946
2957
|
}
|
|
2947
2958
|
};
|
|
2948
|
-
_proto.
|
|
2959
|
+
_proto.updateRaffles = function updateRaffles() {
|
|
2949
2960
|
try {
|
|
2950
2961
|
var _this44 = this;
|
|
2962
|
+
return Promise.resolve(_this44.api.getRafflesT(null)).then(function (payload) {
|
|
2963
|
+
_this44.updateEntity(onUpdateContextKey.Raffles, payload);
|
|
2964
|
+
});
|
|
2965
|
+
} catch (e) {
|
|
2966
|
+
return Promise.reject(e);
|
|
2967
|
+
}
|
|
2968
|
+
};
|
|
2969
|
+
_proto.updateEntity = function updateEntity(contextKey, payload) {
|
|
2970
|
+
try {
|
|
2971
|
+
var _this45 = this;
|
|
2951
2972
|
OCache.set(contextKey, payload, exports.ECacheContext.WSAPI);
|
|
2952
|
-
var onUpdate =
|
|
2973
|
+
var onUpdate = _this45.onUpdateCallback.get(contextKey);
|
|
2953
2974
|
if (onUpdate) {
|
|
2954
2975
|
onUpdate(payload);
|
|
2955
2976
|
}
|
|
@@ -2990,17 +3011,17 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2990
3011
|
;
|
|
2991
3012
|
_proto.jackpotGet = function jackpotGet(filter) {
|
|
2992
3013
|
try {
|
|
2993
|
-
var
|
|
3014
|
+
var _this46 = this;
|
|
2994
3015
|
var signature = (filter == null ? void 0 : filter.jp_template_id) + ":" + (filter == null ? void 0 : filter.related_game_id);
|
|
2995
|
-
if (signature !==
|
|
2996
|
-
|
|
2997
|
-
|
|
3016
|
+
if (signature !== _this46.jackpotGetSignature) {
|
|
3017
|
+
_this46.jackpotGetSignature = signature;
|
|
3018
|
+
_this46.jackpotClearCache();
|
|
2998
3019
|
}
|
|
2999
3020
|
var jackpots = [];
|
|
3000
3021
|
var pots = [];
|
|
3001
3022
|
return Promise.resolve(OCache.use(onUpdateContextKey.Jackpots, exports.ECacheContext.WSAPI, function () {
|
|
3002
3023
|
try {
|
|
3003
|
-
return Promise.resolve(
|
|
3024
|
+
return Promise.resolve(_this46.api.jackpotGet(null, filter)).then(function (_jackpots) {
|
|
3004
3025
|
var _pots = _jackpots.items.map(function (jp) {
|
|
3005
3026
|
return jp.pot;
|
|
3006
3027
|
});
|
|
@@ -3014,7 +3035,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3014
3035
|
return Promise.reject(e);
|
|
3015
3036
|
}
|
|
3016
3037
|
}, JACKPOT_TEMPLATE_CACHE_SEC)).then(function (_OCache$use) {
|
|
3017
|
-
function
|
|
3038
|
+
function _temp11() {
|
|
3018
3039
|
return jackpots.map(function (jp) {
|
|
3019
3040
|
var _jp = _extends({}, jp, {
|
|
3020
3041
|
pot: pots.find(function (p) {
|
|
@@ -3025,17 +3046,17 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3025
3046
|
});
|
|
3026
3047
|
}
|
|
3027
3048
|
jackpots = _OCache$use;
|
|
3028
|
-
var
|
|
3049
|
+
var _temp10 = function () {
|
|
3029
3050
|
if (jackpots.length > 0) {
|
|
3030
3051
|
return Promise.resolve(OCache.use(onUpdateContextKey.Pots, exports.ECacheContext.WSAPI, function () {
|
|
3031
3052
|
try {
|
|
3032
3053
|
var jp_template_ids = jackpots.map(function (jp) {
|
|
3033
3054
|
return jp.jp_template_id;
|
|
3034
3055
|
});
|
|
3035
|
-
return Promise.resolve(
|
|
3056
|
+
return Promise.resolve(_this46.api.potGet(null, {
|
|
3036
3057
|
jp_template_ids: jp_template_ids
|
|
3037
|
-
})).then(function (
|
|
3038
|
-
return
|
|
3058
|
+
})).then(function (_this46$api$potGet) {
|
|
3059
|
+
return _this46$api$potGet.items;
|
|
3039
3060
|
});
|
|
3040
3061
|
} catch (e) {
|
|
3041
3062
|
return Promise.reject(e);
|
|
@@ -3045,7 +3066,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3045
3066
|
});
|
|
3046
3067
|
}
|
|
3047
3068
|
}();
|
|
3048
|
-
return
|
|
3069
|
+
return _temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10);
|
|
3049
3070
|
});
|
|
3050
3071
|
} catch (e) {
|
|
3051
3072
|
return Promise.reject(e);
|
|
@@ -3068,11 +3089,11 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3068
3089
|
;
|
|
3069
3090
|
_proto.jackpotOptIn = function jackpotOptIn(filter) {
|
|
3070
3091
|
try {
|
|
3071
|
-
var
|
|
3092
|
+
var _this47 = this;
|
|
3072
3093
|
if (!filter.jp_template_id) {
|
|
3073
3094
|
throw new Error('jp_template_id is required in jackpotOptIn');
|
|
3074
3095
|
}
|
|
3075
|
-
return Promise.resolve(
|
|
3096
|
+
return Promise.resolve(_this47.api.jackpotOptIn(null, filter));
|
|
3076
3097
|
} catch (e) {
|
|
3077
3098
|
return Promise.reject(e);
|
|
3078
3099
|
}
|
|
@@ -3094,11 +3115,11 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3094
3115
|
;
|
|
3095
3116
|
_proto.jackpotOptOut = function jackpotOptOut(filter) {
|
|
3096
3117
|
try {
|
|
3097
|
-
var
|
|
3118
|
+
var _this48 = this;
|
|
3098
3119
|
if (!filter.jp_template_id) {
|
|
3099
3120
|
throw new Error('jp_template_id is required in jackpotOptOut');
|
|
3100
3121
|
}
|
|
3101
|
-
return Promise.resolve(
|
|
3122
|
+
return Promise.resolve(_this48.api.jackpotOptOut(null, filter));
|
|
3102
3123
|
} catch (e) {
|
|
3103
3124
|
return Promise.reject(e);
|
|
3104
3125
|
}
|
|
@@ -3119,14 +3140,14 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3119
3140
|
*
|
|
3120
3141
|
*/
|
|
3121
3142
|
;
|
|
3122
|
-
_proto.getJackpotWinners = function getJackpotWinners(
|
|
3123
|
-
var limit =
|
|
3124
|
-
offset =
|
|
3125
|
-
jp_template_id =
|
|
3143
|
+
_proto.getJackpotWinners = function getJackpotWinners(_ref11) {
|
|
3144
|
+
var limit = _ref11.limit,
|
|
3145
|
+
offset = _ref11.offset,
|
|
3146
|
+
jp_template_id = _ref11.jp_template_id;
|
|
3126
3147
|
try {
|
|
3127
|
-
var
|
|
3148
|
+
var _this49 = this;
|
|
3128
3149
|
return Promise.resolve(OCache.use(onUpdateContextKey.JackpotWinners + jp_template_id, exports.ECacheContext.WSAPI, function () {
|
|
3129
|
-
return
|
|
3150
|
+
return _this49.api.getJackpotWinnersT(null, limit, offset, jp_template_id);
|
|
3130
3151
|
}, JACKPOT_WINNERS_CACHE_SEC));
|
|
3131
3152
|
} catch (e) {
|
|
3132
3153
|
return Promise.reject(e);
|
|
@@ -3146,16 +3167,16 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3146
3167
|
*
|
|
3147
3168
|
*/
|
|
3148
3169
|
;
|
|
3149
|
-
_proto.getJackpotEligibleGames = function getJackpotEligibleGames(
|
|
3150
|
-
var jp_template_id =
|
|
3151
|
-
onUpdate =
|
|
3170
|
+
_proto.getJackpotEligibleGames = function getJackpotEligibleGames(_ref12) {
|
|
3171
|
+
var jp_template_id = _ref12.jp_template_id,
|
|
3172
|
+
onUpdate = _ref12.onUpdate;
|
|
3152
3173
|
try {
|
|
3153
|
-
var
|
|
3174
|
+
var _this50 = this;
|
|
3154
3175
|
if (onUpdate) {
|
|
3155
|
-
|
|
3176
|
+
_this50.onUpdateCallback.set(onUpdateContextKey.JackpotEligibleGames, onUpdate);
|
|
3156
3177
|
}
|
|
3157
3178
|
return Promise.resolve(OCache.use(onUpdateContextKey.JackpotEligibleGames + jp_template_id, exports.ECacheContext.WSAPI, function () {
|
|
3158
|
-
return
|
|
3179
|
+
return _this50.api.getJackpotEligibleGamesT(null, {
|
|
3159
3180
|
jp_template_id: jp_template_id
|
|
3160
3181
|
});
|
|
3161
3182
|
}, JACKPOT_ELIGIBLE_GAMES_CACHE_SEC));
|
|
@@ -3184,8 +3205,8 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3184
3205
|
;
|
|
3185
3206
|
_proto.getRelatedItemsForGame = function getRelatedItemsForGame(related_game_id) {
|
|
3186
3207
|
try {
|
|
3187
|
-
var
|
|
3188
|
-
return Promise.resolve(
|
|
3208
|
+
var _this51 = this;
|
|
3209
|
+
return Promise.resolve(_this51.api.getRelatedItemsForGame(null, related_game_id));
|
|
3189
3210
|
} catch (e) {
|
|
3190
3211
|
return Promise.reject(e);
|
|
3191
3212
|
}
|
|
@@ -3213,16 +3234,16 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3213
3234
|
*
|
|
3214
3235
|
*/
|
|
3215
3236
|
;
|
|
3216
|
-
_proto.getRaffles = function getRaffles(
|
|
3217
|
-
var
|
|
3218
|
-
onUpdate =
|
|
3237
|
+
_proto.getRaffles = function getRaffles(_temp12) {
|
|
3238
|
+
var _ref13 = _temp12 === void 0 ? {} : _temp12,
|
|
3239
|
+
onUpdate = _ref13.onUpdate;
|
|
3219
3240
|
try {
|
|
3220
|
-
var
|
|
3241
|
+
var _this52 = this;
|
|
3221
3242
|
if (onUpdate) {
|
|
3222
|
-
|
|
3243
|
+
_this52.onUpdateCallback.set(onUpdateContextKey.Raffles, onUpdate);
|
|
3223
3244
|
}
|
|
3224
3245
|
return Promise.resolve(OCache.use(onUpdateContextKey.Raffles, exports.ECacheContext.WSAPI, function () {
|
|
3225
|
-
return
|
|
3246
|
+
return _this52.api.getRafflesT(null);
|
|
3226
3247
|
}, CACHE_DATA_SEC));
|
|
3227
3248
|
} catch (e) {
|
|
3228
3249
|
return Promise.reject(e);
|
|
@@ -3253,8 +3274,8 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3253
3274
|
;
|
|
3254
3275
|
_proto.getRaffleDrawRun = function getRaffleDrawRun(props) {
|
|
3255
3276
|
try {
|
|
3256
|
-
var
|
|
3257
|
-
return Promise.resolve(
|
|
3277
|
+
var _this53 = this;
|
|
3278
|
+
return Promise.resolve(_this53.api.getRaffleDrawRun(null, props)).then(function (res) {
|
|
3258
3279
|
if (!props.raffle_id || !props.run_id) {
|
|
3259
3280
|
throw new Error('both raffle_id and run_id are required');
|
|
3260
3281
|
}
|
|
@@ -3288,8 +3309,8 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3288
3309
|
;
|
|
3289
3310
|
_proto.getRaffleDrawRunsHistory = function getRaffleDrawRunsHistory(props) {
|
|
3290
3311
|
try {
|
|
3291
|
-
var
|
|
3292
|
-
return Promise.resolve(
|
|
3312
|
+
var _this54 = this;
|
|
3313
|
+
return Promise.resolve(_this54.api.getRaffleDrawRunsHistory(null, props)).then(function (res) {
|
|
3293
3314
|
if (!props.raffle_id) {
|
|
3294
3315
|
throw new Error('raffle_id is required');
|
|
3295
3316
|
}
|
|
@@ -3323,11 +3344,11 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3323
3344
|
;
|
|
3324
3345
|
_proto.claimRafflePrize = function claimRafflePrize(props) {
|
|
3325
3346
|
try {
|
|
3326
|
-
var
|
|
3347
|
+
var _this55 = this;
|
|
3327
3348
|
if (!props.won_id) {
|
|
3328
3349
|
throw new Error('won_id is required');
|
|
3329
3350
|
}
|
|
3330
|
-
return Promise.resolve(
|
|
3351
|
+
return Promise.resolve(_this55.api.claimRafflePrize(null, {
|
|
3331
3352
|
won_id: props.won_id
|
|
3332
3353
|
})).then(raffleClaimPrizeResponseTransform);
|
|
3333
3354
|
} catch (e) {
|