@blizzard-api/sc2 2.0.0 → 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.js.map +1 -1
- package/package.json +3 -3
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).\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 } 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,UAAi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;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACD"}
|
|
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,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
|
+
"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",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@blizzard-api/core": "3.0.
|
|
35
|
+
"@blizzard-api/core": "3.0.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@blizzard-api/core": "3.0.
|
|
38
|
+
"@blizzard-api/core": "3.0.1"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsdown",
|