@smartico/public-api 0.0.253 → 0.0.255
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/.github/workflows/semgrep.yml +26 -0
- package/dist/Base/ClassId.d.ts +2 -0
- package/dist/Jackpots/GetJackpotEligibleGamesRequest.d.ts +4 -0
- package/dist/Jackpots/GetJackpotEligibleGamesResponse.d.ts +34 -0
- package/dist/Jackpots/index.d.ts +2 -0
- package/dist/SmarticoAPI.d.ts +7 -0
- package/dist/WSAPI/WSAPI.d.ts +18 -0
- package/dist/index.js +262 -180
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +66 -1
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +4 -0
- package/docs/classes/WSAPI.md +29 -0
- package/docs/interfaces/GetJackpotEligibleGamesRequest.md +43 -0
- package/docs/interfaces/GetJackpotEligibleGamesResponse.md +63 -0
- package/docs/interfaces/JackpotEligibleGame.md +73 -0
- package/docs/interfaces/TGetJackpotEligibleGamesResponse.md +7 -0
- package/package.json +1 -1
- package/src/Base/ClassId.ts +3 -0
- package/src/Jackpots/GetJackpotEligibleGamesRequest.ts +5 -0
- package/src/Jackpots/GetJackpotEligibleGamesResponse.ts +50 -0
- package/src/Jackpots/index.ts +2 -0
- package/src/SmarticoAPI.ts +16 -2
- package/src/WSAPI/WSAPI.ts +30 -0
- package/dist/Quiz/MarketsAnswersType.d.ts +0 -22
- package/dist/Raffle/GetDrawResponse.d.ts +0 -5
- package/dist/SmarticoPublicAPI.d.ts +0 -23
- package/dist/Store/BuyShopItemErrorCode.d.ts +0 -10
- package/dist/Store/BuyShopItemRequest.d.ts +0 -4
- package/dist/Store/BuyShopItemResponse.d.ts +0 -4
- package/dist/Store/GetCategoriesShopResponse.d.ts +0 -5
- package/dist/Store/GetShopItemsResponse.d.ts +0 -5
- package/dist/Store/ShopCategory.d.ts +0 -5
- package/dist/Store/ShopCategoryPublicMeta.d.ts +0 -4
- package/dist/Store/ShopItem.d.ts +0 -9
- package/dist/Store/ShopItemPublicMeta.d.ts +0 -10
- package/dist/Store/ShopItemType.d.ts +0 -4
- package/dist/Store/StorItemPruchased.d.ts +0 -6
- package/dist/service/index.d.ts +0 -5
- package/dist/service/types/ErrorCodes.d.ts +0 -13
- package/dist/service/types/GRequest.d.ts +0 -16
- package/dist/service/types/GResponse.d.ts +0 -10
- package/dist/service/types/Game/GameAttemptType.d.ts +0 -6
- package/dist/service/types/Game/GameCanPlayType.d.ts +0 -10
- package/dist/service/types/Game/GameExternalStatus.d.ts +0 -6
- package/dist/service/types/Game/GameInfo.d.ts +0 -9
- package/dist/service/types/Game/GamePick.d.ts +0 -90
- package/dist/service/types/Game/GameUtil.d.ts +0 -7
- package/dist/service/types/SmarticoProto/GetTranslationsRequest.d.ts +0 -7
- package/dist/service/types/SmarticoProto/GetTranslationsResponse.d.ts +0 -7
- package/dist/service/types/SmarticoProto/ProtocolMessage.d.ts +0 -5
- package/dist/service/types/SmarticoProto/ProtocolRequest.d.ts +0 -6
- package/dist/service/types/SmarticoProto/ProtocolResponse.d.ts +0 -5
- package/dist/service/types/SmarticoProto/PublicLabelInfo.d.ts +0 -34
- package/dist/service/types/SmarticoProto/PublicProperties.d.ts +0 -11
- package/dist/service/types/SmarticoProto/ResponseIdentify.d.ts +0 -12
- package/dist/service/types/SmarticoProto/SAW/SAWAcknowledgeType.d.ts +0 -5
- package/dist/service/types/SmarticoProto/SAW/SAWBuyInType.d.ts +0 -5
- package/dist/service/types/SmarticoProto/SAW/SAWDoSpinRequest.d.ts +0 -5
- package/dist/service/types/SmarticoProto/SAW/SAWDoSpinResponse.d.ts +0 -15
- package/dist/service/types/SmarticoProto/SAW/SAWGameType.d.ts +0 -10
- package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.d.ts +0 -3
- package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.d.ts +0 -5
- package/dist/service/types/SmarticoProto/SAW/SAWPrize.d.ts +0 -11
- package/dist/service/types/SmarticoProto/SAW/SAWPrizeType.d.ts +0 -8
- package/dist/service/types/SmarticoProto/SAW/SAWPrizeUI.d.ts +0 -13
- package/dist/service/types/SmarticoProto/SAW/SAWTemplate.d.ts +0 -21
- package/dist/service/types/SmarticoProto/SAW/SAWTemplateUI.d.ts +0 -31
- package/dist/service/types/SmarticoProto/SAW/SAWWinSoundType.d.ts +0 -12
- package/dist/service/types/SmarticoProto/TranslationArea.d.ts +0 -9
- package/dist/service/types/User/UserInfo.d.ts +0 -10
- package/dist/util/Util.d.ts +0 -51
package/dist/index.modern.mjs
CHANGED
|
@@ -125,6 +125,8 @@ var ClassId;
|
|
|
125
125
|
ClassId[ClassId["JP_WIN_PUSH"] = 808] = "JP_WIN_PUSH";
|
|
126
126
|
ClassId[ClassId["JP_GET_WINNERS_REQUEST"] = 809] = "JP_GET_WINNERS_REQUEST";
|
|
127
127
|
ClassId[ClassId["JP_GET_WINNERS_RESPONSE"] = 810] = "JP_GET_WINNERS_RESPONSE";
|
|
128
|
+
ClassId[ClassId["JP_GET_ELIGIBLE_GAMES_REQUEST"] = 811] = "JP_GET_ELIGIBLE_GAMES_REQUEST";
|
|
129
|
+
ClassId[ClassId["JP_GET_ELIGIBLE_GAMES_RESPONSE"] = 812] = "JP_GET_ELIGIBLE_GAMES_RESPONSE";
|
|
128
130
|
ClassId[ClassId["RAF_GET_RAFFLES_REQUEST"] = 902] = "RAF_GET_RAFFLES_REQUEST";
|
|
129
131
|
ClassId[ClassId["RAF_GET_RAFFLES_RESPONSE"] = 903] = "RAF_GET_RAFFLES_RESPONSE";
|
|
130
132
|
ClassId[ClassId["RAF_GET_DRAW_RUN_REQUEST"] = 904] = "RAF_GET_DRAW_RUN_REQUEST";
|
|
@@ -1781,6 +1783,7 @@ const CACHE_DATA_SEC = 30;
|
|
|
1781
1783
|
const JACKPOT_TEMPLATE_CACHE_SEC = 30;
|
|
1782
1784
|
const JACKPOT_POT_CACHE_SEC = 1;
|
|
1783
1785
|
const JACKPOT_WINNERS_CACHE_SEC = 30;
|
|
1786
|
+
const JACKPOT_ELIGIBLE_GAMES_CACHE_SEC = 30;
|
|
1784
1787
|
/** @hidden */
|
|
1785
1788
|
var onUpdateContextKey;
|
|
1786
1789
|
(function (onUpdateContextKey) {
|
|
@@ -1804,6 +1807,7 @@ var onUpdateContextKey;
|
|
|
1804
1807
|
onUpdateContextKey["SAWHistory"] = "sawHistory";
|
|
1805
1808
|
onUpdateContextKey["JackpotWinners"] = "jackpotWinners";
|
|
1806
1809
|
onUpdateContextKey["Raffles"] = "raffles";
|
|
1810
|
+
onUpdateContextKey["JackpotEligibleGames"] = "jackpotEligibleGames";
|
|
1807
1811
|
})(onUpdateContextKey || (onUpdateContextKey = {}));
|
|
1808
1812
|
/** @group General API */
|
|
1809
1813
|
class WSAPI {
|
|
@@ -2626,6 +2630,30 @@ class WSAPI {
|
|
|
2626
2630
|
}) {
|
|
2627
2631
|
return OCache.use(onUpdateContextKey.JackpotWinners, ECacheContext.WSAPI, () => this.api.getJackpotWinnersT(null, limit, offset, jp_template_id), JACKPOT_WINNERS_CACHE_SEC);
|
|
2628
2632
|
}
|
|
2633
|
+
/**
|
|
2634
|
+
* Returns the eligible games for the jackpot with the specified jp_template_id.
|
|
2635
|
+
*
|
|
2636
|
+
* **Example**:
|
|
2637
|
+
* ```
|
|
2638
|
+
* _smartico.api.getJackpotEligibleGames({ jp_template_id: 123 }).then((result) => {
|
|
2639
|
+
* console.log(result);
|
|
2640
|
+
* });
|
|
2641
|
+
* ```
|
|
2642
|
+
*
|
|
2643
|
+
* **Visitor mode: not supported**
|
|
2644
|
+
*
|
|
2645
|
+
*/
|
|
2646
|
+
async getJackpotEligibleGames({
|
|
2647
|
+
jp_template_id,
|
|
2648
|
+
onUpdate
|
|
2649
|
+
}) {
|
|
2650
|
+
if (onUpdate) {
|
|
2651
|
+
this.onUpdateCallback.set(onUpdateContextKey.JackpotEligibleGames, onUpdate);
|
|
2652
|
+
}
|
|
2653
|
+
return OCache.use(onUpdateContextKey.JackpotEligibleGames + jp_template_id, ECacheContext.WSAPI, () => this.api.getJackpotEligibleGamesT(null, {
|
|
2654
|
+
jp_template_id
|
|
2655
|
+
}), JACKPOT_ELIGIBLE_GAMES_CACHE_SEC);
|
|
2656
|
+
}
|
|
2629
2657
|
/**
|
|
2630
2658
|
* Returns all the related tournaments and missions for the provided game id for the current user
|
|
2631
2659
|
* The provided Game ID should correspond to the ID from the Games Catalog - https://help.smartico.ai/welcome/technical-guides/games-catalog-api
|
|
@@ -2840,6 +2868,28 @@ const GetJackpotWinnersResponseTransform = items => {
|
|
|
2840
2868
|
});
|
|
2841
2869
|
};
|
|
2842
2870
|
|
|
2871
|
+
/**
|
|
2872
|
+
* @ignore
|
|
2873
|
+
*/
|
|
2874
|
+
const GetJackpotEligibleGamesResponseTransform = ({
|
|
2875
|
+
eligible_games
|
|
2876
|
+
}) => {
|
|
2877
|
+
const games = eligible_games.map(game => ({
|
|
2878
|
+
game_id: game.ach_game_id,
|
|
2879
|
+
ext_game_id: game.ext_game_id,
|
|
2880
|
+
name: game.game_public_meta.name,
|
|
2881
|
+
link: game.game_public_meta.link,
|
|
2882
|
+
image: game.game_public_meta.image,
|
|
2883
|
+
enabled: game.game_public_meta.enabled,
|
|
2884
|
+
game_categories: game.game_public_meta.game_categories,
|
|
2885
|
+
game_provider: game.game_public_meta.game_provider,
|
|
2886
|
+
mobile_spec_link: game.game_public_meta.mobile_spec_link
|
|
2887
|
+
}));
|
|
2888
|
+
return {
|
|
2889
|
+
eligible_games: games
|
|
2890
|
+
};
|
|
2891
|
+
};
|
|
2892
|
+
|
|
2843
2893
|
const PUBLIC_API_URL = 'https://papi{ENV_ID}.smartico.ai/services/public';
|
|
2844
2894
|
const C_SOCKET_PROD = 'wss://api{ENV_ID}.smartico.ai/websocket/services';
|
|
2845
2895
|
const AVATAR_DOMAIN = 'https://img{ENV_ID}.smr.vc';
|
|
@@ -3099,6 +3149,21 @@ class SmarticoAPI {
|
|
|
3099
3149
|
async getJackpotWinnersT(user_ext_id, limit = 20, offset = 0, jp_template_id) {
|
|
3100
3150
|
return GetJackpotWinnersResponseTransform((await this.getJackpotWinners(user_ext_id, limit, offset, jp_template_id)).winners);
|
|
3101
3151
|
}
|
|
3152
|
+
async getJackpotEligibleGames(user_ext_id, {
|
|
3153
|
+
jp_template_id
|
|
3154
|
+
}) {
|
|
3155
|
+
const message = this.buildMessage(user_ext_id, ClassId.JP_GET_ELIGIBLE_GAMES_REQUEST, {
|
|
3156
|
+
jp_template_id
|
|
3157
|
+
});
|
|
3158
|
+
return await this.send(message, ClassId.JP_GET_ELIGIBLE_GAMES_RESPONSE);
|
|
3159
|
+
}
|
|
3160
|
+
async getJackpotEligibleGamesT(user_ext_id, {
|
|
3161
|
+
jp_template_id
|
|
3162
|
+
}) {
|
|
3163
|
+
return GetJackpotEligibleGamesResponseTransform(await this.getJackpotEligibleGames(user_ext_id, {
|
|
3164
|
+
jp_template_id
|
|
3165
|
+
}));
|
|
3166
|
+
}
|
|
3102
3167
|
async sawGetTemplates(user_ext_id, force_language, is_visitor_mode = false) {
|
|
3103
3168
|
const message = this.buildMessage(user_ext_id, ClassId.SAW_GET_SPINS_REQUEST, {
|
|
3104
3169
|
is_visitor_mode
|
|
@@ -3917,5 +3982,5 @@ var JackpotType;
|
|
|
3917
3982
|
JackpotType[JackpotType["Personal"] = 2] = "Personal";
|
|
3918
3983
|
})(JackpotType || (JackpotType = {}));
|
|
3919
3984
|
|
|
3920
|
-
export { AchCategoryTransform, AchievementAvailabilityStatus, AchievementStatus, AchievementTaskType, AchievementType, ActivityTypeLimited, BonusItemsTransform, BonusStatus, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, GetJackpotWinnersResponseTransform, GetLevelMapResponseTransform, InboxCategories, InboxMessageBodyTransform, InboxMessageType, InboxMessagesTransform, JackpotContributionType, JackpotType, LeaderBoardPeriodType, MiniGamePrizeTypeName, MiniGamePrizeTypeNamed, OCache, OpenLinksType, PrizeModifiers, PrizeModifiersKeysNames, PublicLabelSettings, QuizAnswersValueType, QuizMarketPerSport, QuizSportType, SAWAcknowledgeType, SAWAcknowledgeTypeName, SAWAcknowledgeTypeNamed, SAWAskForUsername, SAWBuyInType, SAWBuyInTypeName, SAWBuyInTypeNamed, SAWGPMarketType, SAWGameLayout, SAWGameType, SAWGameTypeName, SAWGameTypeNamed, SAWHistoryTransform, SAWPrizeType, SAWSpinErrorCode, SAWTemplatesTransform, SAWUtils, SAWWheelLayout, SAWWinSoundFiles, SAWWinSoundType, ScheduledMissionType, SmarticoAPI, StoreCategoryTransform, StoreItemPurchaseType, StoreItemPurchasedTransform, StoreItemTransform, StoreItemType, StoreItemTypeName, StoreItemTypeNamed, TournamentInstanceStatus, TournamentInstanceStatusName, TournamentItemsTransform, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationStatusName, TournamentRegistrationStatusNamed, TournamentRegistrationType, TournamentRegistrationTypeGetName, TournamentType, TournamentUtils, TranslationArea, UserAchievementTransform, getLeaderBoardTransform, marketsInfo, quizAnswerAwayTeamReplacementText, quizAnswerHomeTeamReplacementText, quizAnswersTrKeys, quizDrawReplacementText, quizEvenReplacementText, quizNoGoalsReplacementText, quizNoReplacementText, quizOddReplacementText, quizOrReplacementText, quizSupportedSports, quizYesReplacementText, tournamentInfoItemTransform };
|
|
3985
|
+
export { AchCategoryTransform, AchievementAvailabilityStatus, AchievementStatus, AchievementTaskType, AchievementType, ActivityTypeLimited, BonusItemsTransform, BonusStatus, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, GetJackpotEligibleGamesResponseTransform, GetJackpotWinnersResponseTransform, GetLevelMapResponseTransform, InboxCategories, InboxMessageBodyTransform, InboxMessageType, InboxMessagesTransform, JackpotContributionType, JackpotType, LeaderBoardPeriodType, MiniGamePrizeTypeName, MiniGamePrizeTypeNamed, OCache, OpenLinksType, PrizeModifiers, PrizeModifiersKeysNames, PublicLabelSettings, QuizAnswersValueType, QuizMarketPerSport, QuizSportType, SAWAcknowledgeType, SAWAcknowledgeTypeName, SAWAcknowledgeTypeNamed, SAWAskForUsername, SAWBuyInType, SAWBuyInTypeName, SAWBuyInTypeNamed, SAWGPMarketType, SAWGameLayout, SAWGameType, SAWGameTypeName, SAWGameTypeNamed, SAWHistoryTransform, SAWPrizeType, SAWSpinErrorCode, SAWTemplatesTransform, SAWUtils, SAWWheelLayout, SAWWinSoundFiles, SAWWinSoundType, ScheduledMissionType, SmarticoAPI, StoreCategoryTransform, StoreItemPurchaseType, StoreItemPurchasedTransform, StoreItemTransform, StoreItemType, StoreItemTypeName, StoreItemTypeNamed, TournamentInstanceStatus, TournamentInstanceStatusName, TournamentItemsTransform, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationStatusName, TournamentRegistrationStatusNamed, TournamentRegistrationType, TournamentRegistrationTypeGetName, TournamentType, TournamentUtils, TranslationArea, UserAchievementTransform, getLeaderBoardTransform, marketsInfo, quizAnswerAwayTeamReplacementText, quizAnswerHomeTeamReplacementText, quizAnswersTrKeys, quizDrawReplacementText, quizEvenReplacementText, quizNoGoalsReplacementText, quizNoReplacementText, quizOddReplacementText, quizOrReplacementText, quizSupportedSports, quizYesReplacementText, tournamentInfoItemTransform };
|
|
3921
3986
|
//# sourceMappingURL=index.modern.mjs.map
|