@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.
@@ -12,11 +12,12 @@ export interface ClanMember {
12
12
  is_me?: boolean;
13
13
  clean_ext_user_id?: string;
14
14
  }
15
- export interface GetClanInfoResponse extends ProtocolResponse {
16
- clan_info: Clan;
15
+ export interface ClanInfo extends Clan {
16
+ label_id: number;
17
17
  members: ClanMember[];
18
- entry_fee_currency_type_id: number;
19
- entry_fee_amount: number;
20
18
  /** Cooldown until date string; null if no cooldown active */
21
19
  cooldown_until: string | null;
22
20
  }
21
+ export interface GetClanInfoResponse extends ProtocolResponse {
22
+ clanInfo: ClanInfo;
23
+ }
@@ -6,4 +6,6 @@ export interface GetClanListResponse extends ProtocolResponse {
6
6
  user_clan_id: number | null;
7
7
  /** Cooldown until date string (e.g. "29/03/2026 10:00:00"); null if no cooldown */
8
8
  cooldown_until: string | null;
9
+ /** Epoch ms when the current user joined their clan; null if clanless */
10
+ join_date: number | null;
9
11
  }
@@ -154,7 +154,7 @@ declare class SmarticoAPI {
154
154
  clanJoin(user_ext_id: string, clanId: number, joinSourceId?: number): Promise<TClanJoinResult>;
155
155
  tournamentsGetInfo(user_ext_id: string, tournamentInstanceId: number, force_language?: string): Promise<GetTournamentInfoResponse>;
156
156
  tournamentsGetInfoT(user_ext_id: string, tournamentInstanceId: number): Promise<TTournamentDetailed>;
157
- clanTournamentGetPlayers(user_ext_id: string, tournamentInstanceId: number, clanId: number, force_language?: string): Promise<TClanTournamentPlayers>;
157
+ clanTournamentGetPlayers(user_ext_id: string, tournament_instance_id: number, clan_id: number, force_language?: string): Promise<TClanTournamentPlayers>;
158
158
  leaderboardGet(user_ext_id: string, period_type_id?: LeaderBoardPeriodType, prevPeriod?: boolean, force_language?: string): Promise<LeaderBoardDetails>;
159
159
  leaderboardsGetT(user_ext_id: string, period_type_id?: LeaderBoardPeriodType, prevPeriod?: boolean): Promise<LeaderBoardDetailsT>;
160
160
  levelsGet(user_ext_id: string, force_language?: string): Promise<GetLevelMapResponse>;
@@ -1,6 +1,6 @@
1
1
  import { ProtocolMessage } from '../Base/ProtocolMessage';
2
2
  export interface GetClanTournamentPlayersRequest extends ProtocolMessage {
3
- tournamentInstanceId: number;
4
- clanId: number;
5
- forceLanguage?: string;
3
+ tournament_instance_id: number;
4
+ clan_id: number;
5
+ force_language?: string;
6
6
  }
@@ -1,18 +1,18 @@
1
1
  import { ClanPublicMeta } from '../Clans/Clan';
2
2
  export interface ClanLeaderboardEntry {
3
- clan_id: number;
4
- public_meta: ClanPublicMeta;
5
- position: number;
6
- total_score: number;
7
- contributing_members: number;
3
+ clanId: number;
4
+ publicMeta: ClanPublicMeta;
5
+ rank: number;
6
+ totalScore: number;
7
+ memberCount: number;
8
8
  }
9
9
  export interface ClanPrizeTier {
10
10
  player_place_from: number;
11
11
  player_place_to: number;
12
12
  pool_amount: number | null;
13
13
  distribution_type: number | null;
14
- activity_type_id: number;
15
- details_json: Record<string, any>;
14
+ activity_type_id: number | null;
15
+ details_json: Record<string, any> | null;
16
16
  public_meta: ClanPublicMeta | null;
17
17
  }
18
18
  export interface ClanPrizeStructureEntry {
@@ -21,7 +21,7 @@ export interface ClanPrizeStructureEntry {
21
21
  prize_type_id: number;
22
22
  prize_pool_amount: number | null;
23
23
  activity_type_id: number | null;
24
- details_json: Record<string, any>;
25
- public_meta: ClanPublicMeta;
26
- tiers: ClanPrizeTier[];
24
+ details_json: Record<string, any> | null;
25
+ public_meta: ClanPublicMeta | null;
26
+ player_tiers: ClanPrizeTier[] | null;
27
27
  }
@@ -385,6 +385,8 @@ export interface TTournament {
385
385
  hide_leaderboard_min_scores?: boolean;
386
386
  /** Total scores across all participants in the tournament */
387
387
  total_scores?: number;
388
+ /** True when this tournament groups participants by clan */
389
+ is_clan_based?: boolean;
388
390
  }
389
391
  /**
390
392
  * TTournamentDetailed describes the information of the tournament item and includes list of participants, their scores and position in the tournament leaderboard
@@ -443,8 +445,6 @@ export interface TTournamentDetailed extends TTournament {
443
445
  /** if the prize is points related, indicates amount of points */
444
446
  points?: number;
445
447
  }[];
446
- /** True when this tournament groups participants by clan */
447
- is_clan_based?: boolean;
448
448
  /** Ranked list of clans in this tournament; null for non-clan tournaments */
449
449
  clan_leaderboard?: {
450
450
  clan_id: number;
@@ -551,6 +551,8 @@ export interface TClans {
551
551
  user_clan_id: number | null;
552
552
  /** Cooldown-until date string; null if no cooldown */
553
553
  cooldown_until: string | null;
554
+ /** Epoch ms when the current user joined their clan; null if clanless */
555
+ join_date: number | null;
554
556
  }
555
557
  /**
556
558
  * TClanInfo describes the detailed info of a single clan including its members.
package/dist/index.js CHANGED
@@ -1892,7 +1892,8 @@ var TournamentItemsTransform = function TournamentItemsTransform(items) {
1892
1892
  is_upcoming: TournamentUtils.isUpcoming(r),
1893
1893
  min_scores_win: r.minScoreToWin,
1894
1894
  hide_leaderboard_min_scores: r.hideLeaderboardsMinScores,
1895
- total_scores: r.totalScores
1895
+ total_scores: r.totalScores,
1896
+ is_clan_based: r.isClanBased
1896
1897
  });
1897
1898
  if (r.prizeStructure) {
1898
1899
  x.prizes = r.prizeStructure.prizes.map(function (p) {
@@ -1907,8 +1908,8 @@ var TournamentItemsTransform = function TournamentItemsTransform(items) {
1907
1908
  };
1908
1909
 
1909
1910
  var tournamentInfoItemTransform = function tournamentInfoItemTransform(t) {
1910
- var _t$tournamentInfo;
1911
- var response = _extends({}, TournamentItemsTransform([t.tournamentInfo.tournamentLobbyInfo])[0], {
1911
+ var _TournamentItemsTrans, _t$tournamentInfo$tou, _t$tournamentInfo, _t$tournamentInfo2;
1912
+ var 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], {
1912
1913
  related_games: (t.tournamentInfo.tournamentLobbyInfo.related_games || []).map(function (g, i) {
1913
1914
  return {
1914
1915
  ext_game_id: g.ext_game_id,
@@ -1936,21 +1937,21 @@ var tournamentInfoItemTransform = function tournamentInfoItemTransform(t) {
1936
1937
  if (t.userPosition) {
1937
1938
  response.me = TournamentUtils.getPlayerTransformed(t.userPosition, true);
1938
1939
  }
1939
- if ((_t$tournamentInfo = t.tournamentInfo) != null && (_t$tournamentInfo = _t$tournamentInfo.tournamentLobbyInfo) != null && _t$tournamentInfo.isClanBased) {
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(function (entry) {
1944
1945
  return {
1945
- clan_id: entry.clan_id,
1946
+ clan_id: entry.clanId,
1946
1947
  public_meta: {
1947
- name: entry.public_meta.name,
1948
- description: entry.public_meta.description,
1949
- image_url: entry.public_meta.image_url
1948
+ name: entry.publicMeta.name,
1949
+ description: entry.publicMeta.description,
1950
+ image_url: entry.publicMeta.image_url
1950
1951
  },
1951
- position: entry.position,
1952
- total_score: entry.total_score,
1953
- contributing_members: entry.contributing_members
1952
+ position: entry.rank,
1953
+ total_score: entry.totalScore,
1954
+ contributing_members: entry.memberCount
1954
1955
  };
1955
1956
  }) : null;
1956
1957
  response.clan_prize_structure = t.clanPrizes ? t.clanPrizes.map(function (entry) {
@@ -1965,7 +1966,7 @@ var tournamentInfoItemTransform = function tournamentInfoItemTransform(t) {
1965
1966
  description: entry.public_meta.description,
1966
1967
  image_url: entry.public_meta.image_url
1967
1968
  } : null,
1968
- tiers: (entry.tiers || []).map(function (tier) {
1969
+ tiers: (entry.player_tiers || []).map(function (tier) {
1969
1970
  return {
1970
1971
  player_place_from: tier.player_place_from,
1971
1972
  player_place_to: tier.player_place_to,
@@ -5775,10 +5776,12 @@ var SmarticoAPI = /*#__PURE__*/function () {
5775
5776
  try {
5776
5777
  var _this47 = this;
5777
5778
  return Promise.resolve(_this47.clansGetList(user_ext_id)).then(function (response) {
5779
+ var _response$join_date;
5778
5780
  return {
5779
5781
  clans: response.clans,
5780
5782
  user_clan_id: response.user_clan_id,
5781
- cooldown_until: response.cooldown_until
5783
+ cooldown_until: response.cooldown_until,
5784
+ join_date: (_response$join_date = response.join_date) != null ? _response$join_date : null
5782
5785
  };
5783
5786
  });
5784
5787
  } catch (e) {
@@ -5800,19 +5803,19 @@ var SmarticoAPI = /*#__PURE__*/function () {
5800
5803
  try {
5801
5804
  var _this49 = this;
5802
5805
  return Promise.resolve(_this49.clansGetInfo(user_ext_id, clanId, force_language)).then(function (response) {
5803
- var _response$entry_fee_c, _response$entry_fee_a, _response$cooldown_un;
5804
- var c = response.clan_info;
5806
+ var _c$cooldown_until;
5807
+ var c = response.clanInfo;
5805
5808
  return {
5806
5809
  clan_id: c.clan_id,
5807
5810
  public_meta: c.public_meta,
5808
5811
  member_count: c.member_count,
5809
5812
  capacity_limit: c.capacity_limit,
5810
- entry_fee_currency_type_id: (_response$entry_fee_c = response.entry_fee_currency_type_id) != null ? _response$entry_fee_c : c.entry_fee_currency_type_id,
5811
- entry_fee_amount: (_response$entry_fee_a = response.entry_fee_amount) != null ? _response$entry_fee_a : c.entry_fee_amount,
5813
+ entry_fee_currency_type_id: c.entry_fee_currency_type_id,
5814
+ entry_fee_amount: c.entry_fee_amount,
5812
5815
  rating_position: c.rating_position,
5813
5816
  rating_score: c.rating_score,
5814
- cooldown_until: (_response$cooldown_un = response.cooldown_until) != null ? _response$cooldown_un : null,
5815
- members: (response.members || []).map(function (m) {
5817
+ cooldown_until: (_c$cooldown_until = c.cooldown_until) != null ? _c$cooldown_until : null,
5818
+ members: (c.members || []).map(function (m) {
5816
5819
  return {
5817
5820
  user_id: m.user_id,
5818
5821
  public_username: m.public_username,
@@ -5885,13 +5888,13 @@ var SmarticoAPI = /*#__PURE__*/function () {
5885
5888
  return Promise.reject(e);
5886
5889
  }
5887
5890
  };
5888
- _proto.clanTournamentGetPlayers = function clanTournamentGetPlayers(user_ext_id, tournamentInstanceId, clanId, force_language) {
5891
+ _proto.clanTournamentGetPlayers = function clanTournamentGetPlayers(user_ext_id, tournament_instance_id, clan_id, force_language) {
5889
5892
  try {
5890
5893
  var _this53 = this;
5891
5894
  var message = _this53.buildMessage(user_ext_id, exports.ClassId.GET_CLAN_TOURNAMENT_PLAYERS_REQUEST, {
5892
- tournamentInstanceId: tournamentInstanceId,
5893
- clanId: clanId,
5894
- forceLanguage: force_language
5895
+ tournament_instance_id: tournament_instance_id,
5896
+ clan_id: clan_id,
5897
+ force_language: force_language
5895
5898
  });
5896
5899
  return Promise.resolve(_this53.send(message, exports.ClassId.GET_CLAN_TOURNAMENT_PLAYERS_RESPONSE, force_language)).then(function (response) {
5897
5900
  var _response$players;