@smartico/public-api 0.0.355 → 0.0.357

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.
Files changed (56) hide show
  1. package/README.md +33 -8
  2. package/dist/SmarticoAPI.d.ts +1 -1
  3. package/dist/WSAPI/WSAPI.d.ts +27 -56
  4. package/dist/WSAPI/WSAPITypes.d.ts +515 -32
  5. package/dist/index.d.ts +0 -1
  6. package/dist/index.js +92 -231
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.modern.mjs +27 -159
  9. package/dist/index.modern.mjs.map +1 -1
  10. package/docs/api/README.md +27 -0
  11. package/docs/api/classes/WSAPI.md +37 -57
  12. package/docs/api/enums/GPRoundStatus.md +43 -0
  13. package/docs/api/enums/GamePickMarketType.md +19 -0
  14. package/docs/api/enums/GamePickResolutionType.md +35 -0
  15. package/docs/api/enums/GamePickScoreType.md +19 -0
  16. package/docs/api/enums/GamePickSportType.md +375 -0
  17. package/docs/api/enums/GameRoundOrderType.md +35 -0
  18. package/docs/api/enums/PointChangeSourceType.md +6 -0
  19. package/docs/api/interfaces/AchRelatedGame-1.md +1 -1
  20. package/docs/api/interfaces/BonusTemplateMetaMap.md +1 -1
  21. package/docs/api/interfaces/GamePickBoardUser.md +75 -0
  22. package/docs/api/interfaces/GamePickEvent.md +121 -0
  23. package/docs/api/interfaces/GamePickEventMeta.md +181 -0
  24. package/docs/api/interfaces/GamePickGameInfo.md +27 -0
  25. package/docs/api/interfaces/GamePickRequestParams.md +41 -0
  26. package/docs/api/interfaces/GamePickRound.md +385 -0
  27. package/docs/api/interfaces/GamePickRoundBase.md +235 -0
  28. package/docs/api/interfaces/GamePickRoundBoard.md +361 -0
  29. package/docs/api/interfaces/GamePickRoundPublicMeta.md +103 -0
  30. package/docs/api/interfaces/GamePickRoundRequestParams.md +65 -0
  31. package/docs/api/interfaces/GamePickUserInfo.md +107 -0
  32. package/docs/api/interfaces/GamesApiResponse.md +33 -0
  33. package/docs/api/interfaces/QuizEventMeta.md +41 -0
  34. package/docs/api/interfaces/TInboxMessageBody.md +1 -1
  35. package/docs/api/interfaces/TLevel.md +1 -1
  36. package/docs/api/interfaces/TLevelCurrent.md +1 -1
  37. package/docs/api/interfaces/TMiniGamePrize.md +1 -1
  38. package/docs/api/interfaces/TMiniGameTemplate.md +2 -2
  39. package/docs/api/interfaces/TMissionOrBadge.md +2 -2
  40. package/docs/api/interfaces/TRaffle.md +2 -2
  41. package/docs/api/interfaces/TRaffleDraw.md +14 -2
  42. package/docs/api/interfaces/TRaffleDrawRun.md +20 -0
  43. package/docs/api/interfaces/TRafflePrize.md +1 -1
  44. package/docs/api/interfaces/TStoreItem.md +3 -3
  45. package/docs/api/interfaces/TTournament.md +4 -4
  46. package/docs/api/interfaces/TTournamentDetailed.md +4 -4
  47. package/docs/api/interfaces/TUICustomSection.md +1 -1
  48. package/package.json +6 -6
  49. package/src/SmarticoAPI.ts +1 -1
  50. package/src/WSAPI/WSAPI.ts +27 -63
  51. package/src/WSAPI/WSAPITypes.ts +525 -32
  52. package/src/index.ts +1 -2
  53. package/dist/GamePick/GPTypes.d.ts +0 -268
  54. package/dist/GamePick/index.d.ts +0 -1
  55. package/src/GamePick/GPTypes.ts +0 -277
  56. package/src/GamePick/index.ts +0 -1
@@ -39,8 +39,6 @@ import {
39
39
  TLevelCurrent,
40
40
  TActivityLog,
41
41
  TRaffleOptinResponse,
42
- } from './WSAPITypes';
43
- import {
44
42
  GamesApiResponse,
45
43
  GamePickRound,
46
44
  GamePickRoundBoard,
@@ -48,7 +46,7 @@ import {
48
46
  GamePickGameInfo,
49
47
  GamePickRequestParams,
50
48
  GamePickRoundRequestParams,
51
- } from '../GamePick';
49
+ } from './WSAPITypes';
52
50
  import { LeaderBoardPeriodType } from '../Leaderboard';
