@smartico/public-api 0.0.279 → 0.0.281

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 (68) hide show
  1. package/dist/MiniGames/SAWBuyInType.d.ts +0 -1
  2. package/dist/MiniGames/SAWGameType.d.ts +0 -1
  3. package/dist/MiniGames/SAWPrizeType.d.ts +0 -1
  4. package/dist/MiniGames/SAWTemplateUI.d.ts +1 -0
  5. package/dist/Missions/index.d.ts +1 -0
  6. package/dist/SmarticoLib/index.d.ts +1 -0
  7. package/dist/Tournaments/Tournament.d.ts +3 -2
  8. package/dist/Tournaments/TournamentRegistrationStatus.d.ts +0 -1
  9. package/dist/Tournaments/TournamentRegistrationType.d.ts +0 -1
  10. package/dist/WSAPI/WSAPITypes.d.ts +26 -1
  11. package/dist/index.js +57 -62
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.modern.mjs +53 -58
  14. package/dist/index.modern.mjs.map +1 -1
  15. package/docs/README.md +103 -0
  16. package/docs/classes/SAWUtils.md +27 -0
  17. package/docs/classes/WSAPI.md +5 -2
  18. package/docs/enums/AchCustomLayoutTheme.md +25 -0
  19. package/docs/enums/AchMissionsTabsOptions.md +19 -0
  20. package/docs/enums/AchOverviewMissionsFilter.md +31 -0
  21. package/docs/enums/BonusStatus-1.md +49 -0
  22. package/docs/enums/BonusStatus.md +37 -0
  23. package/docs/enums/SAWAcknowledgeType.md +25 -0
  24. package/docs/enums/SAWBuyInType.md +31 -0
  25. package/docs/enums/SAWGameType.md +61 -0
  26. package/docs/enums/SAWPrizeType.md +61 -0
  27. package/docs/enums/SAWWheelLayout.md +25 -0
  28. package/docs/enums/SAWWinSoundType.md +31 -0
  29. package/docs/enums/TournamentRegistrationStatus.md +43 -0
  30. package/docs/enums/TournamentRegistrationType.md +43 -0
  31. package/docs/interfaces/BonusMetaMap.md +9 -0
  32. package/docs/interfaces/BonusTemplateMetaMap.md +25 -0
  33. package/docs/interfaces/SAWAcknowledgeSpinPushRequest.md +79 -0
  34. package/docs/interfaces/SAWDoAknowledgeRequest.md +43 -0
  35. package/docs/interfaces/SAWDoAknowledgeResponse.md +43 -0
  36. package/docs/interfaces/SAWDoSpinRequest.md +79 -0
  37. package/docs/interfaces/SAWDoSpinResponse.md +87 -0
  38. package/docs/interfaces/SAWEventSawPush.md +55 -0
  39. package/docs/interfaces/SAWGetTemplatesRequest.md +79 -0
  40. package/docs/interfaces/SAWGetTemplatesResponse.md +63 -0
  41. package/docs/interfaces/SAWPrize.md +107 -0
  42. package/docs/interfaces/SAWPrizeDropAknowledgeRequest.md +55 -0
  43. package/docs/interfaces/SAWPrizeDropAknowledgeResponse.md +43 -0
  44. package/docs/interfaces/SAWPrizeDropWinPush.md +67 -0
  45. package/docs/interfaces/SAWPrizeUI.md +157 -0
  46. package/docs/interfaces/SAWPrizesHistory.md +49 -0
  47. package/docs/interfaces/SAWSpinsCountPush.md +49 -0
  48. package/docs/interfaces/SAWTemplate.md +154 -0
  49. package/docs/interfaces/SAWTemplateUI.md +7 -1
  50. package/docs/interfaces/SAWWinningHistoryRequest.md +61 -0
  51. package/docs/interfaces/SAWWinningHistoryResponse.md +69 -0
  52. package/docs/interfaces/TBonus.md +3 -3
  53. package/docs/interfaces/TSawHistory.md +1 -1
  54. package/docs/interfaces/TUICustomSection.md +3 -3
  55. package/package.json +1 -1
  56. package/src/MiniGames/SAWBuyInType.ts +0 -1
  57. package/src/MiniGames/SAWGameType.ts +0 -2
  58. package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -1
  59. package/src/MiniGames/SAWPrizeType.ts +0 -1
  60. package/src/MiniGames/SAWTemplateUI.ts +1 -0
  61. package/src/Missions/index.ts +1 -0
  62. package/src/SmarticoLib/index.ts +1 -0
  63. package/src/Tournaments/Tournament.ts +4 -2
  64. package/src/Tournaments/TournamentRegistrationStatus.ts +0 -1
  65. package/src/Tournaments/TournamentRegistrationType.ts +0 -1
  66. package/src/WSAPI/WSAPI.ts +1 -16
  67. package/src/WSAPI/WSAPITypes.ts +30 -6
  68. package/tsconfig.json +4 -5
