@smartico/public-api 0.0.366 → 0.0.368
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/SmarticoLib/index.d.ts +1 -0
- package/dist/Tournaments/GetClanTournamentPlayersRequest.d.ts +3 -3
- package/dist/Tournaments/GetClanTournamentPlayersResponse.d.ts +10 -8
- package/dist/Tournaments/TournamentClan.d.ts +10 -10
- package/dist/WSAPI/WSAPITypes.d.ts +4 -2
- package/dist/index.js +30 -27
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +30 -27
- 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/SmarticoAPI.ts +9 -8
- package/src/SmarticoLib/index.ts +1 -0
- package/src/Tournaments/GetClanTournamentPlayersRequest.ts +3 -3
- package/src/Tournaments/GetClanTournamentPlayersResponse.ts +14 -12
- 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
|
@@ -12,11 +12,12 @@ export interface ClanMember {
|
|
|
12
12
|
is_me?: boolean;
|
|
13
13
|
clean_ext_user_id?: string;
|
|
14
14
|
}
|
|
15
|
-
export interface
|
|
16
|
-
|
|
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
|
}
|
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -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,
|
|
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>;
|
|
@@ -674,6 +674,7 @@ export interface GetTournamentsResponse extends ProtocolResponse {
|
|
|
674
674
|
}
|
|
675
675
|
declare enum TournamentRegistrationError {
|
|
676
676
|
NO_ERROR = 0,
|
|
677
|
+
TOURNAMENT_USER_CANNOT_JOIN_WITHOUT_CLAN = 1010,
|
|
677
678
|
TOURNAMENT_INSTANCE_NOT_FOUND = 30001,
|
|
678
679
|
TOURNAMENT_REGISTRATION_NOT_ENOUGH_POINTS = 30002,
|
|
679
680
|
TOURNAMENT_INSTANCE_NOT_IN_STATE = 30003,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProtocolMessage } from '../Base/ProtocolMessage';
|
|
2
2
|
export interface GetClanTournamentPlayersRequest extends ProtocolMessage {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
tournament_instance_id: number;
|
|
4
|
+
clan_id: number;
|
|
5
|
+
force_language?: string;
|
|
6
6
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
2
|
export interface ClanTournamentPlayerRaw {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
userId: number;
|
|
4
|
+
cleanExtUserId: string;
|
|
5
|
+
userAltName: string;
|
|
5
6
|
avatar_id: string;
|
|
6
7
|
avatar_real_id: number;
|
|
7
8
|
position: number;
|
|
8
9
|
scores: number;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
isMe: boolean;
|
|
11
|
+
registration_status?: number;
|
|
12
|
+
crmBrandId?: number;
|
|
11
13
|
avatar_url?: string;
|
|
12
14
|
}
|
|
13
15
|
export interface GetClanTournamentPlayersResponse extends ProtocolResponse {
|
|
@@ -19,15 +21,15 @@ export interface GetClanTournamentPlayersResponse extends ProtocolResponse {
|
|
|
19
21
|
players: ClanTournamentPlayerRaw[];
|
|
20
22
|
}
|
|
21
23
|
export interface TClanTournamentPlayer {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
userId: number;
|
|
25
|
+
cleanExtUserId: string;
|
|
26
|
+
userAltName: string;
|
|
24
27
|
avatar_id: string;
|
|
25
28
|
avatar_real_id: number;
|
|
26
29
|
avatar_url?: string;
|
|
27
30
|
position: number;
|
|
28
31
|
scores: number;
|
|
29
|
-
|
|
30
|
-
clean_ext_user_id: string;
|
|
32
|
+
isMe: boolean;
|
|
31
33
|
}
|
|
32
34
|
export interface TClanTournamentPlayersResult {
|
|
33
35
|
clan_id: number;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ClanPublicMeta } from '../Clans/Clan';
|
|
2
2
|
export interface ClanLeaderboardEntry {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
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
|
@@ -1703,15 +1703,15 @@ var clanTournamentPlayersTransform = function clanTournamentPlayersTransform(res
|
|
|
1703
1703
|
},
|
|
1704
1704
|
players: (response.players || []).map(function (p) {
|
|
1705
1705
|
return {
|
|
1706
|
-
|
|
1707
|
-
|
|
1706
|
+
userId: p.userId,
|
|
1707
|
+
cleanExtUserId: p.cleanExtUserId,
|
|
1708
|
+
userAltName: p.userAltName,
|
|
1708
1709
|
avatar_id: p.avatar_id,
|
|
1709
1710
|
avatar_real_id: p.avatar_real_id,
|
|
1710
1711
|
avatar_url: p.avatar_url,
|
|
1711
1712
|
position: p.position,
|
|
1712
1713
|
scores: p.scores,
|
|
1713
|
-
|
|
1714
|
-
clean_ext_user_id: p.clean_ext_user_id
|
|
1714
|
+
isMe: p.isMe
|
|
1715
1715
|
};
|
|
1716
1716
|
})
|
|
1717
1717
|
};
|
|
@@ -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$
|
|
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.
|
|
1946
|
+
clan_id: entry.clanId,
|
|
1946
1947
|
public_meta: {
|
|
1947
|
-
name: entry.
|
|
1948
|
-
description: entry.
|
|
1949
|
-
image_url: entry.
|
|
1948
|
+
name: entry.publicMeta.name,
|
|
1949
|
+
description: entry.publicMeta.description,
|
|
1950
|
+
image_url: entry.publicMeta.image_url
|
|
1950
1951
|
},
|
|
1951
|
-
position: entry.
|
|
1952
|
-
total_score: entry.
|
|
1953
|
-
contributing_members: entry.
|
|
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.
|
|
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
|
|
5804
|
-
var c = response.
|
|
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:
|
|
5811
|
-
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: (
|
|
5815
|
-
members: (
|
|
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,
|
|
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
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
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;
|