@blizzard-api/sc2 2.0.2 → 3.0.1

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.
@@ -0,0 +1,12 @@
1
+ import { Resource } from "@blizzard-api/core";
2
+
3
+ //#region src/account/index.d.ts
4
+ /**
5
+ * Returns the player information for the specified account ID.
6
+ * @param accountId The account ID
7
+ * @returns The player resource. See {@link Resource}.
8
+ */
9
+ declare function player(accountId: string): Resource<Array<unknown>>;
10
+ //#endregion
11
+ export { player };
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ //#region src/account/index.ts
2
+ /**
3
+ * Returns the player information for the specified account ID.
4
+ * @param accountId The account ID
5
+ * @returns The player resource. See {@link Resource}.
6
+ */
7
+ function player(accountId) {
8
+ return { path: `/sc2/player/${accountId}` };
9
+ }
10
+ //#endregion
11
+ export { player };
12
+
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/account/index.ts"],"sourcesContent":["import type { Resource } from '@blizzard-api/core';\n\n/**\n * Returns the player information for the specified account ID.\n * @param accountId The account ID\n * @returns The player resource. See {@link Resource}.\n */\nexport function player(accountId: string): Resource<Array<unknown>> {\n return {\n path: `/sc2/player/${accountId}`,\n };\n}\n"],"mappings":";;;;;;AAOA,SAAgB,OAAO,WAA6C;CAClE,OAAO,EACL,MAAM,eAAe,aACtB"}
@@ -0,0 +1,181 @@
1
+ import { t as StarcraftRegion } from "./regions-C2THJaaU.js";
2
+ import { Resource } from "@blizzard-api/core";
3
+
4
+ //#region src/legacy/types.d.ts
5
+ interface LegacyAchievementsResponse {
6
+ achievements: Array<Achievement>;
7
+ categories: Array<Category>;
8
+ }
9
+ interface LegacyLaddersResponse {
10
+ currentSeason: Array<unknown>;
11
+ previousSeason: Array<unknown>;
12
+ showcasePlacement: Array<unknown>;
13
+ }
14
+ interface LegacyMatchHistoryResponse {
15
+ matches: Array<Match>;
16
+ }
17
+ interface LegacyProfileResponse {
18
+ achievements: Achievements;
19
+ campaign: Campaign;
20
+ career: Career;
21
+ clanName: string;
22
+ clanTag: string;
23
+ displayName: string;
24
+ id: string;
25
+ portrait: Icon;
26
+ profilePath: string;
27
+ realm: number;
28
+ rewards: Rewards;
29
+ season: Season;
30
+ swarmLevels: SwarmLevels;
31
+ }
32
+ interface LegacyRewardsResponse {
33
+ animations: Array<Animation>;
34
+ portraits: Array<Animation>;
35
+ protossDecals: Array<Animation>;
36
+ skins: Array<Animation>;
37
+ terranDecals: Array<Animation>;
38
+ zergDecals: Array<Animation>;
39
+ }
40
+ interface Achievement {
41
+ achievementId: string;
42
+ categoryId: string;
43
+ description: string;
44
+ icon: Icon;
45
+ points: number;
46
+ title: string;
47
+ }
48
+ interface Achievements {
49
+ achievements: Array<{
50
+ achievementId: string;
51
+ completionDate: number;
52
+ }>;
53
+ points: Points;
54
+ }
55
+ interface Animation {
56
+ achievementId: string;
57
+ command?: '/dance';
58
+ icon: Icon;
59
+ id: string;
60
+ name?: string;
61
+ title: string;
62
+ }
63
+ interface Campaign {
64
+ hots: string;
65
+ wol: string;
66
+ }
67
+ interface Career {
68
+ careerTotalGames: number;
69
+ highest1v1Rank: string;
70
+ highestTeamRank: string;
71
+ primaryRace: string;
72
+ protossWins: number;
73
+ seasonTotalGames: number;
74
+ terranWins: number;
75
+ zergWins: number;
76
+ }
77
+ interface Category {
78
+ categoryId: string;
79
+ children?: Array<CategoryChild>;
80
+ featuredAchievementId: string;
81
+ title: string;
82
+ }
83
+ interface CategoryChild {
84
+ categoryId: string;
85
+ featuredAchievementId: string;
86
+ title: string;
87
+ }
88
+ interface Icon {
89
+ h: number;
90
+ offset: number;
91
+ url: string;
92
+ w: number;
93
+ x: number;
94
+ y: number;
95
+ }
96
+ interface Match {
97
+ date: number;
98
+ decision: 'Left' | 'Loss' | 'Win';
99
+ map: string;
100
+ speed: 'Fast' | 'Faster';
101
+ type: '2v2' | '3v3' | 'Co-Op' | 'Custom';
102
+ }
103
+ interface Points {
104
+ categoryPoints: Record<string, number>;
105
+ totalPoints: number;
106
+ }
107
+ interface Rewards {
108
+ earned: Array<string>;
109
+ selected: Array<string>;
110
+ }
111
+ interface Season {
112
+ seasonId: number;
113
+ seasonNumber: number;
114
+ seasonYear: number;
115
+ stats: Array<Stat>;
116
+ totalGamesThisSeason: number;
117
+ }
118
+ interface Stat {
119
+ games: number;
120
+ type: string;
121
+ wins: number;
122
+ }
123
+ interface SwarmLevels {
124
+ level: number;
125
+ protoss: SwarmLevelsByRace;
126
+ terran: SwarmLevelsByRace;
127
+ zerg: SwarmLevelsByRace;
128
+ }
129
+ interface SwarmLevelsByRace {
130
+ currentLevelXP: number;
131
+ level: number;
132
+ totalLevelXP: number;
133
+ }
134
+ //#endregion
135
+ //#region src/legacy/index.d.ts
136
+ /**
137
+ * Returns the legacy achievements for the specified region.
138
+ * @param regionId The region ID for Starcraft.
139
+ * @returns A resource representing the legacy achievements. See {@link LegacyAchievementsResponse}
140
+ */
141
+ declare function legacyAchievements(regionId: StarcraftRegion): Resource<LegacyAchievementsResponse>;
142
+ /**
143
+ * Returns the ladder information for the specified ladder.
144
+ * @param regionId The region ID for Starcraft.
145
+ * @param ladderId The ID of the ladder.
146
+ * @returns A resource representing the ladder. See {@link LadderResponse}
147
+ */
148
+ declare function legacyLadder(regionId: StarcraftRegion, ladderId: number): Resource<unknown>;
149
+ /**
150
+ * Returns the ladders for the specified profile.
151
+ * @param regionId The region ID for Starcraft.
152
+ * @param realmId 1 or 2
153
+ * @param profileId The ID of the profile.
154
+ * @returns A resource representing the ladders for the given profile. See {@link LegacyLaddersResponse}
155
+ */
156
+ declare function legacyLadders(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<LegacyLaddersResponse>;
157
+ /**
158
+ * Returns the match history for the specified profile.
159
+ * @param regionId The region ID for Starcraft.
160
+ * @param realmId 1 or 2
161
+ * @param profileId The ID of the profile.
162
+ * @returns A resource representing the match history for the given profile. See {@link LegacyMatchHistoryResponse}
163
+ */
164
+ declare function legacyMatchHistory(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<LegacyMatchHistoryResponse>;
165
+ /**
166
+ * Returns the profile for the specified profile.
167
+ * @param regionId The region ID for Starcraft.
168
+ * @param realmId 1 or 2
169
+ * @param profileId The ID of the profile.
170
+ * @returns A resource representing the profile for the given ID. See {@link LegacyProfileResponse}
171
+ */
172
+ declare function legacyProfile(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<LegacyProfileResponse>;
173
+ /**
174
+ * Returns the rewards for the specified region.
175
+ * @param regionId The region ID for Starcraft.
176
+ * @returns A resource representing the rewards for the given region. See {@link LegacyRewardsResponse}
177
+ */
178
+ declare function legacyRewards(regionId: StarcraftRegion): Resource<LegacyRewardsResponse>;
179
+ //#endregion
180
+ export { legacyProfile as a, LegacyLaddersResponse as c, LegacyRewardsResponse as d, legacyMatchHistory as i, LegacyMatchHistoryResponse as l, legacyLadder as n, legacyRewards as o, legacyLadders as r, LegacyAchievementsResponse as s, legacyAchievements as t, LegacyProfileResponse as u };
181
+ //# sourceMappingURL=index-C6XacDRF.d.ts.map
@@ -0,0 +1,39 @@
1
+ import { Resource, ResponseBase } from "@blizzard-api/core";
2
+
3
+ //#region src/league/types.d.ts
4
+ interface LeagueDataResponse extends ResponseBase {
5
+ key: Key;
6
+ tier: Array<Tier>;
7
+ }
8
+ type StarcraftLeagueId = 'bronze' | 'diamond' | 'gold' | 'grandmaster' | 'master' | 'platinum' | 'silver';
9
+ type StarcraftLeagueQueue = 'hots-1v1' | 'hots-2v2' | 'hots-3v3' | 'hots-4v4' | 'lotv-1v1' | 'lotv-2v2' | 'lotv-3v3' | 'lotv-4v4' | 'lotv-archon' | 'wol-1v1' | 'wol-2v2' | 'wol-3v3' | 'wol-4v4';
10
+ type StarcraftLeagueTeamType = 'arranged' | 'random';
11
+ interface Division {
12
+ id: number;
13
+ ladder_id: number;
14
+ member_count: number;
15
+ }
16
+ interface Key {
17
+ league_id: number;
18
+ queue_id: number;
19
+ season_id: number;
20
+ team_type: number;
21
+ }
22
+ interface Tier {
23
+ division: Array<Division>;
24
+ id: number;
25
+ }
26
+ //#endregion
27
+ //#region src/league/index.d.ts
28
+ /**
29
+ * Returns the league data for the specified season, queue, team type, and league.
30
+ * @param seasonId The season ID
31
+ * @param queueId The queue ID
32
+ * @param teamType The team type
33
+ * @param leagueId The league ID
34
+ * @returns The league data resource. See {@link LeagueDataResponse}.
35
+ */
36
+ declare function getLeagueData(seasonId: string, queueId: StarcraftLeagueQueue, teamType: StarcraftLeagueTeamType, leagueId: StarcraftLeagueId): Resource<LeagueDataResponse>;
37
+ //#endregion
38
+ export { StarcraftLeagueTeamType as a, StarcraftLeagueQueue as i, LeagueDataResponse as n, StarcraftLeagueId as r, getLeagueData as t };
39
+ //# sourceMappingURL=index-D4dz9fHQ.d.ts.map
@@ -0,0 +1,48 @@
1
+ import { t as StarcraftRegion } from "./regions-C2THJaaU.js";
2
+ import { Resource } from "@blizzard-api/core";
3
+
4
+ //#region src/ladder/types.d.ts
5
+ interface GrandmasterLeaderboardResponse {
6
+ ladderTeams: Array<LadderTeam>;
7
+ }
8
+ interface SeasonResponse {
9
+ endDate: string;
10
+ number: number;
11
+ seasonId: number;
12
+ startDate: string;
13
+ year: number;
14
+ }
15
+ interface LadderTeam {
16
+ joinTimestamp: number;
17
+ losses: number;
18
+ mmr: number;
19
+ points: number;
20
+ previousRank: number;
21
+ teamMembers: Array<TeamMember>;
22
+ wins: number;
23
+ }
24
+ interface TeamMember {
25
+ clanTag?: string;
26
+ displayName: string;
27
+ favoriteRace: 'protoss' | 'random' | 'terran' | 'zerg';
28
+ id: string;
29
+ realm: number;
30
+ region: number;
31
+ }
32
+ //#endregion
33
+ //#region src/ladder/index.d.ts
34
+ /**
35
+ * Returns the grandmaster leaderboard for the specified region.
36
+ * @param regionId The region ID
37
+ * @returns The grandmaster leaderboard resource. See {@link GrandmasterLeaderboardResponse}.
38
+ */
39
+ declare function grandmasterLeaderboard(regionId: StarcraftRegion): Resource<GrandmasterLeaderboardResponse>;
40
+ /**
41
+ * Returns the season information for the specified region.
42
+ * @param regionId The region ID
43
+ * @returns The season resource. See {@link SeasonResponse}.
44
+ */
45
+ declare function season(regionId: StarcraftRegion): Resource<SeasonResponse>;
46
+ //#endregion
47
+ export { SeasonResponse as i, season as n, GrandmasterLeaderboardResponse as r, grandmasterLeaderboard as t };
48
+ //# sourceMappingURL=index-DShZYxRE.d.ts.map
@@ -0,0 +1,116 @@
1
+ import { t as StarcraftRegion } from "./regions-C2THJaaU.js";
2
+ import { Resource } from "@blizzard-api/core";
3
+
4
+ //#region src/profile/types.d.ts
5
+ interface LadderResponse {
6
+ allLadderMemberships: Array<unknown>;
7
+ ladderTeams: Array<unknown>;
8
+ ranksAndPools: Array<unknown>;
9
+ }
10
+ interface LadderSummaryResponse {
11
+ allLadderMemberships: Array<unknown>;
12
+ placementMatches: Array<unknown>;
13
+ showCaseEntries: Array<unknown>;
14
+ }
15
+ interface MetadataResponse {
16
+ avatarUrl: string;
17
+ name: string;
18
+ profileId: string;
19
+ profileUrl: string;
20
+ realmId: number;
21
+ regionId: number;
22
+ }
23
+ interface StaticProfileResponse {
24
+ achievements: Array<Achievement>;
25
+ categories: Array<Category>;
26
+ criteria: Array<Criterion>;
27
+ rewards: Array<Reward>;
28
+ }
29
+ interface Achievement {
30
+ categoryId: string;
31
+ chainAchievementIds: Array<string>;
32
+ chainRewardSize: number;
33
+ criteriaIds?: Array<string>;
34
+ description: string;
35
+ flags: number;
36
+ id: string;
37
+ imageUrl: string;
38
+ isChained: boolean;
39
+ points: number;
40
+ title: string;
41
+ uiOrderHint: number;
42
+ }
43
+ interface Category {
44
+ childrenCategoryIds: Array<string>;
45
+ featuredAchievementId: string;
46
+ id: string;
47
+ medalTiers?: Array<number>;
48
+ name: string;
49
+ parentCategoryId: null | string;
50
+ points: number;
51
+ uiOrderHint: number;
52
+ }
53
+ interface Criterion {
54
+ achievementId: string;
55
+ description: string;
56
+ evaluationClass: 'Achv' | 'Clnt' | 'S2Gm' | 'Sunk' | 'Trny';
57
+ flags: number;
58
+ id: string;
59
+ necessaryQuantity: number;
60
+ uiOrderHint: number;
61
+ }
62
+ interface Reward {
63
+ achievementId?: string;
64
+ command?: '/dance';
65
+ flags: number;
66
+ id: string;
67
+ imageUrl: string;
68
+ isSkin: boolean;
69
+ name: string;
70
+ uiOrderHint: number;
71
+ unlockableType: string;
72
+ }
73
+ //#endregion
74
+ //#region src/profile/index.d.ts
75
+ /**
76
+ * Returns the ladder information for the specified profile and ladder.
77
+ * @param regionId The region ID for Starcraft.
78
+ * @param realmId 1 or 2
79
+ * @param profileId The ID of the profile.
80
+ * @param ladderId The ID of the ladder.
81
+ * @returns A resource representing the ladder. See {@link LadderResponse}
82
+ */
83
+ declare function ladder(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number, ladderId: number): Resource<LadderResponse>;
84
+ /**
85
+ * Returns the ladder summary information for the specified profile.
86
+ * @param regionId The region ID for Starcraft.
87
+ * @param realmId 1 or 2
88
+ * @param profileId The ID of the profile.
89
+ * @returns A resource representing the ladder summary. See {@link LadderSummaryResponse}
90
+ */
91
+ declare function ladderSummary(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<LadderSummaryResponse>;
92
+ /**
93
+ * Returns the metadata information for the specified profile.
94
+ * @param regionId The region ID for Starcraft.
95
+ * @param realmId 1 or 2
96
+ * @param profileId The ID of the profile.
97
+ * @returns A resource representing the metadata. See {@link MetadataResponse}
98
+ */
99
+ declare function metadata(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<MetadataResponse>;
100
+ /**
101
+ * Returns the profile information for the specified profile.
102
+ * @param regionId The region ID for Starcraft.
103
+ * @param realmId 1 or 2
104
+ * @param profileId The ID of the profile.
105
+ * @returns A resource representing the profile. See {@link MetadataResponse}
106
+ */
107
+ declare function profile(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<MetadataResponse>;
108
+ /**
109
+ *
110
+ * @param regionId The region ID for Starcraft.
111
+ * @returns A resource representing the static profile. See {@link StaticProfileResponse}
112
+ */
113
+ declare function staticProfile(regionId: StarcraftRegion): Resource<StaticProfileResponse>;
114
+ //#endregion
115
+ export { staticProfile as a, MetadataResponse as c, profile as i, StaticProfileResponse as l, ladderSummary as n, LadderResponse as o, metadata as r, LadderSummaryResponse as s, ladder as t };
116
+ //# sourceMappingURL=index-E_sUhfIc.d.ts.map