@blizzard-api/sc2 2.0.2 → 3.0.0
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/account/index.d.ts +12 -0
- package/dist/account/index.js +13 -0
- package/dist/account/index.js.map +1 -0
- package/dist/index-C6XacDRF.d.ts +181 -0
- package/dist/index-D4dz9fHQ.d.ts +39 -0
- package/dist/index-DShZYxRE.d.ts +48 -0
- package/dist/index-E_sUhfIc.d.ts +116 -0
- package/dist/index.d.ts +5 -377
- package/dist/index.js +5 -186
- package/dist/index.js.map +1 -1
- package/dist/ladder/index.d.ts +2 -0
- package/dist/ladder/index.js +22 -0
- package/dist/ladder/index.js.map +1 -0
- package/dist/league/index.d.ts +2 -0
- package/dist/league/index.js +44 -0
- package/dist/league/index.js.map +1 -0
- package/dist/legacy/index.d.ts +2 -0
- package/dist/legacy/index.js +61 -0
- package/dist/legacy/index.js.map +1 -0
- package/dist/profile/index.d.ts +2 -0
- package/dist/profile/index.js +55 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/regions-C2THJaaU.d.ts +5 -0
- package/dist/regions-Dk4G9ABq.js +12 -0
- package/dist/regions-Dk4G9ABq.js.map +1 -0
- package/package.json +16 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,381 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { player } from "./account/index.js";
|
|
2
|
+
import { i as SeasonResponse, n as season, r as GrandmasterLeaderboardResponse, t as grandmasterLeaderboard } from "./index-DShZYxRE.js";
|
|
3
|
+
import { a as StarcraftLeagueTeamType, i as StarcraftLeagueQueue, n as LeagueDataResponse, r as StarcraftLeagueId, t as getLeagueData } from "./index-D4dz9fHQ.js";
|
|
4
|
+
import { a as legacyProfile, c as LegacyLaddersResponse, d as LegacyRewardsResponse, i as legacyMatchHistory, l as LegacyMatchHistoryResponse, n as legacyLadder, o as legacyRewards, r as legacyLadders, s as LegacyAchievementsResponse, t as legacyAchievements, u as LegacyProfileResponse } from "./index-C6XacDRF.js";
|
|
5
|
+
import { a as staticProfile, c as MetadataResponse, i as profile, l as StaticProfileResponse, n as ladderSummary, o as LadderResponse, r as metadata, s as LadderSummaryResponse, t as ladder } from "./index-E_sUhfIc.js";
|
|
2
6
|
|
|
3
|
-
//#region src/account/account.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
|
-
//#region src/regions.d.ts
|
|
12
|
-
type StarcraftRegion = 'cn' | 'eu' | 'kr' | 'tw' | 'us';
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/ladder/types.d.ts
|
|
15
|
-
interface GrandmasterLeaderboardResponse {
|
|
16
|
-
ladderTeams: Array<LadderTeam>;
|
|
17
|
-
}
|
|
18
|
-
interface SeasonResponse {
|
|
19
|
-
endDate: string;
|
|
20
|
-
number: number;
|
|
21
|
-
seasonId: number;
|
|
22
|
-
startDate: string;
|
|
23
|
-
year: number;
|
|
24
|
-
}
|
|
25
|
-
interface LadderTeam {
|
|
26
|
-
joinTimestamp: number;
|
|
27
|
-
losses: number;
|
|
28
|
-
mmr: number;
|
|
29
|
-
points: number;
|
|
30
|
-
previousRank: number;
|
|
31
|
-
teamMembers: Array<TeamMember>;
|
|
32
|
-
wins: number;
|
|
33
|
-
}
|
|
34
|
-
interface TeamMember {
|
|
35
|
-
clanTag?: string;
|
|
36
|
-
displayName: string;
|
|
37
|
-
favoriteRace: 'protoss' | 'random' | 'terran' | 'zerg';
|
|
38
|
-
id: string;
|
|
39
|
-
realm: number;
|
|
40
|
-
region: number;
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/ladder/ladder.d.ts
|
|
44
|
-
/**
|
|
45
|
-
* Returns the grandmaster leaderboard for the specified region.
|
|
46
|
-
* @param regionId The region ID
|
|
47
|
-
* @returns The grandmaster leaderboard resource. See {@link GrandmasterLeaderboardResponse}.
|
|
48
|
-
*/
|
|
49
|
-
declare function grandmasterLeaderboard(regionId: StarcraftRegion): Resource<GrandmasterLeaderboardResponse>;
|
|
50
|
-
/**
|
|
51
|
-
* Returns the season information for the specified region.
|
|
52
|
-
* @param regionId The region ID
|
|
53
|
-
* @returns The season resource. See {@link SeasonResponse}.
|
|
54
|
-
*/
|
|
55
|
-
declare function season(regionId: StarcraftRegion): Resource<SeasonResponse>;
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/league/types.d.ts
|
|
58
|
-
interface LeagueDataResponse extends ResponseBase {
|
|
59
|
-
key: Key;
|
|
60
|
-
tier: Array<Tier>;
|
|
61
|
-
}
|
|
62
|
-
type StarcraftLeagueId = 'bronze' | 'diamond' | 'gold' | 'grandmaster' | 'master' | 'platinum' | 'silver';
|
|
63
|
-
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';
|
|
64
|
-
type StarcraftLeagueTeamType = 'arranged' | 'random';
|
|
65
|
-
interface Division {
|
|
66
|
-
id: number;
|
|
67
|
-
ladder_id: number;
|
|
68
|
-
member_count: number;
|
|
69
|
-
}
|
|
70
|
-
interface Key {
|
|
71
|
-
league_id: number;
|
|
72
|
-
queue_id: number;
|
|
73
|
-
season_id: number;
|
|
74
|
-
team_type: number;
|
|
75
|
-
}
|
|
76
|
-
interface Tier {
|
|
77
|
-
division: Array<Division>;
|
|
78
|
-
id: number;
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/league/league.d.ts
|
|
82
|
-
/**
|
|
83
|
-
* Returns the league data for the specified season, queue, team type, and league.
|
|
84
|
-
* @param seasonId The season ID
|
|
85
|
-
* @param queueId The queue ID
|
|
86
|
-
* @param teamType The team type
|
|
87
|
-
* @param leagueId The league ID
|
|
88
|
-
* @returns The league data resource. See {@link LeagueDataResponse}.
|
|
89
|
-
*/
|
|
90
|
-
declare function getLeagueData(seasonId: string, queueId: StarcraftLeagueQueue, teamType: StarcraftLeagueTeamType, leagueId: StarcraftLeagueId): Resource<LeagueDataResponse>;
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/legacy/types.d.ts
|
|
93
|
-
interface LegacyAchievementsResponse {
|
|
94
|
-
achievements: Array<Achievement$1>;
|
|
95
|
-
categories: Array<Category$1>;
|
|
96
|
-
}
|
|
97
|
-
interface LegacyLaddersResponse {
|
|
98
|
-
currentSeason: Array<unknown>;
|
|
99
|
-
previousSeason: Array<unknown>;
|
|
100
|
-
showcasePlacement: Array<unknown>;
|
|
101
|
-
}
|
|
102
|
-
interface LegacyMatchHistoryResponse {
|
|
103
|
-
matches: Array<Match>;
|
|
104
|
-
}
|
|
105
|
-
interface LegacyProfileResponse {
|
|
106
|
-
achievements: Achievements;
|
|
107
|
-
campaign: Campaign;
|
|
108
|
-
career: Career;
|
|
109
|
-
clanName: string;
|
|
110
|
-
clanTag: string;
|
|
111
|
-
displayName: string;
|
|
112
|
-
id: string;
|
|
113
|
-
portrait: Icon;
|
|
114
|
-
profilePath: string;
|
|
115
|
-
realm: number;
|
|
116
|
-
rewards: Rewards;
|
|
117
|
-
season: Season;
|
|
118
|
-
swarmLevels: SwarmLevels;
|
|
119
|
-
}
|
|
120
|
-
interface LegacyRewardsResponse {
|
|
121
|
-
animations: Array<Animation>;
|
|
122
|
-
portraits: Array<Animation>;
|
|
123
|
-
protossDecals: Array<Animation>;
|
|
124
|
-
skins: Array<Animation>;
|
|
125
|
-
terranDecals: Array<Animation>;
|
|
126
|
-
zergDecals: Array<Animation>;
|
|
127
|
-
}
|
|
128
|
-
interface Achievement$1 {
|
|
129
|
-
achievementId: string;
|
|
130
|
-
categoryId: string;
|
|
131
|
-
description: string;
|
|
132
|
-
icon: Icon;
|
|
133
|
-
points: number;
|
|
134
|
-
title: string;
|
|
135
|
-
}
|
|
136
|
-
interface Achievements {
|
|
137
|
-
achievements: Array<{
|
|
138
|
-
achievementId: string;
|
|
139
|
-
completionDate: number;
|
|
140
|
-
}>;
|
|
141
|
-
points: Points;
|
|
142
|
-
}
|
|
143
|
-
interface Animation {
|
|
144
|
-
achievementId: string;
|
|
145
|
-
command?: '/dance';
|
|
146
|
-
icon: Icon;
|
|
147
|
-
id: string;
|
|
148
|
-
name?: string;
|
|
149
|
-
title: string;
|
|
150
|
-
}
|
|
151
|
-
interface Campaign {
|
|
152
|
-
hots: string;
|
|
153
|
-
wol: string;
|
|
154
|
-
}
|
|
155
|
-
interface Career {
|
|
156
|
-
careerTotalGames: number;
|
|
157
|
-
highest1v1Rank: string;
|
|
158
|
-
highestTeamRank: string;
|
|
159
|
-
primaryRace: string;
|
|
160
|
-
protossWins: number;
|
|
161
|
-
seasonTotalGames: number;
|
|
162
|
-
terranWins: number;
|
|
163
|
-
zergWins: number;
|
|
164
|
-
}
|
|
165
|
-
interface Category$1 {
|
|
166
|
-
categoryId: string;
|
|
167
|
-
children?: Array<CategoryChild>;
|
|
168
|
-
featuredAchievementId: string;
|
|
169
|
-
title: string;
|
|
170
|
-
}
|
|
171
|
-
interface CategoryChild {
|
|
172
|
-
categoryId: string;
|
|
173
|
-
featuredAchievementId: string;
|
|
174
|
-
title: string;
|
|
175
|
-
}
|
|
176
|
-
interface Icon {
|
|
177
|
-
h: number;
|
|
178
|
-
offset: number;
|
|
179
|
-
url: string;
|
|
180
|
-
w: number;
|
|
181
|
-
x: number;
|
|
182
|
-
y: number;
|
|
183
|
-
}
|
|
184
|
-
interface Match {
|
|
185
|
-
date: number;
|
|
186
|
-
decision: 'Left' | 'Loss' | 'Win';
|
|
187
|
-
map: string;
|
|
188
|
-
speed: 'Fast' | 'Faster';
|
|
189
|
-
type: '2v2' | '3v3' | 'Co-Op' | 'Custom';
|
|
190
|
-
}
|
|
191
|
-
interface Points {
|
|
192
|
-
categoryPoints: Record<string, number>;
|
|
193
|
-
totalPoints: number;
|
|
194
|
-
}
|
|
195
|
-
interface Rewards {
|
|
196
|
-
earned: Array<string>;
|
|
197
|
-
selected: Array<string>;
|
|
198
|
-
}
|
|
199
|
-
interface Season {
|
|
200
|
-
seasonId: number;
|
|
201
|
-
seasonNumber: number;
|
|
202
|
-
seasonYear: number;
|
|
203
|
-
stats: Array<Stat>;
|
|
204
|
-
totalGamesThisSeason: number;
|
|
205
|
-
}
|
|
206
|
-
interface Stat {
|
|
207
|
-
games: number;
|
|
208
|
-
type: string;
|
|
209
|
-
wins: number;
|
|
210
|
-
}
|
|
211
|
-
interface SwarmLevels {
|
|
212
|
-
level: number;
|
|
213
|
-
protoss: SwarmLevelsByRace;
|
|
214
|
-
terran: SwarmLevelsByRace;
|
|
215
|
-
zerg: SwarmLevelsByRace;
|
|
216
|
-
}
|
|
217
|
-
interface SwarmLevelsByRace {
|
|
218
|
-
currentLevelXP: number;
|
|
219
|
-
level: number;
|
|
220
|
-
totalLevelXP: number;
|
|
221
|
-
}
|
|
222
|
-
//#endregion
|
|
223
|
-
//#region src/legacy/legacy.d.ts
|
|
224
|
-
/**
|
|
225
|
-
* Returns the legacy achievements for the specified region.
|
|
226
|
-
* @param regionId The region ID for Starcraft.
|
|
227
|
-
* @returns A resource representing the legacy achievements. See {@link LegacyAchievementsResponse}
|
|
228
|
-
*/
|
|
229
|
-
declare function legacyAchievements(regionId: StarcraftRegion): Resource<LegacyAchievementsResponse>;
|
|
230
|
-
/**
|
|
231
|
-
* Returns the ladder information for the specified ladder.
|
|
232
|
-
* @param regionId The region ID for Starcraft.
|
|
233
|
-
* @param ladderId The ID of the ladder.
|
|
234
|
-
* @returns A resource representing the ladder. See {@link LadderResponse}
|
|
235
|
-
*/
|
|
236
|
-
declare function legacyLadder(regionId: StarcraftRegion, ladderId: number): Resource<unknown>;
|
|
237
|
-
/**
|
|
238
|
-
* Returns the ladders for the specified profile.
|
|
239
|
-
* @param regionId The region ID for Starcraft.
|
|
240
|
-
* @param realmId 1 or 2
|
|
241
|
-
* @param profileId The ID of the profile.
|
|
242
|
-
* @returns A resource representing the ladders for the given profile. See {@link LegacyLaddersResponse}
|
|
243
|
-
*/
|
|
244
|
-
declare function legacyLadders(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<LegacyLaddersResponse>;
|
|
245
|
-
/**
|
|
246
|
-
* Returns the match history for the specified profile.
|
|
247
|
-
* @param regionId The region ID for Starcraft.
|
|
248
|
-
* @param realmId 1 or 2
|
|
249
|
-
* @param profileId The ID of the profile.
|
|
250
|
-
* @returns A resource representing the match history for the given profile. See {@link LegacyMatchHistoryResponse}
|
|
251
|
-
*/
|
|
252
|
-
declare function legacyMatchHistory(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<LegacyMatchHistoryResponse>;
|
|
253
|
-
/**
|
|
254
|
-
* Returns the profile for the specified profile.
|
|
255
|
-
* @param regionId The region ID for Starcraft.
|
|
256
|
-
* @param realmId 1 or 2
|
|
257
|
-
* @param profileId The ID of the profile.
|
|
258
|
-
* @returns A resource representing the profile for the given ID. See {@link LegacyProfileResponse}
|
|
259
|
-
*/
|
|
260
|
-
declare function legacyProfile(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<LegacyProfileResponse>;
|
|
261
|
-
/**
|
|
262
|
-
* Returns the rewards for the specified region.
|
|
263
|
-
* @param regionId The region ID for Starcraft.
|
|
264
|
-
* @returns A resource representing the rewards for the given region. See {@link LegacyRewardsResponse}
|
|
265
|
-
*/
|
|
266
|
-
declare function legacyRewards(regionId: StarcraftRegion): Resource<LegacyRewardsResponse>;
|
|
267
|
-
//#endregion
|
|
268
|
-
//#region src/profile/types.d.ts
|
|
269
|
-
interface LadderResponse {
|
|
270
|
-
allLadderMemberships: Array<unknown>;
|
|
271
|
-
ladderTeams: Array<unknown>;
|
|
272
|
-
ranksAndPools: Array<unknown>;
|
|
273
|
-
}
|
|
274
|
-
interface LadderSummaryResponse {
|
|
275
|
-
allLadderMemberships: Array<unknown>;
|
|
276
|
-
placementMatches: Array<unknown>;
|
|
277
|
-
showCaseEntries: Array<unknown>;
|
|
278
|
-
}
|
|
279
|
-
interface MetadataResponse {
|
|
280
|
-
avatarUrl: string;
|
|
281
|
-
name: string;
|
|
282
|
-
profileId: string;
|
|
283
|
-
profileUrl: string;
|
|
284
|
-
realmId: number;
|
|
285
|
-
regionId: number;
|
|
286
|
-
}
|
|
287
|
-
interface StaticProfileResponse {
|
|
288
|
-
achievements: Array<Achievement>;
|
|
289
|
-
categories: Array<Category>;
|
|
290
|
-
criteria: Array<Criterion>;
|
|
291
|
-
rewards: Array<Reward>;
|
|
292
|
-
}
|
|
293
|
-
interface Achievement {
|
|
294
|
-
categoryId: string;
|
|
295
|
-
chainAchievementIds: Array<string>;
|
|
296
|
-
chainRewardSize: number;
|
|
297
|
-
criteriaIds?: Array<string>;
|
|
298
|
-
description: string;
|
|
299
|
-
flags: number;
|
|
300
|
-
id: string;
|
|
301
|
-
imageUrl: string;
|
|
302
|
-
isChained: boolean;
|
|
303
|
-
points: number;
|
|
304
|
-
title: string;
|
|
305
|
-
uiOrderHint: number;
|
|
306
|
-
}
|
|
307
|
-
interface Category {
|
|
308
|
-
childrenCategoryIds: Array<string>;
|
|
309
|
-
featuredAchievementId: string;
|
|
310
|
-
id: string;
|
|
311
|
-
medalTiers?: Array<number>;
|
|
312
|
-
name: string;
|
|
313
|
-
parentCategoryId: null | string;
|
|
314
|
-
points: number;
|
|
315
|
-
uiOrderHint: number;
|
|
316
|
-
}
|
|
317
|
-
interface Criterion {
|
|
318
|
-
achievementId: string;
|
|
319
|
-
description: string;
|
|
320
|
-
evaluationClass: 'Achv' | 'Clnt' | 'S2Gm' | 'Sunk' | 'Trny';
|
|
321
|
-
flags: number;
|
|
322
|
-
id: string;
|
|
323
|
-
necessaryQuantity: number;
|
|
324
|
-
uiOrderHint: number;
|
|
325
|
-
}
|
|
326
|
-
interface Reward {
|
|
327
|
-
achievementId?: string;
|
|
328
|
-
command?: '/dance';
|
|
329
|
-
flags: number;
|
|
330
|
-
id: string;
|
|
331
|
-
imageUrl: string;
|
|
332
|
-
isSkin: boolean;
|
|
333
|
-
name: string;
|
|
334
|
-
uiOrderHint: number;
|
|
335
|
-
unlockableType: string;
|
|
336
|
-
}
|
|
337
|
-
//#endregion
|
|
338
|
-
//#region src/profile/profile.d.ts
|
|
339
|
-
/**
|
|
340
|
-
* Returns the ladder information for the specified profile and ladder.
|
|
341
|
-
* @param regionId The region ID for Starcraft.
|
|
342
|
-
* @param realmId 1 or 2
|
|
343
|
-
* @param profileId The ID of the profile.
|
|
344
|
-
* @param ladderId The ID of the ladder.
|
|
345
|
-
* @returns A resource representing the ladder. See {@link LadderResponse}
|
|
346
|
-
*/
|
|
347
|
-
declare function ladder(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number, ladderId: number): Resource<LadderResponse>;
|
|
348
|
-
/**
|
|
349
|
-
* Returns the ladder summary information for the specified profile.
|
|
350
|
-
* @param regionId The region ID for Starcraft.
|
|
351
|
-
* @param realmId 1 or 2
|
|
352
|
-
* @param profileId The ID of the profile.
|
|
353
|
-
* @returns A resource representing the ladder summary. See {@link LadderSummaryResponse}
|
|
354
|
-
*/
|
|
355
|
-
declare function ladderSummary(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<LadderSummaryResponse>;
|
|
356
|
-
/**
|
|
357
|
-
* Returns the metadata information for the specified profile.
|
|
358
|
-
* @param regionId The region ID for Starcraft.
|
|
359
|
-
* @param realmId 1 or 2
|
|
360
|
-
* @param profileId The ID of the profile.
|
|
361
|
-
* @returns A resource representing the metadata. See {@link MetadataResponse}
|
|
362
|
-
*/
|
|
363
|
-
declare function metadata(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<MetadataResponse>;
|
|
364
|
-
/**
|
|
365
|
-
* Returns the profile information for the specified profile.
|
|
366
|
-
* @param regionId The region ID for Starcraft.
|
|
367
|
-
* @param realmId 1 or 2
|
|
368
|
-
* @param profileId The ID of the profile.
|
|
369
|
-
* @returns A resource representing the profile. See {@link MetadataResponse}
|
|
370
|
-
*/
|
|
371
|
-
declare function profile(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<MetadataResponse>;
|
|
372
|
-
/**
|
|
373
|
-
*
|
|
374
|
-
* @param regionId The region ID for Starcraft.
|
|
375
|
-
* @returns A resource representing the static profile. See {@link StaticProfileResponse}
|
|
376
|
-
*/
|
|
377
|
-
declare function staticProfile(regionId: StarcraftRegion): Resource<StaticProfileResponse>;
|
|
378
|
-
//#endregion
|
|
379
7
|
//#region src/index.d.ts
|
|
380
8
|
declare const sc2: {
|
|
381
9
|
player: typeof player;
|
package/dist/index.js
CHANGED
|
@@ -1,189 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
function player(accountId) {
|
|
8
|
-
return { path: `/sc2/player/${accountId}` };
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/regions.ts
|
|
12
|
-
const starcraftRegion = {
|
|
13
|
-
cn: 5,
|
|
14
|
-
eu: 2,
|
|
15
|
-
kr: 3,
|
|
16
|
-
tw: 3,
|
|
17
|
-
us: 1
|
|
18
|
-
};
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/ladder/ladder.ts
|
|
21
|
-
/**
|
|
22
|
-
* Returns the grandmaster leaderboard for the specified region.
|
|
23
|
-
* @param regionId The region ID
|
|
24
|
-
* @returns The grandmaster leaderboard resource. See {@link GrandmasterLeaderboardResponse}.
|
|
25
|
-
*/
|
|
26
|
-
function grandmasterLeaderboard(regionId) {
|
|
27
|
-
return { path: `/sc2/ladder/grandmaster/${starcraftRegion[regionId]}` };
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Returns the season information for the specified region.
|
|
31
|
-
* @param regionId The region ID
|
|
32
|
-
* @returns The season resource. See {@link SeasonResponse}.
|
|
33
|
-
*/
|
|
34
|
-
function season(regionId) {
|
|
35
|
-
return { path: `/sc2/ladder/season/${starcraftRegion[regionId]}` };
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/league/league.ts
|
|
39
|
-
const starcraftLeagueQueue = {
|
|
40
|
-
"hots-1v1": 101,
|
|
41
|
-
"hots-2v2": 102,
|
|
42
|
-
"hots-3v3": 103,
|
|
43
|
-
"hots-4v4": 104,
|
|
44
|
-
"lotv-1v1": 201,
|
|
45
|
-
"lotv-2v2": 202,
|
|
46
|
-
"lotv-3v3": 203,
|
|
47
|
-
"lotv-4v4": 204,
|
|
48
|
-
"lotv-archon": 206,
|
|
49
|
-
"wol-1v1": 1,
|
|
50
|
-
"wol-2v2": 2,
|
|
51
|
-
"wol-3v3": 3,
|
|
52
|
-
"wol-4v4": 4
|
|
53
|
-
};
|
|
54
|
-
const starcraftLeagueTeam = {
|
|
55
|
-
arranged: 0,
|
|
56
|
-
random: 1
|
|
57
|
-
};
|
|
58
|
-
const starcraftLeagueId = {
|
|
59
|
-
bronze: 0,
|
|
60
|
-
diamond: 4,
|
|
61
|
-
gold: 2,
|
|
62
|
-
grandmaster: 6,
|
|
63
|
-
master: 5,
|
|
64
|
-
platinum: 3,
|
|
65
|
-
silver: 1
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Returns the league data for the specified season, queue, team type, and league.
|
|
69
|
-
* @param seasonId The season ID
|
|
70
|
-
* @param queueId The queue ID
|
|
71
|
-
* @param teamType The team type
|
|
72
|
-
* @param leagueId The league ID
|
|
73
|
-
* @returns The league data resource. See {@link LeagueDataResponse}.
|
|
74
|
-
*/
|
|
75
|
-
function getLeagueData(seasonId, queueId, teamType, leagueId) {
|
|
76
|
-
return { path: `/data/sc2/league/${seasonId}/${starcraftLeagueQueue[queueId]}/${starcraftLeagueTeam[teamType]}/${starcraftLeagueId[leagueId]}` };
|
|
77
|
-
}
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/legacy/legacy.ts
|
|
80
|
-
/**
|
|
81
|
-
* Returns the legacy achievements for the specified region.
|
|
82
|
-
* @param regionId The region ID for Starcraft.
|
|
83
|
-
* @returns A resource representing the legacy achievements. See {@link LegacyAchievementsResponse}
|
|
84
|
-
*/
|
|
85
|
-
function legacyAchievements(regionId) {
|
|
86
|
-
return { path: `/sc2/legacy/data/achievements/${starcraftRegion[regionId]}` };
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Returns the ladder information for the specified ladder.
|
|
90
|
-
* @param regionId The region ID for Starcraft.
|
|
91
|
-
* @param ladderId The ID of the ladder.
|
|
92
|
-
* @returns A resource representing the ladder. See {@link LadderResponse}
|
|
93
|
-
*/
|
|
94
|
-
function legacyLadder(regionId, ladderId) {
|
|
95
|
-
return { path: `/sc2/legacy/ladder/${starcraftRegion[regionId]}/${ladderId}` };
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Returns the ladders for the specified profile.
|
|
99
|
-
* @param regionId The region ID for Starcraft.
|
|
100
|
-
* @param realmId 1 or 2
|
|
101
|
-
* @param profileId The ID of the profile.
|
|
102
|
-
* @returns A resource representing the ladders for the given profile. See {@link LegacyLaddersResponse}
|
|
103
|
-
*/
|
|
104
|
-
function legacyLadders(regionId, realmId, profileId) {
|
|
105
|
-
return { path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/ladders` };
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Returns the match history for the specified profile.
|
|
109
|
-
* @param regionId The region ID for Starcraft.
|
|
110
|
-
* @param realmId 1 or 2
|
|
111
|
-
* @param profileId The ID of the profile.
|
|
112
|
-
* @returns A resource representing the match history for the given profile. See {@link LegacyMatchHistoryResponse}
|
|
113
|
-
*/
|
|
114
|
-
function legacyMatchHistory(regionId, realmId, profileId) {
|
|
115
|
-
return { path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/matches` };
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Returns the profile for the specified profile.
|
|
119
|
-
* @param regionId The region ID for Starcraft.
|
|
120
|
-
* @param realmId 1 or 2
|
|
121
|
-
* @param profileId The ID of the profile.
|
|
122
|
-
* @returns A resource representing the profile for the given ID. See {@link LegacyProfileResponse}
|
|
123
|
-
*/
|
|
124
|
-
function legacyProfile(regionId, realmId, profileId) {
|
|
125
|
-
return { path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}` };
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Returns the rewards for the specified region.
|
|
129
|
-
* @param regionId The region ID for Starcraft.
|
|
130
|
-
* @returns A resource representing the rewards for the given region. See {@link LegacyRewardsResponse}
|
|
131
|
-
*/
|
|
132
|
-
function legacyRewards(regionId) {
|
|
133
|
-
return { path: `/sc2/legacy/data/rewards/${starcraftRegion[regionId]}` };
|
|
134
|
-
}
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region src/profile/profile.ts
|
|
137
|
-
/**
|
|
138
|
-
* Returns the ladder information for the specified profile and ladder.
|
|
139
|
-
* @param regionId The region ID for Starcraft.
|
|
140
|
-
* @param realmId 1 or 2
|
|
141
|
-
* @param profileId The ID of the profile.
|
|
142
|
-
* @param ladderId The ID of the ladder.
|
|
143
|
-
* @returns A resource representing the ladder. See {@link LadderResponse}
|
|
144
|
-
*/
|
|
145
|
-
function ladder(regionId, realmId, profileId, ladderId) {
|
|
146
|
-
return { path: `/sc2/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/ladder/${ladderId}` };
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Returns the ladder summary information for the specified profile.
|
|
150
|
-
* @param regionId The region ID for Starcraft.
|
|
151
|
-
* @param realmId 1 or 2
|
|
152
|
-
* @param profileId The ID of the profile.
|
|
153
|
-
* @returns A resource representing the ladder summary. See {@link LadderSummaryResponse}
|
|
154
|
-
*/
|
|
155
|
-
function ladderSummary(regionId, realmId, profileId) {
|
|
156
|
-
return { path: `/sc2/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/ladder/summary` };
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Returns the metadata information for the specified profile.
|
|
160
|
-
* @param regionId The region ID for Starcraft.
|
|
161
|
-
* @param realmId 1 or 2
|
|
162
|
-
* @param profileId The ID of the profile.
|
|
163
|
-
* @returns A resource representing the metadata. See {@link MetadataResponse}
|
|
164
|
-
*/
|
|
165
|
-
function metadata(regionId, realmId, profileId) {
|
|
166
|
-
return { path: `/sc2/metadata/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}` };
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Returns the profile information for the specified profile.
|
|
170
|
-
* @param regionId The region ID for Starcraft.
|
|
171
|
-
* @param realmId 1 or 2
|
|
172
|
-
* @param profileId The ID of the profile.
|
|
173
|
-
* @returns A resource representing the profile. See {@link MetadataResponse}
|
|
174
|
-
*/
|
|
175
|
-
function profile(regionId, realmId, profileId) {
|
|
176
|
-
return { path: `/sc2/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}` };
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
*
|
|
180
|
-
* @param regionId The region ID for Starcraft.
|
|
181
|
-
* @returns A resource representing the static profile. See {@link StaticProfileResponse}
|
|
182
|
-
*/
|
|
183
|
-
function staticProfile(regionId) {
|
|
184
|
-
return { path: `/sc2/static/profile/${starcraftRegion[regionId]}` };
|
|
185
|
-
}
|
|
186
|
-
//#endregion
|
|
1
|
+
import { player } from "./account/index.js";
|
|
2
|
+
import { grandmasterLeaderboard, season } from "./ladder/index.js";
|
|
3
|
+
import { getLeagueData } from "./league/index.js";
|
|
4
|
+
import { legacyAchievements, legacyLadder, legacyLadders, legacyMatchHistory, legacyProfile, legacyRewards } from "./legacy/index.js";
|
|
5
|
+
import { ladder, ladderSummary, metadata, profile, staticProfile } from "./profile/index.js";
|
|
187
6
|
//#region src/index.ts
|
|
188
7
|
const sc2 = {
|
|
189
8
|
player,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/account/account.ts","../src/regions.ts","../src/ladder/ladder.ts","../src/league/league.ts","../src/legacy/legacy.ts","../src/profile/profile.ts","../src/index.ts"],"sourcesContent":["import type { Resource } from '@blizzard-api/core';\r\n\r\n/**\r\n * Returns the player information for the specified account ID.\r\n * @param accountId The account ID\r\n * @returns The player resource. See {@link Resource}.\r\n */\r\nexport function player(accountId: string): Resource<Array<unknown>> {\r\n return {\r\n path: `/sc2/player/${accountId}`,\r\n };\r\n}\r\n","//The region (1=US, 2=EU, 3=KO and TW, 5=CN).\nexport type StarcraftRegion = 'cn' | 'eu' | 'kr' | 'tw' | 'us';\n\nexport const starcraftRegion: Record<StarcraftRegion, number> = {\n cn: 5,\n eu: 2,\n kr: 3,\n tw: 3,\n us: 1,\n};\n","import type { Resource } from '@blizzard-api/core';\r\nimport { starcraftRegion } from '../regions';\r\nimport type { StarcraftRegion } from '../regions';\r\nimport type { GrandmasterLeaderboardResponse, SeasonResponse } from './types';\r\n\r\n/**\r\n * Returns the grandmaster leaderboard for the specified region.\r\n * @param regionId The region ID\r\n * @returns The grandmaster leaderboard resource. See {@link GrandmasterLeaderboardResponse}.\r\n */\r\nexport function grandmasterLeaderboard(regionId: StarcraftRegion): Resource<GrandmasterLeaderboardResponse> {\r\n return {\r\n path: `/sc2/ladder/grandmaster/${starcraftRegion[regionId]}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the season information for the specified region.\r\n * @param regionId The region ID\r\n * @returns The season resource. See {@link SeasonResponse}.\r\n */\r\nexport function season(regionId: StarcraftRegion): Resource<SeasonResponse> {\r\n return {\r\n path: `/sc2/ladder/season/${starcraftRegion[regionId]}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport type { LeagueDataResponse, StarcraftLeagueId, StarcraftLeagueQueue, StarcraftLeagueTeamType } from './types';\r\n\r\nconst starcraftLeagueQueue: Record<StarcraftLeagueQueue, number> = {\r\n 'hots-1v1': 101,\r\n 'hots-2v2': 102,\r\n 'hots-3v3': 103,\r\n 'hots-4v4': 104,\r\n 'lotv-1v1': 201,\r\n 'lotv-2v2': 202,\r\n 'lotv-3v3': 203,\r\n 'lotv-4v4': 204,\r\n 'lotv-archon': 206,\r\n 'wol-1v1': 1,\r\n 'wol-2v2': 2,\r\n 'wol-3v3': 3,\r\n 'wol-4v4': 4,\r\n};\r\n\r\nconst starcraftLeagueTeam: Record<StarcraftLeagueTeamType, number> = {\r\n arranged: 0,\r\n random: 1,\r\n};\r\n\r\nconst starcraftLeagueId: Record<StarcraftLeagueId, number> = {\r\n bronze: 0,\r\n diamond: 4,\r\n gold: 2,\r\n grandmaster: 6,\r\n master: 5,\r\n platinum: 3,\r\n silver: 1,\r\n};\r\n\r\n/**\r\n * Returns the league data for the specified season, queue, team type, and league.\r\n * @param seasonId The season ID\r\n * @param queueId The queue ID\r\n * @param teamType The team type\r\n * @param leagueId The league ID\r\n * @returns The league data resource. See {@link LeagueDataResponse}.\r\n */\r\nexport function getLeagueData(\r\n seasonId: string,\r\n queueId: StarcraftLeagueQueue,\r\n teamType: StarcraftLeagueTeamType,\r\n leagueId: StarcraftLeagueId,\r\n): Resource<LeagueDataResponse> {\r\n return {\r\n path: `/data/sc2/league/${seasonId}/${starcraftLeagueQueue[queueId]}/${starcraftLeagueTeam[teamType]}/${starcraftLeagueId[leagueId]}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { starcraftRegion } from '../regions';\r\nimport type { StarcraftRegion } from '../regions';\r\nimport type {\r\n LegacyAchievementsResponse,\r\n LegacyLaddersResponse,\r\n LegacyMatchHistoryResponse,\r\n LegacyProfileResponse,\r\n LegacyRewardsResponse,\r\n} from './types';\r\n\r\n/**\r\n * Returns the legacy achievements for the specified region.\r\n * @param regionId The region ID for Starcraft.\r\n * @returns A resource representing the legacy achievements. See {@link LegacyAchievementsResponse}\r\n */\r\nexport function legacyAchievements(regionId: StarcraftRegion): Resource<LegacyAchievementsResponse> {\r\n return {\r\n path: `/sc2/legacy/data/achievements/${starcraftRegion[regionId]}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the ladder information for the specified ladder.\r\n * @param regionId The region ID for Starcraft.\r\n * @param ladderId The ID of the ladder.\r\n * @returns A resource representing the ladder. See {@link LadderResponse}\r\n */\r\nexport function legacyLadder(regionId: StarcraftRegion, ladderId: number): Resource<unknown> {\r\n return {\r\n path: `/sc2/legacy/ladder/${starcraftRegion[regionId]}/${ladderId}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the ladders for the specified profile.\r\n * @param regionId The region ID for Starcraft.\r\n * @param realmId 1 or 2\r\n * @param profileId The ID of the profile.\r\n * @returns A resource representing the ladders for the given profile. See {@link LegacyLaddersResponse}\r\n */\r\nexport function legacyLadders(\r\n regionId: StarcraftRegion,\r\n realmId: 1 | 2,\r\n profileId: number,\r\n): Resource<LegacyLaddersResponse> {\r\n return {\r\n path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/ladders`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the match history for the specified profile.\r\n * @param regionId The region ID for Starcraft.\r\n * @param realmId 1 or 2\r\n * @param profileId The ID of the profile.\r\n * @returns A resource representing the match history for the given profile. See {@link LegacyMatchHistoryResponse}\r\n */\r\nexport function legacyMatchHistory(\r\n regionId: StarcraftRegion,\r\n realmId: 1 | 2,\r\n profileId: number,\r\n): Resource<LegacyMatchHistoryResponse> {\r\n return {\r\n path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/matches`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the profile for the specified profile.\r\n * @param regionId The region ID for Starcraft.\r\n * @param realmId 1 or 2\r\n * @param profileId The ID of the profile.\r\n * @returns A resource representing the profile for the given ID. See {@link LegacyProfileResponse}\r\n */\r\nexport function legacyProfile(\r\n regionId: StarcraftRegion,\r\n realmId: 1 | 2,\r\n profileId: number,\r\n): Resource<LegacyProfileResponse> {\r\n return {\r\n path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the rewards for the specified region.\r\n * @param regionId The region ID for Starcraft.\r\n * @returns A resource representing the rewards for the given region. See {@link LegacyRewardsResponse}\r\n */\r\nexport function legacyRewards(regionId: StarcraftRegion): Resource<LegacyRewardsResponse> {\r\n return {\r\n path: `/sc2/legacy/data/rewards/${starcraftRegion[regionId]}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { starcraftRegion } from '../regions';\r\nimport type { StarcraftRegion } from '../regions';\r\nimport type { LadderResponse, LadderSummaryResponse, MetadataResponse, StaticProfileResponse } from './types';\r\n\r\n/**\r\n * Returns the ladder information for the specified profile and ladder.\r\n * @param regionId The region ID for Starcraft.\r\n * @param realmId 1 or 2\r\n * @param profileId The ID of the profile.\r\n * @param ladderId The ID of the ladder.\r\n * @returns A resource representing the ladder. See {@link LadderResponse}\r\n */\r\nexport function ladder(\r\n regionId: StarcraftRegion,\r\n realmId: 1 | 2,\r\n profileId: number,\r\n ladderId: number,\r\n): Resource<LadderResponse> {\r\n return {\r\n path: `/sc2/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/ladder/${ladderId}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the ladder summary information for the specified profile.\r\n * @param regionId The region ID for Starcraft.\r\n * @param realmId 1 or 2\r\n * @param profileId The ID of the profile.\r\n * @returns A resource representing the ladder summary. See {@link LadderSummaryResponse}\r\n */\r\nexport function ladderSummary(\r\n regionId: StarcraftRegion,\r\n realmId: 1 | 2,\r\n profileId: number,\r\n): Resource<LadderSummaryResponse> {\r\n return {\r\n path: `/sc2/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/ladder/summary`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the metadata information for the specified profile.\r\n * @param regionId The region ID for Starcraft.\r\n * @param realmId 1 or 2\r\n * @param profileId The ID of the profile.\r\n * @returns A resource representing the metadata. See {@link MetadataResponse}\r\n */\r\nexport function metadata(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<MetadataResponse> {\r\n return {\r\n path: `/sc2/metadata/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}`,\r\n };\r\n}\r\n\r\n/**\r\n * Returns the profile information for the specified profile.\r\n * @param regionId The region ID for Starcraft.\r\n * @param realmId 1 or 2\r\n * @param profileId The ID of the profile.\r\n * @returns A resource representing the profile. See {@link MetadataResponse}\r\n */\r\nexport function profile(regionId: StarcraftRegion, realmId: 1 | 2, profileId: number): Resource<MetadataResponse> {\r\n return {\r\n path: `/sc2/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}`,\r\n };\r\n}\r\n\r\n/**\r\n *\r\n * @param regionId The region ID for Starcraft.\r\n * @returns A resource representing the static profile. See {@link StaticProfileResponse}\r\n */\r\nexport function staticProfile(regionId: StarcraftRegion): Resource<StaticProfileResponse> {\r\n return {\r\n path: `/sc2/static/profile/${starcraftRegion[regionId]}`,\r\n };\r\n}\r\n","import { player } from './account/account';\r\nimport { grandmasterLeaderboard, season } from './ladder/ladder';\r\nimport { getLeagueData } from './league/league';\r\nimport {\r\n legacyAchievements,\r\n legacyLadder,\r\n legacyLadders,\r\n legacyMatchHistory,\r\n legacyProfile,\r\n legacyRewards,\r\n} from './legacy/legacy';\r\nimport { ladder, ladderSummary, metadata, profile, staticProfile } from './profile/profile';\r\n\r\nconst sc2 = {\r\n //Account\r\n player,\r\n //Ladder\r\n grandmasterLeaderboard,\r\n season,\r\n //League\r\n getLeagueData,\r\n //Legacy\r\n legacyAchievements,\r\n legacyLadder,\r\n legacyLadders,\r\n legacyMatchHistory,\r\n legacyProfile,\r\n legacyRewards,\r\n //Profile\r\n ladder,\r\n ladderSummary,\r\n metadata,\r\n profile,\r\n staticProfile,\r\n};\r\nexport default sc2;\r\nexport { sc2 };\r\n\r\n//Account\r\nexport * from './account/account';\r\n//Ladder\r\nexport * from './ladder/ladder';\r\nexport type * from './ladder/types';\r\n//League\r\nexport * from './league/league';\r\nexport type * from './league/types';\r\n//Legacy\r\nexport * from './legacy/legacy';\r\nexport type * from './legacy/types';\r\n//Profile\r\nexport * from './profile/profile';\r\nexport type * from './profile/types';\r\n"],"mappings":";;;;;;AAOA,SAAgB,OAAO,WAA6C;AAClE,QAAO,EACL,MAAM,eAAe,aACtB;;;;ACPH,MAAa,kBAAmD;CAC9D,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;;;;;;;;ACCD,SAAgB,uBAAuB,UAAqE;AAC1G,QAAO,EACL,MAAM,2BAA2B,gBAAgB,aAClD;;;;;;;AAQH,SAAgB,OAAO,UAAqD;AAC1E,QAAO,EACL,MAAM,sBAAsB,gBAAgB,aAC7C;;;;ACrBH,MAAM,uBAA6D;CACjE,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,eAAe;CACf,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACZ;AAED,MAAM,sBAA+D;CACnE,UAAU;CACV,QAAQ;CACT;AAED,MAAM,oBAAuD;CAC3D,QAAQ;CACR,SAAS;CACT,MAAM;CACN,aAAa;CACb,QAAQ;CACR,UAAU;CACV,QAAQ;CACT;;;;;;;;;AAUD,SAAgB,cACd,UACA,SACA,UACA,UAC8B;AAC9B,QAAO,EACL,MAAM,oBAAoB,SAAS,GAAG,qBAAqB,SAAS,GAAG,oBAAoB,UAAU,GAAG,kBAAkB,aAC3H;;;;;;;;;AClCH,SAAgB,mBAAmB,UAAiE;AAClG,QAAO,EACL,MAAM,iCAAiC,gBAAgB,aACxD;;;;;;;;AASH,SAAgB,aAAa,UAA2B,UAAqC;AAC3F,QAAO,EACL,MAAM,sBAAsB,gBAAgB,UAAU,GAAG,YAC1D;;;;;;;;;AAUH,SAAgB,cACd,UACA,SACA,WACiC;AACjC,QAAO,EACL,MAAM,uBAAuB,gBAAgB,UAAU,GAAG,QAAQ,GAAG,UAAU,WAChF;;;;;;;;;AAUH,SAAgB,mBACd,UACA,SACA,WACsC;AACtC,QAAO,EACL,MAAM,uBAAuB,gBAAgB,UAAU,GAAG,QAAQ,GAAG,UAAU,WAChF;;;;;;;;;AAUH,SAAgB,cACd,UACA,SACA,WACiC;AACjC,QAAO,EACL,MAAM,uBAAuB,gBAAgB,UAAU,GAAG,QAAQ,GAAG,aACtE;;;;;;;AAQH,SAAgB,cAAc,UAA4D;AACxF,QAAO,EACL,MAAM,4BAA4B,gBAAgB,aACnD;;;;;;;;;;;;AChFH,SAAgB,OACd,UACA,SACA,WACA,UAC0B;AAC1B,QAAO,EACL,MAAM,gBAAgB,gBAAgB,UAAU,GAAG,QAAQ,GAAG,UAAU,UAAU,YACnF;;;;;;;;;AAUH,SAAgB,cACd,UACA,SACA,WACiC;AACjC,QAAO,EACL,MAAM,gBAAgB,gBAAgB,UAAU,GAAG,QAAQ,GAAG,UAAU,kBACzE;;;;;;;;;AAUH,SAAgB,SAAS,UAA2B,SAAgB,WAA+C;AACjH,QAAO,EACL,MAAM,yBAAyB,gBAAgB,UAAU,GAAG,QAAQ,GAAG,aACxE;;;;;;;;;AAUH,SAAgB,QAAQ,UAA2B,SAAgB,WAA+C;AAChH,QAAO,EACL,MAAM,gBAAgB,gBAAgB,UAAU,GAAG,QAAQ,GAAG,aAC/D;;;;;;;AAQH,SAAgB,cAAc,UAA4D;AACxF,QAAO,EACL,MAAM,uBAAuB,gBAAgB,aAC9C;;;;AC9DH,MAAM,MAAM;CAEV;CAEA;CACA;CAEA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { player } from './account/index';\r\nimport { grandmasterLeaderboard, season } from './ladder/index';\r\nimport { getLeagueData } from './league/index';\r\nimport {\r\n legacyAchievements,\r\n legacyLadder,\r\n legacyLadders,\r\n legacyMatchHistory,\r\n legacyProfile,\r\n legacyRewards,\r\n} from './legacy/index';\r\nimport { ladder, ladderSummary, metadata, profile, staticProfile } from './profile/index';\r\n\r\nconst sc2 = {\r\n //Account\r\n player,\r\n //Ladder\r\n grandmasterLeaderboard,\r\n season,\r\n //League\r\n getLeagueData,\r\n //Legacy\r\n legacyAchievements,\r\n legacyLadder,\r\n legacyLadders,\r\n legacyMatchHistory,\r\n legacyProfile,\r\n legacyRewards,\r\n //Profile\r\n ladder,\r\n ladderSummary,\r\n metadata,\r\n profile,\r\n staticProfile,\r\n};\r\nexport default sc2;\r\nexport { sc2 };\r\n\r\n//Account\r\nexport * from './account/index';\r\n//Ladder\r\nexport * from './ladder/index';\r\nexport type * from './ladder/types';\r\n//League\r\nexport * from './league/index';\r\nexport type * from './league/types';\r\n//Legacy\r\nexport * from './legacy/index';\r\nexport type * from './legacy/types';\r\n//Profile\r\nexport * from './profile/index';\r\nexport type * from './profile/types';\r\n"],"mappings":";;;;;;AAaA,MAAM,MAAM;CAEV;CAEA;CACA;CAEA;CAEA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as starcraftRegion } from "../regions-Dk4G9ABq.js";
|
|
2
|
+
//#region src/ladder/index.ts
|
|
3
|
+
/**
|
|
4
|
+
* Returns the grandmaster leaderboard for the specified region.
|
|
5
|
+
* @param regionId The region ID
|
|
6
|
+
* @returns The grandmaster leaderboard resource. See {@link GrandmasterLeaderboardResponse}.
|
|
7
|
+
*/
|
|
8
|
+
function grandmasterLeaderboard(regionId) {
|
|
9
|
+
return { path: `/sc2/ladder/grandmaster/${starcraftRegion[regionId]}` };
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Returns the season information for the specified region.
|
|
13
|
+
* @param regionId The region ID
|
|
14
|
+
* @returns The season resource. See {@link SeasonResponse}.
|
|
15
|
+
*/
|
|
16
|
+
function season(regionId) {
|
|
17
|
+
return { path: `/sc2/ladder/season/${starcraftRegion[regionId]}` };
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { grandmasterLeaderboard, season };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/ladder/index.ts"],"sourcesContent":["import type { Resource } from '@blizzard-api/core';\nimport { starcraftRegion } from '../regions';\nimport type { StarcraftRegion } from '../regions';\nimport type { GrandmasterLeaderboardResponse, SeasonResponse } from './types';\n\n/**\n * Returns the grandmaster leaderboard for the specified region.\n * @param regionId The region ID\n * @returns The grandmaster leaderboard resource. See {@link GrandmasterLeaderboardResponse}.\n */\nexport function grandmasterLeaderboard(regionId: StarcraftRegion): Resource<GrandmasterLeaderboardResponse> {\n return {\n path: `/sc2/ladder/grandmaster/${starcraftRegion[regionId]}`,\n };\n}\n\n/**\n * Returns the season information for the specified region.\n * @param regionId The region ID\n * @returns The season resource. See {@link SeasonResponse}.\n */\nexport function season(regionId: StarcraftRegion): Resource<SeasonResponse> {\n return {\n path: `/sc2/ladder/season/${starcraftRegion[regionId]}`,\n };\n}\n"],"mappings":";;;;;;;AAUA,SAAgB,uBAAuB,UAAqE;AAC1G,QAAO,EACL,MAAM,2BAA2B,gBAAgB,aAClD;;;;;;;AAQH,SAAgB,OAAO,UAAqD;AAC1E,QAAO,EACL,MAAM,sBAAsB,gBAAgB,aAC7C"}
|