@smartico/public-api 0.0.366 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.366",
3
+ "version": "0.0.367",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,11 +14,13 @@ export interface ClanMember {
14
14
  clean_ext_user_id?: string;
15
15
  }
16
16
 
17
- export interface GetClanInfoResponse extends ProtocolResponse {
18
- clan_info: Clan;
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
  }
@@ -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.clan_info;
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: response.entry_fee_currency_type_id ?? c.entry_fee_currency_type_id,
1051
- entry_fee_amount: response.entry_fee_amount ?? c.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: response.cooldown_until ?? null,
1055
- members: (response.members || []).map((m) => ({
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
- tournamentInstanceId: number,
1121
- clanId: number,
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
- { tournamentInstanceId, clanId, forceLanguage: force_language },
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
- tournamentInstanceId: number;
5
- clanId: number;
6
- forceLanguage?: string;
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.tournamentLobbyInfo])[0],
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.clan_id,
68
+ clan_id: entry.clanId,
69
69
  public_meta: {
70
- name: entry.public_meta.name,
71
- description: entry.public_meta.description,
72
- image_url: entry.public_meta.image_url,
70
+ name: entry.publicMeta.name,
71
+ description: entry.publicMeta.description,
72
+ image_url: entry.publicMeta.image_url,
73
73
  },
74
- position: entry.position,
75
- total_score: entry.total_score,
76
- contributing_members: entry.contributing_members,
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.tiers || []).map((tier) => ({
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
- min_scores_win: r.minScoreToWin,
120
- hide_leaderboard_min_scores: r.hideLeaderboardsMinScores,
121
- total_scores: r.totalScores,
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
- clan_id: number;
5
- public_meta: ClanPublicMeta;
6
- position: number;
7
- total_score: number;
8
- contributing_members: number;
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
- tiers: ClanPrizeTier[];
27
+ details_json: Record<string, any> | null;
28
+ public_meta: ClanPublicMeta | null;
29
+ player_tiers: ClanPrizeTier[] | null;
30
30
  }
@@ -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
  /**