riotg.api
Version:
<a href="https://www.npmjs.com/package/riotg.api"> <img src="https://img.shields.io/static/v1?label=npm&message=riotg.api&color=red&style=for-the-badge&logo=NPM" /> </a>
40 lines (39 loc) • 1.69 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Summoner = void 0;
const summoner_class_1 = require("./summoner-class");
class Summoner {
constructor({ apiKey, region = "na1" }) {
this.summonerClient = new summoner_class_1.SummonerClient(apiKey, region);
}
getByName(name) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.summonerClient.getByName(name);
});
}
getByAccountId(accountId) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.summonerClient.getByAccountId(accountId);
});
}
getByPUUID(puuid) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.summonerClient.getByPUUID(puuid);
});
}
getById(id) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.summonerClient.getById(id);
});
}
}
exports.Summoner = Summoner;