@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
|
@@ -12,5 +12,7 @@ export declare enum SAWSpinErrorCode {
|
|
|
12
12
|
/** User tries to play a template that is restricted by date */
|
|
13
13
|
SAW_TEMPLATE_NOT_ACTIVE = 40007,
|
|
14
14
|
/** Special code for the 'visitor' mode */
|
|
15
|
-
SAW_VISITOR_STOP_SPIN_REQUEST = -40001
|
|
15
|
+
SAW_VISITOR_STOP_SPIN_REQUEST = -40001,
|
|
16
|
+
/** User is not in the segment */
|
|
17
|
+
SAW_NOT_IN_SEGMENT = 40009
|
|
16
18
|
}
|
|
@@ -9,6 +9,8 @@ export interface RaffleDrawPublicMeta {
|
|
|
9
9
|
icon_url: string;
|
|
10
10
|
/** URL of the background image that will be used in the draw list item */
|
|
11
11
|
background_image_url: string;
|
|
12
|
+
/** URL of the moible background image that will be used in the draw list item */
|
|
13
|
+
background_image_url_mobile: string;
|
|
12
14
|
/** Show if the draw is grand and is marked as special */
|
|
13
15
|
is_grand: boolean;
|
|
14
16
|
}
|
|
@@ -72,6 +72,8 @@ export interface TMiniGamePrize {
|
|
|
72
72
|
allow_split_decimal?: boolean;
|
|
73
73
|
/** When enabled, you can hide prize from prize history */
|
|
74
74
|
hide_prize_from_history?: boolean;
|
|
75
|
+
/** Requirements to claim the prize (lootbox specific)*/
|
|
76
|
+
requirements_to_get_prize?: string;
|
|
75
77
|
}
|
|
76
78
|
/**
|
|
77
79
|
* TMiniGamePlayResult describes the response of call to _smartico.api.playMiniGame(template_id) method
|
package/dist/index.js
CHANGED
|
@@ -458,7 +458,8 @@ var SAWTemplatesTransform = function SAWTemplatesTransform(items) {
|
|
|
458
458
|
custom_data: IntUtils.JsonOrText((_p$saw_prize_ui_defin = p.saw_prize_ui_definition) == null ? void 0 : _p$saw_prize_ui_defin.custom_data),
|
|
459
459
|
prize_modifiers: p.saw_prize_ui_definition.prize_modifiers,
|
|
460
460
|
allow_split_decimal: p.saw_prize_ui_definition.allow_split_decimal,
|
|
461
|
-
hide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history
|
|
461
|
+
hide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history,
|
|
462
|
+
requirements_to_get_prize: p.saw_prize_ui_definition.requirements_to_get_prize
|
|
462
463
|
};
|
|
463
464
|
return y;
|
|
464
465
|
})
|
|
@@ -486,6 +487,8 @@ exports.SAWSpinErrorCode = void 0;
|
|
|
486
487
|
SAWSpinErrorCode[SAWSpinErrorCode["SAW_TEMPLATE_NOT_ACTIVE"] = 40007] = "SAW_TEMPLATE_NOT_ACTIVE";
|
|
487
488
|
/** Special code for the 'visitor' mode */
|
|
488
489
|
SAWSpinErrorCode[SAWSpinErrorCode["SAW_VISITOR_STOP_SPIN_REQUEST"] = -40001] = "SAW_VISITOR_STOP_SPIN_REQUEST";
|
|
490
|
+
/** User is not in the segment */
|
|
491
|
+
SAWSpinErrorCode[SAWSpinErrorCode["SAW_NOT_IN_SEGMENT"] = 40009] = "SAW_NOT_IN_SEGMENT";
|
|
489
492
|
})(exports.SAWSpinErrorCode || (exports.SAWSpinErrorCode = {}));
|
|
490
493
|
|
|
491
494
|
var _SAWWinSoundFiles;
|
|
@@ -1553,6 +1556,52 @@ exports.LeaderBoardPeriodType = void 0;
|
|
|
1553
1556
|
LeaderBoardPeriodType[LeaderBoardPeriodType["MONTHLY"] = 3] = "MONTHLY";
|
|
1554
1557
|
})(exports.LeaderBoardPeriodType || (exports.LeaderBoardPeriodType = {}));
|
|
1555
1558
|
|
|
1559
|
+
var pointsRewardTransform = function pointsRewardTransform(reward_points) {
|
|
1560
|
+
if (reward_points && reward_points.length) {
|
|
1561
|
+
return reward_points.map(function (r, i) {
|
|
1562
|
+
return {
|
|
1563
|
+
place: i + 1,
|
|
1564
|
+
points: r
|
|
1565
|
+
};
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
return null;
|
|
1569
|
+
};
|
|
1570
|
+
var getLeaderBoardPlayerTransformed = function getLeaderBoardPlayerTransformed(user, isMe) {
|
|
1571
|
+
if (user) {
|
|
1572
|
+
var x = {
|
|
1573
|
+
public_username: (user == null ? void 0 : user.public_username) || user.user_alt_name,
|
|
1574
|
+
avatar_url: user.avatar_url,
|
|
1575
|
+
position: user.position_in_board,
|
|
1576
|
+
points: user.points_accumulated,
|
|
1577
|
+
is_me: user.is_me
|
|
1578
|
+
};
|
|
1579
|
+
if (isMe) {
|
|
1580
|
+
delete x.is_me;
|
|
1581
|
+
}
|
|
1582
|
+
return x;
|
|
1583
|
+
}
|
|
1584
|
+
return null;
|
|
1585
|
+
};
|
|
1586
|
+
var getLeaderBoardTransform = function getLeaderBoardTransform(board) {
|
|
1587
|
+
if (board) {
|
|
1588
|
+
var x = {
|
|
1589
|
+
board_id: board.board_id,
|
|
1590
|
+
name: board.board_public_meta.name,
|
|
1591
|
+
description: board.board_public_meta.description,
|
|
1592
|
+
rules: board.board_public_meta.rules,
|
|
1593
|
+
period_type_id: board.period_type_id,
|
|
1594
|
+
rewards: pointsRewardTransform(board.reward_points),
|
|
1595
|
+
users: board.positions.map(function (p) {
|
|
1596
|
+
return getLeaderBoardPlayerTransformed(p);
|
|
1597
|
+
}),
|
|
1598
|
+
me: getLeaderBoardPlayerTransformed(board.userPosition, true)
|
|
1599
|
+
};
|
|
1600
|
+
return x;
|
|
1601
|
+
}
|
|
1602
|
+
return null;
|
|
1603
|
+
};
|
|
1604
|
+
|
|
1556
1605
|
var GetLevelMapResponseTransform = function GetLevelMapResponseTransform(levels) {
|
|
1557
1606
|
return levels == null ? void 0 : levels.levels.map(function (l) {
|
|
1558
1607
|
var _l$level_public_meta;
|
|
@@ -2812,52 +2861,6 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2812
2861
|
return WSAPI;
|
|
2813
2862
|
}();
|
|
2814
2863
|
|
|
2815
|
-
var pointsRewardTransform = function pointsRewardTransform(reward_points) {
|
|
2816
|
-
if (reward_points && reward_points.length) {
|
|
2817
|
-
return reward_points.map(function (r, i) {
|
|
2818
|
-
return {
|
|
2819
|
-
place: i + 1,
|
|
2820
|
-
points: r
|
|
2821
|
-
};
|
|
2822
|
-
});
|
|
2823
|
-
}
|
|
2824
|
-
return null;
|
|
2825
|
-
};
|
|
2826
|
-
var getLeaderBoardPlayerTransformed = function getLeaderBoardPlayerTransformed(user, isMe) {
|
|
2827
|
-
if (user) {
|
|
2828
|
-
var x = {
|
|
2829
|
-
public_username: (user == null ? void 0 : user.public_username) || user.user_alt_name,
|
|
2830
|
-
avatar_url: user.avatar_url,
|
|
2831
|
-
position: user.position_in_board,
|
|
2832
|
-
points: user.points_accumulated,
|
|
2833
|
-
is_me: user.is_me
|
|
2834
|
-
};
|
|
2835
|
-
if (isMe) {
|
|
2836
|
-
delete x.is_me;
|
|
2837
|
-
}
|
|
2838
|
-
return x;
|
|
2839
|
-
}
|
|
2840
|
-
return null;
|
|
2841
|
-
};
|
|
2842
|
-
var getLeaderBoardTransform = function getLeaderBoardTransform(board) {
|
|
2843
|
-
if (board) {
|
|
2844
|
-
var x = {
|
|
2845
|
-
board_id: board.board_id,
|
|
2846
|
-
name: board.board_public_meta.name,
|
|
2847
|
-
description: board.board_public_meta.description,
|
|
2848
|
-
rules: board.board_public_meta.rules,
|
|
2849
|
-
period_type_id: board.period_type_id,
|
|
2850
|
-
rewards: pointsRewardTransform(board.reward_points),
|
|
2851
|
-
users: board.positions.map(function (p) {
|
|
2852
|
-
return getLeaderBoardPlayerTransformed(p);
|
|
2853
|
-
}),
|
|
2854
|
-
me: getLeaderBoardPlayerTransformed(board.userPosition, true)
|
|
2855
|
-
};
|
|
2856
|
-
return x;
|
|
2857
|
-
}
|
|
2858
|
-
return null;
|
|
2859
|
-
};
|
|
2860
|
-
|
|
2861
2864
|
var AchCustomSectionType;
|
|
2862
2865
|
(function (AchCustomSectionType) {
|
|
2863
2866
|
AchCustomSectionType[AchCustomSectionType["HTML_PAGE"] = 1] = "HTML_PAGE";
|
|
@@ -3049,14 +3052,9 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
3049
3052
|
return C_SOCKET_PROD.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
3050
3053
|
};
|
|
3051
3054
|
SmarticoAPI.getAvatarUrl = function getAvatarUrl(label_api_key) {
|
|
3052
|
-
|
|
3055
|
+
SmarticoAPI.getEnvDnsSuffix(label_api_key);
|
|
3053
3056
|
var avatarUrl = AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
3054
|
-
|
|
3055
|
-
if (envs.includes(envId)) {
|
|
3056
|
-
return SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);
|
|
3057
|
-
} else {
|
|
3058
|
-
return avatarUrl;
|
|
3059
|
-
}
|
|
3057
|
+
return SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);
|
|
3060
3058
|
};
|
|
3061
3059
|
var _proto = SmarticoAPI.prototype;
|
|
3062
3060
|
_proto.send = function send(message, expectCID, force_language) {
|
|
@@ -3116,11 +3114,8 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
3116
3114
|
var timeStart = new Date().getTime();
|
|
3117
3115
|
return Promise.resolve(_this.messageSender(message, _this.publicUrl, expectCID)).then(function (_this$messageSender) {
|
|
3118
3116
|
result = _this$messageSender;
|
|
3117
|
+
result = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);
|
|
3119
3118
|
var timeEnd = new Date().getTime();
|
|
3120
|
-
var envs = ['4', '5', '6', '7'];
|
|
3121
|
-
if (envs.includes(SmarticoAPI.getEnvDnsSuffix(_this.label_api_key)) && result) {
|
|
3122
|
-
result = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);
|
|
3123
|
-
}
|
|
3124
3119
|
if (_this.logHTTPTiming) {
|
|
3125
3120
|
_this.logger.always('HTTP time, ms:' + (timeEnd - timeStart));
|
|
3126
3121
|
}
|
|
@@ -4499,6 +4494,7 @@ exports.TournamentRegistrationStatusNamed = TournamentRegistrationStatusNamed;
|
|
|
4499
4494
|
exports.TournamentRegistrationTypeGetName = TournamentRegistrationTypeGetName;
|
|
4500
4495
|
exports.TournamentUtils = TournamentUtils;
|
|
4501
4496
|
exports.UserAchievementTransform = UserAchievementTransform;
|
|
4497
|
+
exports.getLeaderBoardTransform = getLeaderBoardTransform;
|
|
4502
4498
|
exports.marketsInfo = marketsInfo;
|
|
4503
4499
|
exports.quizAnswerAwayTeamReplacementText = quizAnswerAwayTeamReplacementText;
|
|
4504
4500
|
exports.quizAnswerHomeTeamReplacementText = quizAnswerHomeTeamReplacementText;
|