UNPKG

fantasy-api-client

Version:

API client to easily interact with various fantasy sports APIs including ESPN, Yahoo, and Sleeper

50 lines (49 loc) 2.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var functions = require("./functions"); var Sleeper = /** @class */ (function () { function Sleeper(options) { var _this = this; this.getDrafts = function (leagueId) { if (leagueId === void 0) { leagueId = _this.options.leagueId; } return functions.getDrafts(leagueId); }; this.getDraftPicks = function (draftId) { if (draftId === void 0) { draftId = _this.options.draftId; } return functions.getDraftPicks(draftId); }; this.getNFLState = function () { return functions.getNFLState(); }; this.getLeague = function (leagueId) { if (leagueId === void 0) { leagueId = _this.options.leagueId; } return functions.getLeague(leagueId); }; this.getMatchupsByWeek = function (leagueId, week) { if (leagueId === void 0) { leagueId = _this.options.leagueId; } return functions.getMatchupsByWeek(leagueId, week); }; this.getWinnersBracket = function (leagueId) { if (leagueId === void 0) { leagueId = _this.options.leagueId; } return functions.getWinnersBracket(leagueId); }; this.getLoserBracket = function (leagueId) { if (leagueId === void 0) { leagueId = _this.options.leagueId; } return functions.getLosersBracket(leagueId); }; this.getUsers = function (leagueId) { if (leagueId === void 0) { leagueId = _this.options.leagueId; } return functions.getUsers(leagueId); }; this.getPlayers = function () { return functions.getPlayers(); }; this.getRosters = function (leagueId) { if (leagueId === void 0) { leagueId = _this.options.leagueId; } return functions.getRosters(leagueId); }; this.getTransactionsByWeek = function (leagueId, week) { if (leagueId === void 0) { leagueId = _this.options.leagueId; } return functions.getTransactionsByWeek(leagueId, week); }; this.options = options; } return Sleeper; }()); exports.default = Sleeper;