-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WoW] Add support for Character Mythic Keystone Profile APIs
- @blizzard-api/wow@2.0.1
- @blizzard-api/wow@2.0.0
- @blizzard-api/wow@1.2.3
- @blizzard-api/wow@1.2.2
- @blizzard-api/wow@1.2.1
- @blizzard-api/wow@1.2.0
- @blizzard-api/sc2@1.0.1
- @blizzard-api/sc2@1.0.0
- @blizzard-api/sc2@0.1.1
- @blizzard-api/sc2@0.1.0
- @blizzard-api/hs@1.0.1
- @blizzard-api/hs@1.0.0
- @blizzard-api/hs@0.1.1
- @blizzard-api/hs@0.1.0
- @blizzard-api/d3@1.0.1
- @blizzard-api/d3@1.0.0
- @blizzard-api/d3@0.1.6
- @blizzard-api/d3@0.1.5
- @blizzard-api/d3@0.1.4
- @blizzard-api/core@2.0.1
- @blizzard-api/core@2.0.0
- @blizzard-api/core@1.2.1
- @blizzard-api/core@1.2.0
- @blizzard-api/client@2.0.2
- @blizzard-api/client@2.0.1
- @blizzard-api/client@2.0.0
- @blizzard-api/client@1.0.10
- @blizzard-api/client@1.0.9
- @blizzard-api/client@1.0.8
- @blizzard-api/client@1.0.7
- @blizzard-api/client@1.0.6
- @blizzard-api/classic-wow@2.0.1
- @blizzard-api/classic-wow@2.0.0
- @blizzard-api/classic-wow@1.1.7
- @blizzard-api/classic-wow@1.1.6
- @blizzard-api/classic-wow@1.1.5
Showing
5 changed files
with
132 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@blizzard-api/wow': minor | ||
--- | ||
|
||
Add support for Character Mythic Keystone Profile APIs |
36 changes: 36 additions & 0 deletions
36
packages/wow/src/character-mythic-keystone-profile/character-mythic-keystone-profile.test.ts
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,36 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
import { | ||
characterMythicKeystoneProfileIndex, | ||
characterMythicKeystoneSeasonDetails, | ||
} from './character-mythic-keystone-profile'; | ||
|
||
describe('Character Mythic Keystone Profile', () => { | ||
it('should return the correct ProtectedResource object for characterMythicKeystoneProfileIndex', () => { | ||
const realmSlug = 'realm'; | ||
const characterName = 'character'; | ||
const token = 'token'; | ||
|
||
const result = characterMythicKeystoneProfileIndex(realmSlug, characterName, token); | ||
|
||
expect(result).toEqual({ | ||
namespace: 'profile', | ||
path: `/profile/wow/character/${realmSlug}/${characterName}/mythic-keystone-profile`, | ||
token, | ||
}); | ||
}); | ||
|
||
it('should return the correct ProtectedResource object for characterMythicKeystoneSeasonDetails', () => { | ||
const realmSlug = 'realm'; | ||
const characterName = 'character'; | ||
const seasonId = 123; | ||
const token = 'token'; | ||
|
||
const result = characterMythicKeystoneSeasonDetails(realmSlug, characterName, seasonId, token); | ||
|
||
expect(result).toEqual({ | ||
namespace: 'profile', | ||
path: `/profile/wow/character/${realmSlug}/${characterName}/mythic-keystone-profile/season/${seasonId}`, | ||
token, | ||
}); | ||
}); | ||
}); |
30 changes: 30 additions & 0 deletions
30
packages/wow/src/character-mythic-keystone-profile/character-mythic-keystone-profile.ts
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,30 @@ | ||
import type { ProtectedResource } from '@blizzard-api/core'; | ||
import type { | ||
CharacterMythicKeystoneProfileIndexResponse, | ||
CharacterMythicKeystoneSeasonDetailsResponse, | ||
} from './types'; | ||
|
||
export function characterMythicKeystoneProfileIndex( | ||
realmSlug: string, | ||
characterName: string, | ||
token: string, | ||
): ProtectedResource<CharacterMythicKeystoneProfileIndexResponse> { | ||
return { | ||
namespace: 'profile', | ||
path: `/profile/wow/character/${realmSlug}/${characterName}/mythic-keystone-profile`, | ||
token, | ||
}; | ||
} | ||
|
||
export function characterMythicKeystoneSeasonDetails( | ||
realmSlug: string, | ||
characterName: string, | ||
seasonId: number, | ||
token: string, | ||
): ProtectedResource<CharacterMythicKeystoneSeasonDetailsResponse> { | ||
return { | ||
namespace: 'profile', | ||
path: `/profile/wow/character/${realmSlug}/${characterName}/mythic-keystone-profile/season/${seasonId}`, | ||
token, | ||
}; | ||
} |
51 changes: 51 additions & 0 deletions
51
packages/wow/src/character-mythic-keystone-profile/types.ts
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,51 @@ | ||
import type { Color, Href, KeyBase, NameId, NameIdKey } from '../base'; | ||
|
||
export interface CharacterMythicKeystoneProfileIndexResponse { | ||
_links: { self: Href }; | ||
character: Character; | ||
current_period: CurrentPeriod; | ||
seasons: Array<{ id: number } & KeyBase>; | ||
} | ||
|
||
interface Realm extends NameIdKey { | ||
slug: string; | ||
} | ||
|
||
interface Character extends NameIdKey { | ||
realm: Realm; | ||
} | ||
|
||
interface CurrentPeriod { | ||
period: { id: number } & KeyBase; | ||
} | ||
|
||
export interface CharacterMythicKeystoneSeasonDetailsResponse { | ||
_links: { self: Href }; | ||
best_runs: Array<BestRun>; | ||
character: NameIdKey; | ||
mythic_rating: MythicRating; | ||
season: { id: number } & KeyBase; | ||
} | ||
|
||
interface BestRun { | ||
completed_timestamp: number; | ||
dungeon: NameIdKey; | ||
duration: number; | ||
is_completed_within_time: boolean; | ||
keystone_affixes: Array<NameIdKey>; | ||
keystone_level: number; | ||
members: Array<Member>; | ||
mythic_rating: MythicRating; | ||
} | ||
|
||
interface Member { | ||
character: { realm: Realm } & NameId; | ||
equipped_item_level: number; | ||
race: NameIdKey; | ||
specialization: NameIdKey; | ||
} | ||
|
||
interface MythicRating { | ||
color: Color; | ||
rating: number; | ||
} |
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