@blizzard-api/sc2 1.0.5 → 2.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.
- package/dist/index.d.ts +9 -30
- package/dist/index.js +2 -82
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
import { Resource } from "@blizzard-api/core";
|
|
1
|
+
import { Resource, ResponseBase } from "@blizzard-api/core";
|
|
2
2
|
|
|
3
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
4
|
/**
|
|
10
5
|
* Returns the player information for the specified account ID.
|
|
11
6
|
* @param accountId The account ID
|
|
12
7
|
* @returns The player resource. See {@link Resource}.
|
|
13
8
|
*/
|
|
14
9
|
declare function player(accountId: string): Resource<Array<unknown>>;
|
|
15
|
-
|
|
16
10
|
//#endregion
|
|
17
|
-
//#region src/
|
|
18
|
-
/**
|
|
19
|
-
* Base interface for Blizzard API responses.
|
|
20
|
-
*/
|
|
21
|
-
interface ResponseBase {
|
|
22
|
-
_links: {
|
|
23
|
-
self: {
|
|
24
|
-
href: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
}
|
|
11
|
+
//#region src/regions.d.ts
|
|
28
12
|
type StarcraftRegion = 'cn' | 'eu' | 'kr' | 'tw' | 'us';
|
|
29
|
-
|
|
30
13
|
//#endregion
|
|
31
14
|
//#region src/ladder/types.d.ts
|
|
32
15
|
interface GrandmasterLeaderboardResponse {
|
|
@@ -56,7 +39,6 @@ interface TeamMember {
|
|
|
56
39
|
realm: number;
|
|
57
40
|
region: number;
|
|
58
41
|
}
|
|
59
|
-
|
|
60
42
|
//#endregion
|
|
61
43
|
//#region src/ladder/ladder.d.ts
|
|
62
44
|
/**
|
|
@@ -71,7 +53,6 @@ declare function grandmasterLeaderboard(regionId: StarcraftRegion): Resource<Gra
|
|
|
71
53
|
* @returns The season resource. See {@link SeasonResponse}.
|
|
72
54
|
*/
|
|
73
55
|
declare function season(regionId: StarcraftRegion): Resource<SeasonResponse>;
|
|
74
|
-
|
|
75
56
|
//#endregion
|
|
76
57
|
//#region src/league/types.d.ts
|
|
77
58
|
interface LeagueDataResponse extends ResponseBase {
|
|
@@ -96,7 +77,6 @@ interface Tier {
|
|
|
96
77
|
division: Array<Division>;
|
|
97
78
|
id: number;
|
|
98
79
|
}
|
|
99
|
-
|
|
100
80
|
//#endregion
|
|
101
81
|
//#region src/league/league.d.ts
|
|
102
82
|
/**
|
|
@@ -108,7 +88,6 @@ interface Tier {
|
|
|
108
88
|
* @returns The league data resource. See {@link LeagueDataResponse}.
|
|
109
89
|
*/
|
|
110
90
|
declare function getLeagueData(seasonId: string, queueId: StarcraftLeagueQueue, teamType: StarcraftLeagueTeamType, leagueId: StarcraftLeagueId): Resource<LeagueDataResponse>;
|
|
111
|
-
|
|
112
91
|
//#endregion
|
|
113
92
|
//#region src/legacy/types.d.ts
|
|
114
93
|
interface LegacyAchievementsResponse {
|
|
@@ -185,7 +164,12 @@ interface Career {
|
|
|
185
164
|
}
|
|
186
165
|
interface Category$1 {
|
|
187
166
|
categoryId: string;
|
|
188
|
-
children?: Array<
|
|
167
|
+
children?: Array<CategoryChild>;
|
|
168
|
+
featuredAchievementId: string;
|
|
169
|
+
title: string;
|
|
170
|
+
}
|
|
171
|
+
interface CategoryChild {
|
|
172
|
+
categoryId: string;
|
|
189
173
|
featuredAchievementId: string;
|
|
190
174
|
title: string;
|
|
191
175
|
}
|
|
@@ -235,7 +219,6 @@ interface SwarmLevelsByRace {
|
|
|
235
219
|
level: number;
|
|
236
220
|
totalLevelXP: number;
|
|
237
221
|
}
|
|
238
|
-
|
|
239
222
|
//#endregion
|
|
240
223
|
//#region src/legacy/legacy.d.ts
|
|
241
224
|
/**
|
|
@@ -281,7 +264,6 @@ declare function legacyProfile(regionId: StarcraftRegion, realmId: 1 | 2, profil
|
|
|
281
264
|
* @returns A resource representing the rewards for the given region. See {@link LegacyRewardsResponse}
|
|
282
265
|
*/
|
|
283
266
|
declare function legacyRewards(regionId: StarcraftRegion): Resource<LegacyRewardsResponse>;
|
|
284
|
-
|
|
285
267
|
//#endregion
|
|
286
268
|
//#region src/profile/types.d.ts
|
|
287
269
|
interface LadderResponse {
|
|
@@ -352,7 +334,6 @@ interface Reward {
|
|
|
352
334
|
uiOrderHint: number;
|
|
353
335
|
unlockableType: string;
|
|
354
336
|
}
|
|
355
|
-
|
|
356
337
|
//#endregion
|
|
357
338
|
//#region src/profile/profile.d.ts
|
|
358
339
|
/**
|
|
@@ -394,7 +375,6 @@ declare function profile(regionId: StarcraftRegion, realmId: 1 | 2, profileId: n
|
|
|
394
375
|
* @returns A resource representing the static profile. See {@link StaticProfileResponse}
|
|
395
376
|
*/
|
|
396
377
|
declare function staticProfile(regionId: StarcraftRegion): Resource<StaticProfileResponse>;
|
|
397
|
-
|
|
398
378
|
//#endregion
|
|
399
379
|
//#region src/index.d.ts
|
|
400
380
|
declare const sc2: {
|
|
@@ -414,7 +394,6 @@ declare const sc2: {
|
|
|
414
394
|
profile: typeof profile;
|
|
415
395
|
staticProfile: typeof staticProfile;
|
|
416
396
|
};
|
|
417
|
-
|
|
418
397
|
//#endregion
|
|
419
|
-
export { GrandmasterLeaderboardResponse, LadderResponse, LadderSummaryResponse, LeagueDataResponse, LegacyAchievementsResponse, LegacyLaddersResponse, LegacyMatchHistoryResponse, LegacyProfileResponse, LegacyRewardsResponse, MetadataResponse, SeasonResponse, StarcraftLeagueId, StarcraftLeagueQueue, StarcraftLeagueTeamType, StaticProfileResponse, sc2 as default, getLeagueData, grandmasterLeaderboard, ladder, ladderSummary, legacyAchievements, legacyLadder, legacyLadders, legacyMatchHistory, legacyProfile, legacyRewards, metadata, player, profile,
|
|
398
|
+
export { GrandmasterLeaderboardResponse, LadderResponse, LadderSummaryResponse, LeagueDataResponse, LegacyAchievementsResponse, LegacyLaddersResponse, LegacyMatchHistoryResponse, LegacyProfileResponse, LegacyRewardsResponse, MetadataResponse, SeasonResponse, StarcraftLeagueId, StarcraftLeagueQueue, StarcraftLeagueTeamType, StaticProfileResponse, sc2 as default, sc2, getLeagueData, grandmasterLeaderboard, ladder, ladderSummary, legacyAchievements, legacyLadder, legacyLadders, legacyMatchHistory, legacyProfile, legacyRewards, metadata, player, profile, season, staticProfile };
|
|
420
399
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
//#region src/account/account.ts
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
3
|
* Returns the player information for the specified account ID.
|
|
5
|
-
|
|
6
4
|
* @param accountId The account ID
|
|
7
|
-
|
|
8
5
|
* @returns The player resource. See {@link Resource}.
|
|
9
|
-
|
|
10
6
|
*/
|
|
11
7
|
function player(accountId) {
|
|
12
8
|
return { path: `/sc2/player/${accountId}` };
|
|
13
9
|
}
|
|
14
10
|
|
|
15
11
|
//#endregion
|
|
16
|
-
//#region src/
|
|
12
|
+
//#region src/regions.ts
|
|
17
13
|
const starcraftRegion = {
|
|
18
14
|
cn: 5,
|
|
19
15
|
eu: 2,
|
|
@@ -25,25 +21,17 @@ const starcraftRegion = {
|
|
|
25
21
|
//#endregion
|
|
26
22
|
//#region src/ladder/ladder.ts
|
|
27
23
|
/**
|
|
28
|
-
|
|
29
24
|
* Returns the grandmaster leaderboard for the specified region.
|
|
30
|
-
|
|
31
25
|
* @param regionId The region ID
|
|
32
|
-
|
|
33
26
|
* @returns The grandmaster leaderboard resource. See {@link GrandmasterLeaderboardResponse}.
|
|
34
|
-
|
|
35
27
|
*/
|
|
36
28
|
function grandmasterLeaderboard(regionId) {
|
|
37
29
|
return { path: `/sc2/ladder/grandmaster/${starcraftRegion[regionId]}` };
|
|
38
30
|
}
|
|
39
31
|
/**
|
|
40
|
-
|
|
41
32
|
* Returns the season information for the specified region.
|
|
42
|
-
|
|
43
33
|
* @param regionId The region ID
|
|
44
|
-
|
|
45
34
|
* @returns The season resource. See {@link SeasonResponse}.
|
|
46
|
-
|
|
47
35
|
*/
|
|
48
36
|
function season(regionId) {
|
|
49
37
|
return { path: `/sc2/ladder/season/${starcraftRegion[regionId]}` };
|
|
@@ -80,19 +68,12 @@ const starcraftLeagueId = {
|
|
|
80
68
|
silver: 1
|
|
81
69
|
};
|
|
82
70
|
/**
|
|
83
|
-
|
|
84
71
|
* Returns the league data for the specified season, queue, team type, and league.
|
|
85
|
-
|
|
86
72
|
* @param seasonId The season ID
|
|
87
|
-
|
|
88
73
|
* @param queueId The queue ID
|
|
89
|
-
|
|
90
74
|
* @param teamType The team type
|
|
91
|
-
|
|
92
75
|
* @param leagueId The league ID
|
|
93
|
-
|
|
94
76
|
* @returns The league data resource. See {@link LeagueDataResponse}.
|
|
95
|
-
|
|
96
77
|
*/
|
|
97
78
|
function getLeagueData(seasonId, queueId, teamType, leagueId) {
|
|
98
79
|
return { path: `/data/sc2/league/${seasonId}/${starcraftLeagueQueue[queueId]}/${starcraftLeagueTeam[teamType]}/${starcraftLeagueId[leagueId]}` };
|
|
@@ -101,87 +82,56 @@ function getLeagueData(seasonId, queueId, teamType, leagueId) {
|
|
|
101
82
|
//#endregion
|
|
102
83
|
//#region src/legacy/legacy.ts
|
|
103
84
|
/**
|
|
104
|
-
|
|
105
85
|
* Returns the legacy achievements for the specified region.
|
|
106
|
-
|
|
107
86
|
* @param regionId The region ID for Starcraft.
|
|
108
|
-
|
|
109
87
|
* @returns A resource representing the legacy achievements. See {@link LegacyAchievementsResponse}
|
|
110
|
-
|
|
111
88
|
*/
|
|
112
89
|
function legacyAchievements(regionId) {
|
|
113
90
|
return { path: `/sc2/legacy/data/achievements/${starcraftRegion[regionId]}` };
|
|
114
91
|
}
|
|
115
92
|
/**
|
|
116
|
-
|
|
117
93
|
* Returns the ladder information for the specified ladder.
|
|
118
|
-
|
|
119
94
|
* @param regionId The region ID for Starcraft.
|
|
120
|
-
|
|
121
95
|
* @param ladderId The ID of the ladder.
|
|
122
|
-
|
|
123
96
|
* @returns A resource representing the ladder. See {@link LadderResponse}
|
|
124
|
-
|
|
125
97
|
*/
|
|
126
98
|
function legacyLadder(regionId, ladderId) {
|
|
127
99
|
return { path: `/sc2/legacy/ladder/${starcraftRegion[regionId]}/${ladderId}` };
|
|
128
100
|
}
|
|
129
101
|
/**
|
|
130
|
-
|
|
131
102
|
* Returns the ladders for the specified profile.
|
|
132
|
-
|
|
133
103
|
* @param regionId The region ID for Starcraft.
|
|
134
|
-
|
|
135
104
|
* @param realmId 1 or 2
|
|
136
|
-
|
|
137
105
|
* @param profileId The ID of the profile.
|
|
138
|
-
|
|
139
106
|
* @returns A resource representing the ladders for the given profile. See {@link LegacyLaddersResponse}
|
|
140
|
-
|
|
141
107
|
*/
|
|
142
108
|
function legacyLadders(regionId, realmId, profileId) {
|
|
143
109
|
return { path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/ladders` };
|
|
144
110
|
}
|
|
145
111
|
/**
|
|
146
|
-
|
|
147
112
|
* Returns the match history for the specified profile.
|
|
148
|
-
|
|
149
113
|
* @param regionId The region ID for Starcraft.
|
|
150
|
-
|
|
151
114
|
* @param realmId 1 or 2
|
|
152
|
-
|
|
153
115
|
* @param profileId The ID of the profile.
|
|
154
|
-
|
|
155
116
|
* @returns A resource representing the match history for the given profile. See {@link LegacyMatchHistoryResponse}
|
|
156
|
-
|
|
157
117
|
*/
|
|
158
118
|
function legacyMatchHistory(regionId, realmId, profileId) {
|
|
159
119
|
return { path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/matches` };
|
|
160
120
|
}
|
|
161
121
|
/**
|
|
162
|
-
|
|
163
122
|
* Returns the profile for the specified profile.
|
|
164
|
-
|
|
165
123
|
* @param regionId The region ID for Starcraft.
|
|
166
|
-
|
|
167
124
|
* @param realmId 1 or 2
|
|
168
|
-
|
|
169
125
|
* @param profileId The ID of the profile.
|
|
170
|
-
|
|
171
126
|
* @returns A resource representing the profile for the given ID. See {@link LegacyProfileResponse}
|
|
172
|
-
|
|
173
127
|
*/
|
|
174
128
|
function legacyProfile(regionId, realmId, profileId) {
|
|
175
129
|
return { path: `/sc2/legacy/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}` };
|
|
176
130
|
}
|
|
177
131
|
/**
|
|
178
|
-
|
|
179
132
|
* Returns the rewards for the specified region.
|
|
180
|
-
|
|
181
133
|
* @param regionId The region ID for Starcraft.
|
|
182
|
-
|
|
183
134
|
* @returns A resource representing the rewards for the given region. See {@link LegacyRewardsResponse}
|
|
184
|
-
|
|
185
135
|
*/
|
|
186
136
|
function legacyRewards(regionId) {
|
|
187
137
|
return { path: `/sc2/legacy/data/rewards/${starcraftRegion[regionId]}` };
|
|
@@ -190,79 +140,50 @@ function legacyRewards(regionId) {
|
|
|
190
140
|
//#endregion
|
|
191
141
|
//#region src/profile/profile.ts
|
|
192
142
|
/**
|
|
193
|
-
|
|
194
143
|
* Returns the ladder information for the specified profile and ladder.
|
|
195
|
-
|
|
196
144
|
* @param regionId The region ID for Starcraft.
|
|
197
|
-
|
|
198
145
|
* @param realmId 1 or 2
|
|
199
|
-
|
|
200
146
|
* @param profileId The ID of the profile.
|
|
201
|
-
|
|
202
147
|
* @param ladderId The ID of the ladder.
|
|
203
|
-
|
|
204
148
|
* @returns A resource representing the ladder. See {@link LadderResponse}
|
|
205
|
-
|
|
206
149
|
*/
|
|
207
150
|
function ladder(regionId, realmId, profileId, ladderId) {
|
|
208
151
|
return { path: `/sc2/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/ladder/${ladderId}` };
|
|
209
152
|
}
|
|
210
153
|
/**
|
|
211
|
-
|
|
212
154
|
* Returns the ladder summary information for the specified profile.
|
|
213
|
-
|
|
214
155
|
* @param regionId The region ID for Starcraft.
|
|
215
|
-
|
|
216
156
|
* @param realmId 1 or 2
|
|
217
|
-
|
|
218
157
|
* @param profileId The ID of the profile.
|
|
219
|
-
|
|
220
158
|
* @returns A resource representing the ladder summary. See {@link LadderSummaryResponse}
|
|
221
|
-
|
|
222
159
|
*/
|
|
223
160
|
function ladderSummary(regionId, realmId, profileId) {
|
|
224
161
|
return { path: `/sc2/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}/ladder/summary` };
|
|
225
162
|
}
|
|
226
163
|
/**
|
|
227
|
-
|
|
228
164
|
* Returns the metadata information for the specified profile.
|
|
229
|
-
|
|
230
165
|
* @param regionId The region ID for Starcraft.
|
|
231
|
-
|
|
232
166
|
* @param realmId 1 or 2
|
|
233
|
-
|
|
234
167
|
* @param profileId The ID of the profile.
|
|
235
|
-
|
|
236
168
|
* @returns A resource representing the metadata. See {@link MetadataResponse}
|
|
237
|
-
|
|
238
169
|
*/
|
|
239
170
|
function metadata(regionId, realmId, profileId) {
|
|
240
171
|
return { path: `/sc2/metadata/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}` };
|
|
241
172
|
}
|
|
242
173
|
/**
|
|
243
|
-
|
|
244
174
|
* Returns the profile information for the specified profile.
|
|
245
|
-
|
|
246
175
|
* @param regionId The region ID for Starcraft.
|
|
247
|
-
|
|
248
176
|
* @param realmId 1 or 2
|
|
249
|
-
|
|
250
177
|
* @param profileId The ID of the profile.
|
|
251
|
-
|
|
252
178
|
* @returns A resource representing the profile. See {@link MetadataResponse}
|
|
253
|
-
|
|
254
179
|
*/
|
|
255
180
|
function profile(regionId, realmId, profileId) {
|
|
256
181
|
return { path: `/sc2/profile/${starcraftRegion[regionId]}/${realmId}/${profileId}` };
|
|
257
182
|
}
|
|
258
183
|
/**
|
|
259
|
-
|
|
260
184
|
*
|
|
261
|
-
|
|
262
185
|
* @param regionId The region ID for Starcraft.
|
|
263
|
-
|
|
264
186
|
* @returns A resource representing the static profile. See {@link StaticProfileResponse}
|
|
265
|
-
|
|
266
187
|
*/
|
|
267
188
|
function staticProfile(regionId) {
|
|
268
189
|
return { path: `/sc2/static/profile/${starcraftRegion[regionId]}` };
|
|
@@ -287,8 +208,7 @@ const sc2 = {
|
|
|
287
208
|
profile,
|
|
288
209
|
staticProfile
|
|
289
210
|
};
|
|
290
|
-
var src_default = sc2;
|
|
291
211
|
|
|
292
212
|
//#endregion
|
|
293
|
-
export {
|
|
213
|
+
export { sc2 as default, sc2, getLeagueData, grandmasterLeaderboard, ladder, ladderSummary, legacyAchievements, legacyLadder, legacyLadders, legacyMatchHistory, legacyProfile, legacyRewards, metadata, player, profile, season, staticProfile };
|
|
294
214
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["accountId: string","starcraftRegion: Record<StarcraftRegion, number>","regionId: StarcraftRegion","starcraftLeagueQueue: Record<StarcraftLeagueQueue, number>","starcraftLeagueTeam: Record<StarcraftLeagueTeamType, number>","starcraftLeagueId: Record<StarcraftLeagueId, number>","seasonId: string","queueId: StarcraftLeagueQueue","teamType: StarcraftLeagueTeamType","leagueId: StarcraftLeagueId","regionId: StarcraftRegion","ladderId: number","realmId: 1 | 2","profileId: number","regionId: StarcraftRegion","realmId: 1 | 2","profileId: number","ladderId: number"],"sources":["../src/account/account.ts","../src/base.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","/**\r\n * Base interface for Blizzard API responses.\r\n */\r\nexport interface ResponseBase {\r\n _links: {\r\n self: {\r\n href: string;\r\n };\r\n };\r\n}\r\n\r\n//The region (1=US, 2=EU, 3=KO and TW, 5=CN).\r\nexport type StarcraftRegion = 'cn' | 'eu' | 'kr' | 'tw' | 'us';\r\n\r\nexport const starcraftRegion: Record<StarcraftRegion, number> = {\r\n cn: 5,\r\n eu: 2,\r\n kr: 3,\r\n tw: 3,\r\n us: 1,\r\n};\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { starcraftRegion, type StarcraftRegion } from '../base';\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, type StarcraftRegion } from '../base';\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, type StarcraftRegion } from '../base';\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":"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"}
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blizzard-api/sc2",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Putro",
|
|
6
6
|
"description": "A series of helpers to interact with the Starcraft II Blizzard API",
|
|
7
7
|
"repository": "https://github.com/Pewtro/blizzard-api/tree/main/packages/sc2",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": "^
|
|
10
|
+
"node": "^20.19.0 || ^22.13.0 || >=24"
|
|
11
11
|
},
|
|
12
12
|
"module": "./dist/index.js",
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@blizzard-api/core": "
|
|
35
|
+
"@blizzard-api/core": "3.0.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@blizzard-api/core": "
|
|
38
|
+
"@blizzard-api/core": "3.0.1"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsdown",
|