@smartico/public-api 0.0.262 → 0.0.264

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 (36) hide show
  1. package/dist/Core/GetAchievementsUserInfoResponse.d.ts +2 -0
  2. package/dist/Core/PublicProperties.d.ts +2 -0
  3. package/dist/Jackpots/GetJackpotWinnersRequest.d.ts +1 -1
  4. package/dist/MiniGames/SAWUtils.d.ts +1 -1
  5. package/dist/Raffle/GetDrawRunResponse.d.ts +1 -1
  6. package/dist/Raffle/GetRaffleDrawRunsHistoryResponse.d.ts +1 -1
  7. package/dist/Raffle/GetRafflesResponse.d.ts +1 -1
  8. package/dist/Raffle/RaffleClaimPrizeResponse.d.ts +1 -1
  9. package/dist/SmarticoLib/index.d.ts +13 -3
  10. package/dist/Tournaments/TournamentRegistrationType.d.ts +4 -2
  11. package/dist/WSAPI/WSAPI.d.ts +1 -1
  12. package/dist/WSAPI/WSAPITypes.d.ts +11 -3
  13. package/dist/index.js +27 -13
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.modern.mjs +29 -13
  16. package/dist/index.modern.mjs.map +1 -1
  17. package/docs/README.md +1 -1
  18. package/docs/interfaces/TMiniGameTemplate.md +17 -1
  19. package/docs/interfaces/TTournament.md +17 -1
  20. package/docs/interfaces/TTournamentDetailed.md +25 -1
  21. package/package.json +1 -1
  22. package/src/Core/GetAchievementsUserInfoResponse.ts +2 -0
  23. package/src/Core/PublicProperties.ts +2 -0
  24. package/src/Jackpots/GetJackpotWinnersRequest.ts +1 -1
  25. package/src/MiniGames/SAWGetTemplatesResponse.ts +4 -2
  26. package/src/MiniGames/SAWUtils.ts +4 -4
  27. package/src/Raffle/GetDrawRunResponse.ts +1 -1
  28. package/src/Raffle/GetRaffleDrawRunsHistoryResponse.ts +1 -1
  29. package/src/Raffle/GetRafflesResponse.ts +1 -2
  30. package/src/Raffle/RaffleClaimPrizeResponse.ts +1 -1
  31. package/src/SmarticoLib/index.ts +13 -1
  32. package/src/Tournaments/Tournament.ts +3 -1
  33. package/src/Tournaments/TournamentRegistrationType.ts +6 -0
  34. package/src/Tournaments/TournamentUtils.ts +9 -7
  35. package/src/WSAPI/WSAPI.ts +1 -1
  36. package/src/WSAPI/WSAPITypes.ts +12 -3
@@ -263,7 +263,7 @@ const SAWBuyInTypeNamed = type => {
263
263
  };
264
264
 
265
265
  class SAWUtils {}
