-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
841 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { Character, KeyId, KeyNameId, LinkSelfHref, request } from "../../shared/index.ts"; | ||
|
||
interface MythicRating { | ||
color: { | ||
r: number; | ||
g: number; | ||
b: number; | ||
a: number; | ||
}; | ||
rating: number; | ||
} | ||
|
||
interface CharacterMythicKeystoneProfile extends LinkSelfHref { | ||
current_period: { | ||
period: KeyId; | ||
}; | ||
seasons: KeyId[]; | ||
character: Character; | ||
current_mythic_rating: MythicRating; | ||
} | ||
|
||
interface CharacterMythicKeystoneSeasonDetails extends LinkSelfHref { | ||
season: KeyId; | ||
best_runs: { | ||
completed_timestamp: number; | ||
duration: number; | ||
keystone_level: number; | ||
keystone_affixes: KeyNameId[]; | ||
members: { | ||
character: Character; | ||
specialization: KeyNameId; | ||
race: KeyNameId; | ||
equipped_item_level: number; | ||
}[]; | ||
dungeon: KeyNameId; | ||
is_completed_within_time: boolean; | ||
mythic_rating: MythicRating; | ||
map_rating: MythicRating; | ||
}[]; | ||
character: Character; | ||
mythic_rating: MythicRating; | ||
} | ||
|
||
/** | ||
* Returns the Mythic Keystone profile index for a character. | ||
* | ||
* @param realmSlug - The slug of the realm. | ||
* @param characterName - The lowercase name of the character. | ||
* @returns A promise that resolves to an object representing a Mythic Keystone profile. | ||
*/ | ||
export async function characterMythicKeystoneProfile( | ||
realmSlug: string, | ||
characterName: string, | ||
): Promise<CharacterMythicKeystoneProfile> { | ||
return await request({ | ||
method: "GET", | ||
url: `/profile/wow/character/${realmSlug}/${characterName}/mythic-keystone-profile`, | ||
namespace: "profile", | ||
}); | ||
} | ||
|
||
/** | ||
* Returns the Mythic Keystone season details for a character. | ||
* | ||
* Returns a 404 Not Found for characters that have not yet completed a Mythic Keystone dungeon for the specified season. | ||
* | ||
* @param realmSlug - The slug of the realm. | ||
* @param characterName - The lowercase name of the character. | ||
* @param seasonId - The lowercase name of the character. | ||
* @returns A promise that resolves to an object representing a Mythic Keystone season details. | ||
*/ | ||
export async function characterMythicKeystoneSeasonDetails( | ||
realmSlug: string, | ||
characterName: string, | ||
seasonId: number, | ||
): Promise<CharacterMythicKeystoneSeasonDetails> { | ||
return await request({ | ||
method: "GET", | ||
url: `/profile/wow/character/${realmSlug}/${characterName}/mythic-keystone-profile/season/${seasonId}`, | ||
namespace: "profile", | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Character, KeyNameId, LinkSelfHref, NameId, request } from "../../shared/index.ts"; | ||
|
||
interface Tier { | ||
skill_points: number; | ||
max_skill_points: number; | ||
tier: NameId; | ||
known_recipes: KeyNameId[]; | ||
} | ||
|
||
interface Profession { | ||
profession: KeyNameId; | ||
skill_points?: number; | ||
max_skill_points?: number; | ||
tiers?: Tier[]; | ||
} | ||
|
||
interface CharacterProfessions extends LinkSelfHref { | ||
character: Character; | ||
primaries: Profession[]; | ||
secondaries: Profession[]; | ||
} | ||
|
||
/** | ||
* Returns a summary of professions for a character. | ||
* | ||
* @param realmSlug - The slug of the realm. | ||
* @param characterName - The lowercase name of the character. | ||
* @returns A promise that resolves to an object representing a summary of professions for a character. | ||
*/ | ||
export async function characterProfessions( | ||
realmSlug: string, | ||
characterName: string, | ||
): Promise<CharacterProfessions> { | ||
return await request({ | ||
method: "GET", | ||
url: `/profile/wow/character/${realmSlug}/${characterName}/professions`, | ||
namespace: "profile", | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import { KeyNameId, LinkSelfHref, LocalizedString, request, TypeName } from "../../shared/index.ts"; | ||
|
||
interface Href { | ||
href: string; | ||
} | ||
|
||
interface Realm extends KeyNameId { | ||
slug: string; | ||
} | ||
|
||
interface CharacterProfile extends LinkSelfHref { | ||
id: number; | ||
name: LocalizedString; | ||
gender: TypeName; | ||
faction: TypeName; | ||
race: KeyNameId; | ||
character_class: KeyNameId; | ||
active_spec: KeyNameId; | ||
realm: Realm; | ||
guild: { | ||
key: Href; | ||
name: LocalizedString; | ||
id: number; | ||
realm: Realm; | ||
faction: TypeName; | ||
}; | ||
level: number; | ||
experience: number; | ||
achievement_points: number; | ||
achievements: Href; | ||
titles: Href; | ||
pvp_summary: Href; | ||
encounters: Href; | ||
media: Href; | ||
last_login_timestamp: number; | ||
average_item_level: number; | ||
equipped_item_level: number; | ||
specializations: Href; | ||
statistics: Href; | ||
mythic_keystone_profile: Href; | ||
equipment: Href; | ||
appearance: Href; | ||
collections: Href; | ||
reputations: Href; | ||
quests: Href; | ||
achievements_statistics: Href; | ||
professions: Href; | ||
covenant_progress: { | ||
chosen_covenant: KeyNameId; | ||
renown_level: number; | ||
soulbinds: Href; | ||
}; | ||
} | ||
|
||
interface CharacterProfileStatus extends LinkSelfHref { | ||
id: number; | ||
is_valid: boolean; | ||
} | ||
/** | ||
* Returns a profile summary for a character. | ||
* | ||
* @param realmSlug - The slug of the realm. | ||
* @param characterName - The lowercase name of the character. | ||
* @returns A promise that resolves to an object representing a profile summary. | ||
*/ | ||
export async function characterProfile( | ||
realmSlug: string, | ||
characterName: string, | ||
): Promise<CharacterProfile> { | ||
return await request({ | ||
method: "GET", | ||
url: `/profile/wow/character/${realmSlug}/${characterName}`, | ||
namespace: "profile", | ||
}); | ||
} | ||
|
||
/** | ||
* Returns the status and a unique ID for a character. A client should delete information about a character from their application if any of the following conditions occur: | ||
* | ||
* an HTTP 404 Not Found error is returned | ||
* the is_valid value is false | ||
* the returned character ID doesn't match the previously recorded value for the character | ||
* | ||
* The following example illustrates how to use this endpoint: | ||
* | ||
* A client requests and stores information about a character, including its unique character ID and the timestamp of the request. | ||
* After 30 days, the client makes a request to the status endpoint to verify if the character information is still valid. | ||
* If character cannot be found, is not valid, or the characters IDs do not match, the client removes the information from their application. | ||
* If the character is valid and the character IDs match, the client retains the data for another 30 days. | ||
* | ||
* @param realmSlug - The slug of the realm. | ||
* @param characterName - The lowercase name of the character. | ||
* @returns A promise that resolves to an object representing a profile summary status. | ||
*/ | ||
export async function characterProfileStatus( | ||
realmSlug: string, | ||
characterName: string, | ||
): Promise<CharacterProfileStatus> { | ||
return await request({ | ||
method: "GET", | ||
url: `/profile/wow/character/${realmSlug}/${characterName}/status`, | ||
namespace: "profile", | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { Character, KeyId, LinkSelfHref, LocalizedString, request, TypeName } from "../../shared/index.ts"; | ||
|
||
interface MatchStatistic { | ||
played: number; | ||
won: number; | ||
lost: number; | ||
} | ||
|
||
interface CharacterPvpBracketStatistics extends LinkSelfHref { | ||
character: Character; | ||
faction: TypeName; | ||
bracket: { | ||
id: number; | ||
type: string; | ||
}; | ||
rating: number; | ||
season: KeyId; | ||
tier: KeyId; | ||
season_match_statistics: MatchStatistic; | ||
weekly_match_statistics: MatchStatistic; | ||
} | ||
|
||
interface CharacterPvpSummary extends LinkSelfHref { | ||
brackets: { | ||
href: string; | ||
}[]; | ||
honor_level: number; | ||
pvp_map_statistics: { | ||
world_map: { | ||
name: LocalizedString; | ||
id: number; | ||
}; | ||
match_statistics: MatchStatistic; | ||
}[]; | ||
honorable_kills: number; | ||
character: Character; | ||
} | ||
|
||
/** | ||
* Returns the PvP bracket statistics for a character. | ||
* | ||
* @param realmSlug - The slug of the realm. | ||
* @param characterName - The lowercase name of the character. | ||
* @param pvpBracket - The PvP bracket type. | ||
* @returns A promise that resolves to an object representing the PvP bracket statistics for a character. | ||
*/ | ||
export async function characterPvpBracketStatistics( | ||
realmSlug: string, | ||
characterName: string, | ||
pvpBracket: string, | ||
): Promise<CharacterPvpBracketStatistics> { | ||
return await request({ | ||
method: "GET", | ||
url: `/profile/wow/character/${realmSlug}/${characterName}/pvp-bracket/${pvpBracket}`, | ||
namespace: "profile", | ||
}); | ||
} | ||
|
||
/** | ||
* Returns a PvP summary for a character. | ||
* | ||
* @param realmSlug - The slug of the realm. | ||
* @param characterName - The lowercase name of the character. | ||
* @returns A promise that resolves to an object representing the PvP summary for a character. | ||
*/ | ||
export async function characterPvpSummary( | ||
realmSlug: string, | ||
characterName: string, | ||
): Promise<CharacterPvpSummary> { | ||
return await request({ | ||
method: "GET", | ||
url: `/profile/wow/character/${realmSlug}/${characterName}/pvp-summary`, | ||
namespace: "profile", | ||
}); | ||
} |
Oops, something went wrong.