raiderio-api 0.0.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENCE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026-2026 Aovee
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,99 +1,99 @@
1
- # raiderio-api
2
-
3
- A typed Node.js client and helpers for the [Raider.io API](https://raider.io/api).
4
-
5
- - **Fully typed** — every endpoint returns a parsed, typed response.
6
- - **Grouped by area** — `character`, `general`, `guild`, `mythicPlus`, `raiding`.
7
- - **Tiny runtime** — built on [`ky`](https://github.com/sindresorhus/ky). ESM-only.
8
- - **No API key required** — the Raider.io API is public; most endpoints work without one.
9
-
10
- ## Install
11
-
12
- ```sh
13
- npm install raiderio-api
14
- # or
15
- pnpm add raiderio-api
16
- ```
17
-
18
- > Requires Node.js `^20.19.0 || ^22.13.0 || >=24`. This package is **ESM-only**.
19
-
20
- ## Quick start
21
-
22
- ```ts
23
- import { createRaiderioClient } from 'raiderio-api'
24
-
25
- const client = createRaiderioClient()
26
-
27
- const profile = await client.character.profile('eu', 'ysondre', 'melestra', [
28
- 'gear',
29
- 'mythic_plus_scores_by_season'
30
- ])
31
-
32
- console.log(profile.name, profile.gear?.item_level_equipped)
33
- ```
34
-
35
- You can also instantiate the class directly:
36
-
37
- ```ts
38
- import { RaiderioClient } from 'raiderio-api'
39
-
40
- const client = new RaiderioClient()
41
- ```
42
-
43
- ## Options
44
-
45
- ```ts
46
- const client = createRaiderioClient({
47
- // Optional. Most endpoints are public and work without a key.
48
- key: process.env.RAIDERIO_API_KEY,
49
- // Optional. Forwarded to the underlying `ky` instance
50
- // (timeout, retry, hooks, custom fetch, etc.).
51
- kyOptions: {
52
- timeout: 10_000,
53
- retry: 2
54
- }
55
- })
56
- ```
57
-
58
- Per-request overrides are supported on the escape hatch (see below).
59
-
60
- ## Endpoints
61
-
62
- Each method returns a `Promise` of the fully-typed response.
63
-
64
- | Group | Methods |
65
- | ------------ | --------------------------------------------------------------------------------------------------- |
66
- | `character` | `profile` |
67
- | `general` | `periods` |
68
- | `guild` | `bossKill`, `profile` |
69
- | `mythicPlus` | `affixes`, `leaderboardCapacity`, `runDetails`, `runs`, `scoreTiers`, `seasonCutoffs`, `staticData` |
70
- | `raiding` | `bossRankings`, `hallOfFame`, `progression`, `raidRankings`, `staticData` |
71
-
72
- ```ts
73
- const affixes = await client.mythicPlus.affixes('us', 'en')
74
- const periods = await client.general.periods()
75
- const guild = await client.guild.profile('us', 'illidan', 'liquid', [
76
- 'raid_progression'
77
- ])
78
- ```
79
-
80
- ## Advanced: resource builders + escape hatch
81
-
82
- Every endpoint is backed by a standalone **resource builder** that returns a
83
- `Resource` description (`path` + `query`). You can build one by hand and send it
84
- through the client, with optional per-request overrides:
85
-
86
- ```ts
87
- import { createRaiderioClient, characterProfile } from 'raiderio-api'
88
-
89
- const client = createRaiderioClient()
90
-
91
- const resource = characterProfile('eu', 'ysondre', 'melestra', ['gear'])
92
- const profile = await client.request(resource, { key: 'per-request-key' })
93
- ```
94
-
95
- The low-level `HttpClient` is also exported for fully custom setups.
96
-
97
- ## License
98
-
99
- [MIT](./LICENSE)
1
+ # raiderio-api
2
+
3
+ A typed Node.js client and helpers for the [Raider.io API](https://raider.io/api).
4
+
5
+ - **Fully typed** — every endpoint returns a parsed, typed response.
6
+ - **Grouped by area** — `character`, `general`, `guild`, `mythicPlus`, `raiding`.
7
+ - **Tiny runtime** — built on [`ky`](https://github.com/sindresorhus/ky). ESM-only.
8
+ - **No API key required** — the Raider.io API is public; most endpoints work without one.
9
+
10
+ ## Install
11
+
12
+ ```sh
13
+ npm install raiderio-api
14
+ # or
15
+ pnpm add raiderio-api
16
+ ```
17
+
18
+ > Requires Node.js `^20.19.0 || ^22.13.0 || >=24`. This package is **ESM-only**.
19
+
20
+ ## Quick start
21
+
22
+ ```ts
23
+ import { createRaiderioClient } from 'raiderio-api'
24
+
25
+ const client = createRaiderioClient()
26
+
27
+ const profile = await client.character.profile('eu', 'ysondre', 'melestra', [
28
+ 'gear',
29
+ 'mythic_plus_scores_by_season'
30
+ ])
31
+
32
+ console.log(profile.name, profile.gear?.item_level_equipped)
33
+ ```
34
+
35
+ You can also instantiate the class directly:
36
+
37
+ ```ts
38
+ import { RaiderioClient } from 'raiderio-api'
39
+
40
+ const client = new RaiderioClient()
41
+ ```
42
+
43
+ ## Options
44
+
45
+ ```ts
46
+ const client = createRaiderioClient({
47
+ // Optional. Most endpoints are public and work without a key.
48
+ key: process.env.RAIDERIO_API_KEY,
49
+ // Optional. Forwarded to the underlying `ky` instance
50
+ // (timeout, retry, hooks, custom fetch, etc.).
51
+ kyOptions: {
52
+ timeout: 10_000,
53
+ retry: 2
54
+ }
55
+ })
56
+ ```
57
+
58
+ Per-request overrides are supported on the escape hatch (see below).
59
+
60
+ ## Endpoints
61
+
62
+ Each method returns a `Promise` of the fully-typed response.
63
+
64
+ | Group | Methods |
65
+ | ------------ | --------------------------------------------------------------------------------------------------- |
66
+ | `character` | `profile` |
67
+ | `general` | `periods` |
68
+ | `guild` | `bossKill`, `profile` |
69
+ | `mythicPlus` | `affixes`, `leaderboardCapacity`, `runDetails`, `runs`, `scoreTiers`, `seasonCutoffs`, `staticData` |
70
+ | `raiding` | `bossRankings`, `hallOfFame`, `progression`, `raidRankings`, `staticData` |
71
+
72
+ ```ts
73
+ const affixes = await client.mythicPlus.affixes('us', 'en')
74
+ const periods = await client.general.periods()
75
+ const guild = await client.guild.profile('us', 'illidan', 'liquid', [
76
+ 'raid_progression'
77
+ ])
78
+ ```
79
+
80
+ ## Advanced: resource builders + escape hatch
81
+
82
+ Every endpoint is backed by a standalone **resource builder** that returns a
83
+ `Resource` description (`path` + `query`). You can build one by hand and send it
84
+ through the client, with optional per-request overrides:
85
+
86
+ ```ts
87
+ import { createRaiderioClient, characterProfile } from 'raiderio-api'
88
+
89
+ const client = createRaiderioClient()
90
+
91
+ const resource = characterProfile('eu', 'ysondre', 'melestra', ['gear'])
92
+ const profile = await client.request(resource, { key: 'per-request-key' })
93
+ ```
94
+
95
+ The low-level `HttpClient` is also exported for fully custom setups.
96
+
97
+ ## License
98
+
99
+ [MIT](./LICENSE)
package/dist/index.js.map CHANGED
@@ -1 +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,eAA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;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"}
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'\n\n// eslint-disable-next-line sonarjs/redundant-type-aliases\nexport type ISODateString = string\n\nexport interface Resource<T> {\n /**\n * The response type of the resource\n * @internal\n */\n _responseType?: T\n path: string\n query: Record<string, boolean | number | string | undefined>\n}\n\nexport type ResourceResponse<T = unknown> = Promise<T>\n","export const roles = ['tank', 'healer', 'dps'] as const\nexport type Role = (typeof roles)[number]\n\nexport const factions = ['horde', 'alliance'] as const\nexport type Faction = (typeof factions)[number]\n\nexport const genders = ['male', 'female'] as const\nexport type Gender = (typeof genders)[number]\n\nexport interface PlayableClass {\n id: number\n name: string\n slug: string\n}\n\nexport interface PlayableRace {\n faction: Faction\n id: number\n name: string\n slug: string\n}\n\nexport interface Specialization {\n class_id: number\n id: number\n is_melee: boolean\n name: string\n ordinal: number\n patch: string\n role: Role\n slug: string\n}\n","export const LEGION = 6\nexport const BATTLE_FOR_AZEROTH = 7\nexport const SHADOWLANDS = 8\nexport const DRAGONFLIGHT = 9\nexport const THE_WAR_WITHIN = 10\nexport const MIDNIGHT = 11\n\nexport const expansionIds = [\n LEGION,\n BATTLE_FOR_AZEROTH,\n SHADOWLANDS,\n DRAGONFLIGHT,\n THE_WAR_WITHIN,\n MIDNIGHT\n] as const\nexport type ExpansionId = (typeof expansionIds)[number]\n","export const slots = [\n 'head',\n 'neck',\n 'shoulder',\n 'back',\n 'chest',\n 'waist',\n 'shirt',\n 'wrist',\n 'hands',\n 'legs',\n 'feet',\n 'finger1',\n 'finger2',\n 'trinket1',\n 'trinket2',\n 'mainhand',\n 'offhand'\n]\nexport type ItemSlot = (typeof slots)[number]\n","export const locales = [\n 'en',\n 'ru',\n 'ko',\n 'cn',\n 'pt',\n 'it',\n 'fr',\n 'es',\n 'de',\n 'tw'\n] as const\nexport type Locale = (typeof locales)[number]\nexport type LocalizedString = Record<Locale, string>\n","export const regions = ['us', 'eu', 'tw', 'kr', 'cn'] as const\nexport interface Realm {\n altName: string\n altSlug: string\n connectedRealmId: number\n id: number\n isConnected: boolean\n locale: string\n name: string\n realmType: string\n slug: string\n wowConnectedRealmId: number\n wowRealmId: number\n}\n\nexport type RealmSummary = Pick<Realm, 'isConnected' | 'name' | 'slug'>\n\nexport interface Region {\n name: string\n short_name: RegionShortName\n slug: string\n}\n\nexport type RegionShortName = (typeof regions)[number]\n","export const seasonReferences = [\n 'season-sl-1',\n 'season-sl-2',\n 'season-sl-3',\n 'season-sl-4',\n 'season-df-1',\n 'season-df-2',\n 'season-df-3',\n 'season-df-4',\n 'season-tww-1',\n 'season-tww-2',\n 'season-tww-3',\n 'season-mn-1',\n 'current',\n 'previous'\n]\nexport type SeasonReference = (typeof seasonReferences)[number]\n\nexport const weekScopes = ['current', 'previous'] as const\nexport type WeekScope = (typeof weekScopes)[number]\n","import ky from 'ky'\nimport type { Resource, ResourceResponse } from '../core'\nimport { raiderIoBasePath } from '../core'\nimport type { ClientOptions } from './types'\n\n/**\n * Low-level HTTP layer for the Raider.io API.\n *\n * Turns a {@link Resource} (a `path` + `query` description produced by the\n * resource builders) into an actual HTTP request and returns the parsed JSON.\n * Most consumers should use the higher-level `RaiderioClient` instead.\n */\nexport class HttpClient {\n public defaults: {\n key?: string\n }\n\n private ky\n\n constructor(options: ClientOptions = {}) {\n this.defaults = {\n key: options.key\n }\n this.ky = ky.create(options.kyOptions)\n }\n\n /**\n * Build the absolute request URL for a resource.\n * @param resource The resource to fetch. See {@link Resource}.\n * @returns The fully-qualified request URL.\n */\n public getRequestUrl<T>(resource: Resource<T>): string {\n const slashSeparator = resource.path.startsWith('/') ? '' : '/'\n\n return `${raiderIoBasePath}${slashSeparator}${resource.path}`\n }\n\n /**\n * Send a request to the Raider.io API.\n * @param resource The resource to fetch. See {@link Resource}.\n * @param options Per-request overrides (api key, ky options). See {@link ClientOptions}.\n * @returns The parsed JSON response. See {@link ResourceResponse}.\n */\n public async request<T>(\n resource: Resource<T>,\n options?: Partial<ClientOptions>\n ): ResourceResponse<T> {\n const url = this.getRequestUrl(resource)\n\n // Drop undefined values so optional params never leak into the URL.\n const searchParameters: Record<string, boolean | number | string> = {}\n for (const [key, value] of Object.entries(resource.query)) {\n if (value !== undefined) {\n searchParameters[key] = value\n }\n }\n\n const apiKey = options?.key ?? this.defaults.key\n if (apiKey) {\n searchParameters.api_key = apiKey\n }\n\n const response = await this.ky.get<T>(url, {\n ...options?.kyOptions,\n searchParams: searchParameters\n })\n\n return response.json()\n }\n}\n","import type { Resource } from '../../core'\nimport type {\n CharacterProfileFieldKey,\n ViewCharacterProfileResponse\n} from './types'\n\n// ==================================================\n\nconst charactersBasePath = '/characters'\n\n// ==================================================\n\n/**\n * @param region The region (us, eu, kr or tw).\n * @param realm The realm (can be formatted as \"Altar of Storms\" or \"altar-of-storms\").\n * @param name The character name.\n * @param fields The fields to include in the response. If not provided, only the basic profile information will be returned.\n * @returns information about a character. See {@link ViewCharacterProfileResponse}\n */\nexport function characterProfile(\n region: string,\n realm: string,\n name: string,\n fields?: Array<CharacterProfileFieldKey> // to improve\n): Resource<ViewCharacterProfileResponse> {\n return {\n path: `${charactersBasePath}/profile`,\n query: {\n fields: fields?.join(','),\n name,\n realm,\n region\n }\n }\n}\n","import type { Resource } from '../../core'\nimport type { ViewPeriodsResponse } from './types'\n\n// ==================================================\n\n/**\n * @returns current, previous and next period ids and data ranges. See {@link ViewPeriodsResponse}\n */\nexport function periods(): Resource<ViewPeriodsResponse> {\n return {\n path: '/periods',\n query: {}\n }\n}\n","import type { Resource } from '../../core'\nimport type { RaidDifficulty } from '../raiding/types'\nimport type {\n GuildProfileFieldKey,\n ViewGuildBossKillResponse,\n ViewGuildProfileResponse\n} from './types'\n\n// ==================================================\n\nconst guildsBasePath = '/guilds'\n\n// ==================================================\n\n/**\n * @param region The region (us, eu, kr or tw).\n * @param realm The realm (can be formatted as \"Altar of Storms\" or \"altar-of-storms\").\n * @param guild The guild name.\n * @param raid The raid instance slug (e.g. \"castle-nathria\").\n * @param boss The boss slug (e.g. \"sire-denathrius\").\n * @param difficulty The raid difficulty (e.g. \"mythic\").\n * @returns information about a guild boss kill. See {@link ViewGuildBossKillResponse}\n */\nexport function guildBossKill(\n region: string,\n realm: string,\n guild: string,\n raid: string,\n boss: string,\n difficulty: RaidDifficulty\n): Resource<ViewGuildBossKillResponse> {\n return {\n path: `${guildsBasePath}/boss-kill`,\n query: {\n boss,\n difficulty,\n guild,\n raid,\n realm,\n region\n }\n }\n}\n\n// ==================================================\n\n/**\n * @param region The region (us, eu, kr or tw).\n * @param realm The realm (can be formatted as \"Altar of Storms\" or \"altar-of-storms\").\n * @param name The guild name.\n * @param fields The fields to include in the response. If not provided, only the basic profile information will be returned.\n * @returns Profile information about the guild, including optional fields. See {@link ViewGuildProfileResponse}\n */\nexport function guildProfile(\n region: string,\n realm: string,\n name: string,\n fields?: Array<GuildProfileFieldKey> // to improve\n): Resource<ViewGuildProfileResponse> {\n return {\n path: `${guildsBasePath}/profile`,\n query: {\n fields: fields?.join(','),\n name,\n realm,\n region\n }\n }\n}\n","import type {\n ExpansionId,\n Locale,\n RegionShortName,\n Resource,\n SeasonReference,\n WeekScope\n} from '../../core'\nimport type {\n ViewMythicPlusAffixesResponse,\n ViewMythicPlusLeaderboardCapacityResponse,\n ViewMythicPlusRunDetailsResponse,\n ViewMythicPlusRunsResponse,\n ViewMythicPlusScoreTiersResponse,\n ViewMythicPlusSeasonCutoffsResponse,\n ViewMythicPlusStaticDataResponse\n} from './types'\n\n// ==================================================\n\nconst mythicPlusBasePath = '/mythic-plus'\n\n// ==================================================\n\n/**\n * @param region The region (us, eu, kr or tw).\n * @param locale The locale (en, es, fr, de, ru, ko or cn).\n * @returns List of current Mythic Plus affixes, including their names and descriptions in the specified locale. See {@link ViewMythicPlusAffixesResponse}\n */\nexport function mythicPlusAffixes(\n region: RegionShortName = 'eu',\n locale: Locale = 'en'\n): Resource<ViewMythicPlusAffixesResponse> {\n return {\n path: `${mythicPlusBasePath}/affixes`,\n query: {\n locale,\n region\n }\n }\n}\n\n// ==================================================\n\n/**\n *\n * @param scope The week scope (current or previous).\n * @param region The region (us, eu, kr or tw).\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.\n * @returns The Mythic Plus leaderboard capacity for the specified scope, region and realm (if provided). See {@link ViewMythicPlusLeaderboardCapacityResponse}\n */\nexport function mythicPlusLeaderboardCapacity(\n scope: WeekScope,\n region: RegionShortName,\n realm?: null | string\n): Resource<ViewMythicPlusLeaderboardCapacityResponse> {\n return {\n path: `${mythicPlusBasePath}/leaderboard-capacity`,\n query: {\n realm: realm ?? undefined,\n region,\n scope\n }\n }\n}\n\n// ==================================================\n\n/**\n * @param season The season slug (e.g. \"season-tww-4\").\n * @param id The ID of the Mythic Plus run.\n * @returns Detailed information about the specified Mythic Plus run, including the dungeon, keystone level, clear time, affixes, roster and more. See {@link ViewMythicPlusRunDetailsResponse}\n */\nexport function mythicPlusRunDetails(\n season: SeasonReference,\n id: number\n): Resource<ViewMythicPlusRunDetailsResponse> {\n return {\n path: `${mythicPlusBasePath}/run-details`,\n query: {\n id,\n season\n }\n }\n}\n\n// ==================================================\n\n/**\n * @param region The region (us, eu, kr or tw).\n * @param page The page number for pagination (starting from 0).\n * @param season The season slug (e.g. \"season-tww-4\"). Optional, if not provided, runs from the current season will be returned.\n * @param dungeon The name of the dungeon (e.g. \"plaguefall\"). Optional, if not provided, runs from all dungeons will be returned.\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.\n * @returns information about the top runs that match the given criteria. See {@link ViewMythicPlusRunsResponse}\n */\nexport function mythicPlusRuns(\n region: 'world' | Exclude<RegionShortName, 'cn'>,\n page = 0,\n season?: SeasonReference,\n dungeon?: string,\n affixes?: string\n): Resource<ViewMythicPlusRunsResponse> {\n return {\n path: `${mythicPlusBasePath}/runs`,\n query: {\n affixes,\n dungeon,\n page,\n region: region.toString(),\n season\n }\n }\n}\n\n// ==================================================\n\n/**\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.\n * @returns the colors used for score tiers in the given season. See {@link ViewMythicPlusScoreTiersResponse}\n */\nexport function mythicPlusScoreTiers(\n season: SeasonReference = 'current'\n): Resource<ViewMythicPlusScoreTiersResponse> {\n return {\n path: `${mythicPlusBasePath}/score-tiers`,\n query: { season }\n }\n}\n\n// ==================================================\n\n/**\n * @param region The region (us, eu, kr or tw).\n * @param season The season slug (e.g. \"season-tww-4\"). Optional, if not provided, the cutoffs for the current season will be returned.\n * @returns the Mythic+ Season cutoffs for a region. See {@link ViewMythicPlusSeasonCutoffsResponse}\n */\nexport function mythicPlusSeasonCutoffs(\n region: RegionShortName,\n season: SeasonReference = 'current'\n): Resource<ViewMythicPlusSeasonCutoffsResponse> {\n return {\n path: `${mythicPlusBasePath}/season-cutoffs`,\n query: { region, season }\n }\n}\n\n// ==================================================\n\n/**\n * @param expansionId The expansion ID (e.g. 9 for Shadowlands).\n * @returns mythic plus season and dungeon static data for a specific expansion (slugs, names, etc.). See {@link ViewMythicPlusStaticDataResponse}\n */\nexport function mythicPlusStaticData(\n expansionId: ExpansionId\n): Resource<ViewMythicPlusStaticDataResponse> {\n return {\n path: `${mythicPlusBasePath}/static-data`,\n query: { expansion_id: expansionId }\n }\n}\n","import type { ExpansionId, Realm, RegionShortName, Resource } from '../../core'\nimport type {\n RaidDifficulty,\n RaidInstance,\n ViewBossRankingsResponse,\n ViewHallOfFameResponse,\n ViewRaidingStaticDataResponse,\n ViewRaidProgressionResponse,\n ViewRaidRankingsResponse\n} from './types'\n\n// ==================================================\n\nconst raidingBasePath = '/raiding'\n\n// ==================================================\n\n/**\n * @param raid The raid instance to retrieve boss rankings for.\n * @param boss The boss slug to retrieve rankings for (e.g. \"sire-denathrius\").\n * @param difficulty The raid difficulty to retrieve rankings for (e.g. \"mythic\").\n * @param region The region to retrieve rankings for (us, eu, kr or tw).\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.\n * @returns the rankings for the specified boss, raid, difficulty and region. See {@link ViewBossRankingsResponse}\n */\nexport function raidingBossRankings(\n raid: RaidInstance,\n boss: string,\n difficulty: RaidDifficulty,\n region: RegionShortName,\n realm?: null | Realm['slug']\n): Resource<ViewBossRankingsResponse> {\n return {\n path: `${raidingBasePath}/boss-rankings`,\n query: {\n boss,\n difficulty,\n raid,\n realm: realm ?? undefined,\n region\n }\n }\n}\n\n// ==================================================\n\n/**\n * @param raid The raid instance to retrieve boss rankings for.\n * @param difficulty The raid difficulty to retrieve rankings for (e.g. \"mythic\").\n * @param region The region to retrieve rankings for (us, eu, kr or tw).\n * @returns the hall of fame for a given raid. See {@link ViewHallOfFameResponse}\n */\nexport function raidingHallOfFame(\n raid: RaidInstance,\n difficulty: RaidDifficulty,\n region: RegionShortName\n): Resource<ViewHallOfFameResponse> {\n return {\n path: `${raidingBasePath}/hall-of-fame`,\n query: {\n difficulty,\n raid,\n region\n }\n }\n}\n\n// ==================================================\n\n/**\n * @param raid The raid instance to retrieve progression for.\n * @param difficulty The raid difficulty to retrieve progression for (e.g. \"mythic\").\n * @param region The region to retrieve progression for (us, eu, kr or tw).\n * @returns the raid progression for a given raid. See {@link ViewRaidProgressionResponse}\n */\nexport function raidingProgression(\n raid: RaidInstance,\n difficulty: RaidDifficulty,\n region: RegionShortName\n): Resource<ViewRaidProgressionResponse> {\n return {\n path: `${raidingBasePath}/progression`,\n query: {\n difficulty,\n raid,\n region\n }\n }\n}\n\n// ==================================================\n\n/**\n * @param raid The raid instance to retrieve rankings for.\n * @param difficulty The raid difficulty to retrieve rankings for (e.g. \"mythic\").\n * @param region The region to retrieve rankings for (us, eu, kr or tw).\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.\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.\n * @param limit The number of results to return per page. Default is 50.\n * @param page The page number to return (starting from 0). Default is 0.\n * @returns the raid rankings for a given raid and region. See {@link ViewRaidRankingsResponse}\n */\nexport function raidingRaidRankings(\n raid: RaidInstance,\n difficulty: RaidDifficulty,\n region: RegionShortName,\n realm: null | string,\n guilds = '',\n limit = 50,\n page = 0\n): Resource<ViewRaidRankingsResponse> {\n return {\n path: `${raidingBasePath}/raid-rankings`,\n query: {\n difficulty,\n guilds: guilds || undefined,\n limit,\n page,\n raid,\n realm: realm ?? undefined,\n region\n }\n }\n}\n\n// ==================================================\n\n/**\n * @param expansionId The expansion ID (e.g. 9 for Shadowlands).\n * @returns raid and biss static data for a specific expansion (slugs, names, etc). See {@link ViewRaidingStaticDataResponse}\n */\nexport function raidingStaticData(\n expansionId: ExpansionId\n): Resource<ViewRaidingStaticDataResponse> {\n return {\n path: `${raidingBasePath}/static-data`,\n query: { expansion_id: expansionId }\n }\n}\n","import type { Resource } from './core'\nimport { HttpClient } from './http/http'\nimport type { ClientOptions } from './http/types'\nimport { characterProfile } from './resources/character/character'\nimport { periods } from './resources/general/general'\nimport { guildBossKill, guildProfile } from './resources/guild/guild'\nimport {\n mythicPlusAffixes,\n mythicPlusLeaderboardCapacity,\n mythicPlusRunDetails,\n mythicPlusRuns,\n mythicPlusScoreTiers,\n mythicPlusSeasonCutoffs,\n mythicPlusStaticData\n} from './resources/mythic-plus/mythic-plus'\nimport {\n raidingBossRankings,\n raidingHallOfFame,\n raidingProgression,\n raidingRaidRankings,\n raidingStaticData\n} from './resources/raiding/raiding'\n\n/**\n * A client for the Raider.io API.\n *\n * Endpoints are grouped by area (`character`, `general`, `guild`, `mythicPlus`,\n * `raiding`) and each method returns the parsed, fully-typed response. The\n * underlying resource builder is linked from each group for full parameter docs.\n * @example\n * ```ts\n * const client = new RaiderioClient();\n * const profile = await client.character.profile(\"eu\", \"ysondre\", \"melestra\", [\n * \"gear\",\n * \"mythic_plus_scores_by_season\",\n * ]);\n * ```\n */\nexport class RaiderioClient {\n private readonly http: HttpClient\n\n constructor(options: ClientOptions = {}) {\n this.http = new HttpClient(options)\n }\n\n /** Character endpoints. See {@link characterProfile}. */\n public readonly character = {\n profile: (...parameters: Parameters<typeof characterProfile>) =>\n this.http.request(characterProfile(...parameters))\n }\n\n /** General endpoints. See {@link periods}. */\n public readonly general = {\n periods: (...parameters: Parameters<typeof periods>) =>\n this.http.request(periods(...parameters))\n }\n\n /** Guild endpoints. See {@link guildBossKill} and {@link guildProfile}. */\n public readonly guild = {\n bossKill: (...parameters: Parameters<typeof guildBossKill>) =>\n this.http.request(guildBossKill(...parameters)),\n profile: (...parameters: Parameters<typeof guildProfile>) =>\n this.http.request(guildProfile(...parameters))\n }\n\n /** Mythic+ endpoints. */\n public readonly mythicPlus = {\n affixes: (...parameters: Parameters<typeof mythicPlusAffixes>) =>\n this.http.request(mythicPlusAffixes(...parameters)),\n leaderboardCapacity: (\n ...parameters: Parameters<typeof mythicPlusLeaderboardCapacity>\n ) => this.http.request(mythicPlusLeaderboardCapacity(...parameters)),\n runDetails: (...parameters: Parameters<typeof mythicPlusRunDetails>) =>\n this.http.request(mythicPlusRunDetails(...parameters)),\n runs: (...parameters: Parameters<typeof mythicPlusRuns>) =>\n this.http.request(mythicPlusRuns(...parameters)),\n scoreTiers: (...parameters: Parameters<typeof mythicPlusScoreTiers>) =>\n this.http.request(mythicPlusScoreTiers(...parameters)),\n seasonCutoffs: (\n ...parameters: Parameters<typeof mythicPlusSeasonCutoffs>\n ) => this.http.request(mythicPlusSeasonCutoffs(...parameters)),\n staticData: (...parameters: Parameters<typeof mythicPlusStaticData>) =>\n this.http.request(mythicPlusStaticData(...parameters))\n }\n\n /** Raiding endpoints. */\n public readonly raiding = {\n bossRankings: (...parameters: Parameters<typeof raidingBossRankings>) =>\n this.http.request(raidingBossRankings(...parameters)),\n hallOfFame: (...parameters: Parameters<typeof raidingHallOfFame>) =>\n this.http.request(raidingHallOfFame(...parameters)),\n progression: (...parameters: Parameters<typeof raidingProgression>) =>\n this.http.request(raidingProgression(...parameters)),\n raidRankings: (...parameters: Parameters<typeof raidingRaidRankings>) =>\n this.http.request(raidingRaidRankings(...parameters)),\n staticData: (...parameters: Parameters<typeof raidingStaticData>) =>\n this.http.request(raidingStaticData(...parameters))\n }\n\n /**\n * Escape hatch: send any {@link Resource} through the client. Useful for\n * resources built by hand or not yet covered by a dedicated method.\n * @param resource The resource to fetch.\n * @param options Per-request overrides (api key, ky options).\n * @returns The parsed, typed response.\n */\n public request<T>(resource: Resource<T>, options?: Partial<ClientOptions>) {\n return this.http.request(resource, options)\n }\n}\n\n/**\n * Create a new {@link RaiderioClient}.\n * @param options Client options. See {@link ClientOptions}.\n * @returns A new Raider.io API client.\n */\nexport const createRaiderioClient = (\n options: ClientOptions = {}\n): RaiderioClient => new RaiderioClient(options)\n","import type {\n Faction,\n Gender,\n ISODateString,\n ItemSlot,\n PlayableClass,\n PlayableRace,\n Realm,\n RegionShortName,\n Role,\n SeasonReference,\n Specialization\n} from '../../core'\nimport type { KeystoneRun } from '../mythic-plus/types'\nimport type { RaidInstance, RaidProgression } from '../raiding/types'\n\n// ==================================================\n\n/**\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.\n * @see {@link https://raider.io/api#/character/getApiV1CharactersProfile}\n */\nexport type ViewCharacterProfileResponse = Character & {\n covenant?: unknown\n gear?: CharacterGear\n guild?: {\n name: string\n realm: Realm['name']\n }\n mythic_plus_best_runs?: Array<KeystoneRun>\n mythic_plus_highest_level_runs?: Array<KeystoneRun>\n mythic_plus_previous_weekly_highest_level_runs?: Array<KeystoneRun>\n mythic_plus_ranks?: MythicPlusRanks\n mythic_plus_recent_runs?: Array<KeystoneRun>\n mythic_plus_scores_by_season?: MythciPlusSeasonScores\n mythic_plus_weekly_highest_level_runs?: Array<KeystoneRun>\n previous_mythic_plus_ranks?: MythicPlusRanks\n raid_achievement_curve?: Array<RaidAchievementCurve>\n raid_achievement_meta?: Array<RaidAchievementMeta>\n raid_progression?: Record<RaidInstance, RaidProgression>\n talentLoadout?: TalentLoadout\n}\n\n// ==================================================\n\nexport const characterProfileFieldKeys = [\n 'gear',\n 'talents',\n 'talents:categorized',\n 'guild',\n 'covenant',\n 'mythic_plus_scores_by_season',\n 'mythic_plus_ranks',\n 'mythic_plus_recent_runs',\n 'mythic_plus_best_runs',\n 'mythic_plus_best_runs:all',\n 'mythic_plus_alternate_runs',\n 'mythic_plus_alternate_runs:all',\n 'mythic_plus_highest_level_runs',\n 'mythic_plus_weekly_highest_level_runs',\n 'mythic_plus_previous_weekly_highest_level_runs',\n 'previous_mythic_plus_ranks'\n] as const\n\nexport interface Character {\n achievement_points: number\n active_spec_name: Specialization['name']\n active_spec_role: Specialization['role']\n class: PlayableClass['name']\n faction: Faction\n gender: Gender\n id?: number\n last_crawled_at: ISODateString\n name: string\n profile_banner: string\n profile_url: string\n race: PlayableRace['name']\n realm: string\n region: RegionShortName\n thumbnail_url: string\n}\n\nexport interface CharacterGear {\n artifact_traits: number\n corruption: CorruptionDetails\n created_at: ISODateString\n item_level_equipped: number\n item_level_total: number\n items: ItemsContainer\n source: string\n updated_at: ISODateString\n}\n\nexport type CharacterProfileFieldKey =\n | (typeof characterProfileFieldKeys)[number]\n | `mythic_plus_scores_by_season:${string}`\n | `raid_achievement_curve:${string}`\n | `raid_achievement_meta:${string}`\n\nexport interface TalentLoadout {\n active_hero_tree: {\n description: string\n iconUrl: string\n id: number\n name: string\n slug: string\n traitTreeId: number\n }\n class_talents?: Array<TalentLoadoutEntry>\n hero_talents?: Array<TalentLoadoutEntry>\n loadout?: Array<TalentLoadoutEntry>\n loadout_spec_id: number\n loadout_text: string\n spec_talents?: Array<TalentLoadoutEntry>\n}\n\nexport interface TalentLoadoutEntry {\n entryIndex: number\n node: TalentNodeChoice | TalentNodePassive | TalentNodeSpell\n rank: number\n}\n\n// ==================================================\n\nexport interface Spell {\n hasCooldown: boolean\n icon: string\n id: number\n name: string\n rank: null | number\n school: number\n}\n\ninterface AzeritePower {\n id: number\n spell: {\n icon: string\n id: number\n name: string\n rank: null | number\n school: number\n }\n}\n\ninterface CorruptionDetails {\n added: number\n cloakRank: number\n items: ItemsContainer\n resisted: number\n spells: Array<unknown>\n total: number\n}\n\ninterface EnchantDetails {\n icon: string\n id: number\n name: string\n}\n\ninterface GearItem {\n azerite_powers: Array<AzeritePower>\n bonuses: Array<number>\n corruption: Pick<CorruptionDetails, 'added' | 'resisted' | 'total'>\n domination_shards: Array<unknown>\n enchant: number\n enchants: Array<EnchantDetails['id']>\n enchants_details: Array<EnchantDetails>\n gems: Array<GemDetails['id']>\n gems_details: Array<GemDetails>\n icon: string\n is_azerite_power: boolean\n is_legendary: boolean\n item_id: number\n item_level: number\n item_quality: number\n name: string\n}\n\ninterface GemDetails {\n icon: string\n id: number\n name: string\n}\n\ntype ItemsContainer = Record<ItemSlot, GearItem>\n\ninterface MythciPlusSeasonScores {\n scores: Record<ScoreKey, number>\n season: SeasonReference\n segments: Record<ScoreKey, MythicPlusScoreSegment>\n}\n\ntype MythicPlusRanks = Record<RankKey, Ranks>\n\ninterface MythicPlusScoreSegment {\n color: string\n score: number\n}\n\ninterface RaidAchievement {\n id: number\n raid: string\n timestamp: ISODateString\n}\n\ninterface RaidAchievementCurve {\n aotc: ISODateString\n raid: RaidInstance\n}\n\ninterface RaidAchievementMeta {\n completed_achievements: Array<RaidAchievement>\n completed_count: number\n meta_achievement: {\n id: number\n raid: string\n }\n remaining_achievements: Array<RaidAchievement>\n tier: `tier_${number}`\n total_count: number\n}\n\ntype RankKey = 'overall' | `class_${Role}` | `spec_${number}` | keyof Role\n\ninterface Ranks {\n realm: number\n region: number\n world: number\n}\n\ntype ScoreKey = 'all' | `spec${0 | 1 | 2 | 3}` | Role\n\ninterface TalentNode {\n col: number\n entries: Array<TalentNodeEntryPassive | TalentNodeEntrySpell>\n flags: number\n id: number\n important: boolean\n posX: number\n posY: number\n row: number\n subTreeId: number\n treeId: number\n}\n\ninterface TalentNodeChoice extends TalentNode {\n type: 2\n}\n\ninterface TalentNodeEntry {\n id: number\n maxRanks: number\n spell: Spell\n traitDefinitionId: number\n traitSubTreeId: number\n}\n\ninterface TalentNodeEntryPassive extends TalentNodeEntry {\n type: 2\n}\n\ninterface TalentNodeEntrySpell extends TalentNodeEntry {\n type: 1\n}\n\ninterface TalentNodePassive extends TalentNode {\n type: 0\n}\n\ninterface TalentNodeSpell extends TalentNode {\n type: 1\n}\n","import type {\n Faction,\n Gender,\n ISODateString,\n PlayableClass,\n PlayableRace,\n Realm,\n Region,\n RegionShortName,\n Specialization\n} from '../../core'\nimport type {\n Character,\n CharacterGear,\n Spell,\n TalentLoadout\n} from '../character/types'\nimport type {\n RaidDifficulty,\n RaidDifficultyRankings,\n RaidEncounter,\n RaidInstance,\n RaidProgression,\n RecruitmentProfile\n} from '../raiding/types'\n\n// ==================================================\n\n/**\n * Information about a guild boss kill\n * @see {@link https://raider.io/api#/guild/getApiV1GuildsBosskill}\n */\nexport interface ViewGuildBossKillResponse {\n kill: BossKill\n roster: Array<BossKillRosterMember>\n}\n\n/**\n * Information about a guild\n * @see {@link https://raider.io/api#/guild/getApiV1GuildsProfile}\n */\nexport interface ViewGuildProfileResponse {\n displayName: null | string\n faction: Faction\n last_crawled_at: ISODateString\n members?: Array<GuildMember>\n name: string\n profile_url: string\n raid_encounters?: Array<RaidEncounter>\n raid_progression?: Record<RaidInstance, RaidProgression>\n raid_rankings?: Record<RaidInstance, RaidDifficultyRankings>\n realm: Realm['name']\n region: RegionShortName\n}\n\n// ==================================================\n\nexport const guildProfileKeys = {\n members: 'members',\n raid_progression: 'raid_progression',\n raid_rankings: 'raid_rankings'\n} as const\n\nexport type GuildProfileFieldKey =\n | (typeof guildProfileKeys)[keyof typeof guildProfileKeys]\n | `raid_encounters:${RaidInstance}:${RaidDifficulty}`\n\n// ==================================================\n\ninterface BossKill {\n defeatedAt: ISODateString\n durationMs: number\n isSuccess: boolean\n itemLevelEquippedAvg: number\n itemLevelEquippedMax: number\n itemLevelEquippedMin: number\n pulledAt: ISODateString\n}\n\ninterface BossKillRosterMember {\n character: {\n artifactTraits: number\n class: PlayableClass\n gender: Gender\n id: number\n interestingAuras: Array<Spell>\n itemLevelEquipped: number\n items: CharacterGear\n name: string\n race: PlayableRace\n realm: Realm\n recruitmentProfiles: Array<RecruitmentProfile>\n region: Region\n spec: Specialization\n talentLoadout: TalentLoadout\n thumbnail: string\n }\n vantus: boolean\n}\n\ninterface GuildMember {\n character: Pick<\n Character,\n | 'achievement_points'\n | 'active_spec_name'\n | 'active_spec_role'\n | 'class'\n | 'faction'\n | 'gender'\n | 'last_crawled_at'\n | 'name'\n | 'profile_banner'\n | 'profile_url'\n | 'race'\n | 'realm'\n | 'region'\n >\n rank: number\n}\n","import type {\n ExpansionId,\n Faction,\n Gender,\n ISODateString,\n LocalizedString,\n PlayableClass,\n PlayableRace,\n Realm,\n Region,\n RegionShortName,\n Role,\n SeasonReference,\n Specialization,\n Stream,\n Video\n} from '../../core'\nimport type {\n CharacterGear,\n Spell,\n TalentLoadoutEntry\n} from '../character/types'\nimport type { RecruitmentProfile } from '../raiding/types'\n\n// ==================================================\n\n/**\n * The affixes for a specific region, including the latest run seen with this affix\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusAffixes}\n */\nexport interface ViewMythicPlusAffixesResponse {\n affix_details: Array<Affix>\n leaderboard_url: string\n region: RegionShortName\n title: string\n}\n\n/**\n * Leaderboad capacity for a region including the lowest level and time to quality\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusLeaderboardcapacity}\n */\nexport interface ViewMythicPlusLeaderboardCapacityResponse {\n realmListing: {\n affixes: Array<LeaderboardAffix>\n realms: Array<RealmCapacityEntry>\n region: Region\n }\n}\n\n/**\n * Details for a specific Mythic+ run\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusRundetails}\n */\nexport interface ViewMythicPlusRunDetailsResponse {\n canManageOthersVideos: boolean\n canManageOwnVideos: boolean\n canViewPrivateDetails: boolean\n clear_time_ms: number\n completed_at: ISODateString\n deleted_at: ISODateString | null\n dungeon: Dungeon\n faction: Faction\n isPatron: boolean\n isTournamentProfile: boolean\n isViewingPrivateDetails: boolean\n keystone_platoon_id: number\n keystone_run_id: number\n keystone_team_id: number\n keystone_time_ms: number\n logged_details: LoggedRunDetails\n logged_run_id: number\n loggedSources: Array<LoggedSource>\n mythic_level: number\n num_chests: number\n num_modifiers_active: number\n replay_limit: number\n roster: Array<RunRosterMember>\n runPrivacyMode: string\n score: number\n season: SeasonReference\n status: string\n time_remaining_ms: number\n videos: Array<Video>\n weekly_modifiers: Array<RunModifier>\n}\n\n/**\n * Information about the top runs that match the given criteria\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusRuns}\n */\nexport interface ViewMythicPlusRunsResponse {\n rankings: Array<MythicPlusRankingRun>\n}\n\n/**\n * Colors used for score tiers in the given season\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusScoretiers}\n */\nexport type ViewMythicPlusScoreTiersResponse = Array<ScoreTier>\n\n/**\n * Mythic+ Season cutoffs for a region\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusSeasoncutoffs}\n */\nexport interface ViewMythicPlusSeasonCutoffsResponse {\n cutoffs: SeasonCutoffs\n ui: {\n access_key: string\n region: RegionShortName\n season: SeasonReference\n }\n}\n\n/**\n * Mythic plus season and dungeon static data for a specific expansion (slugs, names, etc.)\n * @see {@link https://raider.io/api#/mythic_plus/getApiV1MythicplusStaticdata}\n */\nexport interface ViewMythicPlusStaticDataResponse {\n dungeons: Array<SeasonDungeon>\n seasons: Array<MythicPlusStaticData>\n}\n\n// ==================================================\n\nexport interface KeystoneRun {\n affixes: Array<Affix>\n background_image_url: string\n clear_time_ms: number\n completed_at: ISODateString\n dungeon: string\n icon_url: string\n keystone_run_id: number\n map_challenge_mode_id: number\n mythic_level: number\n num_keystone_upgrades: number\n par_time_ms: number\n role: Role\n score: number\n short_name: string\n spec: Specialization\n url: string\n zone_expansion_id: ExpansionId\n zone_id: number\n}\n\n// ==================================================\n\ninterface Affix {\n description: string\n icon: string\n icon_url: string\n id: number\n name: string\n wowhead_url: string\n}\n\ninterface Dungeon {\n expansion_id: ExpansionId\n group_finder_activity_ids: Array<number>\n icon_url: string\n id: number\n keystone_timer_ms: number\n map_challenge_mode_id: number\n name: string\n num_bosses: number\n patch: string\n short_name: string\n slug: string\n type: string\n wowInstanceId: number\n}\n\ninterface KeystoneRunRosterMember {\n character: {\n class: PlayableClass\n faction: Faction\n flags: Record<string, unknown>\n id: number\n level: number\n name: string\n path: string\n persona_id: number\n race: PlayableRace\n realm: Realm\n recruitmentProfiles: Array<RecruitmentProfile>\n region: Region\n spec: Specialization\n stream: null | Stream\n }\n isBanned: boolean\n isTransfer: boolean\n oldCharacter: null | RunRosterMember['character']\n role: Role\n}\n\ntype LeaderboardAffix = Pick<Affix, 'icon' | 'id'> & {\n description: LocalizedString\n name: LocalizedString\n slug: string\n}\n\ninterface LeaderboardLowest {\n mythicLevel: number\n rank: number\n timeInMilliseconds: number\n}\n\ninterface LoggedRunDetails {\n correlationId: string\n deaths: Array<RunDeathDetail>\n encounters: Array<RunEncounter>\n route_key: null | string\n showing_replay_authorized: boolean\n showing_route_authorized: boolean\n total_enemy_forces: number\n}\n\ninterface LoggedSource {\n logId: string\n source: string\n}\n\ninterface MythicPlusRankingRun {\n rank: number\n run: RankingKeystoneRun\n score: number\n}\n\ninterface RankingKeystoneRun {\n clear_time_ms: number\n completed_at: ISODateString\n deleted_at: ISODateString | null\n dungeon: Dungeon\n faction: 'mixed' | Faction\n keystone_platoon_id: null | number\n keystone_run_id: number\n keystone_team_id: number\n logged_run_id: number\n mythic_level: number\n num_chests: number\n num_modifiers_active: number\n platoon: null | Record<string, unknown>\n roster: Array<KeystoneRunRosterMember>\n season: SeasonReference\n time_remaining_ms: number\n videos: Array<Video>\n weekly_modifiers: Array<RunModifier>\n}\n\ninterface RealmCapacityEntry {\n connectedRealms: Array<Realm>\n dungeons: Array<RealmDungeonCapacity>\n id: number\n}\n\ninterface RealmDungeonCapacity {\n dungeon: Dungeon\n lowest: LeaderboardLowest | null\n}\n\ninterface RunDeathDetail {\n approximate_died_at: number\n character_id: number\n logged_encounter_id: number\n}\n\ninterface RunEncounter {\n approximate_relative_ended_at: number\n approximate_relative_started_at: number\n boss: RunEncounterBoss\n duration_ms: number\n id: number\n is_success: boolean\n pull_ended_at: ISODateString\n pull_started_at: ISODateString\n roster: Array<RunRosterMember>\n status: string\n}\n\ninterface RunEncounterBoss {\n encounterId: number\n iconUrl: string\n name: string\n ordinal: number\n slug: string\n wingId: number\n}\n\ninterface RunModifier {\n description: string\n icon: string\n id: number\n name: string\n slug: string\n}\n\ninterface RunRosterMember {\n character: {\n artifactTraits: number\n class: PlayableClass\n gender: Gender\n id: number\n itemLevelEquipped: number\n name: string\n race: PlayableRace\n realm: Realm\n region: Region\n spec: Specialization\n talentLoadout: RunRosterTalentLoadout\n thumbnail: string\n }\n guild: null | RunRosterMemberGuild\n interestingAuras: Array<Spell>\n isBanned: boolean\n isTransfer: boolean\n items: CharacterGear\n oldCharacter: null | RunRosterMember['character']\n ranks: {\n realm: number\n region: number\n score: number\n world: number\n }\n role: Role\n}\n\ninterface RunRosterMemberGuild {\n displayName: string\n faction: Faction\n id: number\n isDefaultLogo: boolean\n logo: string\n name: string\n path: string\n realm: Realm\n region: Region\n}\n\ninterface RunRosterTalentLoadout {\n heroSubTreeId: number\n loadout: Array<TalentLoadoutEntry>\n loadoutText: string\n specId: number\n}\n\ninterface ScoreTier {\n rgbFloat: [number, number, number]\n rgbHex: string\n rgbInteger: [number, number, number]\n score: number\n}\n\nexport const bracketDungeonLevels = [\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,\n 23, 24, 25, 26, 27, 28, 29\n] as const\n\ntype BracketDungeonLevel = (typeof bracketDungeonLevels)[number]\n\nexport const percentiles = [999, 990, 900, 750, 600] as const\n\ninterface Coordinates {\n total: number\n x: number\n y: number\n}\n\ninterface CutoffFactionStat {\n quantile: number\n quantileMinValue: number\n quantilePopulationCount: number\n quantilePopulationFraction: number\n totalPopulationCount: number\n}\n\ninterface GraphData {\n color: string\n data: Array<Coordinates>\n marker: {\n enabled: boolean\n }\n name: string\n type: string\n}\n\ninterface MythicPlusStaticData {\n blizzard_season_id: number\n dungeons: Array<SeasonDungeon>\n ends: Record<RegionShortName, ISODateString>\n is_main_season: boolean\n name: string\n seasonal_affix: Affix | null\n short_name: string\n slug: SeasonReference\n starts: Record<RegionShortName, ISODateString>\n}\n\ntype Percentile = (typeof percentiles)[number]\n\ntype PercentileKey = `p${Percentile}`\n\ntype SeasonCutoffEntry = Record<'all' | Faction, CutoffFactionStat | null> &\n Record<'allColor' | `${Faction}Color`, null | string>\n\ntype SeasonCutoffs = Record<\n `allTimed${BracketDungeonLevel}`,\n SeasonCutoffEntry & {\n score: number\n }\n> &\n Record<PercentileKey, SeasonCutoffEntry> & {\n bracketDungeonLevels: Array<BracketDungeonLevel>\n graphData: Record<PercentileKey, GraphData>\n isRemappedSeason: boolean\n keystoneConqueror: SeasonCutoffEntry & { score: number }\n keystoneExplorer: SeasonCutoffEntry & { score: number }\n keystoneHero: SeasonCutoffEntry & { score: number }\n keystoneLegend: SeasonCutoffEntry & { score: number }\n keystoneMaster: SeasonCutoffEntry & { score: number }\n }\n\ninterface SeasonDungeon {\n background_image_url: string\n challenge_mode_id: number\n icon_url: string\n id: number\n keystone_timer_seconds: number\n name: string\n short_name: string\n slug: string\n}\n","import type {\n Faction,\n ISODateString,\n Ranks,\n Realm,\n RealmSummary,\n Region,\n Stream,\n Video\n} from '../../core'\n\n// ==================================================\n\n/**\n * The rankings for the specified boss, raid, difficulty and region\n * @see {@link https://raider.io/api#/raiding/getApiV1RaidingBossrankings}\n */\nexport interface ViewBossRankingsResponse {\n bossRankings: Array<BossRanking>\n}\n\n/**\n * The hall of fame for a given raid\n * @see {@link https://raider.io/api#/raiding/getApiV1RaidingHalloffame}\n */\nexport interface ViewHallOfFameResponse {\n hallOfFame: {\n bossKills: Array<HallOfFameBossKill>\n winningGuilds: Array<HallOfFameGuildEntry>\n }\n}\n\n/**\n * Details of raiding progression for a raid, showing how many guilds have reached each boss kill milestone\n * @see {@link https://raider.io/api#/raiding/getApiV1RaidingProgression}\n */\nexport interface ViewRaidProgressionResponse {\n progression: Array<RaidRaceProgressionEntry>\n}\n\n/**\n * The raid rankings for a given raid and region\n * @see {@link https://raider.io/api#/raiding/getApiV1RaidingRaidrankings}\n */\nexport interface ViewRaidRankingsResponse {\n raidRankings: Array<RaidRankingEntry>\n}\n\n/**\n * Raid and boss static data for a specific expansion (slugs, names, etc)\n * @see {@link https://raider.io/api#/raiding/getApiV1RaidingStaticdata}\n */\nexport interface ViewRaidingStaticDataResponse {\n raids: Array<RaidStaticData>\n}\n\n// ==================================================\n\nexport const raidDifficulties = ['normal', 'heroic', 'mythic'] as const\n\nexport const raidInstances = [\n 'tier-mn-1',\n 'manaforge-omega',\n 'liberation-of-undermine',\n 'nerubar-palace',\n 'blackrock-depths',\n 'awakened-amirdrassil-the-dreams-hope',\n 'awakened-aberrus-the-shadowed-crucible',\n 'awakened-vault-of-the-incarnates',\n 'amirdrassil-the-dreams-hope',\n 'aberrus-the-shadowed-crucible',\n 'vault-of-the-incarnates',\n 'fated-sepulcher-of-the-first-ones',\n 'fated-sanctum-of-domination',\n 'fated-castle-nathria',\n 'sepulcher-of-the-first-ones',\n 'sanctum-of-domination',\n 'castle-nathria',\n 'nyalotha-the-waking-city',\n 'the-eternal-palace',\n 'crucible-of-storms',\n 'battle-of-dazaralor',\n 'uldir',\n 'antorus-the-burning-throne',\n 'tomb-of-sargeras',\n 'the-nighthold',\n 'trial-of-valor',\n 'the-emerald-nightmare'\n] as const\n\nexport type RaidDifficulty = (typeof raidDifficulties)[number]\n\nexport type RaidDifficultyRankings = Record<RaidDifficulty, Ranks>\n\nexport interface RaidEncounter {\n defeatedAt: ISODateString | null\n name: string\n slug: string\n}\n\nexport type RaidInstance = (typeof raidInstances)[number]\n\nexport type RaidProgression = Record<\n `${RaidDifficulty}_bosses_killed`,\n number\n> & {\n expansion_id: number\n summary: string\n total_bosses: number\n}\n\nexport interface RecruitmentProfile {\n activity_type: string\n entity_type: string\n recruitment_profile_id: number\n}\n\n// ==================================================\n\ntype BossRanking = Record<RaidInstance, RaidDifficultyRankings>\n\ninterface EncounterDefeated {\n firstDefeated: ISODateString\n lastDefeated: ISODateString\n slug: string\n}\n\ninterface GuildDefeatEntry {\n defeatedAt: ISODateString\n guild: GuildSummary\n}\n\ninterface GuildEncounter {\n encountersDefeated: Array<EncounterDefeated>\n guild: RaidingGuild\n rank: number\n}\n\ninterface GuildPrivacy {\n raidComps: boolean\n raidPercents: boolean\n raidPulls: boolean\n shareraidUntil: ISODateString\n wereRaidCompsRestricted: boolean\n wereRaidPercentsRestricted: boolean\n wereRaidPullsRestricted: boolean\n}\n\ninterface GuildStreamers {\n count: number\n description: string\n stream: Stream\n}\n\ninterface GuildSummary {\n displayName: string\n faction: Faction\n id: number\n name: string\n realm: RealmSummary\n region: Region\n}\n\ninterface HallOfFameBossKill {\n attemptedBy: {\n attempts: Array<GuildEncounter>\n totalCount: number\n }\n boss: string\n bossKillVideo: Video\n bossSummary: RaidBossSummary\n defeatedBy: {\n guilds: Array<GuildEncounter>\n totalCount: number\n }\n}\n\ntype HallOfFameGuildEntry = GuildEncounter & {\n defeatedAt: ISODateString\n doesVideoExist: boolean\n recruitmentProfiles: Array<RecruitmentProfile>\n streamers: GuildStreamers\n}\n\ninterface RaidBossSummary {\n encounterId: number\n iconUrl: string\n name: string\n ordinal: number\n slug: string\n wingId: number\n}\n\ninterface RaidEncounterStaticData {\n id: number\n name: string\n slug: string\n}\n\ntype RaidingGuild = GuildSummary & {\n color: string\n isDefaultLogo: boolean\n logo: string\n path: string\n realm: Realm\n}\n\ninterface RaidRaceProgressionEntry {\n guilds: Array<GuildDefeatEntry>\n progress: number\n totalGuilds: number\n}\n\ninterface RaidRankingEncounter {\n bestPercent: number\n id: number\n isDefeated: boolean\n numPulls: number\n pulStartedAt: ISODateString\n slug: string\n}\n\ninterface RaidRankingEntry {\n encountersDefeated: Array<EncounterDefeated>\n encountersPulled: Array<RaidRankingEncounter>\n guild: RaidingGuild\n guildPrivacy: GuildPrivacy\n rank: number\n regionRank: number\n}\n\ninterface RaidStaticData {\n encounters: Array<RaidEncounterStaticData>\n ends: {\n ends: ISODateString\n }\n icon: string\n id: number\n name: string\n short_name: string\n slug: RaidInstance\n starts: {\n starts: ISODateString\n }\n}\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;;;;;;;CAQA,MAAa,QACX,UACA,SACqB;EACrB,MAAM,MAAM,KAAK,cAAc,QAAQ;EAGvC,MAAM,mBAA8D,CAAC;EACrE,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,KAAK,GACtD,IAAI,UAAU,KAAA,GACZ,iBAAiB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,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 CHANGED
@@ -1,59 +1,60 @@
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
- }
1
+ {
2
+ "name": "raiderio-api",
3
+ "version": "0.2.0",
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": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/aovee/raiderio-api.git"
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "type": "module",
26
+ "sideEffects": false,
27
+ "module": "./dist/index.js",
28
+ "types": "./dist/index.d.ts",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ },
34
+ "./package.json": "./package.json"
35
+ },
36
+ "dependencies": {
37
+ "ky": "^2.0.2"
38
+ },
39
+ "devDependencies": {
40
+ "@types/node": "25.9.2",
41
+ "@vitest/coverage-v8": "4.1.8",
42
+ "oxfmt": "0.54.0",
43
+ "oxlint": "1.69.0",
44
+ "tsdown": "0.22.2",
45
+ "typescript": "6.0.3",
46
+ "vitest": "4.1.8"
47
+ },
48
+ "engines": {
49
+ "node": "^20.19.0 || ^22.13.0 || >=24"
50
+ },
51
+ "scripts": {
52
+ "build": "tsdown",
53
+ "typecheck": "tsc --noEmit",
54
+ "lint": "oxlint",
55
+ "fmt": "oxfmt",
56
+ "fmt:check": "oxfmt --check",
57
+ "test": "vitest run",
58
+ "test:watch": "vitest"
59
+ }
60
+ }