UNPKG

zhonya

Version:

A simple and typed League of Legends API wrapper for Node.js

29 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FreeWeekService = void 0; const axios_1 = require("axios"); const ZhonyaError_1 = require("../../errors/ZhonyaError"); class FreeWeekService { constructor(config) { this.config = config; const client = axios_1.default.create({ baseURL: `https://${config.platformRouting}.api.riotgames.com`, headers: { "X-Riot-Token": config.riotApiKey, }, }); this.httpClient = client; } async getFreeWeekChampions() { try { const response = await this.httpClient.get(`/lol/platform/v3/champion-rotations`); const responseData = response.data; return responseData; } catch (error) { throw new ZhonyaError_1.ZhonyaError("Failed to fetch free week champions", error); } } } exports.FreeWeekService = FreeWeekService; //# sourceMappingURL=freeweek.service.js.map