@smartico/public-api 0.0.431 → 0.0.433
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/Base/ClassId.d.ts +2 -0
- package/dist/Core/TermsAndConditionsRequest.d.ts +12 -0
- package/dist/Core/TermsAndConditionsResponse.d.ts +14 -0
- package/dist/Core/index.d.ts +2 -0
- package/dist/Jackpots/GetJackpotWinnersResponse.d.ts +28 -0
- package/dist/SmarticoAPI.d.ts +2 -1
- package/dist/SmarticoLib/index.d.ts +3 -0
- package/dist/WSAPI/WSAPIJackpots.d.ts +76 -0
- package/dist/WSAPI/WSAPITypes.d.ts +3 -0
- package/dist/index.js +392 -279
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +96 -2
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/README.md +3 -0
- package/docs/api/classes/WSAPIJackpots.md +100 -0
- package/docs/api/interfaces/GetJackpotWinnersResponse.md +8 -0
- package/docs/api/interfaces/JackpotWin.md +25 -0
- package/docs/api/interfaces/JackpotWinStats.md +25 -0
- package/docs/api/interfaces/TGetJackpotWinStatsResponse.md +17 -0
- package/docs/capabilities/getJackpotWinStats.md +111 -0
- package/docs/ui/user/UIGuide_getUserProfile.md +3 -2
- package/package.json +1 -1
- package/src/Base/ClassId.ts +3 -0
- package/src/Core/TermsAndConditionsRequest.ts +13 -0
- package/src/Core/TermsAndConditionsResponse.ts +15 -0
- package/src/Core/index.ts +2 -0
- package/src/Jackpots/GetJackpotWinnersResponse.ts +41 -0
- package/src/Missions/MissionsUtils.ts +2 -1
- package/src/SmarticoAPI.ts +11 -1
- package/src/SmarticoLib/index.ts +3 -0
- package/src/WSAPI/WSAPIJackpots.ts +89 -0
- package/src/WSAPI/WSAPITypes.ts +3 -0
package/dist/index.modern.mjs
CHANGED
|
@@ -166,6 +166,8 @@ var ClassId;
|
|
|
166
166
|
ClassId[ClassId["BNR_GET_BANNER_PLACEMENTS_RESPONSE"] = 951] = "BNR_GET_BANNER_PLACEMENTS_RESPONSE";
|
|
167
167
|
ClassId[ClassId["BNR_GET_BANNER_CONTENT_REQUEST"] = 952] = "BNR_GET_BANNER_CONTENT_REQUEST";
|
|
168
168
|
ClassId[ClassId["BNR_GET_BANNER_CONTENT_RESPONSE"] = 953] = "BNR_GET_BANNER_CONTENT_RESPONSE";
|
|
169
|
+
ClassId[ClassId["TERMS_AND_CONDITIONS_REQUEST"] = 954] = "TERMS_AND_CONDITIONS_REQUEST";
|
|
170
|
+
ClassId[ClassId["TERMS_AND_CONDITIONS_RESPONSE"] = 955] = "TERMS_AND_CONDITIONS_RESPONSE";
|
|
169
171
|
/*
|
|
170
172
|
!Important, if adding new messages that are 'acting' on behalf of the client,
|
|
171
173
|
you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION
|
|
@@ -1299,7 +1301,7 @@ var BadgesTimeLimitStates;
|
|
|
1299
1301
|
|
|
1300
1302
|
var _MissionUtils;
|
|
1301
1303
|
const USER_STATE_PARAMS_KEYS_GAMES = ['core_fav_game_top3', 'core_fav_game_type_top3', 'core_fav_game_provider_top3'];
|
|
1302
|
-
const USER_STATE_PARAMS_KEYS_BET_AMOUNT = ['core_recommended_deposit_amount', 'core_recommended_casino_bet_amount'];
|
|
1304
|
+
const USER_STATE_PARAMS_KEYS_BET_AMOUNT = ['core_recommended_deposit_amount', 'core_recommended_casino_bet_amount', 'core_recommended_sport_bet_amount'];
|
|
1303
1305
|
const MINOR_WORDS = new Set(['of', 'at', 'in', 'on', 'to', 'up', 'as', 'by', 'for', 'from', 'into', 'onto', 'with', 'upon', 'via', 'and', 'but', 'or', 'nor', 'so', 'yet', 'vs', 'v', 'a', 'an', 'the']);
|
|
1304
1306
|
function toGameTitleCase(raw) {
|
|
1305
1307
|
if (!raw) return raw;
|
|
@@ -6060,6 +6062,81 @@ class WSAPIJackpots extends WSAPIClans {
|
|
|
6060
6062
|
const cacheKey = `${onUpdateContextKey.JackpotWinners}${jp_template_id}:${limit}:${offset}`;
|
|
6061
6063
|
return OCache.use(cacheKey, ECacheContext.WSAPI, () => this.api.getJackpotWinnersT(this.userExtId, limit, offset, jp_template_id), JACKPOT_WINNERS_CACHE_SEC);
|
|
6062
6064
|
}
|
|
6065
|
+
/**
|
|
6066
|
+
* Returns past winners of a specific jackpot template, paginated, together
|
|
6067
|
+
* with the win statistics of that template: total number of wins, the
|
|
6068
|
+
* biggest win and the most recent win. Use it for a jackpot info modal /
|
|
6069
|
+
* tooltip that shows "Total wins", "Highest win" and "Latest win" next to
|
|
6070
|
+
* the winners list.
|
|
6071
|
+
*
|
|
6072
|
+
* @remarks
|
|
6073
|
+
* **Preconditions**
|
|
6074
|
+
* - User must be authenticated. Visitor mode not supported.
|
|
6075
|
+
* - `jp_template_id` is mandatory.
|
|
6076
|
+
* - The consumer SHOULD check
|
|
6077
|
+
* `JackpotDetails.expose_winners_over_api` before calling, since
|
|
6078
|
+
* the server does not enforce it.
|
|
6079
|
+
*
|
|
6080
|
+
* **Statistics**
|
|
6081
|
+
* - `win_stats` describes the whole jackpot template and does not depend
|
|
6082
|
+
* on `limit` / `offset`. Pass `limit: 1` when only the statistics are needed.
|
|
6083
|
+
* - Only issued wins are counted — a pot that exploded but still waits for
|
|
6084
|
+
* manual approval is not included.
|
|
6085
|
+
* - `highest_win` / `last_win` are `null` while the jackpot has no wins,
|
|
6086
|
+
* `total_wins` is `0` in that case.
|
|
6087
|
+
* - `public_username` of `highest_win` / `last_win` is masked by the same
|
|
6088
|
+
* label setting as the winners list, and is `null` when the template
|
|
6089
|
+
* doesn't expose winners over API.
|
|
6090
|
+
* - The server refreshes the statistics once per minute.
|
|
6091
|
+
*
|
|
6092
|
+
* **Currency caveat**
|
|
6093
|
+
* All amounts (`win_stats.*.winning_amount`,
|
|
6094
|
+
* `winners[].winner.winning_amount_jp_currency`) are in the jackpot's
|
|
6095
|
+
* NATIVE currency, NOT the user's wallet currency.
|
|
6096
|
+
*
|
|
6097
|
+
* **Refresh**
|
|
6098
|
+
* - The SDK caches each page separately (per `jp_template_id` +
|
|
6099
|
+
* `limit` + `offset`) for 30 seconds.
|
|
6100
|
+
* - Caches clear on jackpot-win push events and on opt-in / opt-out.
|
|
6101
|
+
*
|
|
6102
|
+
* **Error handling**
|
|
6103
|
+
* Non-zero `errCode` on control-group users or generic server errors. The
|
|
6104
|
+
* SDK does NOT enumerate distinct codes — branch on `errCode === 0` and
|
|
6105
|
+
* surface `errMsg` on failure.
|
|
6106
|
+
*
|
|
6107
|
+
* **Visitor mode**: not supported.
|
|
6108
|
+
*
|
|
6109
|
+
* @returns {@link TGetJackpotWinStatsResponse} —
|
|
6110
|
+
* `{ winners: JackpotWinnerHistory[], win_stats: JackpotWinStats }`.
|
|
6111
|
+
*
|
|
6112
|
+
* @example
|
|
6113
|
+
* ```ts
|
|
6114
|
+
* const [jp] = await window._smartico.api.jackpotGet({ jp_template_id: 42 });
|
|
6115
|
+
*
|
|
6116
|
+
* if (!jp || !jp.expose_winners_over_api) {
|
|
6117
|
+
* console.log('[smartico] winners hidden by operator config — hide the stats');
|
|
6118
|
+
* return;
|
|
6119
|
+
* }
|
|
6120
|
+
*
|
|
6121
|
+
* const { winners, win_stats } = await window._smartico.api.getJackpotWinStats({
|
|
6122
|
+
* jp_template_id: 42,
|
|
6123
|
+
* limit: 10,
|
|
6124
|
+
* offset: 0,
|
|
6125
|
+
* });
|
|
6126
|
+
* console.log('[smartico] total wins', win_stats.total_wins);
|
|
6127
|
+
* console.log('[smartico] highest win', win_stats.highest_win?.winning_amount, jp.jp_currency);
|
|
6128
|
+
* console.log('[smartico] latest win', win_stats.last_win?.public_username, win_stats.last_win?.win_date_ts);
|
|
6129
|
+
* console.log('[smartico] render', winners.length, 'recent winner rows');
|
|
6130
|
+
* ```
|
|
6131
|
+
*/
|
|
6132
|
+
async getJackpotWinStats({
|
|
6133
|
+
limit,
|
|
6134
|
+
offset,
|
|
6135
|
+
jp_template_id
|
|
6136
|
+
}) {
|
|
6137
|
+
const cacheKey = `${onUpdateContextKey.JackpotWinners}stats:${jp_template_id}:${limit}:${offset}`;
|
|
6138
|
+
return OCache.use(cacheKey, ECacheContext.WSAPI, () => this.api.getJackpotWinStatsT(this.userExtId, limit, offset, jp_template_id), JACKPOT_WINNERS_CACHE_SEC);
|
|
6139
|
+
}
|
|
6063
6140
|
/**
|
|
6064
6141
|
* Returns the casino games eligible to contribute to a specific jackpot —
|
|
6065
6142
|
* the catalog the user must play to grow the pot. Use to power an
|
|
@@ -9808,6 +9885,20 @@ const GetJackpotWinnersResponseTransform = items => {
|
|
|
9808
9885
|
return winnerInfo;
|
|
9809
9886
|
});
|
|
9810
9887
|
};
|
|
9888
|
+
/**
|
|
9889
|
+
* @ignore
|
|
9890
|
+
*/
|
|
9891
|
+
const GetJackpotWinStatsResponseTransform = response => {
|
|
9892
|
+
var _response$winners, _response$win_stats$t, _response$win_stats, _response$win_stats$h, _response$win_stats2, _response$win_stats$l, _response$win_stats3;
|
|
9893
|
+
return {
|
|
9894
|
+
winners: GetJackpotWinnersResponseTransform((_response$winners = response.winners) != null ? _response$winners : []),
|
|
9895
|
+
win_stats: {
|
|
9896
|
+
total_wins: (_response$win_stats$t = (_response$win_stats = response.win_stats) == null ? void 0 : _response$win_stats.total_wins) != null ? _response$win_stats$t : 0,
|
|
9897
|
+
highest_win: (_response$win_stats$h = (_response$win_stats2 = response.win_stats) == null ? void 0 : _response$win_stats2.highest_win) != null ? _response$win_stats$h : null,
|
|
9898
|
+
last_win: (_response$win_stats$l = (_response$win_stats3 = response.win_stats) == null ? void 0 : _response$win_stats3.last_win) != null ? _response$win_stats$l : null
|
|
9899
|
+
}
|
|
9900
|
+
};
|
|
9901
|
+
};
|
|
9811
9902
|
|
|
9812
9903
|
/**
|
|
9813
9904
|
* @ignore
|
|
@@ -10144,6 +10235,9 @@ class SmarticoAPI {
|
|
|
10144
10235
|
async getJackpotWinnersT(user_ext_id, limit = 20, offset = 0, jp_template_id) {
|
|
10145
10236
|
return GetJackpotWinnersResponseTransform((await this.getJackpotWinners(user_ext_id, limit, offset, jp_template_id)).winners);
|
|
10146
10237
|
}
|
|
10238
|
+
async getJackpotWinStatsT(user_ext_id, limit = 20, offset = 0, jp_template_id) {
|
|
10239
|
+
return GetJackpotWinStatsResponseTransform(await this.getJackpotWinners(user_ext_id, limit, offset, jp_template_id));
|
|
10240
|
+
}
|
|
10147
10241
|
async getJackpotEligibleGames(user_ext_id, {
|
|
10148
10242
|
jp_template_id
|
|
10149
10243
|
}) {
|
|
@@ -11641,5 +11735,5 @@ var JoinClanErrorCode;
|
|
|
11641
11735
|
JoinClanErrorCode[JoinClanErrorCode["JOIN_CLAN_JOINED_AFTER_TOURNAMENT_START"] = 1011] = "JOIN_CLAN_JOINED_AFTER_TOURNAMENT_START";
|
|
11642
11736
|
})(JoinClanErrorCode || (JoinClanErrorCode = {}));
|
|
11643
11737
|
|
|
11644
|
-
export { AchCategoryTransform, AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter, AchievementAvailabilityStatus, AchievementClaimPeriodTypeId, AchievementStatus, AchievementTaskType, AchievementType, ActivityLogActivities, ActivityLogTransform, ActivityTypeLimited, AllRoundsGameBoardID, AnalyticsInboxSubScreenNameId, AnalyticsInterfaceType, AnalyticsScreenNameId, AnalyticsTournamentsLobbySubScreenNameId, AttemptPeriodType, AvatarCustomizeErrorCode, BadgesTimeLimitStates, BonusItemsTransform, BonusStatus, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, GPRoundStatus, GamePickMarketType, GamePickResolutionType, GamePickScoreType, GamePickSportType, GameRoundOrderType, GetJackpotEligibleGamesResponseTransform, GetJackpotWinnersResponseTransform, GetLevelMapResponseTransform, InboxCategories, InboxMessageBodyTransform, InboxMessageType, InboxMessagesTransform, InboxReadStatus, JackPotTemparature, JackpotContributionType, JackpotType, JoinClanErrorCode, LeaderBoardPeriodType, LiquidEntityData, MiniGamePrizeTypeName, MiniGamePrizeTypeNamed, MissionCategory, MissionUtils, OCache, OpenLinksType, PointChangeSourceType, PrizeModifiers, PrizeModifiersKeysNames, PublicLabelSettings, QuizAnswersValueType, QuizMarketPerSport, QuizSportType, RaffleDrawInstanceState, RaffleDrawTypeExecution, RaffleTicketCapVisualization, SAWAcknowledgeType, SAWAcknowledgeTypeName, SAWAcknowledgeTypeNamed, SAWAskForUsername, SAWBuyInType, SAWBuyInTypeName, SAWBuyInTypeNamed, SAWExposeUserSpinId, SAWExposeUserSpinIdName, SAWExposeUserSpinIdNamed, SAWGPMarketType, SAWGameDifficultyType, SAWGameDifficultyTypeName, SAWGameLayout, SAWGameLayoutName, SAWGameLayoutNamed, SAWGameType, SAWGameTypeName, SAWGameTypeNamed, SAWHistoryTransform, SAWPrizeType, SAWSpinErrorCode, SAWTemplatesTransform, SAWUtils, SAWWheelLayout, SAWWinSoundFiles, SAWWinSoundType, SawGameDifficultyTypeNamed, ScheduledMissionType, SmarticoAPI, StoreCategoryTransform, StoreItemPurchaseType, StoreItemPurchasedTransform, StoreItemTransform, StoreItemType, StoreItemTypeName, StoreItemTypeNamed, TournamentInstanceStatus, TournamentInstanceStatusName, TournamentItemsTransform, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationStatusName, TournamentRegistrationStatusNamed, TournamentRegistrationType, TournamentRegistrationTypeGetName, TournamentType, TournamentUtils, TranslationArea, UICustomSectionTransform, UserAchievementTransform, UserBalanceType, WSAPI, avatarCustomizedTransform, avatarDefinitionTransform, avatarPromptTransform, clanTournamentPlayersTransform, drawRunHistoryTransform, drawRunTransform, drawTransform, enrichUserAchievementsWithBadgeState, getLeaderBoardTransform, marketsInfo, prizeTransform, quizAnswerAwayTeamReplacementText, quizAnswerHomeTeamReplacementText, quizAnswersTrKeys, quizDrawReplacementText, quizEvenReplacementText, quizNoGoalsReplacementText, quizNoReplacementText, quizOddReplacementText, quizOrReplacementText, quizSupportedSports, quizYesReplacementText, raffleClaimPrizeResponseTransform, raffleTransform, ticketsTransform, tournamentInfoItemTransform, winnersTransform };
|
|
11738
|
+
export { AchCategoryTransform, AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter, AchievementAvailabilityStatus, AchievementClaimPeriodTypeId, AchievementStatus, AchievementTaskType, AchievementType, ActivityLogActivities, ActivityLogTransform, ActivityTypeLimited, AllRoundsGameBoardID, AnalyticsInboxSubScreenNameId, AnalyticsInterfaceType, AnalyticsScreenNameId, AnalyticsTournamentsLobbySubScreenNameId, AttemptPeriodType, AvatarCustomizeErrorCode, BadgesTimeLimitStates, BonusItemsTransform, BonusStatus, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, GPRoundStatus, GamePickMarketType, GamePickResolutionType, GamePickScoreType, GamePickSportType, GameRoundOrderType, GetJackpotEligibleGamesResponseTransform, GetJackpotWinStatsResponseTransform, GetJackpotWinnersResponseTransform, GetLevelMapResponseTransform, InboxCategories, InboxMessageBodyTransform, InboxMessageType, InboxMessagesTransform, InboxReadStatus, JackPotTemparature, JackpotContributionType, JackpotType, JoinClanErrorCode, LeaderBoardPeriodType, LiquidEntityData, MiniGamePrizeTypeName, MiniGamePrizeTypeNamed, MissionCategory, MissionUtils, OCache, OpenLinksType, PointChangeSourceType, PrizeModifiers, PrizeModifiersKeysNames, PublicLabelSettings, QuizAnswersValueType, QuizMarketPerSport, QuizSportType, RaffleDrawInstanceState, RaffleDrawTypeExecution, RaffleTicketCapVisualization, SAWAcknowledgeType, SAWAcknowledgeTypeName, SAWAcknowledgeTypeNamed, SAWAskForUsername, SAWBuyInType, SAWBuyInTypeName, SAWBuyInTypeNamed, SAWExposeUserSpinId, SAWExposeUserSpinIdName, SAWExposeUserSpinIdNamed, SAWGPMarketType, SAWGameDifficultyType, SAWGameDifficultyTypeName, SAWGameLayout, SAWGameLayoutName, SAWGameLayoutNamed, SAWGameType, SAWGameTypeName, SAWGameTypeNamed, SAWHistoryTransform, SAWPrizeType, SAWSpinErrorCode, SAWTemplatesTransform, SAWUtils, SAWWheelLayout, SAWWinSoundFiles, SAWWinSoundType, SawGameDifficultyTypeNamed, ScheduledMissionType, SmarticoAPI, StoreCategoryTransform, StoreItemPurchaseType, StoreItemPurchasedTransform, StoreItemTransform, StoreItemType, StoreItemTypeName, StoreItemTypeNamed, TournamentInstanceStatus, TournamentInstanceStatusName, TournamentItemsTransform, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationStatusName, TournamentRegistrationStatusNamed, TournamentRegistrationType, TournamentRegistrationTypeGetName, TournamentType, TournamentUtils, TranslationArea, UICustomSectionTransform, UserAchievementTransform, UserBalanceType, WSAPI, avatarCustomizedTransform, avatarDefinitionTransform, avatarPromptTransform, clanTournamentPlayersTransform, drawRunHistoryTransform, drawRunTransform, drawTransform, enrichUserAchievementsWithBadgeState, getLeaderBoardTransform, marketsInfo, prizeTransform, quizAnswerAwayTeamReplacementText, quizAnswerHomeTeamReplacementText, quizAnswersTrKeys, quizDrawReplacementText, quizEvenReplacementText, quizNoGoalsReplacementText, quizNoReplacementText, quizOddReplacementText, quizOrReplacementText, quizSupportedSports, quizYesReplacementText, raffleClaimPrizeResponseTransform, raffleTransform, ticketsTransform, tournamentInfoItemTransform, winnersTransform };
|
|
11645
11739
|
//# sourceMappingURL=index.modern.mjs.map
|