@smartico/public-api 0.0.356 → 0.0.358
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/README.md +33 -8
- package/dist/WSAPI/WSAPI.d.ts +50 -45
- package/dist/index.js +49 -44
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +49 -44
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/README.md +58 -3
- package/docs/api/classes/WSAPI.md +43 -41
- package/docs/api/enums/AchievementStatus.md +49 -0
- package/docs/api/enums/AchievementTaskType.md +13 -0
- package/docs/api/enums/AchievementType.md +13 -0
- package/docs/api/enums/ActivityTypeLimited.md +115 -0
- package/docs/api/enums/BadgesTimeLimitStates.md +49 -0
- package/docs/api/enums/InboxMessageType.md +55 -0
- package/docs/api/enums/InboxReadStatus.md +13 -0
- package/docs/api/enums/OpenLinksType.md +13 -0
- package/docs/api/enums/ScheduledMissionType.md +19 -0
- package/docs/api/enums/StoreItemPurchaseType.md +19 -0
- package/docs/api/enums/StoreItemType.md +37 -0
- package/docs/api/enums/StoreItemTypeName.md +43 -0
- package/docs/api/enums/TournamentInstanceStatus.md +43 -0
- package/docs/api/enums/TournamentRegistrationError.md +55 -0
- package/docs/api/enums/TournamentType.md +19 -0
- package/docs/api/interfaces/AchievementTaskPublicMeta.md +35 -0
- package/docs/api/interfaces/AffectsProgress.md +25 -0
- package/docs/api/interfaces/Bonus.md +2 -2
- package/docs/api/interfaces/BonusMetaMap-1.md +9 -0
- package/docs/api/interfaces/BonusMetaMap.md +0 -2
- package/docs/api/interfaces/BonusTemplateMetaMap-1.md +33 -0
- package/docs/api/interfaces/BonusTemplateMetaMap.md +0 -8
- package/docs/api/interfaces/GetCustomSectionsResponse.md +67 -0
- package/docs/api/interfaces/GetRelatedAchTourResponse.md +69 -0
- package/docs/api/interfaces/InboxMessageBody.md +2 -2
- package/docs/api/interfaces/StoreItem.md +2 -2
- package/docs/api/interfaces/StoreItemPublicMeta.md +127 -0
- package/docs/api/interfaces/TBonus.md +2 -2
- package/docs/api/interfaces/TMissionOrBadge.md +1 -1
- package/docs/api/interfaces/TTournamentRegistrationResult.md +1 -1
- package/docs/api/interfaces/Tournament.md +3 -3
- package/docs/api/interfaces/TournamentPrize.md +1 -1
- package/docs/api/interfaces/TournamentPublicMeta.md +115 -0
- package/docs/api/interfaces/UserAchievement.md +4 -4
- package/docs/api/interfaces/UserAchievementTask.md +3 -3
- package/package.json +1 -1
- package/src/SmarticoAPI.ts +1 -1
- package/src/WSAPI/WSAPI.ts +55 -49
- package/tsconfig.json +23 -1
package/src/WSAPI/WSAPI.ts
CHANGED
|
@@ -176,7 +176,7 @@ export class WSAPI {
|
|
|
176
176
|
* Pay attention that this method is synchronous and returns the user profile object immediately, not a promise.
|
|
177
177
|
* **Example**:
|
|
178
178
|
* ```
|
|
179
|
-
* var p = _smartico.api.getUserProfile);
|
|
179
|
+
* var p = _smartico.api.getUserProfile();
|
|
180
180
|
* console.log(p);
|
|
181
181
|
* ```
|
|
182
182
|
* **Visitor mode: not supported**
|
|
@@ -223,7 +223,7 @@ export class WSAPI {
|
|
|
223
223
|
return await this.api.coreCheckSegments(this.userExtId, Array.isArray(segment_ids) ? segment_ids : [segment_ids]);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
/** Returns all the levels available the current user
|
|
226
|
+
/** Returns all the levels available to the current user
|
|
227
227
|
* **Example**:
|
|
228
228
|
* ```
|
|
229
229
|
* _smartico.api.getLevels().then((result) => {
|
|
@@ -291,7 +291,7 @@ export class WSAPI {
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
/**
|
|
294
|
-
* Returns all the badges available the current user
|
|
294
|
+
* Returns all the badges available to the current user
|
|
295
295
|
*
|
|
296
296
|
* **Visitor mode: not supported**
|
|
297
297
|
*/
|
|
@@ -301,7 +301,7 @@ export class WSAPI {
|
|
|
301
301
|
|
|
302
302
|
/**
|
|
303
303
|
* Returns all the bonuses for the current user
|
|
304
|
-
* The returned
|
|
304
|
+
* The returned bonuses are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
305
305
|
* Note that each time you call getBonuses with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
306
306
|
* The onUpdate callback will be called on bonus claimed and the updated bonuses will be passed to it.
|
|
307
307
|
*
|
|
@@ -337,7 +337,7 @@ export class WSAPI {
|
|
|
337
337
|
|
|
338
338
|
/**
|
|
339
339
|
* Returns the extra counters for the current user level.
|
|
340
|
-
* These are counters that are configured for each Smartico client
|
|
340
|
+
* These are counters that are configured for each Smartico client separately by request.
|
|
341
341
|
* For example 1st counter could be total wagering amount, 2nd counter could be total deposit amount, etc.
|
|
342
342
|
*
|
|
343
343
|
* **Example**:
|
|
@@ -360,7 +360,7 @@ export class WSAPI {
|
|
|
360
360
|
|
|
361
361
|
/**
|
|
362
362
|
*
|
|
363
|
-
* Returns all the store items available the current user
|
|
363
|
+
* Returns all the store items available to the current user
|
|
364
364
|
* The returned store items are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
|
|
365
365
|
* Note that each time you call getStoreItems with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
366
366
|
* The onUpdate callback will be called on purchase of the store item.
|
|
@@ -533,7 +533,7 @@ export class WSAPI {
|
|
|
533
533
|
/**
|
|
534
534
|
* Returns the list of mini-games configured for the current user (not filtered by spin availability or Widget visibility).
|
|
535
535
|
* The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
536
|
-
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or
|
|
536
|
+
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or won prize is spin/jackpot and if max count of the available user spins equals one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
|
|
537
537
|
*
|
|
538
538
|
* **Example**:
|
|
539
539
|
* ```
|
|
@@ -596,7 +596,7 @@ export class WSAPI {
|
|
|
596
596
|
/**
|
|
597
597
|
* Plays the specified by template_id mini-game on behalf of user and returns prize_id or err_code
|
|
598
598
|
* After playMiniGame is called, you can call getMiniGames to get the list of mini-games.The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call playMiniGame with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
599
|
-
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or
|
|
599
|
+
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or won prize is spin/jackpot and if max count of the available user spins equals one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
|
|
600
600
|
*
|
|
601
601
|
* **Example**:
|
|
602
602
|
* ```
|
|
@@ -643,7 +643,7 @@ export class WSAPI {
|
|
|
643
643
|
/**
|
|
644
644
|
* Plays the specified by template_id mini-game on behalf of user spin_count times and returns array of the prizes
|
|
645
645
|
* After playMiniGameBatch is called, you can call getMiniGames to get the list of mini-games. The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call playMiniGameBatch with a new onUpdate callback, the old one will be overwritten by the new one.
|
|
646
|
-
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or
|
|
646
|
+
* The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or won prize is spin/jackpot and if max count of the available user spins equals one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
|
|
647
647
|
*
|
|
648
648
|
* **Example**:
|
|
649
649
|
* ```
|
|
@@ -656,7 +656,7 @@ export class WSAPI {
|
|
|
656
656
|
public async playMiniGameBatch(
|
|
657
657
|
template_id: number,
|
|
658
658
|
spin_count: number,
|
|
659
|
-
{ onUpdate }: { onUpdate?: (data:
|
|
659
|
+
{ onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {},
|
|
660
660
|
): Promise<TMiniGamePlayBatchResult[]> {
|
|
661
661
|
if (onUpdate) {
|
|
662
662
|
this.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);
|
|
@@ -742,7 +742,7 @@ export class WSAPI {
|
|
|
742
742
|
}
|
|
743
743
|
|
|
744
744
|
/**
|
|
745
|
-
* Returns
|
|
745
|
+
* Returns detailed information for a specific tournament instance; the response includes tournament info and the leaderboard of players
|
|
746
746
|
*
|
|
747
747
|
* **Example**:
|
|
748
748
|
* ```
|
|
@@ -818,7 +818,7 @@ export class WSAPI {
|
|
|
818
818
|
* An indicator "onlyFavorite" can be passed to get only messages marked as favorites.
|
|
819
819
|
* An indicator "read_status" can be passed to get only messages marked as read or unread.
|
|
820
820
|
* You can leave this params empty and by default it will return list of messages ranging from 0 to 20.
|
|
821
|
-
* This
|
|
821
|
+
* This function returns a list of messages without the body of each message.
|
|
822
822
|
* To get the body of the message you need to call getInboxMessageBody function and pass the message guid contained in each message of this request.
|
|
823
823
|
* All other action like mark as read, favorite, delete, etc. can be done using this message GUID.
|
|
824
824
|
* The "onUpdate" callback will be triggered when the user receives a new message. It will provide an updated list of messages, ranging from 0 to 20, to the onUpdate callback function.
|
|
@@ -890,7 +890,7 @@ export class WSAPI {
|
|
|
890
890
|
}
|
|
891
891
|
|
|
892
892
|
/**
|
|
893
|
-
* Requests to mark all inbox messages as
|
|
893
|
+
* Requests to mark all inbox messages as read
|
|
894
894
|
*
|
|
895
895
|
* **Visitor mode: not supported**
|
|
896
896
|
*/
|
|
@@ -996,7 +996,7 @@ export class WSAPI {
|
|
|
996
996
|
* ```
|
|
997
997
|
* _smartico.api.reportClickEvent({
|
|
998
998
|
* engagement_uid: 'abc123-def456',
|
|
999
|
-
* activityType: 31 // Inbox
|
|
999
|
+
* activityType: 31 // Inbox
|
|
1000
1000
|
* action: 'dp:gf_missions'
|
|
1001
1001
|
* });
|
|
1002
1002
|
* ```
|
|
@@ -1097,7 +1097,7 @@ export class WSAPI {
|
|
|
1097
1097
|
*
|
|
1098
1098
|
* **Example**:
|
|
1099
1099
|
* ```
|
|
1100
|
-
* _smartico.api.
|
|
1100
|
+
* _smartico.api.gamePickGetActiveRounds({
|
|
1101
1101
|
* saw_template_id: 1083,
|
|
1102
1102
|
* }).then((result) => {
|
|
1103
1103
|
* console.log(result.data); // GamePickRound[]
|
|
@@ -1109,7 +1109,7 @@ export class WSAPI {
|
|
|
1109
1109
|
*
|
|
1110
1110
|
* **Visitor mode: not supported**
|
|
1111
1111
|
*/
|
|
1112
|
-
public async
|
|
1112
|
+
public async gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {
|
|
1113
1113
|
if (!props.saw_template_id) {
|
|
1114
1114
|
throw new Error('saw_template_id is required');
|
|
1115
1115
|
}
|
|
@@ -1125,12 +1125,12 @@ export class WSAPI {
|
|
|
1125
1125
|
*
|
|
1126
1126
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
1127
1127
|
* - `errCode` - 0 on success
|
|
1128
|
-
* - `data` - Single round object with the same structure as in `
|
|
1128
|
+
* - `data` - Single round object with the same structure as in `gamePickGetActiveRounds`,
|
|
1129
1129
|
* including `events[]` with full event details, user selections, and resolution info
|
|
1130
1130
|
*
|
|
1131
1131
|
* **Example**:
|
|
1132
1132
|
* ```
|
|
1133
|
-
* _smartico.api.
|
|
1133
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
1134
1134
|
* saw_template_id: 1083,
|
|
1135
1135
|
* round_id: 31652,
|
|
1136
1136
|
* }).then((result) => {
|
|
@@ -1141,7 +1141,7 @@ export class WSAPI {
|
|
|
1141
1141
|
*
|
|
1142
1142
|
* **Visitor mode: not supported**
|
|
1143
1143
|
*/
|
|
1144
|
-
public async
|
|
1144
|
+
public async gamePickGetActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>> {
|
|
1145
1145
|
if (!props.saw_template_id) {
|
|
1146
1146
|
throw new Error('saw_template_id is required');
|
|
1147
1147
|
}
|
|
@@ -1160,12 +1160,12 @@ export class WSAPI {
|
|
|
1160
1160
|
* **Response** `GamesApiResponse<GamePickRound[]>`:
|
|
1161
1161
|
* - `errCode` - 0 on success
|
|
1162
1162
|
* - `data` - Array of rounds ordered by `round_row_id` descending (newest first).
|
|
1163
|
-
* Each round has the same structure as in `
|
|
1163
|
+
* Each round has the same structure as in `gamePickGetActiveRounds`, including resolved events
|
|
1164
1164
|
* with `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) and `resolution_score`
|
|
1165
1165
|
*
|
|
1166
1166
|
* **Example**:
|
|
1167
1167
|
* ```
|
|
1168
|
-
* _smartico.api.
|
|
1168
|
+
* _smartico.api.gamePickGetHistory({
|
|
1169
1169
|
* saw_template_id: 1083,
|
|
1170
1170
|
* }).then((result) => {
|
|
1171
1171
|
* result.data.forEach(round => {
|
|
@@ -1176,7 +1176,7 @@ export class WSAPI {
|
|
|
1176
1176
|
*
|
|
1177
1177
|
* **Visitor mode: not supported**
|
|
1178
1178
|
*/
|
|
1179
|
-
public async
|
|
1179
|
+
public async gamePickGetHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {
|
|
1180
1180
|
if (!props.saw_template_id) {
|
|
1181
1181
|
throw new Error('saw_template_id is required');
|
|
1182
1182
|
}
|
|
@@ -1204,7 +1204,7 @@ export class WSAPI {
|
|
|
1204
1204
|
*
|
|
1205
1205
|
* **Example**:
|
|
1206
1206
|
* ```
|
|
1207
|
-
* _smartico.api.
|
|
1207
|
+
* _smartico.api.gamePickGetBoard({
|
|
1208
1208
|
* saw_template_id: 1083,
|
|
1209
1209
|
* round_id: 31652,
|
|
1210
1210
|
* }).then((result) => {
|
|
@@ -1215,7 +1215,7 @@ export class WSAPI {
|
|
|
1215
1215
|
*
|
|
1216
1216
|
* **Visitor mode: not supported**
|
|
1217
1217
|
*/
|
|
1218
|
-
public async
|
|
1218
|
+
public async gamePickGetBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>> {
|
|
1219
1219
|
if (!props.saw_template_id) {
|
|
1220
1220
|
throw new Error('saw_template_id is required');
|
|
1221
1221
|
}
|
|
@@ -1233,7 +1233,7 @@ export class WSAPI {
|
|
|
1233
1233
|
* Predictions can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
|
|
1234
1234
|
*
|
|
1235
1235
|
* @param props.saw_template_id - The ID of the MatchX game template
|
|
1236
|
-
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `
|
|
1236
|
+
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
|
|
1237
1237
|
* and modified with user predictions. Each event needs: `gp_event_id`, `team1_user_selection`, `team2_user_selection`
|
|
1238
1238
|
*
|
|
1239
1239
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
@@ -1243,7 +1243,7 @@ export class WSAPI {
|
|
|
1243
1243
|
*
|
|
1244
1244
|
* **Example**:
|
|
1245
1245
|
* ```
|
|
1246
|
-
* _smartico.api.
|
|
1246
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
1247
1247
|
* saw_template_id: 1190,
|
|
1248
1248
|
* round_id: 38665,
|
|
1249
1249
|
* }).then((roundData) => {
|
|
@@ -1253,7 +1253,7 @@ export class WSAPI {
|
|
|
1253
1253
|
* team1_user_selection: 1,
|
|
1254
1254
|
* team2_user_selection: 0,
|
|
1255
1255
|
* }));
|
|
1256
|
-
* _smartico.api.
|
|
1256
|
+
* _smartico.api.gamePickSubmitSelection({
|
|
1257
1257
|
* saw_template_id: 1190,
|
|
1258
1258
|
* round: round,
|
|
1259
1259
|
* }).then((result) => {
|
|
@@ -1264,7 +1264,7 @@ export class WSAPI {
|
|
|
1264
1264
|
*
|
|
1265
1265
|
* **Visitor mode: not supported**
|
|
1266
1266
|
*/
|
|
1267
|
-
public async
|
|
1267
|
+
public async gamePickSubmitSelection(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {
|
|
1268
1268
|
if (!props.saw_template_id) {
|
|
1269
1269
|
throw new Error('saw_template_id is required');
|
|
1270
1270
|
}
|
|
@@ -1282,7 +1282,7 @@ export class WSAPI {
|
|
|
1282
1282
|
* Answers can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
|
|
1283
1283
|
*
|
|
1284
1284
|
* @param props.saw_template_id - The ID of the Quiz game template
|
|
1285
|
-
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `
|
|
1285
|
+
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
|
|
1286
1286
|
* and modified with user answers. Each event needs: `gp_event_id`, `user_selection`
|
|
1287
1287
|
*
|
|
1288
1288
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
@@ -1292,7 +1292,7 @@ export class WSAPI {
|
|
|
1292
1292
|
*
|
|
1293
1293
|
* **Example**:
|
|
1294
1294
|
* ```
|
|
1295
|
-
* _smartico.api.
|
|
1295
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
1296
1296
|
* saw_template_id: 1183,
|
|
1297
1297
|
* round_id: 37974,
|
|
1298
1298
|
* }).then((roundData) => {
|
|
@@ -1301,7 +1301,7 @@ export class WSAPI {
|
|
|
1301
1301
|
* gp_event_id: e.gp_event_id,
|
|
1302
1302
|
* user_selection: 'x',
|
|
1303
1303
|
* }));
|
|
1304
|
-
* _smartico.api.
|
|
1304
|
+
* _smartico.api.gamePickSubmitSelectionQuiz({
|
|
1305
1305
|
* saw_template_id: 1183,
|
|
1306
1306
|
* round: round,
|
|
1307
1307
|
* }).then((result) => {
|
|
@@ -1312,7 +1312,7 @@ export class WSAPI {
|
|
|
1312
1312
|
*
|
|
1313
1313
|
* **Visitor mode: not supported**
|
|
1314
1314
|
*/
|
|
1315
|
-
public async
|
|
1315
|
+
public async gamePickSubmitSelectionQuiz(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {
|
|
1316
1316
|
if (!props.saw_template_id) {
|
|
1317
1317
|
throw new Error('saw_template_id is required');
|
|
1318
1318
|
}
|
|
@@ -1344,7 +1344,7 @@ export class WSAPI {
|
|
|
1344
1344
|
*
|
|
1345
1345
|
* **Example**:
|
|
1346
1346
|
* ```
|
|
1347
|
-
* _smartico.api.
|
|
1347
|
+
* _smartico.api.gamePickGetUserInfo({
|
|
1348
1348
|
* saw_template_id: 1083,
|
|
1349
1349
|
* }).then((result) => {
|
|
1350
1350
|
* console.log(result.data.public_username, result.data.ach_points_balance);
|
|
@@ -1353,7 +1353,7 @@ export class WSAPI {
|
|
|
1353
1353
|
*
|
|
1354
1354
|
* **Visitor mode: not supported**
|
|
1355
1355
|
*/
|
|
1356
|
-
public async
|
|
1356
|
+
public async gamePickGetUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>> {
|
|
1357
1357
|
if (!props.saw_template_id) {
|
|
1358
1358
|
throw new Error('saw_template_id is required');
|
|
1359
1359
|
}
|
|
@@ -1383,7 +1383,7 @@ export class WSAPI {
|
|
|
1383
1383
|
*
|
|
1384
1384
|
* **Example**:
|
|
1385
1385
|
* ```
|
|
1386
|
-
* _smartico.api.
|
|
1386
|
+
* _smartico.api.gamePickGetGameInfo({
|
|
1387
1387
|
* saw_template_id: 1189,
|
|
1388
1388
|
* }).then((result) => {
|
|
1389
1389
|
* console.log(result.data.sawTemplate.saw_template_ui_definition.name);
|
|
@@ -1394,7 +1394,7 @@ export class WSAPI {
|
|
|
1394
1394
|
*
|
|
1395
1395
|
* **Visitor mode: not supported**
|
|
1396
1396
|
*/
|
|
1397
|
-
public async
|
|
1397
|
+
public async gamePickGetGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>> {
|
|
1398
1398
|
if (!props.saw_template_id) {
|
|
1399
1399
|
throw new Error('saw_template_id is required');
|
|
1400
1400
|
}
|
|
@@ -1404,7 +1404,7 @@ export class WSAPI {
|
|
|
1404
1404
|
/**
|
|
1405
1405
|
* Returns round data with events and picks for a specific user (identified by their internal user ID).
|
|
1406
1406
|
* Useful for viewing another user's predictions from the leaderboard.
|
|
1407
|
-
* The `int_user_id` can be obtained from the `
|
|
1407
|
+
* The `int_user_id` can be obtained from the `gamePickGetBoard` response (`users[].int_user_id`).
|
|
1408
1408
|
*
|
|
1409
1409
|
* @param props.saw_template_id - The ID of the MatchX or Quiz game template
|
|
1410
1410
|
* @param props.round_id - The round to get info for
|
|
@@ -1413,13 +1413,13 @@ export class WSAPI {
|
|
|
1413
1413
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
1414
1414
|
* - `errCode` - 0 on success
|
|
1415
1415
|
* - `data` - Round object with the target user's selections.
|
|
1416
|
-
* Same structure as `
|
|
1416
|
+
* Same structure as `gamePickGetActiveRound`, but `user_selection`/`team1_user_selection`/`team2_user_selection`
|
|
1417
1417
|
* fields on events reflect the specified user's picks instead of the current user's.
|
|
1418
1418
|
* Events also include `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) showing how each prediction was scored
|
|
1419
1419
|
*
|
|
1420
1420
|
* **Example**:
|
|
1421
1421
|
* ```
|
|
1422
|
-
* _smartico.api.
|
|
1422
|
+
* _smartico.api.gamePickGetRoundInfoForUser({
|
|
1423
1423
|
* saw_template_id: 1083,
|
|
1424
1424
|
* round_id: 31652,
|
|
1425
1425
|
* int_user_id: 65653810,
|
|
@@ -1432,7 +1432,7 @@ export class WSAPI {
|
|
|
1432
1432
|
*
|
|
1433
1433
|
* **Visitor mode: not supported**
|
|
1434
1434
|
*/
|
|
1435
|
-
public async
|
|
1435
|
+
public async gamePickGetRoundInfoForUser(props: GamePickRoundRequestParams & { int_user_id: number }): Promise<GamesApiResponse<GamePickRound>> {
|
|
1436
1436
|
if (!props.saw_template_id) {
|
|
1437
1437
|
throw new Error('saw_template_id is required');
|
|
1438
1438
|
}
|
|
@@ -1524,7 +1524,7 @@ export class WSAPI {
|
|
|
1524
1524
|
OCache.clear(ECacheContext.WSAPI, onUpdateContextKey.JackpotWinners);
|
|
1525
1525
|
}
|
|
1526
1526
|
|
|
1527
|
-
/** Returns list of Jackpots that are active in the
|
|
1527
|
+
/** Returns list of Jackpots that are active in the system and matching to the filter definition.
|
|
1528
1528
|
* If filter is not provided, all active jackpots will be returned.
|
|
1529
1529
|
* Filter can be used to get jackpots related to specific game or specific jackpot template.
|
|
1530
1530
|
* You can call this method every second in order to get up to date information about current value of the jackpot(s) and present them to the end-users
|
|
@@ -1641,7 +1641,9 @@ export class WSAPI {
|
|
|
1641
1641
|
}
|
|
1642
1642
|
|
|
1643
1643
|
/**
|
|
1644
|
-
* Returns
|
|
1644
|
+
* Returns jackpot winners for the given `jp_template_id` (paginated on the server).
|
|
1645
|
+
* Default page size on the wire is 20; use `limit`, `offset`, and repeated calls to load more.
|
|
1646
|
+
* The full protocol response also includes `has_more`; this method returns only the `winners` array.
|
|
1645
1647
|
*
|
|
1646
1648
|
* **Example**:
|
|
1647
1649
|
* ```
|
|
@@ -1651,16 +1653,19 @@ export class WSAPI {
|
|
|
1651
1653
|
* console.log(result);
|
|
1652
1654
|
* });
|
|
1653
1655
|
* ```
|
|
1654
|
-
*
|
|
1656
|
+
*
|
|
1655
1657
|
* **Visitor mode: not supported**
|
|
1656
|
-
*
|
|
1658
|
+
*
|
|
1659
|
+
* @param params.jp_template_id - Jackpot template id (required; throws if missing)
|
|
1660
|
+
* @param params.limit - Page size (server default 20 when omitted)
|
|
1661
|
+
* @param params.offset - Offset into the winner list
|
|
1657
1662
|
*/
|
|
1658
1663
|
|
|
1659
1664
|
public async getJackpotWinners({
|
|
1660
1665
|
limit,
|
|
1661
1666
|
offset,
|
|
1662
1667
|
jp_template_id,
|
|
1663
|
-
}
|
|
1668
|
+
}: {
|
|
1664
1669
|
limit?: number;
|
|
1665
1670
|
offset?: number;
|
|
1666
1671
|
jp_template_id?: number;
|
|
@@ -1793,7 +1798,7 @@ export class WSAPI {
|
|
|
1793
1798
|
* **Example**:
|
|
1794
1799
|
*
|
|
1795
1800
|
* ```javascript
|
|
1796
|
-
* _smartico.api.
|
|
1801
|
+
* _smartico.api.getRaffleDrawRunsHistory({ raffle_id: 156, draw_id: 432 }).then((result) => {
|
|
1797
1802
|
* console.log(result);
|
|
1798
1803
|
* });
|
|
1799
1804
|
* ```
|
|
@@ -1801,7 +1806,7 @@ export class WSAPI {
|
|
|
1801
1806
|
* **Example in the Visitor mode**:
|
|
1802
1807
|
*
|
|
1803
1808
|
* ```javascript
|
|
1804
|
-
* _smartico.vapi('EN').
|
|
1809
|
+
* _smartico.vapi('EN').getRaffleDrawRunsHistory({ raffle_id: 156, draw_id: 432 }).then((result) => {
|
|
1805
1810
|
* console.log(result);
|
|
1806
1811
|
* });
|
|
1807
1812
|
* ```
|
|
@@ -1809,6 +1814,7 @@ export class WSAPI {
|
|
|
1809
1814
|
*/
|
|
1810
1815
|
|
|
1811
1816
|
public async getRaffleDrawRunsHistory(props: { raffle_id: number; draw_id?: number }): Promise<TRaffleDrawRun[]> {
|
|
1817
|
+
|
|
1812
1818
|
const res = await this.api.getRaffleDrawRunsHistory(this.userExtId, props);
|
|
1813
1819
|
|
|
1814
1820
|
if (!props.raffle_id) {
|
|
@@ -1819,7 +1825,7 @@ export class WSAPI {
|
|
|
1819
1825
|
}
|
|
1820
1826
|
|
|
1821
1827
|
/**
|
|
1822
|
-
* Returns
|
|
1828
|
+
* Returns `err_code` and `err_message` after the call; `err_code` 0 means the request succeeded.
|
|
1823
1829
|
*
|
|
1824
1830
|
*
|
|
1825
1831
|
* **Example**:
|
|
@@ -1869,6 +1875,6 @@ export class WSAPI {
|
|
|
1869
1875
|
return {
|
|
1870
1876
|
err_code: r.errCode,
|
|
1871
1877
|
err_message: r.errMsg,
|
|
1872
|
-
}
|
|
1878
|
+
};
|
|
1873
1879
|
}
|
|
1874
1880
|
}
|
package/tsconfig.json
CHANGED
|
@@ -18,33 +18,55 @@
|
|
|
18
18
|
"src/WSAPI/WSAPITypes.ts",
|
|
19
19
|
"src/Tournaments/TournamentRegistrationStatus.ts",
|
|
20
20
|
"src/Tournaments/TournamentRegistrationType.ts",
|
|
21
|
+
"src/Tournaments/TournamentRegistrationError.ts",
|
|
22
|
+
"src/Tournaments/TournamentType.ts",
|
|
23
|
+
"src/Tournaments/TournamentPublicMeta.ts",
|
|
24
|
+
"src/Tournaments/TournamentInstanceStatus.ts",
|
|
21
25
|
"src/Tournaments/Tournament.ts",
|
|
22
26
|
"src/Tournaments/TournamentPlayer.ts",
|
|
23
27
|
"src/Tournaments/TournamentPrize.ts",
|
|
24
28
|
"src/Tournaments/GetTournamentInfoResponse.ts",
|
|
25
29
|
"src/Bonuses/BonusStatus.ts",
|
|
26
30
|
"src/Bonuses/Bonus.ts",
|
|
31
|
+
"src/Bonuses/BonusMetaMap.ts",
|
|
32
|
+
"src/Bonuses/BonusTemplateMetaMap.ts",
|
|
27
33
|
"src/MiniGames/index.ts",
|
|
28
34
|
"src/MiniGames/SAWWinningHistoryResponse.ts",
|
|
29
35
|
"src/CustomSections/AchCustomSection.ts",
|
|
30
36
|
"src/CustomSections/UICustomSection.ts",
|
|
37
|
+
"src/CustomSections/GetCustomSectionsResponse.ts",
|
|
31
38
|
"src/Store/BuyStoreItemErrorCode.ts",
|
|
32
39
|
"src/Store/StoreItem.ts",
|
|
40
|
+
"src/Store/StoreItemType.ts",
|
|
41
|
+
"src/Store/StoreItemPublicMeta.ts",
|
|
42
|
+
"src/Store/StoreItemPurchaseType.ts",
|
|
33
43
|
"src/Store/StoreCategory.ts",
|
|
34
44
|
"src/Store/StoreCategoryPublicMeta.ts",
|
|
35
45
|
"src/Leaderboard/LeaderBoardPeriodType.ts",
|
|
36
46
|
"src/Base/AchRelatedGame.ts",
|
|
47
|
+
"src/Core/ActivityTypeLimited.ts",
|
|
37
48
|
"src/Jackpots/index.ts",
|
|
38
49
|
"src/Raffle/index.ts",
|
|
39
50
|
"src/Missions/AchievementAvailabilityStatus.ts",
|
|
51
|
+
"src/Missions/AchievementType.ts",
|
|
52
|
+
"src/Missions/AchievementStatus.ts",
|
|
53
|
+
"src/Missions/ScheduledMissionType.ts",
|
|
54
|
+
"src/Missions/BadgesTimeLimitStates.ts",
|
|
40
55
|
"src/Missions/UserAchievement.ts",
|
|
41
56
|
"src/Missions/UserAchievementTask.ts",
|
|
57
|
+
"src/Missions/AchievementTaskPublicMeta.ts",
|
|
58
|
+
"src/Missions/AchievementTaskType.ts",
|
|
59
|
+
"src/Missions/UserAchievementTaskAffectsProgress.ts",
|
|
60
|
+
"src/Missions/GetRelatedAchTourResponse.ts",
|
|
42
61
|
"src/Missions/AchievementCategory.ts",
|
|
43
62
|
"src/Missions/AchCategoryPublicMeta.ts",
|
|
44
63
|
"src/Missions/AchievementPublicMeta.ts",
|
|
45
64
|
"src/Level/Level.ts",
|
|
46
65
|
"src/Level/LevelPublicMeta.ts",
|
|
47
|
-
"src/Inbox/InboxMessage.ts"
|
|
66
|
+
"src/Inbox/InboxMessage.ts",
|
|
67
|
+
"src/Inbox/InboxMessageType.ts",
|
|
68
|
+
"src/Inbox/OpenLinksType.ts",
|
|
69
|
+
"src/Inbox/InboxReadStatus.ts"
|
|
48
70
|
],
|
|
49
71
|
"out": "docs/api",
|
|
50
72
|
"plugin": ["typedoc-plugin-markdown", "typedoc-plugin-merge-modules"],
|