@pinta365/blizzard_api 0.6.0 → 0.6.2

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/LICENSE CHANGED
File without changes
package/README.md CHANGED
@@ -189,6 +189,7 @@ const sword = await blizzardAPI.wow.item(33791);
189
189
  deno task test # offline unit tests
190
190
  deno task smoke # live smoke test of every endpoint (needs .env with BLIZZARD_CLIENT_ID / BLIZZARD_CLIENT_SECRET)
191
191
  deno task gen:api # regenerate src/generated/ after adding or changing endpoints
192
+ deno task user-token --save # log in with Battle.net and save a user token to .env (for the account endpoints)
192
193
  deno task check:types # check the response types against the responses saved by the smoke test (fixtures/)
193
194
  deno task check:fields # list fields the API returns that the response types don't declare
194
195
  ```
@@ -77,6 +77,8 @@ export interface D3HeroItem {
77
77
  typeName?: string;
78
78
  type?: D3ItemType;
79
79
  armor?: number;
80
+ /** Display text for shields, e.g. "+16.0% Chance to Block\n7-12 Block Amount". */
81
+ blockChance?: string;
80
82
  attacksPerSecond?: number;
81
83
  minDamage?: number;
82
84
  maxDamage?: number;
@@ -304,7 +306,8 @@ export interface D3Account {
304
306
  act4: boolean;
305
307
  act5: boolean;
306
308
  };
307
- fallenHeroes: D3FallenHero[];
309
+ /** Absent when the account has no fallen hardcore heroes. */
310
+ fallenHeroes?: D3FallenHero[];
308
311
  seasonalProfiles: Record<string, D3SeasonalProfile>;
309
312
  blacksmith: D3Artisan;
310
313
  jeweler: D3Artisan;
@@ -69,6 +69,9 @@ export interface WowApi {
69
69
  accountCollectionsIndex(): Promise<AccountCollectionsIndex>;
70
70
  /**
71
71
  * Returns the housing decor collected by an account.
72
+ *
73
+ * Note: as of 2026-10-01 this returns 404 even for accounts with decor, although the collections index links to it.
74
+ * characterCollectionDecor works.
72
75
  * Requires a user access token (client.forUser(token)).
73
76
  *
74
77
  * @returns A promise that resolves to an object representing the account's decor.
@@ -303,6 +306,10 @@ export interface WowApi {
303
306
  /**
304
307
  * Returns a summary of a house a character has built.
305
308
  *
309
+ * Note: Blizzard disabled this endpoint in early 2026 over player privacy concerns, and it currently returns 404 even
310
+ * for characters that own a house. The function is kept for when it returns; the response type is unverified.
311
+ * See https://us.forums.blizzard.com/en/blizzard/t/new-housing-apis/56815
312
+ *
306
313
  * @param realmSlug - The slug of the realm.
307
314
  * @param characterName - The lowercase name of the character.
308
315
  * @param houseNumber - The number of the character's house (e.g. 1 for house-1).
@@ -3,8 +3,18 @@
3
3
  * `wow.profile` scope, acquired via the authorization code flow: use `client.forUser(token).wow.*`.
4
4
  */
5
5
  import type { ApiContext } from "../../shared/index.js";
6
- import type { Href, KeyNameId, LinkSelfHref, TypeName } from "../../shared/index.js";
6
+ import type { Href, KeyNameId, TypeName } from "../../shared/index.js";
7
7
  import type { CollectedHeirloom, CollectedPet, CollectedToy, DecorItem } from "./character_collections.js";
8
+ /**
9
+ * The links at the top of account profile responses.
10
+ */
11
+ export interface AccountLinks {
12
+ _links: {
13
+ self: Href;
14
+ user: Href;
15
+ profile: Href;
16
+ };
17
+ }
8
18
  export interface AccountCharacter {
9
19
  character: Href;
10
20
  protected_character: Href;
@@ -19,15 +29,17 @@ export interface AccountCharacter {
19
29
  faction: TypeName;
20
30
  level: number;
21
31
  }
22
- export interface AccountProfileSummary extends LinkSelfHref {
32
+ export interface AccountProfileSummary extends AccountLinks {
23
33
  id: number;
24
34
  wow_accounts: {
25
35
  id: number;
26
36
  characters: AccountCharacter[];
27
37
  }[];
28
38
  collections: Href;
39
+ /** Links to the account's houses (character house endpoints). Absent when the account has no house. */
40
+ houses?: Href[];
29
41
  }
30
- export interface ProtectedCharacterProfile extends LinkSelfHref {
42
+ export interface ProtectedCharacterProfile extends AccountLinks {
31
43
  id: number;
32
44
  name: string;
33
45
  money: number;
@@ -78,34 +90,36 @@ export interface ProtectedCharacterProfile extends LinkSelfHref {
78
90
  facing: number;
79
91
  };
80
92
  wow_account: number;
93
+ /** Links to this character's houses. Absent when the character has no house. */
94
+ houses?: Href[];
81
95
  }
82
- export interface AccountCollectionsIndex extends LinkSelfHref {
96
+ export interface AccountCollectionsIndex extends AccountLinks {
83
97
  pets: Href;
84
98
  mounts: Href;
85
99
  heirlooms: Href;
86
100
  toys: Href;
87
101
  transmogs: Href;
88
- decor?: Href;
102
+ decors?: Href;
89
103
  }
90
104
  export interface AccountMount {
91
105
  mount: KeyNameId;
92
106
  is_favorite?: boolean;
93
107
  is_useable?: boolean;
94
108
  }
95
- export interface AccountMountsCollection extends LinkSelfHref {
109
+ export interface AccountMountsCollection extends AccountLinks {
96
110
  mounts: AccountMount[];
97
111
  }
98
- export interface AccountPetsCollection extends LinkSelfHref {
112
+ export interface AccountPetsCollection extends AccountLinks {
99
113
  pets: CollectedPet[];
100
114
  unlocked_battle_pet_slots: number;
101
115
  }
102
- export interface AccountToysCollection extends LinkSelfHref {
116
+ export interface AccountToysCollection extends AccountLinks {
103
117
  toys: CollectedToy[];
104
118
  }
105
- export interface AccountHeirloomsCollection extends LinkSelfHref {
119
+ export interface AccountHeirloomsCollection extends AccountLinks {
106
120
  heirlooms: CollectedHeirloom[];
107
121
  }
108
- export interface AccountTransmogsCollection extends LinkSelfHref {
122
+ export interface AccountTransmogsCollection extends AccountLinks {
109
123
  appearance_sets: KeyNameId[];
110
124
  slots: {
111
125
  slot: TypeName;
@@ -115,7 +129,7 @@ export interface AccountTransmogsCollection extends LinkSelfHref {
115
129
  }[];
116
130
  }[];
117
131
  }
118
- export interface AccountDecorCollection extends LinkSelfHref {
132
+ export interface AccountDecorCollection extends AccountLinks {
119
133
  decor_collected: DecorItem[];
120
134
  }
121
135
  /**
@@ -178,6 +192,9 @@ export declare function accountHeirloomsCollection(ctx: ApiContext): Promise<Acc
178
192
  export declare function accountTransmogsCollection(ctx: ApiContext): Promise<AccountTransmogsCollection>;
179
193
  /**
180
194
  * Returns the housing decor collected by an account.
195
+ *
196
+ * Note: as of 2026-10-01 this returns 404 even for accounts with decor, although the collections index links to it.
197
+ * characterCollectionDecor works.
181
198
  * Requires a user access token (client.forUser(token)).
182
199
  *
183
200
  * @returns A promise that resolves to an object representing the account's decor.
@@ -118,6 +118,9 @@ export async function accountTransmogsCollection(ctx) {
118
118
  }
119
119
  /**
120
120
  * Returns the housing decor collected by an account.
121
+ *
122
+ * Note: as of 2026-10-01 this returns 404 even for accounts with decor, although the collections index links to it.
123
+ * characterCollectionDecor works.
121
124
  * Requires a user access token (client.forUser(token)).
122
125
  *
123
126
  * @returns A promise that resolves to an object representing the account's decor.
@@ -31,6 +31,9 @@ export interface CollectedPet {
31
31
  id: number;
32
32
  is_active?: boolean;
33
33
  active_slot?: number;
34
+ is_favorite?: boolean;
35
+ /** The custom name, if the player renamed the pet. */
36
+ name?: string;
34
37
  }
35
38
  export interface CharacterCollectionPets extends LinkSelfHref {
36
39
  pets: CollectedPet[];
@@ -9,6 +9,10 @@ export interface CharacterHouse extends LinkSelfHref {
9
9
  /**
10
10
  * Returns a summary of a house a character has built.
11
11
  *
12
+ * Note: Blizzard disabled this endpoint in early 2026 over player privacy concerns, and it currently returns 404 even
13
+ * for characters that own a house. The function is kept for when it returns; the response type is unverified.
14
+ * See https://us.forums.blizzard.com/en/blizzard/t/new-housing-apis/56815
15
+ *
12
16
  * @param realmSlug - The slug of the realm.
13
17
  * @param characterName - The lowercase name of the character.
14
18
  * @param houseNumber - The number of the character's house (e.g. 1 for house-1).
@@ -4,6 +4,10 @@
4
4
  /**
5
5
  * Returns a summary of a house a character has built.
6
6
  *
7
+ * Note: Blizzard disabled this endpoint in early 2026 over player privacy concerns, and it currently returns 404 even
8
+ * for characters that own a house. The function is kept for when it returns; the response type is unverified.
9
+ * See https://us.forums.blizzard.com/en/blizzard/t/new-housing-apis/56815
10
+ *
7
11
  * @param realmSlug - The slug of the realm.
8
12
  * @param characterName - The lowercase name of the character.
9
13
  * @param houseNumber - The number of the character's house (e.g. 1 for house-1).
@@ -1,13 +1,13 @@
1
1
  import type { ApiContext, Href, KeyNameId, LinkSelfHref, LocalizedString, TypeName } from "../../shared/index.js";
2
+ import type { CharacterActiveTitle } from "./character_titles.js";
2
3
  export interface CharacterRealm extends KeyNameId {
3
4
  slug: string;
4
5
  }
5
6
  export interface CharacterProfile extends LinkSelfHref {
6
7
  id: number;
7
8
  name: LocalizedString;
8
- active_title?: {
9
- name: string;
10
- };
9
+ /** Absent when the character has no active title. */
10
+ active_title?: CharacterActiveTitle;
11
11
  gender: TypeName;
12
12
  faction: TypeName;
13
13
  race: KeyNameId;
@@ -10,7 +10,8 @@ export interface Detail {
10
10
  };
11
11
  description?: LocalizedString | null;
12
12
  cast_time?: LocalizedString;
13
- power_cost?: LocalizedString;
13
+ /** null for abilities without a cost. */
14
+ power_cost?: LocalizedString | null;
14
15
  cooldown?: LocalizedString;
15
16
  range?: LocalizedString;
16
17
  };
@@ -1,7 +1,18 @@
1
1
  import type { ApiContext } from "../../shared/index.js";
2
- import type { Character, KeyNameId, LinkSelfHref } from "../../shared/index.js";
2
+ import type { Character, Href, KeyNameId, LinkSelfHref } from "../../shared/index.js";
3
+ /**
4
+ * A character's active title. `display_string` has a `{name}` placeholder for the character name.
5
+ */
6
+ export interface CharacterActiveTitle {
7
+ key: Href;
8
+ name: string;
9
+ id: number;
10
+ display_string: string;
11
+ }
3
12
  export interface CharacterTitles extends LinkSelfHref {
4
13
  character: Character;
14
+ /** Absent when the character has no active title. */
15
+ active_title?: CharacterActiveTitle;
5
16
  titles: KeyNameId[];
6
17
  }
7
18
  /**
@@ -53,6 +53,6 @@ export type { CharacterReputations } from "./profile/character_reputations.js";
53
53
  export type { CharacterSoulbinds } from "./profile/character_soulbinds.js";
54
54
  export type { CharacterSpecializations, CharacterSpecializationTalent, ClassicSpecializationTalent, Detail, } from "./profile/character_specializations.js";
55
55
  export type { CharacterStatistics, StatRating, StatRatingBonus } from "./profile/character_statistics.js";
56
- export type { CharacterTitles } from "./profile/character_titles.js";
56
+ export type { CharacterActiveTitle, CharacterTitles } from "./profile/character_titles.js";
57
57
  export type { CrestAsset, Critiera, Guild, GuildAchievements, GuildActivity, GuildCrestRgba, GuildReference, GuildRoster, GuildRosterMemberCharacter, } from "./profile/guild.js";
58
58
  export type { Search, SearchParameters } from "./search.js";
@@ -18,7 +18,11 @@ import type { GuildAchievements } from "../wow/profile/guild.js";
18
18
  /** Makes the keys K of T optional. */
19
19
  type WithOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
20
20
  /** Character profile as returned for Classic: Retail-only links and fields are optional. */
21
- export interface ClassicCharacterProfile extends WithOptional<CharacterProfile, "active_spec" | "achievement_points" | "achievements" | "encounters" | "mythic_keystone_profile" | "collections" | "quests" | "achievements_statistics" | "professions" | "name_search" | "is_remix"> {
21
+ export interface ClassicCharacterProfile extends Omit<WithOptional<CharacterProfile, "active_spec" | "achievement_points" | "achievements" | "encounters" | "mythic_keystone_profile" | "collections" | "quests" | "achievements_statistics" | "professions" | "name_search" | "is_remix">, "active_title"> {
22
+ /** Classic only returns the title name. Absent when the character has no active title. */
23
+ active_title?: {
24
+ name: string;
25
+ };
22
26
  }
23
27
  /** Character appearance as returned for Classic (no active specialization on Era). */
24
28
  export interface ClassicCharacterAppearanceSummary extends WithOptional<CharacterAppearanceSummary, "active_spec"> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinta365/blizzard_api",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "TS library to interact with the Blizzard Battle.net API. World of Warcraft, World of Warcraft Classic, StarCraft 2, Diablo 3, Hearthstone.",
5
5
  "keywords": [
6
6
  "blizzard",
@@ -77,6 +77,8 @@ export interface D3HeroItem {
77
77
  typeName?: string;
78
78
  type?: D3ItemType;
79
79
  armor?: number;
80
+ /** Display text for shields, e.g. "+16.0% Chance to Block\n7-12 Block Amount". */
81
+ blockChance?: string;
80
82
  attacksPerSecond?: number;
81
83
  minDamage?: number;
82
84
  maxDamage?: number;
@@ -304,7 +306,8 @@ export interface D3Account {
304
306
  act4: boolean;
305
307
  act5: boolean;
306
308
  };
307
- fallenHeroes: D3FallenHero[];
309
+ /** Absent when the account has no fallen hardcore heroes. */
310
+ fallenHeroes?: D3FallenHero[];
308
311
  seasonalProfiles: Record<string, D3SeasonalProfile>;
309
312
  blacksmith: D3Artisan;
310
313
  jeweler: D3Artisan;
@@ -69,6 +69,9 @@ export interface WowApi {
69
69
  accountCollectionsIndex(): Promise<AccountCollectionsIndex>;
70
70
  /**
71
71
  * Returns the housing decor collected by an account.
72
+ *
73
+ * Note: as of 2026-10-01 this returns 404 even for accounts with decor, although the collections index links to it.
74
+ * characterCollectionDecor works.
72
75
  * Requires a user access token (client.forUser(token)).
73
76
  *
74
77
  * @returns A promise that resolves to an object representing the account's decor.
@@ -303,6 +306,10 @@ export interface WowApi {
303
306
  /**
304
307
  * Returns a summary of a house a character has built.
305
308
  *
309
+ * Note: Blizzard disabled this endpoint in early 2026 over player privacy concerns, and it currently returns 404 even
310
+ * for characters that own a house. The function is kept for when it returns; the response type is unverified.
311
+ * See https://us.forums.blizzard.com/en/blizzard/t/new-housing-apis/56815
312
+ *
306
313
  * @param realmSlug - The slug of the realm.
307
314
  * @param characterName - The lowercase name of the character.
308
315
  * @param houseNumber - The number of the character's house (e.g. 1 for house-1).
@@ -3,8 +3,18 @@
3
3
  * `wow.profile` scope, acquired via the authorization code flow: use `client.forUser(token).wow.*`.
4
4
  */
5
5
  import type { ApiContext } from "../../shared/index.js";
6
- import type { Href, KeyNameId, LinkSelfHref, TypeName } from "../../shared/index.js";
6
+ import type { Href, KeyNameId, TypeName } from "../../shared/index.js";
7
7
  import type { CollectedHeirloom, CollectedPet, CollectedToy, DecorItem } from "./character_collections.js";
8
+ /**
9
+ * The links at the top of account profile responses.
10
+ */
11
+ export interface AccountLinks {
12
+ _links: {
13
+ self: Href;
14
+ user: Href;
15
+ profile: Href;
16
+ };
17
+ }
8
18
  export interface AccountCharacter {
9
19
  character: Href;
10
20
  protected_character: Href;
@@ -19,15 +29,17 @@ export interface AccountCharacter {
19
29
  faction: TypeName;
20
30
  level: number;
21
31
  }
22
- export interface AccountProfileSummary extends LinkSelfHref {
32
+ export interface AccountProfileSummary extends AccountLinks {
23
33
  id: number;
24
34
  wow_accounts: {
25
35
  id: number;
26
36
  characters: AccountCharacter[];
27
37
  }[];
28
38
  collections: Href;
39
+ /** Links to the account's houses (character house endpoints). Absent when the account has no house. */
40
+ houses?: Href[];
29
41
  }
30
- export interface ProtectedCharacterProfile extends LinkSelfHref {
42
+ export interface ProtectedCharacterProfile extends AccountLinks {
31
43
  id: number;
32
44
  name: string;
33
45
  money: number;
@@ -78,34 +90,36 @@ export interface ProtectedCharacterProfile extends LinkSelfHref {
78
90
  facing: number;
79
91
  };
80
92
  wow_account: number;
93
+ /** Links to this character's houses. Absent when the character has no house. */
94
+ houses?: Href[];
81
95
  }
82
- export interface AccountCollectionsIndex extends LinkSelfHref {
96
+ export interface AccountCollectionsIndex extends AccountLinks {
83
97
  pets: Href;
84
98
  mounts: Href;
85
99
  heirlooms: Href;
86
100
  toys: Href;
87
101
  transmogs: Href;
88
- decor?: Href;
102
+ decors?: Href;
89
103
  }
90
104
  export interface AccountMount {
91
105
  mount: KeyNameId;
92
106
  is_favorite?: boolean;
93
107
  is_useable?: boolean;
94
108
  }
95
- export interface AccountMountsCollection extends LinkSelfHref {
109
+ export interface AccountMountsCollection extends AccountLinks {
96
110
  mounts: AccountMount[];
97
111
  }
98
- export interface AccountPetsCollection extends LinkSelfHref {
112
+ export interface AccountPetsCollection extends AccountLinks {
99
113
  pets: CollectedPet[];
100
114
  unlocked_battle_pet_slots: number;
101
115
  }
102
- export interface AccountToysCollection extends LinkSelfHref {
116
+ export interface AccountToysCollection extends AccountLinks {
103
117
  toys: CollectedToy[];
104
118
  }
105
- export interface AccountHeirloomsCollection extends LinkSelfHref {
119
+ export interface AccountHeirloomsCollection extends AccountLinks {
106
120
  heirlooms: CollectedHeirloom[];
107
121
  }
108
- export interface AccountTransmogsCollection extends LinkSelfHref {
122
+ export interface AccountTransmogsCollection extends AccountLinks {
109
123
  appearance_sets: KeyNameId[];
110
124
  slots: {
111
125
  slot: TypeName;
@@ -115,7 +129,7 @@ export interface AccountTransmogsCollection extends LinkSelfHref {
115
129
  }[];
116
130
  }[];
117
131
  }
118
- export interface AccountDecorCollection extends LinkSelfHref {
132
+ export interface AccountDecorCollection extends AccountLinks {
119
133
  decor_collected: DecorItem[];
120
134
  }
121
135
  /**
@@ -178,6 +192,9 @@ export declare function accountHeirloomsCollection(ctx: ApiContext): Promise<Acc
178
192
  export declare function accountTransmogsCollection(ctx: ApiContext): Promise<AccountTransmogsCollection>;
179
193
  /**
180
194
  * Returns the housing decor collected by an account.
195
+ *
196
+ * Note: as of 2026-10-01 this returns 404 even for accounts with decor, although the collections index links to it.
197
+ * characterCollectionDecor works.
181
198
  * Requires a user access token (client.forUser(token)).
182
199
  *
183
200
  * @returns A promise that resolves to an object representing the account's decor.
@@ -129,6 +129,9 @@ async function accountTransmogsCollection(ctx) {
129
129
  }
130
130
  /**
131
131
  * Returns the housing decor collected by an account.
132
+ *
133
+ * Note: as of 2026-10-01 this returns 404 even for accounts with decor, although the collections index links to it.
134
+ * characterCollectionDecor works.
132
135
  * Requires a user access token (client.forUser(token)).
133
136
  *
134
137
  * @returns A promise that resolves to an object representing the account's decor.
@@ -31,6 +31,9 @@ export interface CollectedPet {
31
31
  id: number;
32
32
  is_active?: boolean;
33
33
  active_slot?: number;
34
+ is_favorite?: boolean;
35
+ /** The custom name, if the player renamed the pet. */
36
+ name?: string;
34
37
  }
35
38
  export interface CharacterCollectionPets extends LinkSelfHref {
36
39
  pets: CollectedPet[];
@@ -9,6 +9,10 @@ export interface CharacterHouse extends LinkSelfHref {
9
9
  /**
10
10
  * Returns a summary of a house a character has built.
11
11
  *
12
+ * Note: Blizzard disabled this endpoint in early 2026 over player privacy concerns, and it currently returns 404 even
13
+ * for characters that own a house. The function is kept for when it returns; the response type is unverified.
14
+ * See https://us.forums.blizzard.com/en/blizzard/t/new-housing-apis/56815
15
+ *
12
16
  * @param realmSlug - The slug of the realm.
13
17
  * @param characterName - The lowercase name of the character.
14
18
  * @param houseNumber - The number of the character's house (e.g. 1 for house-1).
@@ -7,6 +7,10 @@ exports.characterHouse = characterHouse;
7
7
  /**
8
8
  * Returns a summary of a house a character has built.
9
9
  *
10
+ * Note: Blizzard disabled this endpoint in early 2026 over player privacy concerns, and it currently returns 404 even
11
+ * for characters that own a house. The function is kept for when it returns; the response type is unverified.
12
+ * See https://us.forums.blizzard.com/en/blizzard/t/new-housing-apis/56815
13
+ *
10
14
  * @param realmSlug - The slug of the realm.
11
15
  * @param characterName - The lowercase name of the character.
12
16
  * @param houseNumber - The number of the character's house (e.g. 1 for house-1).
@@ -1,13 +1,13 @@
1
1
  import type { ApiContext, Href, KeyNameId, LinkSelfHref, LocalizedString, TypeName } from "../../shared/index.js";
2
+ import type { CharacterActiveTitle } from "./character_titles.js";
2
3
  export interface CharacterRealm extends KeyNameId {
3
4
  slug: string;
4
5
  }
5
6
  export interface CharacterProfile extends LinkSelfHref {
6
7
  id: number;
7
8
  name: LocalizedString;
8
- active_title?: {
9
- name: string;
10
- };
9
+ /** Absent when the character has no active title. */
10
+ active_title?: CharacterActiveTitle;
11
11
  gender: TypeName;
12
12
  faction: TypeName;
13
13
  race: KeyNameId;
@@ -10,7 +10,8 @@ export interface Detail {
10
10
  };
11
11
  description?: LocalizedString | null;
12
12
  cast_time?: LocalizedString;
13
- power_cost?: LocalizedString;
13
+ /** null for abilities without a cost. */
14
+ power_cost?: LocalizedString | null;
14
15
  cooldown?: LocalizedString;
15
16
  range?: LocalizedString;
16
17
  };
@@ -1,7 +1,18 @@
1
1
  import type { ApiContext } from "../../shared/index.js";
2
- import type { Character, KeyNameId, LinkSelfHref } from "../../shared/index.js";
2
+ import type { Character, Href, KeyNameId, LinkSelfHref } from "../../shared/index.js";
3
+ /**
4
+ * A character's active title. `display_string` has a `{name}` placeholder for the character name.
5
+ */
6
+ export interface CharacterActiveTitle {
7
+ key: Href;
8
+ name: string;
9
+ id: number;
10
+ display_string: string;
11
+ }
3
12
  export interface CharacterTitles extends LinkSelfHref {
4
13
  character: Character;
14
+ /** Absent when the character has no active title. */
15
+ active_title?: CharacterActiveTitle;
5
16
  titles: KeyNameId[];
6
17
  }
7
18
  /**
@@ -53,6 +53,6 @@ export type { CharacterReputations } from "./profile/character_reputations.js";
53
53
  export type { CharacterSoulbinds } from "./profile/character_soulbinds.js";
54
54
  export type { CharacterSpecializations, CharacterSpecializationTalent, ClassicSpecializationTalent, Detail, } from "./profile/character_specializations.js";
55
55
  export type { CharacterStatistics, StatRating, StatRatingBonus } from "./profile/character_statistics.js";
56
- export type { CharacterTitles } from "./profile/character_titles.js";
56
+ export type { CharacterActiveTitle, CharacterTitles } from "./profile/character_titles.js";
57
57
  export type { CrestAsset, Critiera, Guild, GuildAchievements, GuildActivity, GuildCrestRgba, GuildReference, GuildRoster, GuildRosterMemberCharacter, } from "./profile/guild.js";
58
58
  export type { Search, SearchParameters } from "./search.js";
@@ -18,7 +18,11 @@ import type { GuildAchievements } from "../wow/profile/guild.js";
18
18
  /** Makes the keys K of T optional. */
19
19
  type WithOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
20
20
  /** Character profile as returned for Classic: Retail-only links and fields are optional. */
21
- export interface ClassicCharacterProfile extends WithOptional<CharacterProfile, "active_spec" | "achievement_points" | "achievements" | "encounters" | "mythic_keystone_profile" | "collections" | "quests" | "achievements_statistics" | "professions" | "name_search" | "is_remix"> {
21
+ export interface ClassicCharacterProfile extends Omit<WithOptional<CharacterProfile, "active_spec" | "achievement_points" | "achievements" | "encounters" | "mythic_keystone_profile" | "collections" | "quests" | "achievements_statistics" | "professions" | "name_search" | "is_remix">, "active_title"> {
22
+ /** Classic only returns the title name. Absent when the character has no active title. */
23
+ active_title?: {
24
+ name: string;
25
+ };
22
26
  }
23
27
  /** Character appearance as returned for Classic (no active specialization on Era). */
24
28
  export interface ClassicCharacterAppearanceSummary extends WithOptional<CharacterAppearanceSummary, "active_spec"> {