@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/package.json
CHANGED
|
@@ -14,11 +14,13 @@ export interface ClanMember {
|
|
|
14
14
|
clean_ext_user_id?: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export interface
|
|
18
|
-
|
|
17
|
+
export interface ClanInfo extends Clan {
|
|
18
|
+
label_id: number;
|
|
19
19
|
members: ClanMember[];
|
|
20
|
-
entry_fee_currency_type_id: number;
|
|
21
|
-
entry_fee_amount: number;
|
|
22
20
|
/** Cooldown until date string; null if no cooldown active */
|
|
23
21
|
cooldown_until: string | null;
|
|
24
22
|
}
|
|
23
|
+
|
|
24
|
+
export interface GetClanInfoResponse extends ProtocolResponse {
|
|
25
|
+
clanInfo: ClanInfo;
|
|
26
|
+
}
|
|
@@ -7,4 +7,6 @@ export interface GetClanListResponse extends ProtocolResponse {
|
|
|
7
7
|
user_clan_id: number | null;
|
|
8
8
|
/** Cooldown until date string (e.g. "29/03/2026 10:00:00"); null if no cooldown */
|
|
9
9
|
cooldown_until: string | null;
|
|
10
|
+
/** Epoch ms when the current user joined their clan; null if clanless */
|
|
11
|
+
join_date: number | null;
|
|
10
12
|
}
|
|
@@ -26,7 +26,7 @@ export const winnersTransform = (items: RafflePrizeWinner[]): TRafflePrizeWinner
|
|
|
26
26
|
return {
|
|
27
27
|
id: item.user_id,
|
|
28
28
|
username: item.public_username,
|
|
29
|
-
avatar_url: item.avatar_url,
|
|
29
|
+
avatar_url: item.avatar_url || item.avatar_id,
|
|
30
30
|
ticket: { ticekt_id: item.ticket.id, ticket_id_string: item.ticket.s },
|
|
31
31
|
raf_won_id: item.raf_won_id,
|
|
32
32
|
claimed_date: item.claimed_date,
|
package/src/SmarticoAPI.ts
CHANGED
|
@@ -1027,6 +1027,7 @@ class SmarticoAPI {
|
|
|
1027
1027
|
clans: response.clans,
|
|
1028
1028
|
user_clan_id: response.user_clan_id,
|
|
1029
1029
|
cooldown_until: response.cooldown_until,
|
|
1030
|
+
join_date: response.join_date ?? null,
|
|
1030
1031
|
};
|
|
1031
1032
|
}
|
|
1032
1033
|
|
|
@@ -1041,18 +1042,18 @@ class SmarticoAPI {
|
|
|
1041
1042
|
|
|
1042
1043
|
public async clansGetInfoT(user_ext_id: string, clanId: number, force_language?: string): Promise<TClanInfo> {
|
|
1043
1044
|
const response = await this.clansGetInfo(user_ext_id, clanId, force_language);
|
|
1044
|
-
const c = response.
|
|
1045
|
+
const c = response.clanInfo;
|
|
1045
1046
|
return {
|
|
1046
1047
|
clan_id: c.clan_id,
|
|
1047
1048
|
public_meta: c.public_meta,
|
|
1048
1049
|
member_count: c.member_count,
|
|
1049
1050
|
capacity_limit: c.capacity_limit,
|
|
1050
|
-
entry_fee_currency_type_id:
|
|
1051
|
-
entry_fee_amount:
|
|
1051
|
+
entry_fee_currency_type_id: c.entry_fee_currency_type_id,
|
|
1052
|
+
entry_fee_amount: c.entry_fee_amount,
|
|
1052
1053
|
rating_position: c.rating_position,
|
|
1053
1054
|
rating_score: c.rating_score,
|
|
1054
|
-
cooldown_until:
|
|
1055
|
-
members: (
|
|
1055
|
+
cooldown_until: c.cooldown_until ?? null,
|
|
1056
|
+
members: (c.members || []).map((m) => ({
|
|
1056
1057
|
user_id: m.user_id,
|
|
1057
1058
|
public_username: m.public_username,
|
|
1058
1059
|
avatar_id: m.avatar_id,
|
|
@@ -1117,14 +1118,14 @@ class SmarticoAPI {
|
|
|
1117
1118
|
|
|
1118
1119
|
public async clanTournamentGetPlayers(
|
|
1119
1120
|
user_ext_id: string,
|
|
1120
|
-
|
|
1121
|
-
|
|
1121
|
+
tournament_instance_id: number,
|
|
1122
|
+
clan_id: number,
|
|
1122
1123
|
force_language?: string,
|
|
1123
1124
|
): Promise<TClanTournamentPlayers> {
|
|
1124
1125
|
const message = this.buildMessage<GetClanTournamentPlayersRequest, GetClanTournamentPlayersResponse>(
|
|
1125
1126
|
user_ext_id,
|
|
1126
1127
|
ClassId.GET_CLAN_TOURNAMENT_PLAYERS_REQUEST,
|
|
1127
|
-
{
|
|
1128
|
+
{ tournament_instance_id, clan_id, force_language },
|
|
1128
1129
|
);
|
|
1129
1130
|
const response = await this.send<GetClanTournamentPlayersResponse>(
|
|
1130
1131
|
message,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ProtocolMessage } from '../Base/ProtocolMessage';
|
|
2
2
|
|
|
3
3
|
export interface GetClanTournamentPlayersRequest extends ProtocolMessage {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
tournament_instance_id: number;
|
|
5
|
+
clan_id: number;
|
|
6
|
+
force_language?: string;
|
|
7
7
|
}
|
|
@@ -35,7 +35,7 @@ export interface GetTournamentInfoResponse extends ProtocolResponse {
|
|
|
35
35
|
|
|
36
36
|
export const tournamentInfoItemTransform = (t: GetTournamentInfoResponse): TTournamentDetailed => {
|
|
37
37
|
const response: TTournamentDetailed = {
|
|
38
|
-
...TournamentItemsTransform([t.tournamentInfo
|
|
38
|
+
...TournamentItemsTransform([t.tournamentInfo?.tournamentLobbyInfo ?? null])?.[0],
|
|
39
39
|
related_games: (t.tournamentInfo.tournamentLobbyInfo.related_games || []).map((g, i) => ({
|
|
40
40
|
ext_game_id: g.ext_game_id,
|
|
41
41
|
game_public_meta: {
|
|
@@ -65,15 +65,15 @@ export const tournamentInfoItemTransform = (t: GetTournamentInfoResponse): TTour
|
|
|
65
65
|
response.user_clan_id = t.userClanId ?? null;
|
|
66
66
|
response.clan_leaderboard = t.clanLeaderboard
|
|
67
67
|
? t.clanLeaderboard.map((entry) => ({
|
|
68
|
-
clan_id: entry.
|
|
68
|
+
clan_id: entry.clanId,
|
|
69
69
|
public_meta: {
|
|
70
|
-
name: entry.
|
|
71
|
-
description: entry.
|
|
72
|
-
image_url: entry.
|
|
70
|
+
name: entry.publicMeta.name,
|
|
71
|
+
description: entry.publicMeta.description,
|
|
72
|
+
image_url: entry.publicMeta.image_url,
|
|
73
73
|
},
|
|
74
|
-
position: entry.
|
|
75
|
-
total_score: entry.
|
|
76
|
-
contributing_members: entry.
|
|
74
|
+
position: entry.rank,
|
|
75
|
+
total_score: entry.totalScore,
|
|
76
|
+
contributing_members: entry.memberCount,
|
|
77
77
|
}))
|
|
78
78
|
: null;
|
|
79
79
|
response.clan_prize_structure = t.clanPrizes
|
|
@@ -86,7 +86,7 @@ export const tournamentInfoItemTransform = (t: GetTournamentInfoResponse): TTour
|
|
|
86
86
|
public_meta: entry.public_meta
|
|
87
87
|
? { name: entry.public_meta.name, description: entry.public_meta.description, image_url: entry.public_meta.image_url }
|
|
88
88
|
: null,
|
|
89
|
-
tiers: (entry.
|
|
89
|
+
tiers: (entry.player_tiers || []).map((tier) => ({
|
|
90
90
|
player_place_from: tier.player_place_from,
|
|
91
91
|
player_place_to: tier.player_place_to,
|
|
92
92
|
pool_amount: tier.pool_amount,
|
|
@@ -116,9 +116,10 @@ export const TournamentItemsTransform = (items: Tournament[]): TTournament[] =>
|
|
|
116
116
|
is_in_progress: TournamentUtils.isInProgress(r),
|
|
117
117
|
is_upcoming: TournamentUtils.isUpcoming(r),
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
min_scores_win: r.minScoreToWin,
|
|
120
|
+
hide_leaderboard_min_scores: r.hideLeaderboardsMinScores,
|
|
121
|
+
total_scores: r.totalScores,
|
|
122
|
+
is_clan_based: r.isClanBased,
|
|
122
123
|
};
|
|
123
124
|
|
|
124
125
|
if (r.prizeStructure) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ClanPublicMeta } from '../Clans/Clan';
|
|
2
2
|
|
|
3
3
|
export interface ClanLeaderboardEntry {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
clanId: number;
|
|
5
|
+
publicMeta: ClanPublicMeta;
|
|
6
|
+
rank: number;
|
|
7
|
+
totalScore: number;
|
|
8
|
+
memberCount: number;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface ClanPrizeTier {
|
|
@@ -13,8 +13,8 @@ export interface ClanPrizeTier {
|
|
|
13
13
|
player_place_to: number;
|
|
14
14
|
pool_amount: number | null;
|
|
15
15
|
distribution_type: number | null;
|
|
16
|
-
activity_type_id: number;
|
|
17
|
-
details_json: Record<string, any
|
|
16
|
+
activity_type_id: number | null;
|
|
17
|
+
details_json: Record<string, any> | null;
|
|
18
18
|
public_meta: ClanPublicMeta | null;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -24,7 +24,7 @@ export interface ClanPrizeStructureEntry {
|
|
|
24
24
|
prize_type_id: number;
|
|
25
25
|
prize_pool_amount: number | null;
|
|
26
26
|
activity_type_id: number | null;
|
|
27
|
-
details_json: Record<string, any
|
|
28
|
-
public_meta: ClanPublicMeta;
|
|
29
|
-
|
|
27
|
+
details_json: Record<string, any> | null;
|
|
28
|
+
public_meta: ClanPublicMeta | null;
|
|
29
|
+
player_tiers: ClanPrizeTier[] | null;
|
|
30
30
|
}
|
package/src/WSAPI/WSAPITypes.ts
CHANGED
|
@@ -418,6 +418,8 @@ export interface TTournament {
|
|
|
418
418
|
hide_leaderboard_min_scores?: boolean;
|
|
419
419
|
/** Total scores across all participants in the tournament */
|
|
420
420
|
total_scores?: number;
|
|
421
|
+
/** True when this tournament groups participants by clan */
|
|
422
|
+
is_clan_based?: boolean;
|
|
421
423
|
}
|
|
422
424
|
|
|
423
425
|
/**
|
|
@@ -479,8 +481,6 @@ export interface TTournamentDetailed extends TTournament {
|
|
|
479
481
|
points?: number;
|
|
480
482
|
}[];
|
|
481
483
|
|
|
482
|
-
/** True when this tournament groups participants by clan */
|
|
483
|
-
is_clan_based?: boolean;
|
|
484
484
|
/** Ranked list of clans in this tournament; null for non-clan tournaments */
|
|
485
485
|
clan_leaderboard?: {
|
|
486
486
|
clan_id: number;
|
|
@@ -575,6 +575,8 @@ export interface TClans {
|
|
|
575
575
|
user_clan_id: number | null;
|
|
576
576
|
/** Cooldown-until date string; null if no cooldown */
|
|
577
577
|
cooldown_until: string | null;
|
|
578
|
+
/** Epoch ms when the current user joined their clan; null if clanless */
|
|
579
|
+
join_date: number | null;
|
|
578
580
|
}
|
|
579
581
|
|
|
580
582
|
/**
|