@smartico/public-api 0.0.365 → 0.0.367
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/Clans/GetClanInfoResponse.d.ts +5 -4
- package/dist/Clans/GetClanListResponse.d.ts +2 -0
- package/dist/SmarticoAPI.d.ts +1 -1
- package/dist/Tournaments/GetClanTournamentPlayersRequest.d.ts +3 -3
- package/dist/Tournaments/TournamentClan.d.ts +10 -10
- package/dist/WSAPI/WSAPITypes.d.ts +4 -2
- package/dist/index.js +27 -24
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +27 -24
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Clans/GetClanInfoResponse.ts +6 -4
- package/src/Clans/GetClanListResponse.ts +2 -0
- package/src/Raffle/GetRafflesResponse.ts +1 -1
- package/src/SmarticoAPI.ts +9 -8
- package/src/Tournaments/GetClanTournamentPlayersRequest.ts +3 -3
- package/src/Tournaments/GetTournamentInfoResponse.ts +9 -9
- package/src/Tournaments/Tournament.ts +4 -3
- package/src/Tournaments/TournamentClan.ts +10 -10
- package/src/WSAPI/WSAPITypes.ts +4 -2
package/dist/index.modern.mjs
CHANGED
|
@@ -1900,7 +1900,8 @@ const TournamentItemsTransform = items => {
|
|
|
1900
1900
|
is_upcoming: TournamentUtils.isUpcoming(r),
|
|
1901
1901
|
min_scores_win: r.minScoreToWin,
|
|
1902
1902
|
hide_leaderboard_min_scores: r.hideLeaderboardsMinScores,
|
|
1903
|
-
total_scores: r.totalScores
|
|
1903
|
+
total_scores: r.totalScores,
|
|
1904
|
+
is_clan_based: r.isClanBased
|
|
1904
1905
|
});
|
|
1905
1906
|
if (r.prizeStructure) {
|
|
1906
1907
|
x.prizes = r.prizeStructure.prizes.map(p => TournamentUtils.getPrizeTransformed(p));
|
|
@@ -1913,8 +1914,8 @@ const TournamentItemsTransform = items => {
|
|
|
1913
1914
|
};
|
|
1914
1915
|
|
|
1915
1916
|
const tournamentInfoItemTransform = t => {
|
|
1916
|
-
var _t$tournamentInfo;
|
|
1917
|
-
const response = _extends({}, TournamentItemsTransform([t.tournamentInfo.tournamentLobbyInfo])[0], {
|
|
1917
|
+
var _TournamentItemsTrans, _t$tournamentInfo$tou, _t$tournamentInfo, _t$tournamentInfo2;
|
|
1918
|
+
const response = _extends({}, (_TournamentItemsTrans = TournamentItemsTransform([(_t$tournamentInfo$tou = (_t$tournamentInfo = t.tournamentInfo) == null ? void 0 : _t$tournamentInfo.tournamentLobbyInfo) != null ? _t$tournamentInfo$tou : null])) == null ? void 0 : _TournamentItemsTrans[0], {
|
|
1918
1919
|
related_games: (t.tournamentInfo.tournamentLobbyInfo.related_games || []).map((g, i) => ({
|
|
1919
1920
|
ext_game_id: g.ext_game_id,
|
|
1920
1921
|
game_public_meta: {
|
|
@@ -1936,20 +1937,20 @@ const tournamentInfoItemTransform = t => {
|
|
|
1936
1937
|
if (t.userPosition) {
|
|
1937
1938
|
response.me = TournamentUtils.getPlayerTransformed(t.userPosition, true);
|
|
1938
1939
|
}
|
|
1939
|
-
if ((_t$
|
|
1940
|
+
if ((_t$tournamentInfo2 = t.tournamentInfo) != null && (_t$tournamentInfo2 = _t$tournamentInfo2.tournamentLobbyInfo) != null && _t$tournamentInfo2.isClanBased) {
|
|
1940
1941
|
var _t$userClanId;
|
|
1941
1942
|
response.is_clan_based = true;
|
|
1942
1943
|
response.user_clan_id = (_t$userClanId = t.userClanId) != null ? _t$userClanId : null;
|
|
1943
1944
|
response.clan_leaderboard = t.clanLeaderboard ? t.clanLeaderboard.map(entry => ({
|
|
1944
|
-
clan_id: entry.
|
|
1945
|
+
clan_id: entry.clanId,
|
|
1945
1946
|
public_meta: {
|
|
1946
|
-
name: entry.
|
|
1947
|
-
description: entry.
|
|
1948
|
-
image_url: entry.
|
|
1947
|
+
name: entry.publicMeta.name,
|
|
1948
|
+
description: entry.publicMeta.description,
|
|
1949
|
+
image_url: entry.publicMeta.image_url
|
|
1949
1950
|
},
|
|
1950
|
-
position: entry.
|
|
1951
|
-
total_score: entry.
|
|
1952
|
-
contributing_members: entry.
|
|
1951
|
+
position: entry.rank,
|
|
1952
|
+
total_score: entry.totalScore,
|
|
1953
|
+
contributing_members: entry.memberCount
|
|
1953
1954
|
})) : null;
|
|
1954
1955
|
response.clan_prize_structure = t.clanPrizes ? t.clanPrizes.map(entry => ({
|
|
1955
1956
|
clan_place: entry.clan_place,
|
|
@@ -1962,7 +1963,7 @@ const tournamentInfoItemTransform = t => {
|
|
|
1962
1963
|
description: entry.public_meta.description,
|
|
1963
1964
|
image_url: entry.public_meta.image_url
|
|
1964
1965
|
} : null,
|
|
1965
|
-
tiers: (entry.
|
|
1966
|
+
tiers: (entry.player_tiers || []).map(tier => ({
|
|
1966
1967
|
player_place_from: tier.player_place_from,
|
|
1967
1968
|
player_place_to: tier.player_place_to,
|
|
1968
1969
|
pool_amount: tier.pool_amount,
|
|
@@ -2088,7 +2089,7 @@ const winnersTransform = items => {
|
|
|
2088
2089
|
return {
|
|
2089
2090
|
id: item.user_id,
|
|
2090
2091
|
username: item.public_username,
|
|
2091
|
-
avatar_url: item.avatar_url,
|
|
2092
|
+
avatar_url: item.avatar_url || item.avatar_id,
|
|
2092
2093
|
ticket: {
|
|
2093
2094
|
ticekt_id: item.ticket.id,
|
|
2094
2095
|
ticket_id_string: item.ticket.s
|
|
@@ -4806,11 +4807,13 @@ class SmarticoAPI {
|
|
|
4806
4807
|
return await this.send(message, ClassId.GET_CLAN_LIST_RESPONSE, force_language);
|
|
4807
4808
|
}
|
|
4808
4809
|
async clansGetListT(user_ext_id) {
|
|
4810
|
+
var _response$join_date;
|
|
4809
4811
|
const response = await this.clansGetList(user_ext_id);
|
|
4810
4812
|
return {
|
|
4811
4813
|
clans: response.clans,
|
|
4812
4814
|
user_clan_id: response.user_clan_id,
|
|
4813
|
-
cooldown_until: response.cooldown_until
|
|
4815
|
+
cooldown_until: response.cooldown_until,
|
|
4816
|
+
join_date: (_response$join_date = response.join_date) != null ? _response$join_date : null
|
|
4814
4817
|
};
|
|
4815
4818
|
}
|
|
4816
4819
|
async clansGetInfo(user_ext_id, clanId, force_language) {
|
|
@@ -4820,20 +4823,20 @@ class SmarticoAPI {
|
|
|
4820
4823
|
return await this.send(message, ClassId.GET_CLAN_INFO_RESPONSE, force_language);
|
|
4821
4824
|
}
|
|
4822
4825
|
async clansGetInfoT(user_ext_id, clanId, force_language) {
|
|
4823
|
-
var
|
|
4826
|
+
var _c$cooldown_until;
|
|
4824
4827
|
const response = await this.clansGetInfo(user_ext_id, clanId, force_language);
|
|
4825
|
-
const c = response.
|
|
4828
|
+
const c = response.clanInfo;
|
|
4826
4829
|
return {
|
|
4827
4830
|
clan_id: c.clan_id,
|
|
4828
4831
|
public_meta: c.public_meta,
|
|
4829
4832
|
member_count: c.member_count,
|
|
4830
4833
|
capacity_limit: c.capacity_limit,
|
|
4831
|
-
entry_fee_currency_type_id:
|
|
4832
|
-
entry_fee_amount:
|
|
4834
|
+
entry_fee_currency_type_id: c.entry_fee_currency_type_id,
|
|
4835
|
+
entry_fee_amount: c.entry_fee_amount,
|
|
4833
4836
|
rating_position: c.rating_position,
|
|
4834
4837
|
rating_score: c.rating_score,
|
|
4835
|
-
cooldown_until: (
|
|
4836
|
-
members: (
|
|
4838
|
+
cooldown_until: (_c$cooldown_until = c.cooldown_until) != null ? _c$cooldown_until : null,
|
|
4839
|
+
members: (c.members || []).map(m => ({
|
|
4837
4840
|
user_id: m.user_id,
|
|
4838
4841
|
public_username: m.public_username,
|
|
4839
4842
|
avatar_id: m.avatar_id,
|
|
@@ -4881,12 +4884,12 @@ class SmarticoAPI {
|
|
|
4881
4884
|
const response = await this.tournamentsGetInfo(user_ext_id, tournamentInstanceId);
|
|
4882
4885
|
return tournamentInfoItemTransform(response);
|
|
4883
4886
|
}
|
|
4884
|
-
async clanTournamentGetPlayers(user_ext_id,
|
|
4887
|
+
async clanTournamentGetPlayers(user_ext_id, tournament_instance_id, clan_id, force_language) {
|
|
4885
4888
|
var _response$players;
|
|
4886
4889
|
const message = this.buildMessage(user_ext_id, ClassId.GET_CLAN_TOURNAMENT_PLAYERS_REQUEST, {
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
+
tournament_instance_id,
|
|
4891
|
+
clan_id,
|
|
4892
|
+
force_language
|
|
4890
4893
|
});
|
|
4891
4894
|
const response = await this.send(message, ClassId.GET_CLAN_TOURNAMENT_PLAYERS_RESPONSE, force_language);
|
|
4892
4895
|
if ((_response$players = response.players) != null && _response$players.length) {
|