UNPKG

galeforce-tmp-sea

Version:

A customizable, promise-based, and command-oriented TypeScript library for the Riot Games API.

848 lines 61.2 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const debug_1 = __importDefault(require("debug")); const riot_api_1 = require("./riot-api"); const configs_1 = require("./galeforce/configs"); const match_1 = __importDefault(require("./galeforce/actions/lol/match/match")); const summoner_1 = __importDefault(require("./galeforce/actions/lol/summoner")); const timeline_1 = __importDefault(require("./galeforce/actions/lol/match/timeline")); const matchlist_1 = __importDefault(require("./galeforce/actions/lol/match/matchlist")); const by_summoner_1 = __importDefault(require("./galeforce/actions/lol/champion-mastery/by-summoner")); const entries_1 = __importDefault(require("./galeforce/actions/lol/league/entries")); const leagues_1 = __importDefault(require("./galeforce/actions/lol/league/leagues")); const lol_status_1 = __importDefault(require("./galeforce/actions/lol/lol-status")); const champion_1 = __importDefault(require("./galeforce/actions/lol/champion")); const players_1 = __importDefault(require("./galeforce/actions/lol/clash/players")); const teams_1 = __importDefault(require("./galeforce/actions/lol/clash/teams")); const tournaments_1 = __importDefault(require("./galeforce/actions/lol/clash/tournaments")); const active_games_1 = __importDefault(require("./galeforce/actions/lol/spectator/active-games")); const featured_games_1 = __importDefault(require("./galeforce/actions/lol/spectator/featured-games")); const score_1 = __importDefault(require("./galeforce/actions/lol/champion-mastery/score")); const account_1 = __importDefault(require("./galeforce/actions/riot/account/account")); const active_shard_1 = __importDefault(require("./galeforce/actions/riot/account/active-shard")); const create_codes_1 = __importDefault(require("./galeforce/actions/lol/tournament/create-codes")); const get_tournament_by_code_1 = __importDefault(require("./galeforce/actions/lol/tournament/get-tournament-by-code")); const update_tournament_1 = __importDefault(require("./galeforce/actions/lol/tournament/update-tournament")); const providers_1 = __importDefault(require("./galeforce/actions/lol/tournament/providers")); const tournaments_2 = __importDefault(require("./galeforce/actions/lol/tournament/tournaments")); const lobby_events_1 = __importDefault(require("./galeforce/actions/lol/tournament/lobby-events")); const upcoming_tournaments_1 = __importDefault(require("./galeforce/actions/lol/clash/upcoming-tournaments")); const match_2 = __importDefault(require("./galeforce/actions/lor/lor-match/match")); const matchlist_2 = __importDefault(require("./galeforce/actions/lor/lor-match/matchlist")); const leaderboard_1 = __importDefault(require("./galeforce/actions/lor/lor-ranked/leaderboard")); const lor_status_1 = __importDefault(require("./galeforce/actions/lor/lor-status")); const entries_2 = __importDefault(require("./galeforce/actions/tft/tft-league/entries")); const leagues_2 = __importDefault(require("./galeforce/actions/tft/tft-league/leagues")); const match_3 = __importDefault(require("./galeforce/actions/tft/tft-match/match")); const matchlist_3 = __importDefault(require("./galeforce/actions/tft/tft-match/matchlist")); const tft_summoner_1 = __importDefault(require("./galeforce/actions/tft/tft-summoner")); const contents_1 = __importDefault(require("./galeforce/actions/valorant/val-content/contents")); const match_4 = __importDefault(require("./galeforce/actions/valorant/val-match/match")); const matchlist_4 = __importDefault(require("./galeforce/actions/valorant/val-match/matchlist")); const recent_matches_1 = __importDefault(require("./galeforce/actions/valorant/val-match/recent-matches")); const leaderboard_2 = __importDefault(require("./galeforce/actions/valorant/val-ranked/leaderboard")); const val_status_1 = __importDefault(require("./galeforce/actions/valorant/val-status")); const by_champion_1 = __importDefault(require("./galeforce/actions/lol/champion-mastery/by-champion")); const asset_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/asset")); const versions_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/versions")); const regions_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/regions")); const languages_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/languages")); const champion_list_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/champion-list")); const champion_2 = __importDefault(require("./galeforce/actions/lol/data-dragon/champion")); const splash_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/splash-art")); const loading_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/loading-art")); const tile_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/tile-art")); const champion_square_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/champion-square-art")); const spell_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/spell-art")); const item_list_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/item-list")); const item_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/item-art")); const rune_list_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/rune-list")); const rune_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/rune-art")); const summoner_spell_list_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/summoner-spell-list")); const profile_icon_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/profile-icon-art")); const profile_icon_list_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/profile-icon-list")); const minimap_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/minimap-art")); const sprite_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/sprite-art")); const scoreboard_icon_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/scoreboard-icon-art")); const champion_passive_art_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/champion-passive-art")); const dragon_tail_1 = __importDefault(require("./galeforce/actions/lol/data-dragon/dragon-tail")); const swagger_1 = __importDefault(require("./galeforce/actions/game-client/swagger")); const open_api_1 = __importDefault(require("./galeforce/actions/game-client/open-api")); const all_game_data_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/all-game-data")); const active_player_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/active-player")); const active_player_name_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/active-player-name")); const active_player_abilities_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/active-player-abilities")); const active_player_runes_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/active-player-runes")); const player_list_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/player-list")); const player_scores_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/player-scores")); const player_summoner_spells_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/player-summoner-spells")); const player_runes_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/player-runes")); const player_items_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/player-items")); const events_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/events")); const game_stats_1 = __importDefault(require("./galeforce/actions/game-client/live-client-data/game-stats")); const DTO = __importStar(require("./galeforce/interfaces/dto")); const bottleneck_1 = __importDefault(require("./galeforce/rate-limiters/bottleneck")); const null_1 = __importDefault(require("./galeforce/rate-limiters/null")); const core_bundle_1 = __importDefault(require("./galeforce/actions/lor/data-dragon/core-bundle")); const set_bundle_full_1 = __importDefault(require("./galeforce/actions/lor/data-dragon/set-bundle-full")); const set_bundle_lite_1 = __importDefault(require("./galeforce/actions/lor/data-dragon/set-bundle-lite")); const core_globals_1 = __importDefault(require("./galeforce/actions/lor/data-dragon/core-globals")); const set_data_1 = __importDefault(require("./galeforce/actions/lor/data-dragon/set-data")); const core_region_icons_1 = __importDefault(require("./galeforce/actions/lor/data-dragon/core-region-icons")); const set_card_art_1 = __importDefault(require("./galeforce/actions/lor/data-dragon/set-card-art")); const player_data_1 = __importDefault(require("./galeforce/actions/lol/challenges/player-data")); const leaderboard_3 = __importDefault(require("./galeforce/actions/lol/challenges/leaderboard")); const config_1 = __importDefault(require("./galeforce/actions/lol/challenges/config")); const config_list_1 = __importDefault(require("./galeforce/actions/lol/challenges/config-list")); const percentiles_1 = __importDefault(require("./galeforce/actions/lol/challenges/percentiles")); const percentiles_list_1 = __importDefault(require("./galeforce/actions/lol/challenges/percentiles-list")); const Region = { lol: riot_api_1.LeagueRegion, val: riot_api_1.ValorantRegion, riot: riot_api_1.RiotRegion, ddragon: riot_api_1.DataDragonRegion, lor: riot_api_1.LorRegion, }; const Queue = { lol: riot_api_1.LeagueQueue, val: riot_api_1.ValorantQueue, }; class Galeforce { /** * Initializes the Galeforce module with a provided configuration object. * The configuration object is verified using a JSON schema generated from the * {@link ConfigInterface} interface. * @param options A JSON configuration object or a path to a valid YAML file. * @throws Will throw an Error if provided an invalid configuration file or object. */ constructor(options = {}) { /** * Object containing actions corresponding to the `/lol` set of endpoints. */ this.lol = { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/summoner/v4/summoners/by-account/{encryptedAccountId}` * - (**GET**) `/lol/summoner/v4/summoners/by-name/{summonerName}` * - (**GET**) `/lol/summoner/v4/summoners/by-puuid/{encryptedPUUID}` * - (**GET**) `/lol/summoner/v4/summoners/{encryptedSummonerId}` */ summoner: () => new summoner_1.default(this.submodules), /** * Object containing actions corresponding to the `/lol/champion-mastery` set of endpoints. */ mastery: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/champion-mastery/v4/champion-masteries/by-summoner/{encryptedSummonerId}` */ list: () => new by_summoner_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/champion-mastery/v4/champion-masteries/by-summoner/{encryptedSummonerId}/by-champion/{championId}` */ champion: () => new by_champion_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/champion-mastery/v4/scores/by-summoner/{encryptedSummonerId}` */ score: () => new score_1.default(this.submodules), }, /** * Object containing actions corresponding to the `/lol/league` set of endpoints. */ league: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/league/v4/entries/by-summoner/{encryptedSummonerId}` * - (**GET**) `/lol/league/v4/entries/{queue}/{tier}/{division}` */ entries: () => new entries_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/league/v4/challengerleagues/by-queue/{queue}` * - (**GET**) `/lol/league/v4/grandmasterleagues/by-queue/{queue}` * - (**GET**) `/lol/league/v4/masterleagues/by-queue/{queue}` * - (**GET**) `/lol/league/v4/entries/by-summoner/{encryptedSummonerId}` */ league: () => new leagues_1.default(this.submodules), }, /** * Object containing actions corresponding to the `/lol/challenges` set of endpoint. */ challenges: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/challenges/v1/challenges/{challengeId}/config` */ config: () => new config_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/challenges/v1/challenges/config` */ configList: () => new config_list_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/challenges/v1/challenges/{challengeId}/percentiles` */ percentiles: () => new percentiles_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/challenges/v1/challenges/percentiles` */ percentilesList: () => new percentiles_list_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/challenges/v1/player-data/{puuid}` */ player: () => new player_data_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/challenges/v1/challenges/{challengeId}/leaderboards/by-level/{level}` */ leaderboard: () => new leaderboard_3.default(this.submodules), }, /** * Object containing actions corresponding to the `/lol/match` set of endpoints. */ match: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/match/v5/matches/{matchId}` */ match: () => new match_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/match/v5/matches/{matchId}/timeline` */ timeline: () => new timeline_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/match/v5/matches/by-puuid/{puuid}/ids` */ list: () => new matchlist_1.default(this.submodules), }, /** * Object containing actions corresponding to the `/lol/platform` set of endpoints. * This includes the **CHAMPION-V3** API section. */ platform: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/platform/v3/champion-rotations` */ championRotations: () => new champion_1.default(this.submodules), }, /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/status/v4/platform-data` */ status: () => new lol_status_1.default(this.submodules), /** * Object containing actions corresponding to the `/lol/clash` set of endpoints. */ clash: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/clash/v1/players/by-summoner/{summonerId}` */ players: () => new players_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/clash/v1/teams/{teamId}` */ team: () => new teams_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/clash/v1/tournaments/by-team/{teamId}` * - (**GET**) `/lol/clash/v1/tournaments/{tournamentId}` */ tournament: () => new tournaments_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/clash/v1/tournaments` */ upcoming: () => new upcoming_tournaments_1.default(this.submodules), }, /** * Object containing actions corresponding to the `/lol/spectator` set of endpoints. */ spectator: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/spectator/v4/active-games/by-summoner/{encryptedSummonerId}` */ active: () => new active_games_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/spectator/v4/featured-games` */ featured: () => new featured_games_1.default(this.submodules), }, /** * Object containing actions corresponding to the `/lol/tournament` set of endpoints. * Note that these endpoints require a tournament-approved **production** key to use. * Please visit [here](https://developer.riotgames.com) for more information. */ tournament: { /** * Object containing actions corresponding to the `/lol/tournament/v4/codes` set of endpoints. */ code: { /** * Action constructor corresponding to the following endpoints: * - (**POST**) `/lol/tournament/v4/codes` * - (**POST**) `/lol/tournament-stub/v4/codes` * * Tournament stub endpoints can be accessed by passing in `true`. */ create: (stub = false) => new create_codes_1.default(this.submodules, stub), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/tournament/v4/codes/{tournamentCode}` */ get: () => new get_tournament_by_code_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**PUT**) `/lol/tournament/v4/codes/{tournamentCode}` */ update: () => new update_tournament_1.default(this.submodules), }, /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lol/tournament/v4/lobby-events/by-code/{tournamentCode}` * - (**GET**) `/lol/tournament-stub/v4/lobby-events/by-code/{tournamentCode}` * * Tournament stub endpoints can be accessed by passing in `true`. */ event: (stub = false) => new lobby_events_1.default(this.submodules, stub), /** * Action constructor corresponding to the following endpoints: * - (**POST**) `/lol/tournament/v4/providers` * - (**POST**) `/lol/tournament-stub/v4/providers` * * Tournament stub endpoints can be accessed by passing in `true`. */ provider: (stub = false) => new providers_1.default(this.submodules, stub), /** * Action constructor corresponding to the following endpoints: * - (**POST**) `/lol/tournament/v4/tournaments` * - (**POST**) `/lol/tournament-stub/v4/tournaments` * * Tournament stub endpoints can be accessed by passing in `true`. */ tournament: (stub = false) => new tournaments_2.default(this.submodules, stub), }, /** * Object containing actions corresponding to League of Legends Data Dragon endpoints. See the official Data * Dragon documentation [here](https://developer.riotgames.com/docs/lol#data-dragon). */ ddragon: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/dragontail-{version}.tgz` * * Returns a compressed tarball (.tgz) file containing all Data Dragon assets * for a given patch. Note that Data Dragon is updated manually after each patch, * so it may not always be updated immediately after a new patch is released to * the live servers. * * Swaps to a *.zip* file automatically when fetching data for patch 10.10.5. * * Returns data as a `Buffer` object. */ tail: () => new dragon_tail_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/api/versions.json` * * Returns a JSON file (an array) containing all valid Data Dragon versions. * Most patches will only have one associated build, but occasionally * multiple builds are necessary due to errors. As a result, use the latest * version for a given patch whenever possible. */ versions: () => new versions_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/realms/{region}.json` * * Returns the latest Data Dragon version for a given region (realm). Note that * Data Dragon versions are *not* always equivalent to the League of Legends * client version within a given region. */ realm: () => new regions_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/languages.json` * * Returns a list of languages supported by Data Dragon. See the official documentation * for more information. */ languages: () => new languages_1.default(this.submodules), /** * Action constructor corresponding to a generic Data Dragon asset. * - (**GET**) `/cdn${assetPath}` * * Returns the target file as a Buffer object. */ asset: () => new asset_1.default(this.submodules), champion: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/data/{locale}/champion.json` * * Returns a list of champions along with a brief summary for each champion. * See the official API documentation for more information about interpreting spell text. */ list: () => new champion_list_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/data/{locale}/champion/{champion}.json` * * Returns detailed information and additional data about a single champion. * See the official API documentation for more information about interpreting spell text. */ details: () => new champion_2.default(this.submodules), art: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/img/champion/splash/{champion}_{skin}.jpg` * * Returns the splash art assets for a given champion and skin. The number corresponding * to each skin can be found under the `num` field in the skins section of each champion's * detailed Data Dragon file. `0` is always the default splash art. * * Returns data as a `Buffer` object containing JPG data. */ splash: () => new splash_art_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/img/champion/loading/{champion}_{skin}.jpg` * * Returns the loading art image for a given champion and skin. The number corresponding * to each skin can be found under the `num` field in the skins section of each champion's * detailed Data Dragon file. `0` is always the default splash art. * * Returns data as a `Buffer` object containing JPG data. */ loading: () => new loading_art_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/img/champion/tiles/{champion}_{skin}.jpg` * * Returns the tile art image for a given champion and skin. The number corresponding * to each skin can be found under the `num` field in the skins section of each champion's * detailed Data Dragon file. `0` is always the default splash art. * * Returns data as a `Buffer` object containing JPG data. */ tile: () => new tile_art_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/img/champion/{champion}.png` * * Returns the icon (square) art asset for a given champion. * * Returns data as a `Buffer` object containing PNG data. */ icon: () => new champion_square_art_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/img/passive/{spell}.png` * * Returns the icon art asset for a passive ability. The filename for each champion's passive can be * found in the `passive` field's `image` data (as the `full` field) within an individual champion's Data Dragon file. * * Returns data as a `Buffer` object containing PNG data. */ passive: () => new champion_passive_art_1.default(this.submodules), }, }, spell: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/img/spell/{spell}.png` * * Returns the art asset for a non-passive ability. The filename corresponding to a given ability can be * found in the `full` entry of the image data within the `spells` field of an individual champion's Data Dragon file. * * Returns data as a `Buffer` object containing PNG data. */ art: () => new spell_art_1.default(this.submodules), }, item: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/data/{locale}/item.json` * * Returns detailed information about all items in League of Legends, including purchase value, sell value, * build path, stats, and descriptions. See the official Data Dragon API documentation for more information. * */ list: () => new item_list_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/img/item/{assetId}.png` * * Returns the art asset for an item by item ID. A list of item IDs can be found in the item data file. * * Returns data as a `Buffer` object containing PNG data. */ art: () => new item_art_1.default(this.submodules), }, rune: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/data/{locale}/runesReforged.json` * * Returns detailed information about all runes in League of Legends, including short and long descriptions * of each rune. See the official Data Dragon API documentation for more information. * */ list: () => new rune_list_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/img/perk-images${assetPath}` * * Returns art for Runes Reforged given a specified asset path. * * Stat runes are found under the `/StatMods` folder, while rune tree icons, rune icons (including keystones), * and the runes logo are found under the `/Styles` folder. * */ art: () => new rune_art_1.default(this.submodules), }, summonerSpell: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/data/{locale}/summoner.json` * * Returns a list of summoner spells. Art assets for each summoner spell can be retrieved using the * `galeforce.ddragon.spell.art` method. */ list: () => new summoner_spell_list_1.default(this.submodules), }, profileIcon: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/data/{locale}/profileicon.json` * * Returns a list of summoner icons/profile icons. */ list: () => new profile_icon_list_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/img/profileicon/{assetId}.png` * * Returns the art asset for a profile icon by ID. * * Returns data as a `Buffer` object containing PNG data. */ art: () => new profile_icon_art_1.default(this.submodules), }, minimap: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/img/map/{assetId}.png` * * Returns the art asset for the minimap corresponding to a given map ID. Map IDs can be found * under *Game Constants > Map Names* in the official Riot API documentation. * * Returns data as a `Buffer` object containing PNG data. */ art: () => new minimap_art_1.default(this.submodules), }, sprite: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/{version}/img/sprite/{assetId}.png` * * Returns the sprite art assets for a given asset ID. * * Returns data as a `Buffer` object containing PNG data. */ art: () => new sprite_art_1.default(this.submodules), }, /** * Object containing actions that retrieve legacy scoreboard art (from patch **5.5.1** and earlier). */ scoreboard: { /** * Object containing actions that retrieve legacy scoreboard art (from patch **5.5.1** and earlier). */ art: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/5.5.1/img/ui/champion.png` * * Returns data as a `Buffer` object. */ champion: () => new scoreboard_icon_art_1.default(this.submodules, 'champion'), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/5.5.1/img/ui/items.png` * * Returns data as a `Buffer` object. */ items: () => new scoreboard_icon_art_1.default(this.submodules, 'items'), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/5.5.1/img/ui/minion.png` * * Returns data as a `Buffer` object. */ minion: () => new scoreboard_icon_art_1.default(this.submodules, 'minion'), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/5.5.1/img/ui/score.png` * * Returns data as a `Buffer` object. */ score: () => new scoreboard_icon_art_1.default(this.submodules, 'score'), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/cdn/5.5.1/img/ui/spells.png` * * Returns data as a `Buffer` object. */ spells: () => new scoreboard_icon_art_1.default(this.submodules, 'spells'), }, }, }, }; /** * Object containing actions corresponding to the `/riot` set of endpoints. */ this.riot = { /** * Object containing actions corresponding to the `/riot/account` set of endpoints. */ account: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/riot/account/v1/accounts/by-puuid/{puuid}` * - (**GET**) `/riot/account/v1/accounts/by-riot-id/{gameName}/{tagLine}` */ account: () => new account_1.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/riot/account/v1/active-shards/by-game/{game}/by-puuid/{puuid}` */ activeShard: () => new active_shard_1.default(this.submodules), }, }; /** * Object containing actions corresponding to the `/lor` set of endpoints. */ this.lor = { /** * Object containing actions corresponding to the `/lor/match` set of endpoints. */ match: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lor/match/v1/matches/{matchId}` */ match: () => new match_2.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lor/match/v1/matches/by-puuid/{puuid}/ids` */ list: () => new matchlist_2.default(this.submodules), }, ranked: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lor/ranked/v1/leaderboards` */ leaderboard: () => new leaderboard_1.default(this.submodules), }, /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lor/status/v1/platform-data` */ status: () => new lor_status_1.default(this.submodules), /** * Object containing actions corresponding to Legends of Runeterra Data Dragon endpoints. See the official Data * Dragon documentation [here](https://developer.riotgames.com/docs/lor#data-dragon). */ ddragon: { /** * Object containing actions corresponding to the "core bundles," which contain data shared across all sets. */ core: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/{version}/core-{locale}.zip` * * Returns a .zip file containing all Data Dragon core assets for a given version. * * Returns data as a `Buffer` object. */ bundle: () => new core_bundle_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/${version}/core/${locale}/data/globals-${locale}.json` * * Returns the set of values shared across cards of all sets, including keywords, rarities, * regions/factions, spell speeds, and card types. */ globals: () => new core_globals_1.default(this.submodules), art: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/${version}/core/${locale}/img/region/icon-${lorRegion}.png` * * Returns the art asset for a region's icon in Legends of Runeterra. * * Returns data as a `Buffer` object containing PNG data. */ regionIcon: () => new core_region_icons_1.default(this.submodules), }, }, /** * Object containing actions that retrieve data corresponding to individual released sets. */ set: { /** * Object containing actions that return Data Dragon assets for a given set as a Buffer containing `.zip` data. */ bundle: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/${version}/set${lorSet}-${locale}.zip` * * Returns a .zip file containing the *full* Data Dragon assets for a given set, including all * card art, alternative art, and full-size illustrations for each card. * * Returns data as a `Buffer` object. */ full: () => new set_bundle_full_1.default(this.submodules), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/${version}/set${lorSet}-${locale}.zip` * * Returns a .zip file containing the *lite* Data Dragon assets for a given set, which includes * only the card art and alternative art (without the full-size illustrations). * * Returns data as a `Buffer` object. */ lite: () => new set_bundle_lite_1.default(this.submodules), }, /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/${version}/set${lorSet}/${locale}/data/set${lorSet}-${locale}.json` * * Returns data related to cards in the provided set, including assets, associated cards, in-game properties * (attack, health, cost, etc.), description, flavor text, name, code, keywords, rarity, type, and subtype. */ data: () => new set_data_1.default(this.submodules), /** * Object containing actions that return Data Dragon assets for a given Legends of Runeterra card, on a set-by-set basis. */ card: { /** * Object containing actions that return Data Dragon *art* assets for a given Legends of Runeterra card. */ art: { /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/${version}/set${lorSet}/${locale}/img/cards/${card}.png` * * Returns the in-game art asset for a card in Legends of Runeterra. * * Returns data as a `Buffer` object containing PNG data. */ game: () => new set_card_art_1.default(this.submodules, 'card'), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/${version}/set${lorSet}/${locale}/img/cards/${card}-full.png` * * Returns the in-game *full* art asset for a card in Legends of Runeterra. * * Returns data as a `Buffer` object containing PNG data. */ full: () => new set_card_art_1.default(this.submodules, 'full'), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/${version}/set${lorSet}/${locale}/img/cards/${card}-alt.png` * * Returns the in-game *alternative* art asset for a card in Legends of Runeterra. * * Returns data as a `Buffer` object containing PNG data. */ alt: () => new set_card_art_1.default(this.submodules, 'alt'), /** * Action constructor corresponding to the following Data Dragon files: * - (**GET**) `/${version}/set${lorSet}/${locale}/img/cards/${card}-alt-full.png` * * Returns the in-game *alternative full* art asset for a card in Legends of Runeterra. * * Returns data as a `Buffer` object containing PNG data. */ altFull: () => new set_card_art_1.default(this.submodules, 'alt-full'), }, }, }, }, }; /** * Object containing actions corresponding to the `/tft` set of endpoints. */ this.tft = { /** * Object containing actions corresponding to the `/tft/league` set of endpoints. */ league: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/tft/league/v1/entries/by-summoner/{encryptedSummonerId}` * - (**GET**) `/tft/league/v1/entries/{tier}/{division}` */ entries: () => new entries_2.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/tft/league/v1/challenger` * - (**GET**) `/tft/league/v1/grandmaster` * - (**GET**) `/tft/league/v1/master` * - (**GET**) `/tft/league/v1/leagues/{leagueId} ` */ league: () => new leagues_2.default(this.submodules), }, /** * Object containing actions corresponding to the `/tft/match` set of endpoints. */ match: { /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lor/ranked/v1/leaderboards` */ match: () => new match_3.default(this.submodules), /** * Action constructor corresponding to the following endpoints: * - (**GET**) `/lor/ranked/v1/l