@smartico/public-api 0.0.246 → 0.0.248
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/Leaderboard/index.d.ts +1 -0
- package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
- package/dist/MiniGames/SAWSpinErrorCode.d.ts +3 -1
- package/dist/Raffle/RaffleDrawPublicMeta.d.ts +2 -0
- package/dist/Raffle/RafflePrizeWinner.d.ts +1 -0
- package/dist/WSAPI/WSAPITypes.d.ts +2 -0
- package/dist/index.js +54 -58
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +50 -55
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Leaderboard/index.ts +1 -0
- package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -0
- package/src/MiniGames/SAWPrizeUI.ts +1 -0
- package/src/MiniGames/SAWSpinErrorCode.ts +2 -0
- package/src/Raffle/RaffleDrawPublicMeta.ts +2 -0
- package/src/Raffle/RafflePrizeWinner.ts +1 -0
- package/src/SmarticoAPI.ts +2 -11
- package/src/WSAPI/WSAPITypes.ts +2 -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
|
@@ -450,7 +450,8 @@ const SAWTemplatesTransform = items => {
|
|
|
450
450
|
custom_data: IntUtils.JsonOrText((_p$saw_prize_ui_defin = p.saw_prize_ui_definition) == null ? void 0 : _p$saw_prize_ui_defin.custom_data),
|
|
451
451
|
prize_modifiers: p.saw_prize_ui_definition.prize_modifiers,
|
|
452
452
|
allow_split_decimal: p.saw_prize_ui_definition.allow_split_decimal,
|
|
453
|
-
hide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history
|
|
453
|
+
hide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history,
|
|
454
|
+
requirements_to_get_prize: p.saw_prize_ui_definition.requirements_to_get_prize
|
|
454
455
|
};
|
|
455
456
|
return y;
|
|
456
457
|
})
|
|
@@ -478,6 +479,8 @@ var SAWSpinErrorCode;
|
|
|
478
479
|
SAWSpinErrorCode[SAWSpinErrorCode["SAW_TEMPLATE_NOT_ACTIVE"] = 40007] = "SAW_TEMPLATE_NOT_ACTIVE";
|
|
479
480
|
/** Special code for the 'visitor' mode */
|
|
480
481
|
SAWSpinErrorCode[SAWSpinErrorCode["SAW_VISITOR_STOP_SPIN_REQUEST"] = -40001] = "SAW_VISITOR_STOP_SPIN_REQUEST";
|
|
482
|
+
/** User is not in the segment */
|
|
483
|
+
SAWSpinErrorCode[SAWSpinErrorCode["SAW_NOT_IN_SEGMENT"] = 40009] = "SAW_NOT_IN_SEGMENT";
|
|
481
484
|
})(SAWSpinErrorCode || (SAWSpinErrorCode = {}));
|
|
482
485
|
|
|
483
486
|
var SAWWinSoundType;
|
|
@@ -1543,6 +1546,48 @@ var LeaderBoardPeriodType;
|
|
|
1543
1546
|
LeaderBoardPeriodType[LeaderBoardPeriodType["MONTHLY"] = 3] = "MONTHLY";
|
|
1544
1547
|
})(LeaderBoardPeriodType || (LeaderBoardPeriodType = {}));
|
|
1545
1548
|
|
|
1549
|
+
const pointsRewardTransform = reward_points => {
|
|
1550
|
+
if (reward_points && reward_points.length) {
|
|
1551
|
+
return reward_points.map((r, i) => ({
|
|
1552
|
+
place: i + 1,
|
|
1553
|
+
points: r
|
|
1554
|
+
}));
|
|
1555
|
+
}
|
|
1556
|
+
return null;
|
|
1557
|
+
};
|
|
1558
|
+
const getLeaderBoardPlayerTransformed = (user, isMe) => {
|
|
1559
|
+
if (user) {
|
|
1560
|
+
const x = {
|
|
1561
|
+
public_username: (user == null ? void 0 : user.public_username) || user.user_alt_name,
|
|
1562
|
+
avatar_url: user.avatar_url,
|
|
1563
|
+
position: user.position_in_board,
|
|
1564
|
+
points: user.points_accumulated,
|
|
1565
|
+
is_me: user.is_me
|
|
1566
|
+
};
|
|
1567
|
+
if (isMe) {
|
|
1568
|
+
delete x.is_me;
|
|
1569
|
+
}
|
|
1570
|
+
return x;
|
|
1571
|
+
}
|
|
1572
|
+
return null;
|
|
1573
|
+
};
|
|
1574
|
+
const getLeaderBoardTransform = board => {
|
|
1575
|
+
if (board) {
|
|
1576
|
+
const x = {
|
|
1577
|
+
board_id: board.board_id,
|
|
1578
|
+
name: board.board_public_meta.name,
|
|
1579
|
+
description: board.board_public_meta.description,
|
|
1580
|
+
rules: board.board_public_meta.rules,
|
|
1581
|
+
period_type_id: board.period_type_id,
|
|
1582
|
+
rewards: pointsRewardTransform(board.reward_points),
|
|
1583
|
+
users: board.positions.map(p => getLeaderBoardPlayerTransformed(p)),
|
|
1584
|
+
me: getLeaderBoardPlayerTransformed(board.userPosition, true)
|
|
1585
|
+
};
|
|
1586
|
+
return x;
|
|
1587
|
+
}
|
|
1588
|
+
return null;
|
|
1589
|
+
};
|
|
1590
|
+
|
|
1546
1591
|
const GetLevelMapResponseTransform = levels => {
|
|
1547
1592
|
return levels == null ? void 0 : levels.levels.map(l => {
|
|
1548
1593
|
var _l$level_public_meta;
|
|
@@ -2412,48 +2457,6 @@ class WSAPI {
|
|
|
2412
2457
|
}
|
|
2413
2458
|
}
|
|
2414
2459
|
|
|
2415
|
-
const pointsRewardTransform = reward_points => {
|
|
2416
|
-
if (reward_points && reward_points.length) {
|
|
2417
|
-
return reward_points.map((r, i) => ({
|
|
2418
|
-
place: i + 1,
|
|
2419
|
-
points: r
|
|
2420
|
-
}));
|
|
2421
|
-
}
|
|
2422
|
-
return null;
|
|
2423
|
-
};
|
|
2424
|
-
const getLeaderBoardPlayerTransformed = (user, isMe) => {
|
|
2425
|
-
if (user) {
|
|
2426
|
-
const x = {
|
|
2427
|
-
public_username: (user == null ? void 0 : user.public_username) || user.user_alt_name,
|
|
2428
|
-
avatar_url: user.avatar_url,
|
|
2429
|
-
position: user.position_in_board,
|
|
2430
|
-
points: user.points_accumulated,
|
|
2431
|
-
is_me: user.is_me
|
|
2432
|
-
};
|
|
2433
|
-
if (isMe) {
|
|
2434
|
-
delete x.is_me;
|
|
2435
|
-
}
|
|
2436
|
-
return x;
|
|
2437
|
-
}
|
|
2438
|
-
return null;
|
|
2439
|
-
};
|
|
2440
|
-
const getLeaderBoardTransform = board => {
|
|
2441
|
-
if (board) {
|
|
2442
|
-
const x = {
|
|
2443
|
-
board_id: board.board_id,
|
|
2444
|
-
name: board.board_public_meta.name,
|
|
2445
|
-
description: board.board_public_meta.description,
|
|
2446
|
-
rules: board.board_public_meta.rules,
|
|
2447
|
-
period_type_id: board.period_type_id,
|
|
2448
|
-
rewards: pointsRewardTransform(board.reward_points),
|
|
2449
|
-
users: board.positions.map(p => getLeaderBoardPlayerTransformed(p)),
|
|
2450
|
-
me: getLeaderBoardPlayerTransformed(board.userPosition, true)
|
|
2451
|
-
};
|
|
2452
|
-
return x;
|
|
2453
|
-
}
|
|
2454
|
-
return null;
|
|
2455
|
-
};
|
|
2456
|
-
|
|
2457
2460
|
var AchCustomSectionType;
|
|
2458
2461
|
(function (AchCustomSectionType) {
|
|
2459
2462
|
AchCustomSectionType[AchCustomSectionType["HTML_PAGE"] = 1] = "HTML_PAGE";
|
|
@@ -2624,14 +2627,9 @@ class SmarticoAPI {
|
|
|
2624
2627
|
return C_SOCKET_PROD.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
2625
2628
|
}
|
|
2626
2629
|
static getAvatarUrl(label_api_key) {
|
|
2627
|
-
|
|
2630
|
+
SmarticoAPI.getEnvDnsSuffix(label_api_key);
|
|
2628
2631
|
const avatarUrl = AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
2629
|
-
|
|
2630
|
-
if (envs.includes(envId)) {
|
|
2631
|
-
return SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);
|
|
2632
|
-
} else {
|
|
2633
|
-
return avatarUrl;
|
|
2634
|
-
}
|
|
2632
|
+
return SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);
|
|
2635
2633
|
}
|
|
2636
2634
|
async send(message, expectCID, force_language) {
|
|
2637
2635
|
if (this.logCIDs.includes(message.cid)) {
|
|
@@ -2644,11 +2642,8 @@ class SmarticoAPI {
|
|
|
2644
2642
|
try {
|
|
2645
2643
|
const timeStart = new Date().getTime();
|
|
2646
2644
|
result = await this.messageSender(message, this.publicUrl, expectCID);
|
|
2645
|
+
result = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);
|
|
2647
2646
|
const timeEnd = new Date().getTime();
|
|
2648
|
-
const envs = ['4', '5', '6', '7'];
|
|
2649
|
-
if (envs.includes(SmarticoAPI.getEnvDnsSuffix(this.label_api_key)) && result) {
|
|
2650
|
-
result = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);
|
|
2651
|
-
}
|
|
2652
2647
|
if (this.logHTTPTiming) {
|
|
2653
2648
|
this.logger.always('HTTP time, ms:' + (timeEnd - timeStart));
|
|
2654
2649
|
}
|
|
@@ -3613,5 +3608,5 @@ var JackpotType;
|
|
|
3613
3608
|
JackpotType[JackpotType["Personal"] = 2] = "Personal";
|
|
3614
3609
|
})(JackpotType || (JackpotType = {}));
|
|
3615
3610
|
|
|
3616
|
-
export { AchCategoryTransform, AchievementAvailabilityStatus, AchievementStatus, AchievementTaskType, AchievementType, ActivityTypeLimited, BonusItemsTransform, BonusStatus, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, 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, marketsInfo, quizAnswerAwayTeamReplacementText, quizAnswerHomeTeamReplacementText, quizAnswersTrKeys, quizDrawReplacementText, quizEvenReplacementText, quizNoGoalsReplacementText, quizNoReplacementText, quizOddReplacementText, quizOrReplacementText, quizSupportedSports, quizYesReplacementText, tournamentInfoItemTransform };
|
|
3611
|
+
export { AchCategoryTransform, AchievementAvailabilityStatus, AchievementStatus, AchievementTaskType, AchievementType, ActivityTypeLimited, BonusItemsTransform, BonusStatus, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, 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 };
|
|
3617
3612
|
//# sourceMappingURL=index.modern.mjs.map
|