raiderio-api 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/core/api.ts","../src/core/character.ts","../src/core/expansion.ts","../src/core/gear.ts","../src/core/locales.ts","../src/core/region-realm.ts","../src/core/season.ts","../src/http/http.ts","../src/resources/character/character.ts","../src/resources/general/general.ts","../src/resources/guild/guild.ts","../src/resources/mythic-plus/mythic-plus.ts","../src/resources/raiding/raiding.ts","../src/client.ts","../src/resources/character/types.ts","../src/resources/guild/types.ts","../src/resources/mythic-plus/types.ts","../src/resources/raiding/types.ts"],"sourcesContent":["export const raiderIoBasePath = 'https://raider.io/api/v1'\r\n\r\n// eslint-disable-next-line sonarjs/redundant-type-aliases\r\nexport type ISODateString = string\r\n\r\nexport interface Resource<T> {\r\n /**\r\n * The response type of the resource\r\n * @internal\r\n */\r\n _responseType?: T\r\n path: string\r\n query: Record<string, boolean | number | string | undefined>\r\n}\r\n\r\nexport type ResourceResponse<T = unknown> = Promise<T>\r\n","export const roles = ['tank', 'healer', 'dps'] as const\r\nexport type Role = (typeof roles)[number]\r\n\r\nexport const factions = ['horde', 'alliance'] as const\r\nexport type Faction = (typeof factions)[number]\r\n\r\nexport const genders = ['male', 'female'] as const\r\nexport type Gender = (typeof genders)[number]\r\n\r\nexport interface PlayableClass {\r\n id: number\r\n name: string\r\n slug: string\r\n}\r\n\r\nexport interface PlayableRace {\r\n faction: Faction\r\n id: number\r\n name: string\r\n slug: string\r\n}\r\n\r\nexport interface Specialization {\r\n class_id: number\r\n id: number\r\n is_melee: boolean\r\n name: string\r\n ordinal: number\r\n patch: string\r\n role: Role\r\n slug: string\r\n}\r\n","export const LEGION = 6\r\nexport const BATTLE_FOR_AZEROTH = 7\r\nexport const SHADOWLANDS = 8\r\nexport const DRAGONFLIGHT = 9\r\nexport const THE_WAR_WITHIN = 10\r\nexport const MIDNIGHT = 11\r\n\r\nexport const expansionIds = [\r\n LEGION,\r\n BATTLE_FOR_AZEROTH,\r\n SHADOWLANDS,\r\n DRAGONFLIGHT,\r\n THE_WAR_WITHIN,\r\n MIDNIGHT\r\n] as const\r\nexport type ExpansionId = (typeof expansionIds)[number]\r\n","export const slots = [\r\n 'head',\r\n 'neck',\r\n 'shoulder',\r\n 'back',\r\n 'chest',\r\n 'waist',\r\n 'shirt',\r\n 'wrist',\r\n 'hands',\r\n 'legs',\r\n 'feet',\r\n 'finger1',\r\n 'finger2',\r\n 'trinket1',\r\n 'trinket2',\r\n 'mainhand',\r\n 'offhand'\r\n]\r\nexport type ItemSlot = (typeof slots)[number]\r\n","export const locales = [\r\n 'en',\r\n 'ru',\r\n 'ko',\r\n 'cn',\r\n 'pt',\r\n 'it',\r\n 'fr',\r\n 'es',\r\n 'de',\r\n 'tw'\r\n] as const\r\nexport type Locale = (typeof locales)[number]\r\nexport type LocalizedString = Record<Locale, string>\r\n","export const regions = ['us', 'eu', 'tw', 'kr', 'cn'] as const\r\nexport interface Realm {\r\n altName: string\r\n altSlug: string\r\n connectedRealmId: number\r\n id: number\r\n isConnected: boolean\r\n locale: string\r\n name: string\r\n realmType: string\r\n slug: string\r\n wowConnectedRealmId: number\r\n wowRealmId: number\r\n}\r\n\r\nexport type RealmSummary = Pick<Realm, 'isConnected' | 'name' | 'slug'>\r\n\r\nexport interface Region {\r\n name: string\r\n short_name: RegionShortName\r\n slug: string\r\n}\r\n\r\nexport type RegionShortName = (typeof regions)[number]\r\n","export const seasonReferences = [\r\n 'season-sl-1',\r\n 'season-sl-2',\r\n 'season-sl-3',\r\n 'season-sl-4',\r\n 'season-df-1',\r\n 'season-df-2',\r\n 'season-df-3',\r\n 'season-df-4',\r\n 'season-tww-1',\r\n 'season-tww-2',\r\n 'season-tww-3',\r\n 'season-mn-1',\r\n 'current',\r\n 'previous'\r\n]\r\nexport type SeasonReference = (typeof seasonReferences)[number]\r\n\r\nexport const weekScopes = ['current', 'previous'] as const\r\nexport type WeekScope = (typeof weekScopes)[number]\r\n","import ky from 'ky'\r\nimport type { Resource, ResourceResponse } from '../core'\r\nimport { raiderIoBasePath } from '../core'\r\nimport type { ClientOptions } from './types'\r\n\r\n/**\r\n * Low-level HTTP layer for the Raider.io API.\r\n *\r\n * Turns a {@link Resource} (a `path` + `query` description produced by the\r\n * resource builders) into an actual HTTP request and returns the parsed JSON.\r\n * Most consumers should use the higher-level `RaiderioClient` instead.\r\n */\r\nexport class HttpClient {\r\n public defaults: {\r\n key?: string\r\n }\r\n\r\n private ky\r\n\r\n constructor(options: ClientOptions = {}) {\r\n this.defaults = {\r\n key: options.key\r\n }\r\n this.ky = ky.create(options.kyOptions)\r\n }\r\n\r\n /**\r\n * Build the absolute request URL for a resource.\r\n * @param resource The resource to fetch. See {@link Resource}.\r\n * @returns The fully-qualified request URL.\r\n */\r\n public getRequestUrl<T>(resource: Resource<T>): string {\r\n const slashSeparator = resource.path.startsWith('/') ? '' : '/'\r\n\r\n return `${raiderIoBasePath}${slashSeparator}${resource.path}`\r\n }\r\n\r\n /**\r\n * Send a request to the Raider.io API.\r\n * @param resource The resource to fetch. See {@link Resource}.\r\n * @param options Per-request overrides (api key, ky options). See {@link ClientOptions}.\r\n * @returns The parsed JSON response. See {@link ResourceResponse}.\r\n */\r\n public async request<T>(\r\n resource: Resource<T>,\r\n options?: Partial<ClientOptions>\r\n ): ResourceResponse<T> {\r\n const url = this.getRequestUrl(resource)\r\n\r\n // Drop undefined values so optional params never leak into the URL.\r\n const searchParameters: Record<string, boolean | number | string> = {}\r\n for (const [key, value] of Object.entries(resource.query)) {\r\n if (value !== undefined) {\r\n searchParameters[key] = value\r\n }\r\n }\r\n\r\n const apiKey = options?.key ?? this.defaults.key\r\n if (apiKey) {\r\n searchParameters.api_key = apiKey\r\n }\r\n\r\n const response = await this.ky.get<T>(url, {\r\n ...options?.kyOptions,\r\n searchParams: searchParameters\r\n })\r\n\r\n return response.json()\r\n }\r\n}\r\n","import type { Resource } from '../../core'\r\nimport type {\r\n CharacterProfileFieldKey,\r\n ViewCharacterProfileResponse\r\n} from './types'\r\n\r\n// ==================================================\r\n\r\nconst charactersBasePath = '/characters'\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param region The region (us, eu, kr or tw).\r\n * @param realm The realm (can be formatted as \"Altar of Storms\" or \"altar-of-storms\").\r\n * @param name The character name.\r\n * @param fields The fields to include in the response. If not provided, only the basic profile information will be returned.\r\n * @returns information about a character. See {@link ViewCharacterProfileResponse}\r\n */\r\nexport function characterProfile(\r\n region: string,\r\n realm: string,\r\n name: string,\r\n fields?: Array<CharacterProfileFieldKey> // to improve\r\n): Resource<ViewCharacterProfileResponse> {\r\n return {\r\n path: `${charactersBasePath}/profile`,\r\n query: {\r\n fields: fields?.join(','),\r\n name,\r\n realm,\r\n region\r\n }\r\n }\r\n}\r\n","import type { Resource } from '../../core'\r\nimport type { ViewPeriodsResponse } from './types'\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @returns current, previous and next period ids and data ranges. See {@link ViewPeriodsResponse}\r\n */\r\nexport function periods(): Resource<ViewPeriodsResponse> {\r\n return {\r\n path: '/periods',\r\n query: {}\r\n }\r\n}\r\n","import type { Resource } from '../../core'\r\nimport type { RaidDifficulty } from '../raiding/types'\r\nimport type {\r\n GuildProfileFieldKey,\r\n ViewGuildBossKillResponse,\r\n ViewGuildProfileResponse\r\n} from './types'\r\n\r\n// ==================================================\r\n\r\nconst guildsBasePath = '/guilds'\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param region The region (us, eu, kr or tw).\r\n * @param realm The realm (can be formatted as \"Altar of Storms\" or \"altar-of-storms\").\r\n * @param guild The guild name.\r\n * @param raid The raid instance slug (e.g. \"castle-nathria\").\r\n * @param boss The boss slug (e.g. \"sire-denathrius\").\r\n * @param difficulty The raid difficulty (e.g. \"mythic\").\r\n * @returns information about a guild boss kill. See {@link ViewGuildBossKillResponse}\r\n */\r\nexport function guildBossKill(\r\n region: string,\r\n realm: string,\r\n guild: string,\r\n raid: string,\r\n boss: string,\r\n difficulty: RaidDifficulty\r\n): Resource<ViewGuildBossKillResponse> {\r\n return {\r\n path: `${guildsBasePath}/boss-kill`,\r\n query: {\r\n boss,\r\n difficulty,\r\n guild,\r\n raid,\r\n realm,\r\n region\r\n }\r\n }\r\n}\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param region The region (us, eu, kr or tw).\r\n * @param realm The realm (can be formatted as \"Altar of Storms\" or \"altar-of-storms\").\r\n * @param name The guild name.\r\n * @param fields The fields to include in the response. If not provided, only the basic profile information will be returned.\r\n * @returns Profile information about the guild, including optional fields. See {@link ViewGuildProfileResponse}\r\n */\r\nexport function guildProfile(\r\n region: string,\r\n realm: string,\r\n name: string,\r\n fields?: Array<GuildProfileFieldKey> // to improve\r\n): Resource<ViewGuildProfileResponse> {\r\n return {\r\n path: `${guildsBasePath}/profile`,\r\n query: {\r\n fields: fields?.join(','),\r\n name,\r\n realm,\r\n region\r\n }\r\n }\r\n}\r\n","import type {\r\n ExpansionId,\r\n Locale,\r\n RegionShortName,\r\n Resource,\r\n SeasonReference,\r\n WeekScope\r\n} from '../../core'\r\nimport type {\r\n ViewMythicPlusAffixesResponse,\r\n ViewMythicPlusLeaderboardCapacityResponse,\r\n ViewMythicPlusRunDetailsResponse,\r\n ViewMythicPlusRunsResponse,\r\n ViewMythicPlusScoreTiersResponse,\r\n ViewMythicPlusSeasonCutoffsResponse,\r\n ViewMythicPlusStaticDataResponse\r\n} from './types'\r\n\r\n// ==================================================\r\n\r\nconst mythicPlusBasePath = '/mythic-plus'\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param region The region (us, eu, kr or tw).\r\n * @param locale The locale (en, es, fr, de, ru, ko or cn).\r\n * @returns List of current Mythic Plus affixes, including their names and descriptions in the specified locale. See {@link ViewMythicPlusAffixesResponse}\r\n */\r\nexport function mythicPlusAffixes(\r\n region: RegionShortName = 'eu',\r\n locale: Locale = 'en'\r\n): Resource<ViewMythicPlusAffixesResponse> {\r\n return {\r\n path: `${mythicPlusBasePath}/affixes`,\r\n query: {\r\n locale,\r\n region\r\n }\r\n }\r\n}\r\n\r\n// ==================================================\r\n\r\n/**\r\n *\r\n * @param scope The week scope (current or previous).\r\n * @param region The region (us, eu, kr or tw).\r\n * @param realm The realm (can be formatted as \"Altar of Storms\" or \"altar-of-storms\"). Optional, if not provided, the capacity for the entire region will be returned.\r\n * @returns The Mythic Plus leaderboard capacity for the specified scope, region and realm (if provided). See {@link ViewMythicPlusLeaderboardCapacityResponse}\r\n */\r\nexport function mythicPlusLeaderboardCapacity(\r\n scope: WeekScope,\r\n region: RegionShortName,\r\n realm?: null | string\r\n): Resource<ViewMythicPlusLeaderboardCapacityResponse> {\r\n return {\r\n path: `${mythicPlusBasePath}/leaderboard-capacity`,\r\n query: {\r\n realm: realm ?? undefined,\r\n region,\r\n scope\r\n }\r\n }\r\n}\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param season The season slug (e.g. \"season-tww-4\").\r\n * @param id The ID of the Mythic Plus run.\r\n * @returns Detailed information about the specified Mythic Plus run, including the dungeon, keystone level, clear time, affixes, roster and more. See {@link ViewMythicPlusRunDetailsResponse}\r\n */\r\nexport function mythicPlusRunDetails(\r\n season: SeasonReference,\r\n id: number\r\n): Resource<ViewMythicPlusRunDetailsResponse> {\r\n return {\r\n path: `${mythicPlusBasePath}/run-details`,\r\n query: {\r\n id,\r\n season\r\n }\r\n }\r\n}\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param region The region (us, eu, kr or tw).\r\n * @param page The page number for pagination (starting from 0).\r\n * @param season The season slug (e.g. \"season-tww-4\"). Optional, if not provided, runs from the current season will be returned.\r\n * @param dungeon The name of the dungeon (e.g. \"plaguefall\"). Optional, if not provided, runs from all dungeons will be returned.\r\n * @param affixes A hyphen-separated list of affix slugs (e.g. \"fortified-bolstering\"). Optional, if not provided, runs with any affixes will be returned.\r\n * @returns information about the top runs that match the given criteria. See {@link ViewMythicPlusRunsResponse}\r\n */\r\nexport function mythicPlusRuns(\r\n region: 'world' | Exclude<RegionShortName, 'cn'>,\r\n page = 0,\r\n season?: SeasonReference,\r\n dungeon?: string,\r\n affixes?: string\r\n): Resource<ViewMythicPlusRunsResponse> {\r\n return {\r\n path: `${mythicPlusBasePath}/runs`,\r\n query: {\r\n affixes,\r\n dungeon,\r\n page,\r\n region: region.toString(),\r\n season\r\n }\r\n }\r\n}\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param season The season slug (e.g. \"season-tww-4\"). Optional, if not provided, the score tiers for the current season will be returned.\r\n * @returns the colors used for score tiers in the given season. See {@link ViewMythicPlusScoreTiersResponse}\r\n */\r\nexport function mythicPlusScoreTiers(\r\n season: SeasonReference = 'current'\r\n): Resource<ViewMythicPlusScoreTiersResponse> {\r\n return {\r\n path: `${mythicPlusBasePath}/score-tiers`,\r\n query: { season }\r\n }\r\n}\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param region The region (us, eu, kr or tw).\r\n * @param season The season slug (e.g. \"season-tww-4\"). Optional, if not provided, the cutoffs for the current season will be returned.\r\n * @returns the Mythic+ Season cutoffs for a region. See {@link ViewMythicPlusSeasonCutoffsResponse}\r\n */\r\nexport function mythicPlusSeasonCutoffs(\r\n region: RegionShortName,\r\n season: SeasonReference = 'current'\r\n): Resource<ViewMythicPlusSeasonCutoffsResponse> {\r\n return {\r\n path: `${mythicPlusBasePath}/season-cutoffs`,\r\n query: { region, season }\r\n }\r\n}\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param expansionId The expansion ID (e.g. 9 for Shadowlands).\r\n * @returns mythic plus season and dungeon static data for a specific expansion (slugs, names, etc.). See {@link ViewMythicPlusStaticDataResponse}\r\n */\r\nexport function mythicPlusStaticData(\r\n expansionId: ExpansionId\r\n): Resource<ViewMythicPlusStaticDataResponse> {\r\n return {\r\n path: `${mythicPlusBasePath}/static-data`,\r\n query: { expansion_id: expansionId }\r\n }\r\n}\r\n","import type { ExpansionId, Realm, RegionShortName, Resource } from '../../core'\r\nimport type {\r\n RaidDifficulty,\r\n RaidInstance,\r\n ViewBossRankingsResponse,\r\n ViewHallOfFameResponse,\r\n ViewRaidingStaticDataResponse,\r\n ViewRaidProgressionResponse,\r\n ViewRaidRankingsResponse\r\n} from './types'\r\n\r\n// ==================================================\r\n\r\nconst raidingBasePath = '/raiding'\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param raid The raid instance to retrieve boss rankings for.\r\n * @param boss The boss slug to retrieve rankings for (e.g. \"sire-denathrius\").\r\n * @param difficulty The raid difficulty to retrieve rankings for (e.g. \"mythic\").\r\n * @param region The region to retrieve rankings for (us, eu, kr or tw).\r\n * @param realm The realm slug to retrieve rankings for (e.g. \"area-52\"). Optional, if not provided rankings for all realms in the specified region will be returned.\r\n * @returns the rankings for the specified boss, raid, difficulty and region. See {@link ViewBossRankingsResponse}\r\n */\r\nexport function raidingBossRankings(\r\n raid: RaidInstance,\r\n boss: string,\r\n difficulty: RaidDifficulty,\r\n region: RegionShortName,\r\n realm?: null | Realm['slug']\r\n): Resource<ViewBossRankingsResponse> {\r\n return {\r\n path: `${raidingBasePath}/boss-rankings`,\r\n query: {\r\n boss,\r\n difficulty,\r\n raid,\r\n realm: realm ?? undefined,\r\n region\r\n }\r\n }\r\n}\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param raid The raid instance to retrieve boss rankings for.\r\n * @param difficulty The raid difficulty to retrieve rankings for (e.g. \"mythic\").\r\n * @param region The region to retrieve rankings for (us, eu, kr or tw).\r\n * @returns the hall of fame for a given raid. See {@link ViewHallOfFameResponse}\r\n */\r\nexport function raidingHallOfFame(\r\n raid: RaidInstance,\r\n difficulty: RaidDifficulty,\r\n region: RegionShortName\r\n): Resource<ViewHallOfFameResponse> {\r\n return {\r\n path: `${raidingBasePath}/hall-of-fame`,\r\n query: {\r\n difficulty,\r\n raid,\r\n region\r\n }\r\n }\r\n}\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param raid The raid instance to retrieve progression for.\r\n * @param difficulty The raid difficulty to retrieve progression for (e.g. \"mythic\").\r\n * @param region The region to retrieve progression for (us, eu, kr or tw).\r\n * @returns the raid progression for a given raid. See {@link ViewRaidProgressionResponse}\r\n */\r\nexport function raidingProgression(\r\n raid: RaidInstance,\r\n difficulty: RaidDifficulty,\r\n region: RegionShortName\r\n): Resource<ViewRaidProgressionResponse> {\r\n return {\r\n path: `${raidingBasePath}/progression`,\r\n query: {\r\n difficulty,\r\n raid,\r\n region\r\n }\r\n }\r\n}\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param raid The raid instance to retrieve rankings for.\r\n * @param difficulty The raid difficulty to retrieve rankings for (e.g. \"mythic\").\r\n * @param region The region to retrieve rankings for (us, eu, kr or tw).\r\n * @param realm The realm slug to retrieve rankings for (e.g. \"area-52\"). Optional, if not provided rankings for all realms in the specified region will be returned.\r\n * @param guilds A comma-separated list of guild names to filter the rankings by (e.g. \"guild1,guild2\"). Optional, if not provided rankings for all guilds will be returned.\r\n * @param limit The number of results to return per page. Default is 50.\r\n * @param page The page number to return (starting from 0). Default is 0.\r\n * @returns the raid rankings for a given raid and region. See {@link ViewRaidRankingsResponse}\r\n */\r\nexport function raidingRaidRankings(\r\n raid: RaidInstance,\r\n difficulty: RaidDifficulty,\r\n region: RegionShortName,\r\n realm: null | string,\r\n guilds = '',\r\n limit = 50,\r\n page = 0\r\n): Resource<ViewRaidRankingsResponse> {\r\n return {\r\n path: `${raidingBasePath}/raid-rankings`,\r\n query: {\r\n difficulty,\r\n guilds: guilds || undefined,\r\n limit,\r\n page,\r\n raid,\r\n realm: realm ?? undefined,\r\n region\r\n }\r\n }\r\n}\r\n\r\n// ==================================================\r\n\r\n/**\r\n * @param expansionId The expansion ID (e.g. 9 for Shadowlands).\r\n * @returns raid and biss static data for a specific expansion (slugs, names, etc). See {@link ViewRaidingStaticDataResponse}\r\n */\r\nexport function raidingStaticData(\r\n expansionId: ExpansionId\r\n): Resource<ViewRaidingStaticDataResponse> {\r\n return {\r\n path: `${raidingBasePath}/static-data`,\r\n query: { expansion_id: expansionId }\r\n }\r\n}\r\n","import type { Resource } from './core'\r\nimport { HttpClient } from './http/http'\r\nimport type { ClientOptions } from './http/types'\r\nimport { characterProfile } from './resources/character/character'\r\nimport { periods } from './resources/general/general'\r\nimport { guildBossKill, guildProfile } from './resources/guild/guild'\r\nimport {\r\n mythicPlusAffixes,\r\n mythicPlusLeaderboardCapacity,\r\n mythicPlusRunDetails,\r\n mythicPlusRuns,\r\n mythicPlusScoreTiers,\r\n mythicPlusSeasonCutoffs,\r\n mythicPlusStaticData\r\n} from './resources/mythic-plus/mythic-plus'\r\nimport {\r\n raidingBossRankings,\r\n raidingHallOfFame,\r\n raidingProgression,\r\n raidingRaidRankings,\r\n raidingStaticData\r\n} from './resources/raiding/raiding'\r\n\r\n/**\r\n * A client for the Raider.io API.\r\n *\r\n * Endpoints are grouped by area (`character`, `general`, `guild`, `mythicPlus`,\r\n * `raiding`) and each method returns the parsed, fully-typed response. The\r\n * underlying resource builder is linked from each group for full parameter docs.\r\n * @example\r\n * ```ts\r\n * const client = new RaiderioClient();\r\n * const profile = await client.character.profile(\"eu\", \"ysondre\", \"melestra\", [\r\n * \"gear\",\r\n * \"mythic_plus_scores_by_season\",\r\n * ]);\r\n * ```\r\n */\r\nexport class RaiderioClient {\r\n private readonly http: HttpClient\r\n\r\n constructor(options: ClientOptions = {}) {\r\n this.http = new HttpClient(options)\r\n }\r\n\r\n /** Character endpoints. See {@link characterProfile}. */\r\n public readonly character = {\r\n profile: (...parameters: Parameters<typeof characterProfile>) =>\r\n this.http.request(characterProfile(...parameters))\r\n }\r\n\r\n /** General endpoints. See {@link periods}. */\r\n public readonly general = {\r\n periods: (...parameters: Parameters<typeof periods>) =>\r\n this.http.request(periods(...parameters))\r\n }\r\n\r\n /** Guild endpoints. See {@link guildBossKill} and {@link guildProfile}. */\r\n public readonly guild = {\r\n bossKill: (...parameters: Parameters<typeof guildBossKill>) =>\r\n this.http.request(guildBossKill(...parameters)),\r\n profile: (...parameters: Parameters<typeof guildProfile>) =>\r\n this.http.request(guildProfile(...parameters))\r\n }\r\n\r\n /** Mythic+ endpoints. */\r\n public readonly mythicPlus = {\r\n affixes: (...parameters: Parameters<typeof mythicPlusAffixes>) =>\r\n this.http.request(mythicPlusAffixes(...parameters)),\r\n leaderboardCapacity: (\r\n ...parameters: Parameters<typeof mythicPlusLeaderboardCapacity>\r\n ) => this.http.request(mythicPlusLeaderboardCapacity(...parameters)),\r\n runDetails: (...parameters: Parameters<typeof mythicPlusRunDetails>) =>\r\n this.http.request(mythicPlusRunDetails(...parameters)),\r\n runs: (...parameters: Parameters<typeof mythicPlusRuns>) =>\r\n this.http.request(mythicPlusRuns(...parameters)),\r\n scoreTiers: (...parameters: Parameters<typeof mythicPlusScoreTiers>) =>\r\n this.http.request(mythicPlusScoreTiers(...parameters)),\r\n seasonCutoffs: (\r\n ...parameters: Parameters<typeof mythicPlusSeasonCutoffs>\r\n ) => this.http.request(mythicPlusSeasonCutoffs(...parameters)),\r\n staticData: (...parameters: Parameters<typeof mythicPlusStaticData>) =>\r\n this.http.request(mythicPlusStaticData(...parameters))\r\n }\r\n\r\n /** Raiding endpoints. */\r\n public readonly raiding = {\r\n bossRankings: (...parameters: Parameters<typeof raidingBossRankings>) =>\r\n this.http.request(raidingBossRankings(...parameters)),\r\n hallOfFame: (...parameters: Parameters<typeof raidingHallOfFame>) =>\r\n this.http.request(raidingHallOfFame(...parameters)),\r\n progression: (...parameters: Parameters<typeof raidingProgression>) =>\r\n this.http.request(raidingProgression(...parameters)),\r\n raidRankings: (...parameters: Parameters<typeof raidingRaidRankings>) =>\r\n this.http.request(raidingRaidRankings(...parameters)),\r\n staticData: (...parameters: Parameters<typeof raidingStaticData>) =>\r\n this.http.request(raidingStaticData(...parameters))\r\n }\r\n\r\n /**\r\n * Escape hatch: send any {@link Resource} through the client. Useful for\r\n * resources built by hand or not yet covered by a dedicated method.\r\n * @param resource The resource to fetch.\r\n * @param options Per-request overrides (api key, ky options).\r\n * @returns The parsed, typed response.\r\n */\r\n public request<T>(resource: Resource<T>, options?: Partial<ClientOptions>) {\r\n return this.http.request(resource, options)\r\n }\r\n}\r\n\r\n/**\r\n * Create a new {@link RaiderioClient}.\r\n * @param options Client options. See {@link ClientOptions}.\r\n * @returns A new Raider.io API client.\r\n */\r\nexport const createRaiderioClient = (\r\n options: ClientOptions = {}\r\n): RaiderioClient => new RaiderioClient(options)\r\n","import type {\r\n Faction,\r\n Gender,\r\n ISODateString,\r\n ItemSlot,\r\n PlayableClass,\r\n PlayableRace,\r\n Realm,\r\n RegionShortName,\r\n Role,\r\n SeasonReference,\r\n Specialization\r\n} from '../../core'\r\nimport type { KeystoneRun } from '../mythic-plus/types'\r\nimport type { RaidInstance, RaidProgression } from '../raiding/types'\r\n\r\n// ==================================================\r\n\r\n/**\r\n * The response from the character profile endpoint. The basic profile information is always included, while the optional fields are only included if they were requested in the `fields` parameter of the request.\r\n * @see {@link https://raider.io/api#/character/getApiV1CharactersProfile}\r\n */\r\nexport type ViewCharacterProfileResponse = Character & {\r\n covenant?: unknown\r\n gear?: CharacterGear\r\n guild?: {\r\n name: string\r\n realm: Realm['name']\r\n }\r\n mythic_plus_best_runs?: Array<KeystoneRun>\r\n mythic_plus_highest_level_runs?: Array<KeystoneRun>\r\n mythic_plus_previous_weekly_highest_level_runs?: Array<KeystoneRun>\r\n mythic_plus_ranks?: MythicPlusRanks\r\n mythic_plus_recent_runs?: Array<KeystoneRun>\r\n mythic_plus_scores_by_season?: MythciPlusSeasonScores\r\n mythic_plus_weekly_highest_level_runs?: Array<KeystoneRun>\r\n previous_mythic_plus_ranks?: MythicPlusRanks\r\n raid_achievement_curve?: Array<RaidAchievementCurve>\r\n raid_achievement_meta?: Array<RaidAchievementMeta>\r\n raid_progression?: Record<RaidInstance, RaidProgression>\r\n talentLoadout?: TalentLoadout\r\n}\r\n\r\n// ==================================================\r\n\r\nexport const characterProfileFieldKeys = [\r\n 'gear',\r\n 'talents',\r\n 'talents:categorized',\r\n 'guild',\r\n 'covenant',\r\n 'mythic_plus_scores_by_season',\r\n 'mythic_plus_ranks',\r\n 'mythic_plus_recent_runs',\r\n 'mythic_plus_best_runs',\r\n 'mythic_plus_best_runs:all',\r\n 'mythic_plus_alternate_runs',\r\n 'mythic_plus_alternate_runs:all',\r\n 'mythic_plus_highest_level_runs',\r\n 'mythic_plus_weekly_highest_level_runs',\r\n 'mythic_plus_previous_weekly_highest_level_runs',\r\n 'previous_mythic_plus_ranks'\r\n] as const\r\n\r\nexport interface Character {\r\n achievement_points: number\r\n active_spec_name: Specialization['name']\r\n active_spec_role: Specialization['role']\r\n class: PlayableClass['name']\r\n faction: Faction\r\n gender: Gender\r\n id?: number\r\n last_crawled_at: ISODateString\r\n name: string\r\n profile_banner: string\r\n profile_url: string\r\n race: PlayableRace['name']\r\n realm: string\r\n region: RegionShortName\r\n thumbnail_url: string\r\n}\r\n\r\nexport interface CharacterGear {\r\n artifact_traits: number\r\n corruption: CorruptionDetails\r\n created_at: ISODateString\r\n item_level_equipped: number\r\n item_level_total: number\r\n items: ItemsContainer\r\n source: string\r\n updated_at: ISODateString\r\n}\r\n\r\nexport type CharacterProfileFieldKey =\r\n | (typeof characterProfileFieldKeys)[number]\r\n | `mythic_plus_scores_by_season:${string}`\r\n | `raid_achievement_curve:${string}`\r\n | `raid_achievement_meta:${string}`\r\n\r\nexport interface TalentLoadout {\r\n active_hero_tree: {\r\n description: string\r\n iconUrl: string\r\n id: number\r\n name: string\r\n slug: string\r\n traitTreeId: number\r\n }\r\n class_talents?: Array<TalentLoadoutEntry>\r\n hero_talents?: Array<TalentLoadoutEntry>\r\n loadout?: Array<TalentLoadoutEntry>\r\n loadout_spec_id: number\r\n loadout_text: string\r\n spec_talents?: Array<TalentLoadoutEntry>\r\n}\r\n\r\nexport interface TalentLoadoutEntry {\r\n entryIndex: number\r\n node: TalentNodeChoice | TalentNodePassive | TalentNodeSpell\r\n rank: number\r\n}\r\n\r\n// ==================================================\r\n\r\nexport interface Spell {\r\n hasCooldown: boolean\r\n icon: string\r\n id: number\r\n name: string\r\n rank: null | number\r\n school: number\r\n}\r\n\r\ninterface AzeritePower {\r\n id: number\r\n spell: {\r\n icon: string\r\n id: number\r\n name: string\r\n rank: null | number\r\n school: number\r\n }\r\n}\r\n\r\ninterface CorruptionDetails {\r\n added: number\r\n cloakRank: number\r\n items: ItemsContainer\r\n resisted: number\r\n spells: Array<unknown>\r\n total: number\r\n}\r\n\r\ninterface EnchantDetails {\r\n icon: string\r\n id: number\r\n name: string\r\n}\r\n\r\ninterface GearItem {\r\n azerite_powers: Array<AzeritePower>\r\n bonuses: Array<number>\r\n corruption: Pick<CorruptionDetails, 'added' | 'resisted' | 'total'>\r\n domination_shards: Array<unknown>\r\n enchant: number\r\n enchants: Array<EnchantDetails['id']>\r\n enchants_details: Array<EnchantDetails>\r\n gems: Array<GemDetails['id']>\r\n gems_details: Array<GemDetails>\r\n icon: string\r\n is_azerite_power: boolean\r\n is_legendary: boolean\r\n item_id: number\r\n item_level: number\r\n item_quality: number\r\n name: string\r\n}\r\n\r\ninterface GemDetails {\r\n icon: string\r\n id: number\r\n name: string\r\n}\r\n\r\ntype ItemsContainer = Record<ItemSlot, GearItem>\r\n\r\ninterface MythciPlusSeasonScores {\r\n scores: Record<ScoreKey, number>\r\n season: SeasonReference\r\n segments: Record<ScoreKey, MythicPlusScoreSegment>\r\n}\r\n\r\ntype MythicPlusRanks = Record<RankKey, Ranks>\r\n\r\ninterface MythicPlusScoreSegment {\r\n color: string\r\n score: number\r\n}\r\n\r\ninterface RaidAchievement {\r\n id: number\r\n raid: string\r\n timestamp: ISODateString\r\n}\r\n\r\ninterface RaidAchievementCurve {\r\n aotc: ISODateString\r\n raid: RaidInstance\r\n}\r\n\r\ninterface RaidAchievementMeta {\r\n completed_achievements: Array<RaidAchievement>\r\n completed_count: number\r\n meta_achievement: {\r\n id: number\r\n raid: string\r\n }\r\n remaining_achievements: Array<RaidAchievement>\r\n tier: `tier_${number}`\r\n total_count: number\r\n}\r\n\r\ntype RankKey = 'overall' | `class_${Role}` | `spec_${number}` | keyof Role\r\n\r\ninterface Ranks {\r\n realm: number\r\n region: number\r\n world: number\r\n}\r\n\r\ntype ScoreKey = 'all' | `spec${0 | 1 | 2 | 3}` | Role\r\n\r\ninterface TalentNode {\r\n col: number\r\n entries: Array<TalentNodeEntryPassive | TalentNodeEntrySpell>\r\n flags: number\r\n id: number\r\n important: boolean\r\n posX: number\r\n posY: number\r\n row: number\r\n subTreeId: number\r\n treeId: number\r\n}\r\n\r\ninterface TalentNodeChoice extends TalentNode {\r\n type: 2\r\n}\r\n\r\ninterface TalentNodeEntry {\r\n id: number\r\n maxRanks: number\r\n spell: Spell\r\n traitDefinitionId: number\r\n traitSubTreeId: number\r\n}\r\n\r\ninterface TalentNodeEntryPassive extends TalentNodeEntry {\r\n type: 2\r\n}\r\n\r\ninterface TalentNodeEntrySpell extends TalentNodeEntry {\r\n type: 1\r\n}\r\n\r\ninterface TalentNodePassive extends TalentNode {\r\n type: 0\r\n}\r\n\r\ninterface TalentNodeSpell extends TalentNode {\r\n type: 1\r\n}\r\n","import type {\r\n Faction,\r\n Gender,\r\n ISODateString,\r\n PlayableClass,\r\n PlayableRace,\r\n Realm,\r\n Region,\r\n RegionShortName,\r\n Specialization\r\n} from '../../core'\r\nimport type {\r\n Character,\r\n CharacterGear,\r\n Spell,\r\n TalentLoadout\r\n} from '../character/types'\r\nimport type {\r\n RaidDifficulty,\r\n RaidDifficultyRankings,\r\n RaidEncounter,\r\n RaidInstance,\r\n RaidProgression,\r\n RecruitmentProfile\r\n} from '../raiding/types'\r\n\r\n// ==================================================\r\n\r\n/**\r\n * Information about a guild boss kill\r\n * @see {@link https://raider.io/api#/guild/getApiV1GuildsBosskill}\r\n */\r\nexport interface ViewGuildBossKillResponse {\r\n kill: BossKill\r\n roster: Array<BossKillRosterMember>\r\n}\r\n\r\n/**\r\n * Information about a guild\r\n * @see {@link https://raider.io/api#/guild/getApiV1GuildsProfile}\r\n */\r\nexport interface ViewGuildProfileResponse {\r\n displayName: null | string\r\n faction: Faction\r\n last_crawled_at: ISODateString\r\n members?: Array<GuildMember>\r\n name: string\r\n profile_url: string\r\n raid_encounters?: Array<RaidEncounter>\r\n raid_progression?: Record<RaidInstance, RaidProgression>\r\n raid_rankings?: Record<RaidInstance, RaidDifficultyRankings>\r\n realm: Realm['name']\r\n region: RegionShortName\r\n}\r\n\r\n// ==================================================\r\n\r\nexport const guildProfileKeys = {\r\n members: 'members',\r\n raid_progression: 'raid_progression',\r\n raid_rankings: 'raid_rankings'\r\n} as const\r\n\r\nexport type GuildProfileFieldKey =\r\n | (typeof guildProfileKeys)[keyof typeof guildProfileKeys]\r\n | `raid_encounters:${RaidInstance}:${RaidDifficulty}`\r\n\r\n// ==================================================\r\n\r\ninterface BossKill {\r\n defeatedAt: ISODateString\r\n durationMs: number\r\n isSuccess: boolean\r\n itemLevelEquippedAvg: number\r\n itemLevelEquippedMax: number\r\n itemLevelEquippedMin: number\r\n pulledAt: ISODateString\r\n}\r\n\r\ninterface BossKillRosterMember {\r\n character: {\r\n artifactTraits: number\r\n class: PlayableClass\r\n gender: Gender\r\n id: number\r\n interestingAuras: Array<Spell>\r\n itemLevelEquipped: number\r\n items: CharacterGear\r\n name: string\r\n race: PlayableRace\r\n realm: Realm\r\n recruitmentProfiles: Array<RecruitmentProfile>\r\n region: Region\r\n spec: Specialization\r\n talentLoadout: TalentLoadout\r\n thumbnail: string\r\n }\r\n vantus: boolean\r\n}\r\n\r\ninterface GuildMember {\r\n character: Pick<\r\n Character,\r\n | 'achievement_points'\r\n | 'active_spec_name'\r\n | 'active_spec_role'\r\n | 'class'\r\n | 'faction'\r\n | 'gender'\r\n | 'last_crawled_at'\r\n | 'name'\r\n | 'profile_banner'\r\n | 'profile_url'\r\n | 'race'\r\n | 'realm'\r\n | 'region'\r\n >\r\n rank: number\r\n}\r\n","import type {\r\n ExpansionId,\r\n Faction,\r\n Gender,\r\n ISODateString,\r\n LocalizedString,\r\n PlayableClass,\r\n PlayableRace,\r\n Realm,\r\n Region,\r\n RegionShortName,\r\n Role,\r\n SeasonReference,\r\n Specialization,\r\n Stream,\r\n Video\r\n} from '../../core'\r\nimport type {\r\n CharacterGear,\r\n Spell,\r\n TalentLoadoutEntry\r\n} from '../character/types'\r\nimport type { RecruitmentProfile } from '../raiding/types'\r\n\r\n// ==================================================\r\n\r\n/**\r\n * The affixes for a specific region, including the latest run seen with this affix\r\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusAffixes}\r\n */\r\nexport interface ViewMythicPlusAffixesResponse {\r\n affix_details: Array<Affix>\r\n leaderboard_url: string\r\n region: RegionShortName\r\n title: string\r\n}\r\n\r\n/**\r\n * Leaderboad capacity for a region including the lowest level and time to quality\r\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusLeaderboardcapacity}\r\n */\r\nexport interface ViewMythicPlusLeaderboardCapacityResponse {\r\n realmListing: {\r\n affixes: Array<LeaderboardAffix>\r\n realms: Array<RealmCapacityEntry>\r\n region: Region\r\n }\r\n}\r\n\r\n/**\r\n * Details for a specific Mythic+ run\r\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusRundetails}\r\n */\r\nexport interface ViewMythicPlusRunDetailsResponse {\r\n canManageOthersVideos: boolean\r\n canManageOwnVideos: boolean\r\n canViewPrivateDetails: boolean\r\n clear_time_ms: number\r\n completed_at: ISODateString\r\n deleted_at: ISODateString | null\r\n dungeon: Dungeon\r\n faction: Faction\r\n isPatron: boolean\r\n isTournamentProfile: boolean\r\n isViewingPrivateDetails: boolean\r\n keystone_platoon_id: number\r\n keystone_run_id: number\r\n keystone_team_id: number\r\n keystone_time_ms: number\r\n logged_details: LoggedRunDetails\r\n logged_run_id: number\r\n loggedSources: Array<LoggedSource>\r\n mythic_level: number\r\n num_chests: number\r\n num_modifiers_active: number\r\n replay_limit: number\r\n roster: Array<RunRosterMember>\r\n runPrivacyMode: string\r\n score: number\r\n season: SeasonReference\r\n status: string\r\n time_remaining_ms: number\r\n videos: Array<Video>\r\n weekly_modifiers: Array<RunModifier>\r\n}\r\n\r\n/**\r\n * Information about the top runs that match the given criteria\r\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusRuns}\r\n */\r\nexport interface ViewMythicPlusRunsResponse {\r\n rankings: Array<MythicPlusRankingRun>\r\n}\r\n\r\n/**\r\n * Colors used for score tiers in the given season\r\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusScoretiers}\r\n */\r\nexport type ViewMythicPlusScoreTiersResponse = Array<ScoreTier>\r\n\r\n/**\r\n * Mythic+ Season cutoffs for a region\r\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusSeasoncutoffs}\r\n */\r\nexport interface ViewMythicPlusSeasonCutoffsResponse {\r\n cutoffs: SeasonCutoffs\r\n ui: {\r\n access_key: string\r\n region: RegionShortName\r\n season: SeasonReference\r\n }\r\n}\r\n\r\n/**\r\n * Mythic plus season and dungeon static data for a specific expansion (slugs, names, etc.)\r\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusStaticdata}\r\n */\r\nexport interface ViewMythicPlusStaticDataResponse {\r\n dungeons: Array<SeasonDungeon>\r\n seasons: Array<MythicPlusStaticData>\r\n}\r\n\r\n// ==================================================\r\n\r\nexport interface KeystoneRun {\r\n affixes: Array<Affix>\r\n background_image_url: string\r\n clear_time_ms: number\r\n completed_at: ISODateString\r\n dungeon: string\r\n icon_url: string\r\n keystone_run_id: number\r\n map_challenge_mode_id: number\r\n mythic_level: number\r\n num_keystone_upgrades: number\r\n par_time_ms: number\r\n role: Role\r\n score: number\r\n short_name: string\r\n spec: Specialization\r\n url: string\r\n zone_expansion_id: ExpansionId\r\n zone_id: number\r\n}\r\n\r\n// ==================================================\r\n\r\ninterface Affix {\r\n description: string\r\n icon: string\r\n icon_url: string\r\n id: number\r\n name: string\r\n wowhead_url: string\r\n}\r\n\r\ninterface Dungeon {\r\n expansion_id: ExpansionId\r\n group_finder_activity_ids: Array<number>\r\n icon_url: string\r\n id: number\r\n keystone_timer_ms: number\r\n map_challenge_mode_id: number\r\n name: string\r\n num_bosses: number\r\n patch: string\r\n short_name: string\r\n slug: string\r\n type: string\r\n wowInstanceId: number\r\n}\r\n\r\ninterface KeystoneRunRosterMember {\r\n character: {\r\n class: PlayableClass\r\n faction: Faction\r\n flags: Record<string, unknown>\r\n id: number\r\n level: number\r\n name: string\r\n path: string\r\n persona_id: number\r\n race: PlayableRace\r\n realm: Realm\r\n recruitmentProfiles: Array<RecruitmentProfile>\r\n region: Region\r\n spec: Specialization\r\n stream: null | Stream\r\n }\r\n isBanned: boolean\r\n isTransfer: boolean\r\n oldCharacter: null | RunRosterMember['character']\r\n role: Role\r\n}\r\n\r\ntype LeaderboardAffix = Pick<Affix, 'icon' | 'id'> & {\r\n description: LocalizedString\r\n name: LocalizedString\r\n slug: string\r\n}\r\n\r\ninterface LeaderboardLowest {\r\n mythicLevel: number\r\n rank: number\r\n timeInMilliseconds: number\r\n}\r\n\r\ninterface LoggedRunDetails {\r\n correlationId: string\r\n deaths: Array<RunDeathDetail>\r\n encounters: Array<RunEncounter>\r\n route_key: null | string\r\n showing_replay_authorized: boolean\r\n showing_route_authorized: boolean\r\n total_enemy_forces: number\r\n}\r\n\r\ninterface LoggedSource {\r\n logId: string\r\n source: string\r\n}\r\n\r\ninterface MythicPlusRankingRun {\r\n rank: number\r\n run: RankingKeystoneRun\r\n score: number\r\n}\r\n\r\ninterface RankingKeystoneRun {\r\n clear_time_ms: number\r\n completed_at: ISODateString\r\n deleted_at: ISODateString | null\r\n dungeon: Dungeon\r\n faction: 'mixed' | Faction\r\n keystone_platoon_id: null | number\r\n keystone_run_id: number\r\n keystone_team_id: number\r\n logged_run_id: number\r\n mythic_level: number\r\n num_chests: number\r\n num_modifiers_active: number\r\n platoon: null | Record<string, unknown>\r\n roster: Array<KeystoneRunRosterMember>\r\n season: SeasonReference\r\n time_remaining_ms: number\r\n videos: Array<Video>\r\n weekly_modifiers: Array<RunModifier>\r\n}\r\n\r\ninterface RealmCapacityEntry {\r\n connectedRealms: Array<Realm>\r\n dungeons: Array<RealmDungeonCapacity>\r\n id: number\r\n}\r\n\r\ninterface RealmDungeonCapacity {\r\n dungeon: Dungeon\r\n lowest: LeaderboardLowest | null\r\n}\r\n\r\ninterface RunDeathDetail {\r\n approximate_died_at: number\r\n character_id: number\r\n logged_encounter_id: number\r\n}\r\n\r\ninterface RunEncounter {\r\n approximate_relative_ended_at: number\r\n approximate_relative_started_at: number\r\n boss: RunEncounterBoss\r\n duration_ms: number\r\n id: number\r\n is_success: boolean\r\n pull_ended_at: ISODateString\r\n pull_started_at: ISODateString\r\n roster: Array<RunRosterMember>\r\n status: string\r\n}\r\n\r\ninterface RunEncounterBoss {\r\n encounterId: number\r\n iconUrl: string\r\n name: string\r\n ordinal: number\r\n slug: string\r\n wingId: number\r\n}\r\n\r\ninterface RunModifier {\r\n description: string\r\n icon: string\r\n id: number\r\n name: string\r\n slug: string\r\n}\r\n\r\ninterface RunRosterMember {\r\n character: {\r\n artifactTraits: number\r\n class: PlayableClass\r\n gender: Gender\r\n id: number\r\n itemLevelEquipped: number\r\n name: string\r\n race: PlayableRace\r\n realm: Realm\r\n region: Region\r\n spec: Specialization\r\n talentLoadout: RunRosterTalentLoadout\r\n thumbnail: string\r\n }\r\n guild: null | RunRosterMemberGuild\r\n interestingAuras: Array<Spell>\r\n isBanned: boolean\r\n isTransfer: boolean\r\n items: CharacterGear\r\n oldCharacter: null | RunRosterMember['character']\r\n ranks: {\r\n realm: number\r\n region: number\r\n score: number\r\n world: number\r\n }\r\n role: Role\r\n}\r\n\r\ninterface RunRosterMemberGuild {\r\n displayName: string\r\n faction: Faction\r\n id: number\r\n isDefaultLogo: boolean\r\n logo: string\r\n name: string\r\n path: string\r\n realm: Realm\r\n region: Region\r\n}\r\n\r\ninterface RunRosterTalentLoadout {\r\n heroSubTreeId: number\r\n loadout: Array<TalentLoadoutEntry>\r\n loadoutText: string\r\n specId: number\r\n}\r\n\r\ninterface ScoreTier {\r\n rgbFloat: [number, number, number]\r\n rgbHex: string\r\n rgbInteger: [number, number, number]\r\n score: number\r\n}\r\n\r\nexport const bracketDungeonLevels = [\r\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,\r\n 23, 24, 25, 26, 27, 28, 29\r\n] as const\r\n\r\ntype BracketDungeonLevel = (typeof bracketDungeonLevels)[number]\r\n\r\nexport const percentiles = [999, 990, 900, 750, 600] as const\r\n\r\ninterface Coordinates {\r\n total: number\r\n x: number\r\n y: number\r\n}\r\n\r\ninterface CutoffFactionStat {\r\n quantile: number\r\n quantileMinValue: number\r\n quantilePopulationCount: number\r\n quantilePopulationFraction: number\r\n totalPopulationCount: number\r\n}\r\n\r\ninterface GraphData {\r\n color: string\r\n data: Array<Coordinates>\r\n marker: {\r\n enabled: boolean\r\n }\r\n name: string\r\n type: string\r\n}\r\n\r\ninterface MythicPlusStaticData {\r\n blizzard_season_id: number\r\n dungeons: Array<SeasonDungeon>\r\n ends: Record<RegionShortName, ISODateString>\r\n is_main_season: boolean\r\n name: string\r\n seasonal_affix: Affix | null\r\n short_name: string\r\n slug: SeasonReference\r\n starts: Record<RegionShortName, ISODateString>\r\n}\r\n\r\ntype Percentile = (typeof percentiles)[number]\r\n\r\ntype PercentileKey = `p${Percentile}`\r\n\r\ntype SeasonCutoffEntry = Record<'all' | Faction, CutoffFactionStat | null> &\r\n Record<'allColor' | `${Faction}Color`, null | string>\r\n\r\ntype SeasonCutoffs = Record<\r\n `allTimed${BracketDungeonLevel}`,\r\n SeasonCutoffEntry & {\r\n score: number\r\n }\r\n> &\r\n Record<PercentileKey, SeasonCutoffEntry> & {\r\n bracketDungeonLevels: Array<BracketDungeonLevel>\r\n graphData: Record<PercentileKey, GraphData>\r\n isRemappedSeason: boolean\r\n keystoneConqueror: SeasonCutoffEntry & { score: number }\r\n keystoneExplorer: SeasonCutoffEntry & { score: number }\r\n keystoneHero: SeasonCutoffEntry & { score: number }\r\n keystoneLegend: SeasonCutoffEntry & { score: number }\r\n keystoneMaster: SeasonCutoffEntry & { score: number }\r\n }\r\n\r\ninterface SeasonDungeon {\r\n background_image_url: string\r\n challenge_mode_id: number\r\n icon_url: string\r\n id: number\r\n keystone_timer_seconds: number\r\n name: string\r\n short_name: string\r\n slug: string\r\n}\r\n","import type {\r\n Faction,\r\n ISODateString,\r\n Ranks,\r\n Realm,\r\n RealmSummary,\r\n Region,\r\n Stream,\r\n Video\r\n} from '../../core'\r\n\r\n// ==================================================\r\n\r\n/**\r\n * The rankings for the specified boss, raid, difficulty and region\r\n * @see {@link https://raider.io/api#/raiding/getApiV1RaidingBossrankings}\r\n */\r\nexport interface ViewBossRankingsResponse {\r\n bossRankings: Array<BossRanking>\r\n}\r\n\r\n/**\r\n * The hall of fame for a given raid\r\n * @see {@link https://raider.io/api#/raiding/getApiV1RaidingHalloffame}\r\n */\r\nexport interface ViewHallOfFameResponse {\r\n hallOfFame: {\r\n bossKills: Array<HallOfFameBossKill>\r\n winningGuilds: Array<HallOfFameGuildEntry>\r\n }\r\n}\r\n\r\n/**\r\n * Details of raiding progression for a raid, showing how many guilds have reached each boss kill milestone\r\n * @see {@link https://raider.io/api#/raiding/getApiV1RaidingProgression}\r\n */\r\nexport interface ViewRaidProgressionResponse {\r\n progression: Array<RaidRaceProgressionEntry>\r\n}\r\n\r\n/**\r\n * The raid rankings for a given raid and region\r\n * @see {@link https://raider.io/api#/raiding/getApiV1RaidingRaidrankings}\r\n */\r\nexport interface ViewRaidRankingsResponse {\r\n raidRankings: Array<RaidRankingEntry>\r\n}\r\n\r\n/**\r\n * Raid and boss static data for a specific expansion (slugs, names, etc)\r\n * @see {@link https://raider.io/api#/raiding/getApiV1RaidingStaticdata}\r\n */\r\nexport interface ViewRaidingStaticDataResponse {\r\n raids: Array<RaidStaticData>\r\n}\r\n\r\n// ==================================================\r\n\r\nexport const raidDifficulties = ['normal', 'heroic', 'mythic'] as const\r\n\r\nexport const raidInstances = [\r\n 'tier-mn-1',\r\n 'manaforge-omega',\r\n 'liberation-of-undermine',\r\n 'nerubar-palace',\r\n 'blackrock-depths',\r\n 'awakened-amirdrassil-the-dreams-hope',\r\n 'awakened-aberrus-the-shadowed-crucible',\r\n 'awakened-vault-of-the-incarnates',\r\n 'amirdrassil-the-dreams-hope',\r\n 'aberrus-the-shadowed-crucible',\r\n 'vault-of-the-incarnates',\r\n 'fated-sepulcher-of-the-first-ones',\r\n 'fated-sanctum-of-domination',\r\n 'fated-castle-nathria',\r\n 'sepulcher-of-the-first-ones',\r\n 'sanctum-of-domination',\r\n 'castle-nathria',\r\n 'nyalotha-the-waking-city',\r\n 'the-eternal-palace',\r\n 'crucible-of-storms',\r\n 'battle-of-dazaralor',\r\n 'uldir',\r\n 'antorus-the-burning-throne',\r\n 'tomb-of-sargeras',\r\n 'the-nighthold',\r\n 'trial-of-valor',\r\n 'the-emerald-nightmare'\r\n] as const\r\n\r\nexport type RaidDifficulty = (typeof raidDifficulties)[number]\r\n\r\nexport type RaidDifficultyRankings = Record<RaidDifficulty, Ranks>\r\n\r\nexport interface RaidEncounter {\r\n defeatedAt: ISODateString | null\r\n name: string\r\n slug: string\r\n}\r\n\r\nexport type RaidInstance = (typeof raidInstances)[number]\r\n\r\nexport type RaidProgression = Record<\r\n `${RaidDifficulty}_bosses_killed`,\r\n number\r\n> & {\r\n expansion_id: number\r\n summary: string\r\n total_bosses: number\r\n}\r\n\r\nexport interface RecruitmentProfile {\r\n activity_type: string\r\n entity_type: string\r\n recruitment_profile_id: number\r\n}\r\n\r\n// ==================================================\r\n\r\ntype BossRanking = Record<RaidInstance, RaidDifficultyRankings>\r\n\r\ninterface EncounterDefeated {\r\n firstDefeated: ISODateString\r\n lastDefeated: ISODateString\r\n slug: string\r\n}\r\n\r\ninterface GuildDefeatEntry {\r\n defeatedAt: ISODateString\r\n guild: GuildSummary\r\n}\r\n\r\ninterface GuildEncounter {\r\n encountersDefeated: Array<EncounterDefeated>\r\n guild: RaidingGuild\r\n rank: number\r\n}\r\n\r\ninterface GuildPrivacy {\r\n raidComps: boolean\r\n raidPercents: boolean\r\n raidPulls: boolean\r\n shareraidUntil: ISODateString\r\n wereRaidCompsRestricted: boolean\r\n wereRaidPercentsRestricted: boolean\r\n wereRaidPullsRestricted: boolean\r\n}\r\n\r\ninterface GuildStreamers {\r\n count: number\r\n description: string\r\n stream: Stream\r\n}\r\n\r\ninterface GuildSummary {\r\n displayName: string\r\n faction: Faction\r\n id: number\r\n name: string\r\n realm: RealmSummary\r\n region: Region\r\n}\r\n\r\ninterface HallOfFameBossKill {\r\n attemptedBy: {\r\n attempts: Array<GuildEncounter>\r\n totalCount: number\r\n }\r\n boss: string\r\n bossKillVideo: Video\r\n bossSummary: RaidBossSummary\r\n defeatedBy: {\r\n guilds: Array<GuildEncounter>\r\n totalCount: number\r\n }\r\n}\r\n\r\ntype HallOfFameGuildEntry = GuildEncounter & {\r\n defeatedAt: ISODateString\r\n doesVideoExist: boolean\r\n recruitmentProfiles: Array<RecruitmentProfile>\r\n streamers: GuildStreamers\r\n}\r\n\r\ninterface RaidBossSummary {\r\n encounterId: number\r\n iconUrl: string\r\n name: string\r\n ordinal: number\r\n slug: string\r\n wingId: number\r\n}\r\n\r\ninterface RaidEncounterStaticData {\r\n id: number\r\n name: string\r\n slug: string\r\n}\r\n\r\ntype RaidingGuild = GuildSummary & {\r\n color: string\r\n isDefaultLogo: boolean\r\n logo: string\r\n path: string\r\n realm: Realm\r\n}\r\n\r\ninterface RaidRaceProgressionEntry {\r\n guilds: Array<GuildDefeatEntry>\r\n progress: number\r\n totalGuilds: number\r\n}\r\n\r\ninterface RaidRankingEncounter {\r\n bestPercent: number\r\n id: number\r\n isDefeated: boolean\r\n numPulls: number\r\n pulStartedAt: ISODateString\r\n slug: string\r\n}\r\n\r\ninterface RaidRankingEntry {\r\n encountersDefeated: Array<EncounterDefeated>\r\n encountersPulled: Array<RaidRankingEncounter>\r\n guild: RaidingGuild\r\n guildPrivacy: GuildPrivacy\r\n rank: number\r\n regionRank: number\r\n}\r\n\r\ninterface RaidStaticData {\r\n encounters: Array<RaidEncounterStaticData>\r\n ends: {\r\n ends: ISODateString\r\n }\r\n icon: string\r\n id: number\r\n name: string\r\n short_name: string\r\n slug: RaidInstance\r\n starts: {\r\n starts: ISODateString\r\n }\r\n}\r\n"],"mappings":";;AAAA,MAAa,mBAAmB;;;ACAhC,MAAa,QAAQ;CAAC;CAAQ;CAAU;AAAK;AAG7C,MAAa,WAAW,CAAC,SAAS,UAAU;AAG5C,MAAa,UAAU,CAAC,QAAQ,QAAQ;;;ACNxC,MAAa,SAAS;AACtB,MAAa,qBAAqB;AAClC,MAAa,cAAc;AAC3B,MAAa,eAAe;AAC5B,MAAa,iBAAiB;AAC9B,MAAa,WAAW;AAExB,MAAa,eAAe;;;;;;;AAO5B;;;ACdA,MAAa,QAAQ;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;AClBA,MAAa,UAAU;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;ACXA,MAAa,UAAU;CAAC;CAAM;CAAM;CAAM;CAAM;AAAI;;;ACApD,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,aAAa,CAAC,WAAW,UAAU;;;;;;;;;;ACNhD,IAAa,aAAb,MAAwB;CACtB;CAIA;CAEA,YAAY,UAAyB,CAAC,GAAG;EACvC,KAAK,WAAW,EACd,KAAK,QAAQ,IACf;EACA,KAAK,KAAK,GAAG,OAAO,QAAQ,SAAS;CACvC;;;;;;CAOA,cAAwB,UAA+B;EAGrD,OAAO,GAAG,mBAFa,SAAS,KAAK,WAAW,GAAG,IAAI,KAAK,MAEd,SAAS;CACzD;;;;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AG,UAAU,CAAC;EACtD,aAAa,GAAG,eACd,KAAK,KAAK,QAAQ,kBAAkB,GAAG,UAAU,CAAC;EACpD,cAAc,GAAG,eACf,KAAK,KAAK,QAAQ,mBAAmB,GAAG,UAAU,CAAC;EACrD,eAAe,GAAG,eAChB,KAAK,KAAK,QAAQ,oBAAoB,GAAG,UAAU,CAAC;EACtD,aAAa,GAAG,eACd,KAAK,KAAK,QAAQ,kBAAkB,GAAG,UAAU,CAAC;CACtD;;;;;;;;CASA,QAAkB,UAAuB,SAAkC;EACzE,OAAO,KAAK,KAAK,QAAQ,UAAU,OAAO;CAC5C;AACF;;;;;;AAOA,MAAa,wBACX,UAAyB,CAAC,MACP,IAAI,eAAe,OAAO;;;ACzE/C,MAAa,4BAA4B;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;ACLA,MAAa,mBAAmB;CAC9B,SAAS;CACT,kBAAkB;CAClB,eAAe;AACjB;;;ACmSA,MAAa,uBAAuB;CAClC;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;CAC3E;CAAI;CAAI;CAAI;CAAI;CAAI;CAAI;AAC1B;AAIA,MAAa,cAAc;CAAC;CAAK;CAAK;CAAK;CAAK;AAAG;;;AC7SnD,MAAa,mBAAmB;CAAC;CAAU;CAAU;AAAQ;AAE7D,MAAa,gBAAgB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "raiderio-api",
3
+ "version": "0.0.1",
4
+ "description": "A typed Node.js client and helpers for the Raider.io API.",
5
+ "keywords": [
6
+ "api",
7
+ "client",
8
+ "mythic plus",
9
+ "raider.io",
10
+ "raiderio",
11
+ "raiding",
12
+ "warcraft",
13
+ "world of warcraft",
14
+ "wow"
15
+ ],
16
+ "license": "MIT",
17
+ "author": "Aovee",
18
+ "repository": "https://github.com/aovee/raiderio-api",
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "type": "module",
23
+ "sideEffects": false,
24
+ "module": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js"
30
+ },
31
+ "./package.json": "./package.json"
32
+ },
33
+ "scripts": {
34
+ "build": "tsdown",
35
+ "typecheck": "tsc --noEmit",
36
+ "lint": "oxlint",
37
+ "fmt": "oxfmt",
38
+ "fmt:check": "oxfmt --check",
39
+ "test": "vitest run",
40
+ "test:watch": "vitest",
41
+ "prepublishOnly": "pnpm run build"
42
+ },
43
+ "dependencies": {
44
+ "ky": "2.0.2"
45
+ },
46
+ "devDependencies": {
47
+ "@types/node": "25.9.2",
48
+ "@vitest/coverage-v8": "4.1.8",
49
+ "oxfmt": "0.54.0",
50
+ "oxlint": "1.69.0",
51
+ "tsdown": "0.22.2",
52
+ "typescript": "6.0.3",
53
+ "vitest": "4.1.8"
54
+ },
55
+ "engines": {
56
+ "node": "^20.19.0 || ^22.13.0 || >=24"
57
+ },
58
+ "packageManager": "pnpm@10.33.0"
59
+ }