@blizzard-api/wow
Version:
A series of helpers to interact with the World of Warcraft Blizzard API
1,933 lines (1,679 loc) • 67.9 kB
JavaScript
//#region src/account-profile/account-profile.ts
const accountProfileBase = "/profile/user/wow";
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns an index of collection types for an account.
*/
function accountCollectionsIndex(token) {
return {
namespace: "profile",
path: `${accountProfileBase}/collections`,
token
};
}
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a summary of the heirlooms an account has obtained.
*/
function accountHeirloomsCollectionSummary(token) {
return {
namespace: "profile",
path: `${accountProfileBase}/collections/heirlooms`,
token
};
}
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a summary of the mounts an account has obtained.
*/
function accountMountsCollectionSummary(token) {
return {
namespace: "profile",
path: `${accountProfileBase}/collections/mounts`,
token
};
}
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a summary of the battle pets an account has obtained.
*/
function accountPetsCollectionSummary(token) {
return {
namespace: "profile",
path: `${accountProfileBase}/collections/pets`,
token
};
}
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a profile summary for an account.
*/
function accountProfileSummary(token) {
return {
namespace: "profile",
path: `${accountProfileBase}`,
token
};
}
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a summary of the toys an account has obtained.
*/
function accountToysCollectionSummary(token) {
return {
namespace: "profile",
path: `${accountProfileBase}/collections/toys`,
token
};
}
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a summary of the transmog unlocks an account has obtained.
*/
function accountTransmogsCollectionSummary(token) {
return {
namespace: "profile",
path: `${accountProfileBase}/collections/transmogs`,
token
};
}
/**
* Because this endpoint provides data about the current logged-in user's World of Warcraft account, it requires an access token with the wow.profile scope acquired via the Authorization Code Flow. See {@link https://develop.battle.net/documentation/guides/using-oauth/authorization-code-flow}
* @param realmId The realm ID.
* @param characterId The character ID.
* @param token The OAuth 2.0 access token to use for authentication.
* @returns a protected profile summary for a character.
*/
function protectedCharacterProfileSummary(realmId, characterId, token) {
return {
namespace: "profile",
path: `${accountProfileBase}/protected-character/${realmId}-${characterId}`,
token
};
}
//#endregion
//#region src/base.ts
/**
* @file base.ts
* @module base
* @description Contains base constants and interfaces for the Blizzard API.
*/
/**
* The base request path for the Blizzard API for world of warcraft.
*/
const base = "/data/wow";
/**
* The base request path for media in the Blizzard API for world of warcraft.
*/
const mediaBase = `${base}/media`;
/**
* The base request path for search in the Blizzard API for world of warcraft.
*/
const searchBase = `${base}/search`;
//#endregion
//#region src/achievements/achievements.ts
const achievementBase = `${base}/achievement`;
const achievementCategoryBase = `${base}/achievement-category`;
/**
* Get an achievement by ID.
* @param achievementId The achievement ID.
* @returns The achievement. See {@link AchievementResponse}.
*/
function achievement(achievementId) {
return {
namespace: "static",
path: `${achievementBase}/${achievementId}`
};
}
/**
* Get an achievement category by ID.
* @param achievementCategoryId The achievement category ID.
* @returns The achievement category. See {@link AchievementCategoryResponse}.
*/
function achievementCategory(achievementCategoryId) {
return {
namespace: "static",
path: `${achievementCategoryBase}/${achievementCategoryId}`
};
}
/**
* Get an achievement category index.
* @returns The achievement category index. See {@link AchievementCategoryIndexResponse}.
*/
function achievementCategoryIndex() {
return {
namespace: "static",
path: `${achievementCategoryBase}/index`
};
}
/**
* Get an achievement index.
* @returns The achievement index. See {@link AchievementIndexResponse}.
*/
function achievementIndex() {
return {
namespace: "static",
path: `${achievementBase}/index`
};
}
/**
* Get achievement media by ID.
* @param achievementId The achievement ID.
* @returns The achievement media. See {@link AchievementMediaResponse}.
*/
function achievementMedia(achievementId) {
return {
namespace: "static",
path: `${mediaBase}/achievement/${achievementId}`
};
}
//#endregion
//#region src/auction-house/auction-house.ts
/**
* Get auction house data for a connected realm.
* @param connectedRealmId The ID of the connected realm.
* @returns The auction house data. See {@link AuctionHouseResponse}.
*/
function auctions(connectedRealmId) {
return {
namespace: "dynamic",
path: `${base}/connected-realm/${connectedRealmId}/auctions`
};
}
/**
* Get auction house data for all connected realms.
* @returns The auction house data. See {@link AuctionHouseResponse}.
*/
function commodities() {
return {
namespace: "dynamic",
path: `${base}/auctions/commodities`
};
}
//#endregion
//#region src/azerite-essence/azerite-essence.ts
/**
* Get an azerite essence by ID.
* @param azeriteEssenceId The azerite essence ID.
* @returns The azerite essence. See {@link AzeriteEssenceResponse}.
*/
function azeriteEssence(azeriteEssenceId) {
return {
namespace: "static",
path: `${base}/azerite-essence/${azeriteEssenceId}`
};
}
/**
* Get an azerite essence index.
* @returns The azerite essence index. See {@link AzeriteEssenceIndexResponse}.
*/
function azeriteEssenceIndex() {
return {
namespace: "static",
path: `${base}/azerite-essence/index`
};
}
/**
* Get azerite essence media by ID.
* @param azeriteEssenceId The azerite essence ID.
* @returns The azerite essence media. See {@link AzeriteEssenceMediaResponse}.
*/
function azeriteEssenceMedia(azeriteEssenceId) {
return {
namespace: "static",
path: `${mediaBase}/azerite-essence/${azeriteEssenceId}`
};
}
/**
* Search for azerite essences.
* @param options The search parameters. See {@link AzeriteEssenceSearchParameters}.
* @returns The search results. See {@link SearchResponse}.
*/
function azeriteEssenceSearch(options) {
return {
namespace: "static",
parameters: {
_page: options._page,
"allowed_specializations.id": options["allowed_specializations.id"],
orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby
},
path: `${searchBase}/azerite-essence`
};
}
//#endregion
//#region src/character-achievements/character-achievements.ts
const basePath$2 = "/profile/wow/character";
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the achievements a character has completed.
*/
function characterAchievementsSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `${basePath$2}/${realmSlug}/${characterName.toLowerCase()}/achievements`
};
}
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a character's statistics as they pertain to achievements.
*/
function characterAchievementStatistics(realmSlug, characterName) {
return {
namespace: "profile",
path: `${basePath$2}/${realmSlug}/${characterName.toLowerCase()}/achievements/statistics`
};
}
//#endregion
//#region src/character-appearance/character-appearance.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's appearance settings.
*/
function characterAppearanceSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName.toLowerCase()}/appearance`
};
}
//#endregion
//#region src/character-collections/character-collections.ts
const basePath$1 = "/profile/wow/character";
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns an index of collection types for a character.
*/
function characterCollectionsIndex(realmSlug, characterName) {
return {
namespace: "profile",
path: `${basePath$1}/${realmSlug}/${characterName}/collections`
};
}
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the heirlooms a character has obtained.
*/
function characterHeirloomsCollectionSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `${basePath$1}/${realmSlug}/${characterName}/collections/heirlooms`
};
}
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the mounts a character has obtained.
*/
function characterMountsCollectionSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `${basePath$1}/${realmSlug}/${characterName}/collections/mounts`
};
}
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the battle pets a character has obtained.
*/
function characterPetsCollectionSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `${basePath$1}/${realmSlug}/${characterName}/collections/pets`
};
}
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the toys a character has obtained.
*/
function characterToysCollectionSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `${basePath$1}/${realmSlug}/${characterName}/collections/toys`
};
}
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the transmog unlocks a character has obtained.
*/
function characterTransmogCollectionSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `${basePath$1}/${realmSlug}/${characterName}/collections/transmogs`
};
}
//#endregion
//#region src/character-encounters/character-encounters.ts
const bathPase = "profile/wow/character";
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's completed dungeons.
*/
function characterDungeons(realmSlug, characterName) {
return {
namespace: "profile",
path: `${bathPase}/${realmSlug}/${characterName.toLowerCase()}/encounters/dungeons`
};
}
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's encounters.
*/
function characterEncountersSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `${bathPase}/${realmSlug}/${characterName.toLowerCase()}/encounters`
};
}
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's completed raids.
*/
function characterRaids(realmSlug, characterName) {
return {
namespace: "profile",
path: `${bathPase}/${realmSlug}/${characterName.toLowerCase()}/encounters/raids`
};
}
//#endregion
//#region src/character-equipment/character-equipment.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the items equipped by a character.
*/
function characterEquipmentSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName.toLowerCase()}/equipment`
};
}
//#endregion
//#region src/character-hunter-pets/character-hunter-pets.ts
/**
* If the character is a hunter, returns a summary of the character's hunter pets. Otherwise, returns an HTTP 404 Not Found error.
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the character's hunter pets.
*/
function characterHunterPetsSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName}/hunter-pets`
};
}
//#endregion
//#region src/character-media/character-media.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the media assets available for a character (such as an avatar render).
*/
function characterMediaSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName}/character-media`
};
}
//#endregion
//#region src/character-mythic-keystone-profile/character-mythic-keystone-profile.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns 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.
*/
function characterMythicKeystoneProfileIndex(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName}/mythic-keystone-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 ID of the season.
* @returns the Mythic Keystone season details for a character.
*/
function characterMythicKeystoneSeasonDetails(realmSlug, characterName, seasonId) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName}/mythic-keystone-profile/season/${seasonId}`
};
}
//#endregion
//#region src/character-professions/character-professions.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the professions for a character.
*/
function characterProfessionsSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName.toLowerCase()}/professions`
};
}
//#endregion
//#region src/character-profile/character-profile.ts
/**
* 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:
*
* 1. A client requests and stores information about a character, including its unique character ID and the timestamp of the request.
* 2. After 30 days, the client makes a request to the status endpoint to verify if the character information is still valid.
* 3. If character cannot be found, is not valid, or the characters IDs do not match, the client removes the information from their application.
* 4. 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 the status of the character profile for a character.
*/
function characterProfileStatus(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName.toLowerCase()}/status`
};
}
/**
* Returns a summary of the character profile for a character.
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of the character profile for a character.
*/
function characterProfileSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName.toLowerCase()}`
};
}
//#endregion
//#region src/character-pvp/character-pvp.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @param bracketId The ID of the PvP bracket.
* @returns a PvP bracket statistics for a character.
*/
function characterPvpBracketStatistics(realmSlug, characterName, bracketId) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName.toLowerCase()}/pvp-bracket/${bracketId}`
};
}
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a PvP summary for a character.
*/
function characterPvpSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName.toLowerCase()}/pvp-summary`
};
}
//#endregion
//#region src/character-quests/character-quests.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a list of quests that a character has completed.
*/
function characterCompletedQuests(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName}/quests/completed`
};
}
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a character's active quests as well as a link to the character's completed quests.
*/
function characterQuests(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName}/quests`
};
}
//#endregion
//#region src/character-reputations/character-reputations.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's reputations.
*/
function characterReputationsSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName}/reputations`
};
}
//#endregion
//#region src/character-soulbinds/character-soulbinds.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a character's soulbinds.
*/
function characterSoulbinds(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName.toLowerCase()}/soulbinds`
};
}
//#endregion
//#region src/character-specializations/character-specializations.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of a character's specializations.
*/
function characterSpecializationsSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName}/specializations`
};
}
//#endregion
//#region src/character-statistics/character-statistics.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a statistics summary for a character.
*/
function characterStatisticsSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName}/statistics`
};
}
//#endregion
//#region src/character-titles/character-titles.ts
/**
* @param realmSlug The slug of the realm.
* @param characterName The lowercase name of the character.
* @returns a summary of titles a character has obtained.
*/
function characterTitlesSummary(realmSlug, characterName) {
return {
namespace: "profile",
path: `/profile/wow/character/${realmSlug}/${characterName}/titles`
};
}
//#endregion
//#region src/connected-realm/connected-realm.ts
/**
* Get a connected realm by ID.
* @param connectedRealmId The connected realm ID.
* @returns The connected realm. See {@link ConnectedRealmResponse}.
*/
function connectedRealm(connectedRealmId) {
return {
namespace: "dynamic",
path: `${base}/connected-realm/${connectedRealmId}`
};
}
/**
* Get a connected realm index.
* @returns The connected realm index. See {@link ConnectedRealmIndexResponse}.
*/
function connectedRealmIndex() {
return {
namespace: "dynamic",
path: `${base}/connected-realm/index`
};
}
/**
* Search for connected realms.
* @param options The search parameters. See {@link ConnectedRealmSearchParameters}.
* @returns The search results. See {@link SearchResponse} & {@link ConnectedRealmSearchResponseItem}.
*/
function connectedRealmSearch(options) {
return {
namespace: "dynamic",
parameters: {
_page: options._page,
orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
"realms.timezone": options["realms.timezone"],
"status.type": options["status.type"]
},
path: `${base}/search/connected-realm`
};
}
//#endregion
//#region src/covenant/covenant.ts
/**
* Get a conduit by ID.
* @param conduitId The conduit ID.
* @returns The conduit. See {@link ConduitResponse}.
*/
function conduit(conduitId) {
return {
namespace: "static",
path: `${base}/covenant/conduit/${conduitId}`
};
}
/**
* Get a conduit index.
* @returns The conduit index. See {@link ConduitIndexResponse}.
*/
function conduitIndex() {
return {
namespace: "static",
path: `${base}/covenant/conduit/index`
};
}
/**
* Get a covenant by ID.
* @param covenantId The covenant ID.
* @returns The covenant. See {@link CovenantResponse}.
*/
function covenant(covenantId) {
return {
namespace: "static",
path: `${base}/covenant/${covenantId}`
};
}
/**
* Get a covenant index.
* @returns The covenant index. See {@link CovenantIndexResponse}.
*/
function covenantIndex() {
return {
namespace: "static",
path: `${base}/covenant/index`
};
}
/**
* Get covenant media by ID.
* @param covenantId The covenant ID.
* @returns The covenant media. See {@link CovenantMediaResponse}.
*/
function covenantMedia(covenantId) {
return {
namespace: "static",
path: `${mediaBase}/covenant/${covenantId}`
};
}
/**
* Get a soulbind by ID.
* @param soulbindId The soulbind ID.
* @returns The soulbind. See {@link SoulbindResponse}.
*/
function soulbind(soulbindId) {
return {
namespace: "static",
path: `${base}/covenant/soulbind/${soulbindId}`
};
}
/**
* Get a soulbind index.
* @returns The soulbind index. See {@link SoulbindIndexResponse}.
*/
function soulbindIndex() {
return {
namespace: "static",
path: `${base}/covenant/soulbind/index`
};
}
//#endregion
//#region src/creature/creature.ts
/**
* Get a creature by ID.
* @param creatureId The creature ID.
* @returns The creature. See {@link CreatureResponse}.
*/
function creature(creatureId) {
return {
namespace: "static",
path: `${base}/creature/${creatureId}`
};
}
/**
* Get creature display media by ID.
* @param creatureDisplayId The creature display ID.
* @returns The creature display media. See {@link CreatureDisplayMediaResponse}.
*/
function creatureDisplayMedia(creatureDisplayId) {
return {
namespace: "static",
path: `${mediaBase}/creature-display/${creatureDisplayId}`
};
}
/**
* Get a creature family by ID.
* @param creatureFamilyId The creature family ID.
* @returns The creature family. See {@link CreatureFamilyResponse}.
*/
function creatureFamily(creatureFamilyId) {
return {
namespace: "static",
path: `${base}/creature-family/${creatureFamilyId}`
};
}
/**
* Get a creature family index.
* @returns The creature family index. See {@link CreatureFamilyIndexResponse}.
*/
function creatureFamilyIndex() {
return {
namespace: "static",
path: `${base}/creature-family/index`
};
}
/**
* Get creature family media by ID.
* @param creatureFamilyId The creature family ID.
* @returns The creature family media. See {@link CreatureFamilyMediaResponse}.
*/
function creatureFamilyMedia(creatureFamilyId) {
return {
namespace: "static",
path: `${mediaBase}/creature-family/${creatureFamilyId}`
};
}
/**
* Search for creatures.
* @param options The creature search parameters. See {@link CreatureSearchParameters}.
* @returns The creature search results. See {@link SearchResponse} & {@link CreatureSearchResponseItem}.
*/
function creatureSearch(options) {
return {
namespace: "static",
parameters: {
_page: options._page,
[`name.${options.locale}`]: options.name,
orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby
},
path: `${searchBase}/creature`
};
}
/**
* Get a creature type by ID.
* @param creatureTypeId The creature type ID.
* @returns The creature type. See {@link CreatureTypeResponse}.
*/
function creatureType(creatureTypeId) {
return {
namespace: "static",
path: `${base}/creature-type/${creatureTypeId}`
};
}
/**
* Get a creature type index.
* @returns The creature type index. See {@link CreatureTypeIndexResponse}.
*/
function creatureTypeIndex() {
return {
namespace: "static",
path: `${base}/creature-type/index`
};
}
//#endregion
//#region src/guild-crest/guild-crest.ts
/**
* Get a guild crest border by ID.
* @param borderId The guild crest border ID.
* @returns The guild crest border. See {@link GuildCrestBorderEmblemResponse}.
*/
function guildCrestBorder(borderId) {
return {
namespace: "static",
path: `${mediaBase}/guild-crest/border/${borderId}`
};
}
/**
* Get the guild crest components index.
* @returns The guild crest components index. See {@link GuildCrestComponentsIndexResponse}.
*/
function guildCrestComponentsIndex() {
return {
namespace: "static",
path: `${base}/guild-crest/index`
};
}
/**
* Get a guild crest emblem by ID.
* @param emblemId The guild crest emblem ID.
* @returns The guild crest emblem. See {@link GuildCrestBorderEmblemResponse}.
*/
function guildCrestEmblem(emblemId) {
return {
namespace: "static",
path: `${mediaBase}/guild-crest/emblem/${emblemId}`
};
}
//#endregion
//#region src/guild/guild.ts
const basePath = "/data/wow/guild";
/**
* @param realmSlug The slug of the realm.
* @param nameSlug The lowercase name of the guild.
* @returns a single guild by its name and realm.
*/
function guild(realmSlug, nameSlug) {
return {
namespace: "profile",
path: `${basePath}/${realmSlug}/${nameSlug}`
};
}
/**
* @param realmSlug The slug of the realm.
* @param nameSlug The lowercase name of the guild.
* @returns a single guild's achievements by name and realm.
*/
function guildAchievements(realmSlug, nameSlug) {
return {
namespace: "profile",
path: `${basePath}/${realmSlug}/${nameSlug}/achievements`
};
}
/**
* @param realmSlug The slug of the realm.
* @param nameSlug The lowercase name of the guild.
* @returns a single guild's activity by name and realm.
*/
function guildActivity(realmSlug, nameSlug) {
return {
namespace: "profile",
path: `${basePath}/${realmSlug}/${nameSlug}/activity`
};
}
/**
* @param realmSlug The slug of the realm.
* @param nameSlug The lowercase name of the guild.
* @returns a single guild's roster by its name and realm.
*/
function guildRoster(realmSlug, nameSlug) {
return {
namespace: "profile",
path: `${basePath}/${realmSlug}/${nameSlug}/roster`
};
}
//#endregion
//#region src/heirloom/heirloom.ts
/**
* Get a heirloom by ID.
* @param heirloomId The heirloom ID.
* @returns The heirloom. See {@link HeirloomResponse}.
*/
function heirloom(heirloomId) {
return {
namespace: "static",
path: `${base}/heirloom/${heirloomId}`
};
}
/**
* Get the heirloom index.
* @returns The heirloom index. See {@link HeirloomIndexResponse}.
*/
function heirloomIndex() {
return {
namespace: "static",
path: `${base}/heirloom/index`
};
}
//#endregion
//#region src/item/item.ts
/**
* Get an item by ID.
* @param itemId The item ID.
* @returns The item. See {@link ItemResponse}.
*/
function item(itemId) {
return {
namespace: "static",
path: `${base}/item/${itemId}`
};
}
/**
* Get an item class by ID.
* @param itemClassId The item class ID.
* @returns The item class. See {@link ItemClassResponse}.
*/
function itemClass(itemClassId) {
return {
namespace: "static",
path: `${base}/item-class/${itemClassId}`
};
}
/**
* Get an item class index.
* @returns The item class index. See {@link ItemClassIndexResponse}.
*/
function itemClassIndex() {
return {
namespace: "static",
path: `${base}/item-class/index`
};
}
/**
* Get item media by ID.
* @param itemId The item ID.
* @returns The item media. See {@link ItemMediaResponse}.
*/
function itemMedia(itemId) {
return {
namespace: "static",
path: `${mediaBase}/item/${itemId}`
};
}
/**
* Search for items.
* @param options The search parameters. See {@link ItemSearchParameters}.
* @returns The search results. See {@link SearchResponse}.
*/
function itemSearch(options) {
return {
namespace: "static",
parameters: {
_page: options._page,
[`name.${options.locale}`]: options.name,
orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby
},
path: `${searchBase}/item`
};
}
/**
* Get an item set by ID.
* @param itemSetId The item set ID.
* @returns The item set. See {@link ItemSetResponse}.
*/
function itemSet(itemSetId) {
return {
namespace: "static",
path: `${base}/item-set/${itemSetId}`
};
}
/**
* Get an item set index.
* @returns The item set index. See {@link ItemSetIndexResponse}.
*/
function itemSetIndex() {
return {
namespace: "static",
path: `${base}/item-set/index`
};
}
/**
* Get an item subclass by ID.
* @param itemClassId The item class ID.
* @param itemSubclassId The item subclass ID.
* @returns The item subclass. See {@link ItemSubClassResponse}.
*/
function itemSubClass(itemClassId, itemSubclassId) {
return {
namespace: "static",
path: `${base}/item-class/${itemClassId}/item-subclass/${itemSubclassId}`
};
}
//#endregion
//#region src/journal/journal.ts
/**
* Get a journal encounter by ID.
* @param journalEncounterId The journal encounter ID.
* @returns The journal encounter. See {@link JournalEncounterResponse}.
*/
function journalEncounter(journalEncounterId) {
return {
namespace: "static",
path: `${base}/journal-encounter/${journalEncounterId}`
};
}
/**
* Get the journal encounter index.
* @returns The journal encounter index. See {@link JournalEncounterIndexResponse}.
*/
function journalEncounterIndex() {
return {
namespace: "static",
path: `${base}/journal-encounter/index`
};
}
/**
* Search for journal encounters.
* @param options The search parameters. See {@link JournalEncounterSearchParameters}.
* @returns The search results. See {@link SearchResponse}.
*/
function journalEncounterSearch(options) {
return {
namespace: "static",
parameters: {
_page: options._page,
[`instance.name.${options.locale}`]: options.instanceName,
orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby
},
path: `${searchBase}/journal-encounter`
};
}
/**
* Get a journal expansion by ID.
* @param journalExpansionId The journal expansion ID.
* @returns The journal expansion. See {@link JournalExpansionResponse}.
*/
function journalExpansion(journalExpansionId) {
return {
namespace: "static",
path: `${base}/journal-expansion/${journalExpansionId}`
};
}
/**
* Get the journal expansion index.
* @returns The journal expansion index. See {@link JournalExpansionIndexResponse}.
*/
function journalExpansionIndex() {
return {
namespace: "static",
path: `${base}/journal-expansion/index`
};
}
/**
* Get a journal instance by ID.
* @param journalInstanceId The journal instance ID.
* @returns The journal instance. See {@link JournalInstanceResponse}.
*/
function journalInstance(journalInstanceId) {
return {
namespace: "static",
path: `${base}/journal-instance/${journalInstanceId}`
};
}
/**
* Get the journal instance index.
* @returns The journal instance index. See {@link JournalInstanceIndexResponse}.
*/
function journalInstanceIndex() {
return {
namespace: "static",
path: `${base}/journal-instance/index`
};
}
/**
* Get journal instance media by ID.
* @param journalInstanceId The journal instance ID.
* @returns The journal instance media. See {@link JournalInstanceMediaResponse}.
*/
function journalInstanceMedia(journalInstanceId) {
return {
namespace: "static",
path: `${mediaBase}/journal-instance/${journalInstanceId}`
};
}
//#endregion
//#region src/media-search/media-search.ts
/**
* Search for media.
* @param options The search parameters. See {@link MediaSearchParameters}.
* @returns The search results. See {@link SearchResponse}.
*/
function mediaSearch(options) {
return {
namespace: "static",
parameters: {
_page: options._page,
orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby,
tags: options.tags
},
path: `${searchBase}/media`
};
}
//#endregion
//#region src/modified-crafting/modified-crafting.ts
/**
* Get a modified crafting category by ID.
* @param modifiedCraftingCategoryId The modified crafting category ID.
* @returns The modified crafting category. See {@link ModifiedCraftingCategoryResponse}.
*/
function modifiedCraftingCategory(modifiedCraftingCategoryId) {
return {
namespace: "static",
path: `${base}/modified-crafting/category/${modifiedCraftingCategoryId}`
};
}
/**
* Get a modified crafting category index.
* @returns The modified crafting category index. See {@link ModifiedCraftingCategoryIndexResponse}.
*/
function modifiedCraftingCategoryIndex() {
return {
namespace: "static",
path: `${base}/modified-crafting/category/index`
};
}
/**
* Get a modified crafting index.
* @returns The modified crafting index. See {@link ModifiedCraftingIndexResponse}.
*/
function modifiedCraftingIndex() {
return {
namespace: "static",
path: `${base}/modified-crafting/index`
};
}
/**
* Get a modified crafting reagent slot type by ID.
* @param modifiedCraftingReagentSlotTypeId The modified crafting reagent slot type ID.
* @returns The modified crafting reagent slot type. See {@link ModifiedCraftingReagentSlotTypeResponse}.
*/
function modifiedCraftingReagentSlotType(modifiedCraftingReagentSlotTypeId) {
return {
namespace: "static",
path: `${base}/modified-crafting/reagent-slot-type/${modifiedCraftingReagentSlotTypeId}`
};
}
/**
* Get a modified crafting reagent slot type index.
* @returns The modified crafting reagent slot type index. See {@link ModifiedCraftingReagentSlotTypeIndexResponse}.
*/
function modifiedCraftingReagentSlotTypeIndex() {
return {
namespace: "static",
path: `${base}/modified-crafting/reagent-slot-type/index`
};
}
//#endregion
//#region src/mount/mount.ts
/**
* Get a mount by ID.
* @param mountId The mount ID.
* @returns The mount. See {@link MountResponse}.
*/
function mount(mountId) {
return {
namespace: "static",
path: `${base}/mount/${mountId}`
};
}
/**
* Get a mount index.
* @returns The mount index. See {@link MountIndexResponse}.
*/
function mountIndex() {
return {
namespace: "static",
path: `${base}/mount/index`
};
}
/**
* Get a mount search.
* @param options The search parameters. See {@link MountSearchParameters}.
* @returns The search results. See {@link SearchResponse}.
*/
function mountSearch(options) {
return {
namespace: "static",
parameters: {
_page: options._page,
[`name.${options.locale}`]: options.name,
orderby: Array.isArray(options.orderby) ? options.orderby.join(",") : options.orderby
},
path: `${searchBase}/mount`
};
}
//#endregion
//#region src/mythic-keystone-affix/mythic-keystone-affix.ts
/**
* Get a list of all Mythic Keystone affixes.
* @param mythicKeystoneAffixId The ID of the Mythic Keystone affix.
* @returns A list of all Mythic Keystone affixes. See {@link MythicKeystoneAffixIndexResponse}
*/
function mythicKeystoneAffix(mythicKeystoneAffixId) {
return {
namespace: "static",
path: `${base}/keystone-affix/${mythicKeystoneAffixId}`
};
}
/**
* Get a list of all Mythic Keystone affixes.
* @returns A list of all Mythic Keystone affixes. See {@link MythicKeystoneAffixIndexResponse}
*/
function mythicKeystoneAffixIndex() {
return {
namespace: "static",
path: `${base}/keystone-affix/index`
};
}
/**
* Get a list of all Mythic Keystone affix media.
* @param mythicKeystoneAffixId The ID of the Mythic Keystone affix.
* @returns A list of all Mythic Keystone affix media. See {@link MythicKeystoneAffixMediaResponse}
*/
function mythicKeystoneAffixMedia(mythicKeystoneAffixId) {
return {
namespace: "static",
path: `${mediaBase}/keystone-affix/${mythicKeystoneAffixId}`
};
}
//#endregion
//#region src/mythic-keystone-dungeon/mythic-keystone-dungeon.ts
/**
* Get a Mythic Keystone dungeon by ID.
* @param mythicKeystoneDungeonId The Mythic Keystone dungeon ID.
* @returns The Mythic Keystone dungeon. See {@link MythicKeystoneDungeonResponse}.
*/
function mythicKeystoneDungeon(mythicKeystoneDungeonId) {
return {
namespace: "dynamic",
path: `${base}/mythic-keystone/dungeon/${mythicKeystoneDungeonId}`
};
}
/**
* Get a Mythic Keystone dungeon index.
* @returns The Mythic Keystone dungeon index. See {@link MythicKeystoneDungeonIndexResponse}.
*/
function mythicKeystoneDungeonIndex() {
return {
namespace: "dynamic",
path: `${base}/mythic-keystone/dungeon/index`
};
}
/**
* Get a Mythic Keystone index.
* @returns The Mythic Keystone index. See {@link MythicKeystoneIndexResponse}.
*/
function mythicKeystoneIndex() {
return {
namespace: "dynamic",
path: `${base}/mythic-keystone/index`
};
}
/**
* Get a Mythic Keystone period by ID.
* @param mythicKeystonePeriodId The Mythic Keystone period ID.
* @returns The Mythic Keystone period. See {@link MythicKeystonePeriodResponse}.
*/
function mythicKeystonePeriod(mythicKeystonePeriodId) {
return {
namespace: "dynamic",
path: `${base}/mythic-keystone/period/${mythicKeystonePeriodId}`
};
}
/**
* Get a Mythic Keystone period index.
* @returns The Mythic Keystone period index. See {@link MythicKeystonePeriodIndexResponse}.
*/
function mythicKeystonePeriodIndex() {
return {
namespace: "dynamic",
path: `${base}/mythic-keystone/period/index`
};
}
/**
* Get a Mythic Keystone season by ID.
* @param mythicKeystoneSeasonId The Mythic Keystone season ID.
* @returns The Mythic Keystone season. See {@link MythicKeystoneSeasonResponse}.
*/
function mythicKeystoneSeason(mythicKeystoneSeasonId) {
return {
namespace: "dynamic",
path: `${base}/mythic-keystone/season/${mythicKeystoneSeasonId}`
};
}
/**
* Get a Mythic Keystone season index.
* @returns The Mythic Keystone season index. See {@link MythicKeystoneSeasonIndexResponse}.
*/
function mythicKeystoneSeasonIndex() {
return {
namespace: "dynamic",
path: `${base}/mythic-keystone/season/index`
};
}
//#endregion
//#region src/mythic-keystone-leaderboard/mythic-keystone-leaderboard.ts
/**
* Get a Mythic Keystone leaderboard by connected realm ID, dungeon ID, and period.
* @param connectedRealmId The connected realm ID.
* @param dungeonId The dungeon ID.
* @param period The period ID.
* @returns The Mythic Keystone leaderboard. See {@link MythicKeystoneLeaderboardResponse}.
*/
function mythicKeystoneLeaderboard(connectedRealmId, dungeonId, period) {
return {
namespace: "dynamic",
path: `${base}/connected-realm/${connectedRealmId}/mythic-leaderboard/${dungeonId}/period/${period}`
};
}
/**
* Get a Mythic Keystone leaderboard index by connected realm ID.
* @param connectedRealmId The connected realm ID.
* @returns The Mythic Keystone leaderboard index. See {@link MythicKeystoneLeaderboardIndexResponse}.
*/
function mythicKeystoneLeaderboardIndex(connectedRealmId) {
return {
namespace: "dynamic",
path: `${base}/connected-realm/${connectedRealmId}/mythic-leaderboard/index`
};
}
//#endregion
//#region src/mythic-raid-leaderboard/mythic-raid-leaderboard.ts
/**
* Get a Mythic Raid leaderboard by raid and faction.
* @param raid The slug of the raid.
* @param faction The faction. Either 'alliance' or 'horde'.
* @returns The Mythic Raid leaderboard. See {@link MythicRaidLeaderboardResponse}.
*/
function mythicRaidLeaderboard(raid, faction) {
return {
namespace: "dynamic",
path: `${base}/leaderboard/hall-of-fame/${raid}/${faction}`
};
}
//#endregion
//#region src/pet/pet.ts
/**
* Get a pet by ID.
* @param petId The pet ID.
* @returns The pet. See {@link PetResponse}.
*/
function pet(petId) {
return {
namespace: "static",
path: `${base}/pet/${petId}`
};
}
/**
* Get a pet ability by ID.
* @param petAbilityId The pet ability ID.
* @returns The pet ability. See {@link PetAbilityResponse}.
*/
function petAbility(petAbilityId) {
return {
namespace: "static",
path: `${base}/pet-ability/${petAbilityId}`
};
}
/**
* Get a pet ability index.
* @returns The pet ability index. See {@link PetAbilityIndexResponse}.
*/
function petAbilityIndex() {
return {
namespace: "static",
path: `${base}/pet-ability/index`
};
}
/**
* Get a pet ability media by ID.
* @param petAbilityId The pet ability ID.
* @returns The pet ability media. See {@link PetAbilityMediaResponse}.
*/
function petAbilityMedia(petAbilityId) {
return {
namespace: "static",
path: `${mediaBase}/pet-ability/${petAbilityId}`
};
}
/**
* Get a pet index.
* @returns The pet index. See {@link PetIndexResponse}.
*/
function petIndex() {
return {
namespace: "static",
path: `${base}/pet/index`
};
}
/**
* Get a pet media by ID.
* @param petId The pet ID.
* @returns The pet media. See {@link PetMediaResponse}.
*/
function petMedia(petId) {
return {
namespace: "static",
path: `${mediaBase}/pet/${petId}`
};
}
//#endregion
//#region src/playable-class/playable-class.ts
/**
* Get a playable class by ID.
* @param playableClassId The playable class ID.
* @returns The playable class. See {@link PlayableClassResponse}.
*/
function playableClass(playableClassId) {
return {
namespace: "static",
path: `${base}/playable-class/${playableClassId}`
};
}
/**
* Get a playable class index.
* @returns The playable class index. See {@link PlayableClassIndexResponse}.
*/
function playableClassIndex() {
return {
namespace: "static",
path: `${base}/playable-class/index`
};
}
/**
* Get playable class media by ID.
* @param playableClassId The playable class ID.
* @returns The playable class media. See {@link PlayableClassMediaResponse}.
*/
function playableClassMedia(playableClassId) {
return {
namespace: "static",
path: `${mediaBase}/playable-class/${playableClassId}`
};
}
/**
* Get a playable class's PvP talent slots by ID.
* @param playableClassId The playable class ID.
* @returns The playable class's PvP talent slots. See {@link PvpTalentSlotsResponse}.
*/
function pvpTalentSlots(playableClassId) {
return {
namespace: "static",
path: `${base}/playable-class/${playableClassId}/pvp-talent-slots`
};
}
//#endregion
//#region src/playable-race/playable-race.ts
/**
* Get a playable race by ID.
* @param playableRaceId The playable race ID.
* @returns The playable race. See {@link PlayableRaceResponse}.
*/
function playableRace(playableRaceId) {
return {
namespace: "static",
path: `${base}/playable-race/${playableRaceId}`
};
}
/**
* Get a playable race index.
* @returns The playable race index. See {@link PlayableRaceIndexResponse}.
*/
function playableRaceIndex() {
return {
namespace: "static",
path: `${base}/playable-race/index`
};
}
//#endregion
//#region src/playable-specialization/playable-specialization.ts
/**
* Get a playable specialization by ID.
* @param specializationId The playable specialization ID.
* @returns The playable specialization. See {@link PlayableSpecializationResponse}.
*/
function playableSpecialization(specializationId) {
return {
namespace: "static",
path: `${base}/playable-specialization/${specializationId}`
};
}
/**
* Get a playable specialization index.
* @returns The playable specialization index. See {@link PlayableSpecializationIndexResponse}.
*/
function playableSpecializationIndex() {
return {
namespace: "static",
path: `${base}/playable-specialization/index`
};
}
/**
* Get a playable specialization media by ID.
* @param specializationId The playable specialization ID.
* @returns The playable specialization media. See {@link PlayableSpecializationMediaResponse}.
*/
function playableSpecializationMedia(specializationId) {
return {
namespace: "static",
path: `${mediaBase}/playable-specialization/${specializationId}`
};
}
//#endregion
//#region src/power-type/power-type.ts
/**
* Get a power type by ID.
* @param powerTypeId The power type ID.
* @returns The power type. See {@link PowerTypeResponse}.
*/
function powerType(powerTypeId) {
return {
namespace: "static",
path: `${base}/power-type/${powerTypeId}`
};
}
/**
* Get a power type index.
* @returns The power type index. See {@link PowerTypeIndexResponse}.
*/
function powerTypeIndex() {
return {
namespace: "static",
path: `${base}/power-type/index`
};
}
//#endregion
//#region src/profession/profession.ts
/**
* Get a profession by ID.
* @param professionId The profession ID.
* @returns The profession. See {@link ProfessionResponse}.
*/
function profession(professionId) {
return {
namespace: "static",
path: `${base}/profession/${professionId}`
};
}
/**
* Get a profession index.
* @returns The profession index. See {@link ProfessionIndexResponse}.
*/
function professionIndex() {
return {
namespace: "static",
path: `${base}/profession/index`
};
}
/**
* Get profession media by ID.
* @param professionId The profession ID.
* @returns The profession media. See {@link ProfessionMediaResponse}.
*/
function professionMedia(professionId) {
return {
namespace: "static",
path: `${mediaBase}/profession/${professionId}`
};
}
/**
* Get a profession's skill tier by ID.
* @param professionId The profession ID.
* @param skillTierId The skill tier ID.
* @returns The profession's skill tier. See {@link ProfessionSkillTierResponse}.
*/
function professionSkillTier(professionId, skillTierId) {
return {
namespace: "static",
path: `${base}/profession/${professionId}/skill-tier/${skillTierId}`
};
}
/**
* Get a recipe by ID.
* @param recipeId The recipe ID.
* @returns The recipe. See {@link RecipeResponse}.
*/
function recipe(recipeId) {
return {
namespace: "static",
path: `${base}/recipe/${recipeId}`
};
}
/**
* Get recipe media by ID.
* @param recipeId The recipe ID.
* @returns The recipe media. See {@link RecipeMediaResponse}.
*/
function recipeMedia(recipeId) {
return {
namespace: "static",
path: `${mediaBase}/recipe/${recipeId}`
};
}
//#endregion
//#region src/pvp-season/pvp-season.ts
/**
* Get a PvP leaderboard by PvP season ID and bracket.
* @param pvpSeasonId The PvP season ID.
* @param bracket The PvP bracket.
* @returns The PvP leaderboard. See {@link PvpLeaderboardResponse}.
*/
function pvpLeaderboard(pvpSeasonId, bracket) {
return {
namespace: "dynamic",
path: `${base}/pvp-season/${pvpSeasonId}/pvp-leaderboard/${bracket}`
};
}
/**
* Get a PvP leaderboard index by PvP season ID.
* @param pvpSeasonId The PvP season ID.
* @returns The PvP leaderboard index. See {@link PvpLeaderboardIndexResponse}.
*/
function pvpLeaderboardIndex(pvpSeasonId) {
return {
namespace: "dynamic",
path: `${base}/pvp-season/${pvpSeasonId}/pvp-leaderboard/index`
};
}
/**
* Get a PvP reward index by PvP season ID.
* @param pvpSeasonId The PvP season ID.
* @returns The PvP reward index. See {@link PvpRewardsIndexResponse}.
*/
function pvpRewardsIndex(pvpSeasonId) {
return {
namespace: "dynamic",
path: `${base}/pvp-season/${pvpSeasonId}/pvp-reward/index`
};
}
/**
* Get a PvP season by ID.
* @param pv