266
- SAWUtils.canPlay = (t, user) => {
266
+ SAWUtils.canPlay = (t, user_balances) => {
267
267
  if (t === null || t === undefined) {
268
268
  return false;
269
269
  }
@@ -280,11 +280,11 @@ SAWUtils.canPlay = (t, user) => {
280
280
  case SAWBuyInType.Gems:
281
281
  case SAWBuyInType.Diamonds:
282
282
  {
283
- let balance = user.ach_points_balance;
283
+ let balance = user_balances.ach_points_balance;
284
284
  if (t.saw_buyin_type_id === SAWBuyInType.Gems) {
285
- balance = user.ach_gems_balance;
285
+ balance = user_balances.ach_gems_balance;
286
286
  } else if (t.saw_buyin_type_id === SAWBuyInType.Diamonds) {
287
- balance = user.ach_diamonds_balance;
287
+ balance = user_balances.ach_diamonds_balance;
288
288
  }
289
289
  return t.buyin_cost_points <= balance;
290
290
  }
@@ -414,7 +414,7 @@ const MiniGamePrizeTypeNamed = type => {
414
414
  const SAWTemplatesTransform = items => {
415
415
  return items.map(r => {
416
416
  var _r$saw_skin_ui_defini;
417
- const x = {
417
+ const x = _extends({
418
418
  id: r.saw_template_id,
419
419
  name: r.saw_template_ui_definition.name,
420
420
  description: r.saw_template_ui_definition.description,
@@ -423,8 +423,14 @@ const SAWTemplatesTransform = items => {
423
423
  no_attempts_message: r.saw_template_ui_definition.no_attempts_message,
424
424
  jackpot_symbol: r.saw_template_ui_definition.jackpot_symbol,
425
425
  saw_game_type: SAWGameTypeNamed(r.saw_game_type_id),
426
- saw_buyin_type: SAWBuyInTypeNamed(r.saw_buyin_type_id),
427
- buyin_cost_points: r.buyin_cost_points,
426
+ saw_buyin_type: SAWBuyInTypeNamed(r.saw_buyin_type_id)
427
+ }, r.saw_buyin_type_id === SAWBuyInType.Points ? {
428
+ buyin_cost_points: r.buyin_cost_points
429
+ } : {}, r.saw_buyin_type_id === SAWBuyInType.Gems ? {
430
+ buyin_cost_gems: r.buyin_cost_points
431
+ } : {}, r.saw_buyin_type_id === SAWBuyInType.Diamonds ? {
432
+ buyin_cost_diamonds: r.buyin_cost_points
433
+ } : {}, {
428
434
  jackpot_add_on_attempt: r.jackpot_add_on_attempt,
429
435
  jackpot_current: r.jackpot_current,
430
436
  spin_count: r.spin_count,
@@ -476,7 +482,7 @@ const SAWTemplatesTransform = items => {
476
482
  };
477
483
  return y;
478
484
  })
479
- };
485
+ });
480
486
  return x;
481
487
  });
482
488
  };
@@ -1327,6 +1333,8 @@ var TournamentRegistrationType;
1327
1333
  TournamentRegistrationType[TournamentRegistrationType["BUY_IN_POINTS"] = 3] = "BUY_IN_POINTS";
1328
1334
  TournamentRegistrationType[TournamentRegistrationType["MANUAL_APPROVAL"] = 4] = "MANUAL_APPROVAL";
1329
1335
  TournamentRegistrationType[TournamentRegistrationType["REQUIRES_QUALIFICATION"] = 5] = "REQUIRES_QUALIFICATION";
1336
+ TournamentRegistrationType[TournamentRegistrationType["BUY_IN_GEMS"] = 15] = "BUY_IN_GEMS";
1337
+ TournamentRegistrationType[TournamentRegistrationType["BUY_IN_DIAMONDS"] = 16] = "BUY_IN_DIAMONDS";
1330
1338
  // BUY_IN_CASH = 5???,
1331
1339
  })(TournamentRegistrationType || (TournamentRegistrationType = {}));
1332
1340
  /** @hidden */
@@ -1336,7 +1344,9 @@ const TournamentRegistrationTypeGetName = type => {
1336
1344
  [TournamentRegistrationType.BUY_IN_POINTS]: 'BUY_IN_POINTS',
1337
1345
  [TournamentRegistrationType.MANUAL_APPROVAL]: 'MANUAL_APPROVAL',
1338
1346
  [TournamentRegistrationType.OPT_IN]: 'OPT_IN',
1339
- [TournamentRegistrationType.REQUIRES_QUALIFICATION]: 'REQUIRES_QUALIFICATION'
1347
+ [TournamentRegistrationType.REQUIRES_QUALIFICATION]: 'REQUIRES_QUALIFICATION',
1348
+ [TournamentRegistrationType.BUY_IN_GEMS]: 'BUY_IN_GEMS',
1349
+ [TournamentRegistrationType.BUY_IN_DIAMONDS]: 'BUY_IN_DIAMONDS'
1340
1350
  }[type] || 'UNKNOWN';
1341
1351
  };
1342
1352
 
@@ -1377,7 +1387,7 @@ const TournamentRegistrationStatusNamed = type => {
1377
1387
 
1378
1388
  const TournamentItemsTransform = items => {
1379
1389
  return items.filter(r => r.tournamentId >= 1).map(r => {
1380
- const x = {
1390
+ const x = _extends({
1381
1391
  instance_id: r.tournamentInstanceId,
1382
1392
  tournament_id: r.tournamentId,
1383
1393
  name: r.publicMeta.name,
@@ -1400,8 +1410,14 @@ const TournamentItemsTransform = items => {
1400
1410
  players_min_count: r.playersMinCount,
1401
1411
  players_max_count: r.playersMaxCount,
1402
1412
  registration_status: TournamentRegistrationStatusNamed(r.tournamentRegistrationStatus),
1403
- registration_type: TournamentRegistrationTypeGetName(r.registrationType),
1404
- registration_cost_points: r.buyInAmount,
1413
+ registration_type: TournamentRegistrationTypeGetName(r.registrationType)
1414
+ }, r.registrationType === TournamentRegistrationType.BUY_IN_POINTS ? {
1415
+ registration_cost_points: r.buyInAmount
1416
+ } : {}, r.registrationType === TournamentRegistrationType.BUY_IN_GEMS ? {
1417
+ registration_cost_gems: r.buyInAmount
1418
+ } : {}, r.registrationType === TournamentRegistrationType.BUY_IN_DIAMONDS ? {
1419
+ registration_cost_diamonds: r.buyInAmount
1420
+ } : {}, {
1405
1421
  duration_ms: r.durationMs,
1406
1422
  is_active: TournamentUtils.isActive(r),
1407
1423
  is_can_register: TournamentUtils.isCanRegister(r),
@@ -1411,7 +1427,7 @@ const TournamentItemsTransform = items => {
1411
1427
  is_upcoming: TournamentUtils.isUpcoming(r),
1412
1428
  min_scores_win: r.minScoreToWin,
1413
1429
  hide_leaderboard_min_scores: r.hideLeaderboardsMinScores
1414
- };
1430
+ });
1415
1431
  if (r.prizeStructure) {
1416
1432
  x.prizes = r.prizeStructure.prizes.map(p => TournamentUtils.getPrizeTransformed(p));
1417
1433
  }