@@ -1,4 +1,3 @@
1
- /** @hidden */
2
1
  export declare enum SAWBuyInType {
3
2
  Free = 1,
4
3
  Points = 2,
@@ -1,4 +1,3 @@
1
- /** @hidden */
2
1
  export declare enum SAWGameType {
3
2
  SpinAWheel = 1,
4
3
  ScratchCard = 2,
@@ -1,4 +1,3 @@
1
- /** @hidden */
2
1
  export declare enum SAWPrizeType {
3
2
  NO_PRIZE = 1,
4
3
  POINTS = 2,
@@ -33,6 +33,7 @@ export interface SAWTemplateUI {
33
33
  matchx_is_completed?: boolean;
34
34
  matchx_general_board_users_count?: number;
35
35
  matchx_hide_ranking?: boolean;
36
+ prize_pool_image?: string;
36
37
  ask_for_username?: SAWAskForUsername;
37
38
  show_prize_board?: boolean;
38
39
  max_spins_period_ms?: number;
@@ -18,3 +18,4 @@ export * from './GetAchCategoriesRequest';
18
18
  export * from './AchClaimPrizeRequest';
19
19
  export * from './AchClaimPrizeResponse';
20
20
  export * from './AchievementAvailabilityStatus';
21
+ export * from './GetRelatedAchTourResponse';
@@ -412,6 +412,7 @@ export interface SAWTemplateUI {
412
412
  matchx_is_completed?: boolean;
413
413
  matchx_general_board_users_count?: number;
414
414
  matchx_hide_ranking?: boolean;
415
+ prize_pool_image?: string;
415
416
  ask_for_username?: SAWAskForUsername;
416
417
  show_prize_board?: boolean;
417
418
  max_spins_period_ms?: number;
@@ -4,7 +4,8 @@ import { TournamentRegistrationStatus } from './TournamentRegistrationStatus';
4
4
  import { TournamentType } from './TournamentType';
5
5
  import { TournamentPublicMeta } from './TournamentPublicMeta';
6
6
  import { TTournament } from '../WSAPI/WSAPITypes';
7
- import { TournamentPlayer, TournamentPrize } from '.';
7
+ import { TournamentPlayer } from './TournamentPlayer';
8
+ import { TournamentPrize } from './TournamentPrize';
8
9
  import { AchRelatedGame } from '../Base/AchRelatedGame';
9
10
  export interface Tournament {
10
11
  /** ID of tournament template */
@@ -57,7 +58,7 @@ export interface Tournament {
57
58
  related_games?: AchRelatedGame[];
58
59
  /** The minimum amount of score points that the user should get in order to be qualified for the prize */
59
60
  minScoreToWin?: number;
60
- /** When enabled, users who dont meet the minimum qualifying score will be hidden from the Leaderboard. */
61
+ /** When enabled, users who don't meet the minimum qualifying score will be hidden from the Leaderboard. */
61
62
  hideLeaderboardsMinScores?: boolean;
62
63
  }
63
64
  export declare const TournamentItemsTransform: (items: Tournament[]) => TTournament[];
@@ -1,4 +1,3 @@
1
- /** @hidden */
2
1
  export declare enum TournamentRegistrationStatus {
3
2
  NOT_REGISTERED = 0,
4
3
  REGISTERED = 1,
@@ -1,4 +1,3 @@
1
- /** @hidden */
2
1
  export declare enum TournamentRegistrationType {
3
2
  AUTO = 1,
4
3
  OPT_IN = 2,
@@ -4,7 +4,6 @@ import { TournamentRegistrationError, TournamentRegistrationStatusName, Tourname
4
4
  import { AchievementAvailabilityStatus } from '../Missions';
5
5
  import { LeaderBoardPeriodType } from '../Leaderboard';
6
6
  import { AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter } from '../CustomSections';
7
- import { BonusStatus, BonusTemplateMetaMap, BonusMetaMap } from '../Bonuses';
8
7
  import { PrizeModifiers } from '../MiniGames/PrizeModifiers';
9
8
  import { InboxCategories } from '../Inbox/InboxCategories';
10
9
  import { RaffleDrawInstanceState, RaffleDrawTypeExecution } from '../Raffle';
@@ -781,6 +780,32 @@ export interface TBonus {
781
780
  /** Additional information presented to the player when the bonus is redeemed */
782
781
  bonus_meta_map?: BonusMetaMap;
783
782
  }
783
+ export declare enum BonusStatus {
784
+ /** The bonus is newly created (shouldn't be shown to the client) */
785
+ New = 1,
786
+ /** The bonus is issued and available for redemption but has not been redeemed yet */
787
+ COUPON_ISSUED = 2,
788
+ /** The bonus has been successfully redeemed */
789
+ REDEEMED = 3,
790
+ /** The bonus is still valid, but a previous redemption attempt failed */
791
+ REDEEM_FAILED = 4,
792
+ /** Failed to issue the bonus (shouldn't be shown to the client) */
793
+ COUPON_ISSUE_FAILED = 5,
794
+ /** The bonus was issued but has expired and can no longer be redeemed (shouldn't be shown to the client) */
795
+ EXPIRED = 6
796
+ }
797
+ export interface BonusTemplateMetaMap {
798
+ /** Description of the bonus template*/
799
+ description: string;
800
+ /** Acknowledge message setup in the bonus template*/
801
+ acknowledge: string;
802
+ /** Image URL of the bonus template*/
803
+ image_url: string;
804
+ }
805
+ export interface BonusMetaMap {
806
+ /** Label and description of the bonus sent to the player*/
807
+ uiAmount?: string;
808
+ }
784
809
  /**
785
810
  * TClaimBonusResult describes the response of call to _smartico.api.claimBonus(bonus_id) method
786
811
  */
package/dist/index.js CHANGED
@@ -266,7 +266,6 @@ IntUtils.isWithinPeriod = function (timestamp, period) {
266
266
  }
267
267
  };
268
268
 
269
- /** @hidden */
270
269
  exports.SAWBuyInType = void 0;
271
270
  (function (SAWBuyInType) {
272
271
  SAWBuyInType[SAWBuyInType["Free"] = 1] = "Free";
@@ -350,7 +349,6 @@ exports.SAWAskForUsername = void 0;
350
349
  SAWAskForUsername["ONSUMBIT"] = "on-submit";
351
350
  })(exports.SAWAskForUsername || (exports.SAWAskForUsername = {}));
352
351
 
353
- /** @hidden */
354
352
  exports.SAWGameType = void 0;
355
353
  (function (SAWGameType) {
356
354
  SAWGameType[SAWGameType["SpinAWheel"] = 1] = "SpinAWheel";
@@ -384,7 +382,6 @@ var SAWGameTypeNamed = function SAWGameTypeNamed(type) {
384
382
  return (_SAWGameType$SpinAWhe = {}, _SAWGameType$SpinAWhe[exports.SAWGameType.SpinAWheel] = exports.SAWGameTypeName.SpinAWheel, _SAWGameType$SpinAWhe[exports.SAWGameType.ScratchCard] = exports.SAWGameTypeName.ScratchCard, _SAWGameType$SpinAWhe[exports.SAWGameType.MatchX] = exports.SAWGameTypeName.MatchX, _SAWGameType$SpinAWhe[exports.SAWGameType.GiftBox] = exports.SAWGameTypeName.GiftBox, _SAWGameType$SpinAWhe[exports.SAWGameType.PrizeDrop] = exports.SAWGameTypeName.PrizeDrop, _SAWGameType$SpinAWhe[exports.SAWGameType.Quiz] = exports.SAWGameTypeName.Quiz, _SAWGameType$SpinAWhe[exports.SAWGameType.LootboxWeekdays] = exports.SAWGameTypeName.LootboxWeekdays, _SAWGameType$SpinAWhe[exports.SAWGameType.LootboxCalendarDays] = exports.SAWGameTypeName.LootboxCalendarDays, _SAWGameType$SpinAWhe[exports.SAWGameType.TreasureHunt] = exports.SAWGameTypeName.TreasureHunt, _SAWGameType$SpinAWhe[exports.SAWGameType.Voyager] = exports.SAWGameTypeName.Voyager, _SAWGameType$SpinAWhe)[type] || exports.SAWGameTypeName.Unknown;
385
383
  };
386
384
 
387
- /** @hidden */
388
385
  exports.SAWPrizeType = void 0;
389
386
  (function (SAWPrizeType) {
390
387
  SAWPrizeType[SAWPrizeType["NO_PRIZE"] = 1] = "NO_PRIZE";
@@ -1360,7 +1357,6 @@ var AchCategoryTransform = function AchCategoryTransform(items) {
1360
1357
  });
1361
1358
  };
1362
1359
 
1363
- /** @hidden */
1364
1360
  exports.TournamentRegistrationType = void 0;
1365
1361
  (function (TournamentRegistrationType) {
1366
1362
  TournamentRegistrationType[TournamentRegistrationType["AUTO"] = 1] = "AUTO";
@@ -1378,7 +1374,6 @@ var TournamentRegistrationTypeGetName = function TournamentRegistrationTypeGetNa
1378
1374
  return (_TournamentRegistrati = {}, _TournamentRegistrati[exports.TournamentRegistrationType.AUTO] = 'AUTO', _TournamentRegistrati[exports.TournamentRegistrationType.BUY_IN_POINTS] = 'BUY_IN_POINTS', _TournamentRegistrati[exports.TournamentRegistrationType.MANUAL_APPROVAL] = 'MANUAL_APPROVAL', _TournamentRegistrati[exports.TournamentRegistrationType.OPT_IN] = 'OPT_IN', _TournamentRegistrati[exports.TournamentRegistrationType.REQUIRES_QUALIFICATION] = 'REQUIRES_QUALIFICATION', _TournamentRegistrati[exports.TournamentRegistrationType.BUY_IN_GEMS] = 'BUY_IN_GEMS', _TournamentRegistrati[exports.TournamentRegistrationType.BUY_IN_DIAMONDS] = 'BUY_IN_DIAMONDS', _TournamentRegistrati)[type] || 'UNKNOWN';
1379
1375
  };
1380
1376
 
1381
- /** @hidden */
1382
1377
  exports.TournamentRegistrationStatus = void 0;
1383
1378
  (function (TournamentRegistrationStatus) {
1384
1379
  TournamentRegistrationStatus[TournamentRegistrationStatus["NOT_REGISTERED"] = 0] = "NOT_REGISTERED";
@@ -1406,63 +1401,6 @@ var TournamentRegistrationStatusNamed = function TournamentRegistrationStatusNam
1406
1401
  return (_TournamentRegistrati = {}, _TournamentRegistrati[exports.TournamentRegistrationStatus.CANCELLED] = exports.TournamentRegistrationStatusName.CANCELLED, _TournamentRegistrati[exports.TournamentRegistrationStatus.FINISHED] = exports.TournamentRegistrationStatusName.FINISHED, _TournamentRegistrati[exports.TournamentRegistrationStatus.NOT_REGISTERED] = exports.TournamentRegistrationStatusName.NOT_REGISTERED, _TournamentRegistrati[exports.TournamentRegistrationStatus.PENDING] = exports.TournamentRegistrationStatusName.PENDING, _TournamentRegistrati[exports.TournamentRegistrationStatus.QUALIFIED_PENDING_REGISTRATION] = exports.TournamentRegistrationStatusName.QUALIFIED_PENDING_REGISTRATION, _TournamentRegistrati[exports.TournamentRegistrationStatus.REGISTERED] = exports.TournamentRegistrationStatusName.REGISTERED, _TournamentRegistrati[exports.TournamentRegistrationStatus.REGISTERED_PENDING_QUALIFICATION] = exports.TournamentRegistrationStatusName.REGISTERED_PENDING_QUALIFICATION, _TournamentRegistrati)[type] || exports.TournamentRegistrationStatusName.UNKNOWN;
1407
1402
  };
1408
1403
 
1409
- var TournamentItemsTransform = function TournamentItemsTransform(items) {
1410
- return items.filter(function (r) {
1411
- return r.tournamentId >= 1;
1412
- }).map(function (r) {
1413
- var x = _extends({
1414
- instance_id: r.tournamentInstanceId,
1415
- tournament_id: r.tournamentId,
1416
- name: r.publicMeta.name,
1417
- description: r.publicMeta.description,
1418
- segment_dont_match_message: r.publicMeta.segment_dont_match_message,
1419
- image1: r.publicMeta.image_url,
1420
- image2: r.publicMeta.image_url2,
1421
- image2_mobile: r.publicMeta.image_url2_mobile,
1422
- prize_pool_short: r.publicMeta.prize_pool_short,
1423
- custom_price_text: r.publicMeta.custom_price_text,
1424
- custom_section_id: r.publicMeta.custom_section_id,
1425
- custom_data: IntUtils.JsonOrText(r.publicMeta.custom_data),
1426
- is_featured: r.publicMeta.featured,
1427
- ribbon: r.publicMeta.label_tag === 'custom' ? r.publicMeta.custom_label_tag : r.publicMeta.label_tag,
1428
- priority: r.publicMeta.position,
1429
- start_time: r.startTimeTs,
1430
- end_time: r.endTimeTs,
1431
- registration_count: r.registrationCount,
1432
- is_user_registered: r.isUserRegistered,
1433
- players_min_count: r.playersMinCount,
1434
- players_max_count: r.playersMaxCount,
1435
- registration_status: TournamentRegistrationStatusNamed(r.tournamentRegistrationStatus),
1436
- registration_type: TournamentRegistrationTypeGetName(r.registrationType)
1437
- }, r.registrationType === exports.TournamentRegistrationType.BUY_IN_POINTS ? {
1438
- registration_cost_points: r.buyInAmount
1439
- } : {}, r.registrationType === exports.TournamentRegistrationType.BUY_IN_GEMS ? {
1440
- registration_cost_gems: r.buyInAmount
1441
- } : {}, r.registrationType === exports.TournamentRegistrationType.BUY_IN_DIAMONDS ? {
1442
- registration_cost_diamonds: r.buyInAmount
1443
- } : {}, {
1444
- duration_ms: r.durationMs,
1445
- is_active: TournamentUtils.isActive(r),
1446
- is_can_register: TournamentUtils.isCanRegister(r),
1447
- is_cancelled: TournamentUtils.isCancelled(r),
1448
- is_finished: TournamentUtils.isFinished(r),
1449
- is_in_progress: TournamentUtils.isInProgress(r),
1450
- is_upcoming: TournamentUtils.isUpcoming(r),
1451
- min_scores_win: r.minScoreToWin,
1452
- hide_leaderboard_min_scores: r.hideLeaderboardsMinScores
1453
- });
1454
- if (r.prizeStructure) {
1455
- x.prizes = r.prizeStructure.prizes.map(function (p) {
1456
- return TournamentUtils.getPrizeTransformed(p);
1457
- });
1458
- }
1459
- if (r.tournamentPlayer) {
1460
- x.me = TournamentUtils.getPlayerTransformed(r.tournamentPlayer, true);
1461
- }
1462
- return x;
1463
- });
1464
- };
1465
-
1466
1404
  exports.TournamentInstanceStatus = void 0;
1467
1405
  (function (TournamentInstanceStatus) {
1468
1406
  TournamentInstanceStatus[TournamentInstanceStatus["PUBLISHED"] = 1] = "PUBLISHED";
@@ -1547,6 +1485,63 @@ TournamentUtils.getPrizeTransformed = function (prize) {
1547
1485
  return null;
1548
1486
  };
1549
1487
 
1488
+ var TournamentItemsTransform = function TournamentItemsTransform(items) {
1489
+ return items.filter(function (r) {
1490
+ return r.tournamentId >= 1;
1491
+ }).map(function (r) {
1492
+ var x = _extends({
1493
+ instance_id: r.tournamentInstanceId,
1494
+ tournament_id: r.tournamentId,
1495
+ name: r.publicMeta.name,
1496
+ description: r.publicMeta.description,
1497
+ segment_dont_match_message: r.publicMeta.segment_dont_match_message,
1498
+ image1: r.publicMeta.image_url,
1499
+ image2: r.publicMeta.image_url2,
1500
+ image2_mobile: r.publicMeta.image_url2_mobile,
1501
+ prize_pool_short: r.publicMeta.prize_pool_short,
1502
+ custom_price_text: r.publicMeta.custom_price_text,
1503
+ custom_section_id: r.publicMeta.custom_section_id,
1504
+ custom_data: IntUtils.JsonOrText(r.publicMeta.custom_data),
1505
+ is_featured: r.publicMeta.featured,
1506
+ ribbon: r.publicMeta.label_tag === 'custom' ? r.publicMeta.custom_label_tag : r.publicMeta.label_tag,
1507
+ priority: r.publicMeta.position,
1508
+ start_time: r.startTimeTs,
1509
+ end_time: r.endTimeTs,
1510
+ registration_count: r.registrationCount,
1511
+ is_user_registered: r.isUserRegistered,
1512
+ players_min_count: r.playersMinCount,
1513
+ players_max_count: r.playersMaxCount,
1514
+ registration_status: TournamentRegistrationStatusNamed(r.tournamentRegistrationStatus),
1515
+ registration_type: TournamentRegistrationTypeGetName(r.registrationType)
1516
+ }, r.registrationType === exports.TournamentRegistrationType.BUY_IN_POINTS ? {
1517
+ registration_cost_points: r.buyInAmount
1518
+ } : {}, r.registrationType === exports.TournamentRegistrationType.BUY_IN_GEMS ? {
1519
+ registration_cost_gems: r.buyInAmount
1520
+ } : {}, r.registrationType === exports.TournamentRegistrationType.BUY_IN_DIAMONDS ? {
1521
+ registration_cost_diamonds: r.buyInAmount
1522
+ } : {}, {
1523
+ duration_ms: r.durationMs,
1524
+ is_active: TournamentUtils.isActive(r),
1525
+ is_can_register: TournamentUtils.isCanRegister(r),
1526
+ is_cancelled: TournamentUtils.isCancelled(r),
1527
+ is_finished: TournamentUtils.isFinished(r),
1528
+ is_in_progress: TournamentUtils.isInProgress(r),
1529
+ is_upcoming: TournamentUtils.isUpcoming(r),
1530
+ min_scores_win: r.minScoreToWin,
1531
+ hide_leaderboard_min_scores: r.hideLeaderboardsMinScores
1532
+ });
1533
+ if (r.prizeStructure) {
1534
+ x.prizes = r.prizeStructure.prizes.map(function (p) {
1535
+ return TournamentUtils.getPrizeTransformed(p);
1536
+ });
1537
+ }
1538
+ if (r.tournamentPlayer) {
1539
+ x.me = TournamentUtils.getPlayerTransformed(r.tournamentPlayer, true);
1540
+ }
1541
+ return x;
1542
+ });
1543
+ };
1544
+
1550
1545
  var tournamentInfoItemTransform = function tournamentInfoItemTransform(t) {
1551
1546
  var response = _extends({}, TournamentItemsTransform([t.tournamentInfo.tournamentLobbyInfo])[0], {
1552
1547
  related_games: (t.tournamentInfo.tournamentLobbyInfo.related_games || []).map(function (g) {