53
51
  import {
54
52
  JackpotDetails,
@@ -1099,7 +1097,7 @@ export class WSAPI {
1099
1097
  *
1100
1098
  * **Example**:
1101
1099
  * ```
1102
- * _smartico.api.getGamePickActiveRounds({
1100
+ * _smartico.api.gamePickGetActiveRounds({
1103
1101
  * saw_template_id: 1083,
1104
1102
  * }).then((result) => {
1105
1103
  * console.log(result.data); // GamePickRound[]
@@ -1111,7 +1109,7 @@ export class WSAPI {
1111
1109
  *
1112
1110
  * **Visitor mode: not supported**
1113
1111
  */
1114
- public async getGamePickActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {
1112
+ public async gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {
1115
1113
  if (!props.saw_template_id) {
1116
1114
  throw new Error('saw_template_id is required');
1117
1115
  }
@@ -1127,12 +1125,12 @@ export class WSAPI {
1127
1125
  *
1128
1126
  * **Response** `GamesApiResponse<GamePickRound>`:
1129
1127
  * - `errCode` - 0 on success
1130
- * - `data` - Single round object with the same structure as in `getGamePickActiveRounds`,
1128
+ * - `data` - Single round object with the same structure as in `gamePickGetActiveRounds`,
1131
1129
  * including `events[]` with full event details, user selections, and resolution info
1132
1130
  *
1133
1131
  * **Example**:
1134
1132
  * ```
1135
- * _smartico.api.getGamePickActiveRound({
1133
+ * _smartico.api.gamePickGetActiveRound({
1136
1134
  * saw_template_id: 1083,
1137
1135
  * round_id: 31652,
1138
1136
  * }).then((result) => {
@@ -1143,7 +1141,7 @@ export class WSAPI {
1143
1141
  *
1144
1142
  * **Visitor mode: not supported**
1145
1143
  */
1146
- public async getGamePickActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>> {
1144
+ public async gamePickGetActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>> {
1147
1145
  if (!props.saw_template_id) {
1148
1146
  throw new Error('saw_template_id is required');
1149
1147
  }
@@ -1162,12 +1160,12 @@ export class WSAPI {
1162
1160
  * **Response** `GamesApiResponse<GamePickRound[]>`:
1163
1161
  * - `errCode` - 0 on success
1164
1162
  * - `data` - Array of rounds ordered by `round_row_id` descending (newest first).
1165
- * Each round has the same structure as in `getGamePickActiveRounds`, including resolved events
1163
+ * Each round has the same structure as in `gamePickGetActiveRounds`, including resolved events
1166
1164
  * with `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) and `resolution_score`
1167
1165
  *
1168
1166
  * **Example**:
1169
1167
  * ```
1170
- * _smartico.api.getGamePickHistory({
1168
+ * _smartico.api.gamePickGetHistory({
1171
1169
  * saw_template_id: 1083,
1172
1170
  * }).then((result) => {
1173
1171
  * result.data.forEach(round => {
@@ -1178,7 +1176,7 @@ export class WSAPI {
1178
1176
  *
1179
1177
  * **Visitor mode: not supported**
1180
1178
  */
1181
- public async getGamePickHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {
1179
+ public async gamePickGetHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {
1182
1180
  if (!props.saw_template_id) {
1183
1181
  throw new Error('saw_template_id is required');
1184
1182
  }
@@ -1206,7 +1204,7 @@ export class WSAPI {
1206
1204
  *
1207
1205
  * **Example**:
1208
1206
  * ```
1209
- * _smartico.api.getGamePickBoard({
1207
+ * _smartico.api.gamePickGetBoard({
1210
1208
  * saw_template_id: 1083,
1211
1209
  * round_id: 31652,
1212
1210
  * }).then((result) => {
@@ -1217,7 +1215,7 @@ export class WSAPI {
1217
1215
  *
1218
1216
  * **Visitor mode: not supported**
1219
1217
  */
1220
- public async getGamePickBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>> {
1218
+ public async gamePickGetBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>> {
1221
1219
  if (!props.saw_template_id) {
1222
1220
  throw new Error('saw_template_id is required');
1223
1221
  }
@@ -1235,7 +1233,7 @@ export class WSAPI {
1235
1233
  * Predictions can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
1236
1234
  *
1237
1235
  * @param props.saw_template_id - The ID of the MatchX game template
1238
- * @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `getGamePickActiveRound`
1236
+ * @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
1239
1237
  * and modified with user predictions. Each event needs: `gp_event_id`, `team1_user_selection`, `team2_user_selection`
1240
1238
  *
1241
1239
  * **Response** `GamesApiResponse<GamePickRound>`:
@@ -1245,7 +1243,7 @@ export class WSAPI {
1245
1243
  *
1246
1244
  * **Example**:
1247
1245
  * ```
1248
- * _smartico.api.getGamePickActiveRound({
1246
+ * _smartico.api.gamePickGetActiveRound({
1249
1247
  * saw_template_id: 1190,
1250
1248
  * round_id: 38665,
1251
1249
  * }).then((roundData) => {
@@ -1255,7 +1253,7 @@ export class WSAPI {
1255
1253
  * team1_user_selection: 1,
1256
1254
  * team2_user_selection: 0,
1257
1255
  * }));
1258
- * _smartico.api.submitGamePickSelection({
1256
+ * _smartico.api.gamePickSubmitSelection({
1259
1257
  * saw_template_id: 1190,
1260
1258
  * round: round,
1261
1259
  * }).then((result) => {
@@ -1266,7 +1264,7 @@ export class WSAPI {
1266
1264
  *
1267
1265
  * **Visitor mode: not supported**
1268
1266
  */
1269
- public async submitGamePickSelection(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {
1267
+ public async gamePickSubmitSelection(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {
1270
1268
  if (!props.saw_template_id) {
1271
1269
  throw new Error('saw_template_id is required');
1272
1270
  }
@@ -1284,7 +1282,7 @@ export class WSAPI {
1284
1282
  * Answers can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
1285
1283
  *
1286
1284
  * @param props.saw_template_id - The ID of the Quiz game template
1287
- * @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `getGamePickActiveRound`
1285
+ * @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
1288
1286
  * and modified with user answers. Each event needs: `gp_event_id`, `user_selection`
1289
1287
  *
1290
1288
  * **Response** `GamesApiResponse<GamePickRound>`:
@@ -1294,7 +1292,7 @@ export class WSAPI {
1294
1292
  *
1295
1293
  * **Example**:
1296
1294
  * ```
1297
- * _smartico.api.getGamePickActiveRound({
1295
+ * _smartico.api.gamePickGetActiveRound({
1298
1296
  * saw_template_id: 1183,
1299
1297
  * round_id: 37974,
1300
1298
  * }).then((roundData) => {
@@ -1303,7 +1301,7 @@ export class WSAPI {
1303
1301
  * gp_event_id: e.gp_event_id,
1304
1302
  * user_selection: 'x',
1305
1303
  * }));
1306
- * _smartico.api.submitGamePickSelectionQuiz({
1304
+ * _smartico.api.gamePickSubmitSelectionQuiz({
1307
1305
  * saw_template_id: 1183,
1308
1306
  * round: round,
1309
1307
  * }).then((result) => {
@@ -1314,7 +1312,7 @@ export class WSAPI {
1314
1312
  *
1315
1313
  * **Visitor mode: not supported**
1316
1314
  */
1317
- public async submitGamePickSelectionQuiz(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {
1315
+ public async gamePickSubmitSelectionQuiz(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {
1318
1316
  if (!props.saw_template_id) {
1319
1317
  throw new Error('saw_template_id is required');
1320
1318
  }
@@ -1346,7 +1344,7 @@ export class WSAPI {
1346
1344
  *
1347
1345
  * **Example**:
1348
1346
  * ```
1349
- * _smartico.api.getGamePickUserInfo({
1347
+ * _smartico.api.gamePickGetUserInfo({
1350
1348
  * saw_template_id: 1083,
1351
1349
  * }).then((result) => {
1352
1350
  * console.log(result.data.public_username, result.data.ach_points_balance);
@@ -1355,7 +1353,7 @@ export class WSAPI {
1355
1353
  *
1356
1354
  * **Visitor mode: not supported**
1357
1355
  */
1358
- public async getGamePickUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>> {
1356
+ public async gamePickGetUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>> {
1359
1357
  if (!props.saw_template_id) {
1360
1358
  throw new Error('saw_template_id is required');
1361
1359
  }
@@ -1385,7 +1383,7 @@ export class WSAPI {
1385
1383
  *
1386
1384
  * **Example**:
1387
1385
  * ```
1388
- * _smartico.api.getGamePickGameInfo({
1386
+ * _smartico.api.gamePickGetGameInfo({
1389
1387
  * saw_template_id: 1189,
1390
1388
  * }).then((result) => {
1391
1389
  * console.log(result.data.sawTemplate.saw_template_ui_definition.name);
@@ -1396,51 +1394,17 @@ export class WSAPI {
1396
1394
  *
1397
1395
  * **Visitor mode: not supported**
1398
1396
  */
1399
- public async getGamePickGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>> {
1397
+ public async gamePickGetGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>> {
1400
1398
  if (!props.saw_template_id) {
1401
1399
  throw new Error('saw_template_id is required');
1402
1400
  }
1403
1401
  return this.api.gpGetGameInfo(props.saw_template_id);
1404
1402
  }
1405
1403
 
1406
- /**
1407
- * Returns translations for the MatchX/Quiz game UI.
1408
- * Translations are returned as a key-value map for the Gamification and RetentionGames areas,
1409
- * resolved to the current user's language.
1410
- *
1411
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
1412
- *
1413
- * **Response** `GamesApiResponse<any>`:
1414
- * - `errCode` - 0 on success
1415
- * - `data`:
1416
- * - `translations` - Key-value map of translation strings (e.g. `rgSubmitSelection`, `rgLeaderboardTitle`, `quizConfirmAnswer`, etc.)
1417
- * - `hash_code` - Hash for cache invalidation
1418
- * - `lang_code` - Resolved language code (e.g. 'EN')
1419
- *
1420
- * **Example**:
1421
- * ```
1422
- * _smartico.api.getGamePickTranslations({
1423
- * saw_template_id: 1083,
1424
- * }).then((result) => {
1425
- * const tr = result.data.translations;
1426
- * console.log(tr.rgSubmitSelection); // "Submit selection"
1427
- * console.log(tr.rgLeaderboardTitle); // "Leaderboard"
1428
- * });
1429
- * ```
1430
- *
1431
- * **Visitor mode: not supported**
1432
- */
1433
- public async getGamePickTranslations(props: GamePickRequestParams): Promise<GamesApiResponse<any>> {
1434
- if (!props.saw_template_id) {
1435
- throw new Error('saw_template_id is required');
1436
- }
1437
- return this.api.gpGetTranslations(props.saw_template_id);
1438
- }
1439
-
1440
1404
  /**
1441
1405
  * Returns round data with events and picks for a specific user (identified by their internal user ID).
1442
1406
  * Useful for viewing another user's predictions from the leaderboard.
1443
- * The `int_user_id` can be obtained from the `getGamePickBoard` response (`users[].int_user_id`).
1407
+ * The `int_user_id` can be obtained from the `gamePickGetBoard` response (`users[].int_user_id`).
1444
1408
  *
1445
1409
  * @param props.saw_template_id - The ID of the MatchX or Quiz game template
1446
1410
  * @param props.round_id - The round to get info for
@@ -1449,13 +1413,13 @@ export class WSAPI {
1449
1413
  * **Response** `GamesApiResponse<GamePickRound>`:
1450
1414
  * - `errCode` - 0 on success
1451
1415
  * - `data` - Round object with the target user's selections.
1452
- * Same structure as `getGamePickActiveRound`, but `user_selection`/`team1_user_selection`/`team2_user_selection`
1416
+ * Same structure as `gamePickGetActiveRound`, but `user_selection`/`team1_user_selection`/`team2_user_selection`
1453
1417
  * fields on events reflect the specified user's picks instead of the current user's.
1454
1418
  * Events also include `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) showing how each prediction was scored
1455
1419
  *
1456
1420
  * **Example**:
1457
1421
  * ```
1458
- * _smartico.api.getGamePickRoundInfoForUser({
1422
+ * _smartico.api.gamePickGetRoundInfoForUser({
1459
1423
  * saw_template_id: 1083,
1460
1424
  * round_id: 31652,
1461
1425
  * int_user_id: 65653810,
@@ -1468,7 +1432,7 @@ export class WSAPI {
1468
1432
  *
1469
1433
  * **Visitor mode: not supported**
1470
1434
  */
1471
- public async getGamePickRoundInfoForUser(props: GamePickRoundRequestParams & { int_user_id: number }): Promise<GamesApiResponse<GamePickRound>> {
1435
+ public async gamePickGetRoundInfoForUser(props: GamePickRoundRequestParams & { int_user_id: number }): Promise<GamesApiResponse<GamePickRound>> {
1472
1436
  if (!props.saw_template_id) {
1473
1437
  throw new Error('saw_template_id is required');
1474
1438
  }