UNPKG

cfbd

Version:

This API is in limited Beta for Patreon subscribers. It may have bugs and is subject to changes. API keys can be acquired from the CollegeFootballData.com website.

483 lines (482 loc) 22.9 kB
"use strict"; // This file is auto-generated by @hey-api/openapi-ts var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWeather = exports.getMedia = exports.getGamePlayerStats = exports.getGameTeamStats = exports.getGames = exports.getUserInfo = exports.getLines = exports.getLivePlays = exports.getFieldGoalExpectedPoints = exports.getPregameWinProbabilities = exports.getWinProbability = exports.getPredictedPointsAddedByPlayerSeason = exports.getPredictedPointsAddedByPlayerGame = exports.getPredictedPointsAddedByGame = exports.getPredictedPointsAddedByTeam = exports.getPredictedPoints = exports.getTransferPortal = exports.getReturningProduction = exports.getPlayerUsage = exports.searchPlayers = exports.getPlayStatTypes = exports.getPlayStats = exports.getPlayTypes = exports.getPlays = exports.getRankings = exports.getFpi = exports.getElo = exports.getSrs = exports.getConferenceSp = exports.getSp = exports.getAggregatedTeamRecruitingRatings = exports.getTeamRecruitingRankings = exports.getRecruits = exports.getAdvancedGameStats = exports.getAdvancedSeasonStats = exports.getCategories = exports.getTeamStats = exports.getPlayerSeasonStats = exports.getVenues = exports.getTalent = exports.getConferences = exports.getRoster = exports.getMatchup = exports.getFbsTeams = exports.getTeams = exports.getKickerPaar = exports.getAdjustedPlayerRushingStats = exports.getAdjustedPlayerPassingStats = exports.getAdjustedTeamSeasonStats = exports.client = void 0; exports.getAdvancedBoxScore = exports.getCoaches = exports.getDraftPicks = exports.getDraftPositions = exports.getDraftTeams = exports.getDrives = exports.getScoreboard = exports.getCalendar = exports.getRecords = void 0; var client_fetch_1 = require("@hey-api/client-fetch"); exports.client = (0, client_fetch_1.createClient)((0, client_fetch_1.createConfig)({ baseUrl: 'https://api.collegefootballdata.com' })); /** * Retrieve opponent-adjusted team season statistics */ var getAdjustedTeamSeasonStats = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/wepa/team/season' })); }; exports.getAdjustedTeamSeasonStats = getAdjustedTeamSeasonStats; /** * Retrieve opponent-adjusted player passing statistics */ var getAdjustedPlayerPassingStats = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/wepa/players/passing' })); }; exports.getAdjustedPlayerPassingStats = getAdjustedPlayerPassingStats; /** * Retrieve opponent-adjusted player rushing statistics */ var getAdjustedPlayerRushingStats = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/wepa/players/rushing' })); }; exports.getAdjustedPlayerRushingStats = getAdjustedPlayerRushingStats; /** * Retrieve Points Added Above Replacement (PAAR) ratings for kickers */ var getKickerPaar = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/wepa/players/kicking' })); }; exports.getKickerPaar = getKickerPaar; /** * Retrieves team information */ var getTeams = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/teams' })); }; exports.getTeams = getTeams; /** * Retrieves information on teams playing in the highest division of CFB */ var getFbsTeams = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/teams/fbs' })); }; exports.getFbsTeams = getFbsTeams; /** * Retrieves historical matchup details for two given teams */ var getMatchup = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/teams/matchup' })); }; exports.getMatchup = getMatchup; /** * Retrieves historical roster data */ var getRoster = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/roster' })); }; exports.getRoster = getRoster; /** * Retrieves list of conferences */ var getConferences = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/conferences' })); }; exports.getConferences = getConferences; /** * Retrieve 247 Team Talent Composite for a given year */ var getTalent = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/talent' })); }; exports.getTalent = getTalent; /** * Retrieve list of venues */ var getVenues = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/venues' })); }; exports.getVenues = getVenues; /** * Retrieves aggregated player statistics for a given season */ var getPlayerSeasonStats = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/stats/player/season' })); }; exports.getPlayerSeasonStats = getPlayerSeasonStats; /** * Retrieves aggregated team season statistics */ var getTeamStats = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/stats/season' })); }; exports.getTeamStats = getTeamStats; /** * Gets team statistical categories */ var getCategories = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/stats/categories' })); }; exports.getCategories = getCategories; /** * Retrieves advanced season statistics for teams */ var getAdvancedSeasonStats = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/stats/season/advanced' })); }; exports.getAdvancedSeasonStats = getAdvancedSeasonStats; /** * Retrieves advanced statistics aggregated by game */ var getAdvancedGameStats = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/stats/game/advanced' })); }; exports.getAdvancedGameStats = getAdvancedGameStats; /** * Retrieves player recruiting rankings */ var getRecruits = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/recruiting/players' })); }; exports.getRecruits = getRecruits; /** * Retrieves team recruiting rankings */ var getTeamRecruitingRankings = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/recruiting/teams' })); }; exports.getTeamRecruitingRankings = getTeamRecruitingRankings; /** * Retrieves aggregated recruiting statistics by team and position grouping */ var getAggregatedTeamRecruitingRatings = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/recruiting/groups' })); }; exports.getAggregatedTeamRecruitingRatings = getAggregatedTeamRecruitingRatings; /** * Retrieves SP+ ratings for a given year or school */ var getSp = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/ratings/sp' })); }; exports.getSp = getSp; /** * Retrieves aggregated historical conference SP+ data */ var getConferenceSp = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/ratings/sp/conferences' })); }; exports.getConferenceSp = getConferenceSp; /** * Retrieves historical SRS for a year or team */ var getSrs = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/ratings/srs' })); }; exports.getSrs = getSrs; /** * Retrieves historical Elo ratings */ var getElo = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/ratings/elo' })); }; exports.getElo = getElo; /** * Retrieves historical Football Power Index (FPI) ratings */ var getFpi = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/ratings/fpi' })); }; exports.getFpi = getFpi; /** * Retrieves historical poll data */ var getRankings = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/rankings' })); }; exports.getRankings = getRankings; /** * Retrieves historical play data */ var getPlays = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/plays' })); }; exports.getPlays = getPlays; /** * Retrieves available play types */ var getPlayTypes = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/plays/types' })); }; exports.getPlayTypes = getPlayTypes; /** * Retrieve player-play associations (limit 2000) */ var getPlayStats = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/plays/stats' })); }; exports.getPlayStats = getPlayStats; /** * Retrieves available play stat types */ var getPlayStatTypes = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/plays/stats/types' })); }; exports.getPlayStatTypes = getPlayStatTypes; /** * Search for players (lists top 100 results) */ var searchPlayers = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/player/search' })); }; exports.searchPlayers = searchPlayers; /** * Retrieves player usage data for a given season */ var getPlayerUsage = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/player/usage' })); }; exports.getPlayerUsage = getPlayerUsage; /** * Retrieves returning production data. Either a year or team filter must be specified. */ var getReturningProduction = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/player/returning' })); }; exports.getReturningProduction = getReturningProduction; /** * Retrieves transfer portal data for a given year */ var getTransferPortal = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/player/portal' })); }; exports.getTransferPortal = getTransferPortal; /** * Query Predicted Points values by down and distance */ var getPredictedPoints = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/ppa/predicted' })); }; exports.getPredictedPoints = getPredictedPoints; /** * Retrieves historical team PPA metrics by season */ var getPredictedPointsAddedByTeam = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/ppa/teams' })); }; exports.getPredictedPointsAddedByTeam = getPredictedPointsAddedByTeam; /** * Retrieves historical team PPA metrics by game */ var getPredictedPointsAddedByGame = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/ppa/games' })); }; exports.getPredictedPointsAddedByGame = getPredictedPointsAddedByGame; /** * Queries player PPA statistics by game */ var getPredictedPointsAddedByPlayerGame = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/ppa/players/games' })); }; exports.getPredictedPointsAddedByPlayerGame = getPredictedPointsAddedByPlayerGame; /** * Queries player PPA statistics by season */ var getPredictedPointsAddedByPlayerSeason = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/ppa/players/season' })); }; exports.getPredictedPointsAddedByPlayerSeason = getPredictedPointsAddedByPlayerSeason; /** * Query play win probabilities by game */ var getWinProbability = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/metrics/wp' })); }; exports.getWinProbability = getWinProbability; /** * Queries pregame win probabilities */ var getPregameWinProbabilities = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/metrics/wp/pregame' })); }; exports.getPregameWinProbabilities = getPregameWinProbabilities; /** * Queries field goal expected points values */ var getFieldGoalExpectedPoints = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/metrics/fg/ep' })); }; exports.getFieldGoalExpectedPoints = getFieldGoalExpectedPoints; /** * Queries live play-by-play data and advanced stats */ var getLivePlays = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/live/plays' })); }; exports.getLivePlays = getLivePlays; /** * Retrieves historical betting data */ var getLines = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/lines' })); }; exports.getLines = getLines; /** * Retrieves information about the user, including their Patreon level and remaining API calls. */ var getUserInfo = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/info' })); }; exports.getUserInfo = getUserInfo; /** * Retrieves historical game data */ var getGames = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/games' })); }; exports.getGames = getGames; /** * Retrieves team box score statistics */ var getGameTeamStats = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/games/teams' })); }; exports.getGameTeamStats = getGameTeamStats; /** * Retrieves player box score statistics */ var getGamePlayerStats = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/games/players' })); }; exports.getGamePlayerStats = getGamePlayerStats; /** * Retrieves media information for games */ var getMedia = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/games/media' })); }; exports.getMedia = getMedia; /** * Retrieve historical and future weather data (Patreon only) */ var getWeather = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/games/weather' })); }; exports.getWeather = getWeather; /** * Retrieves historical team records */ var getRecords = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/records' })); }; exports.getRecords = getRecords; /** * Retrieves calendar information */ var getCalendar = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/calendar' })); }; exports.getCalendar = getCalendar; /** * Retrieves live scoreboard data */ var getScoreboard = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/scoreboard' })); }; exports.getScoreboard = getScoreboard; /** * Retrieves historical drive data */ var getDrives = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/drives' })); }; exports.getDrives = getDrives; /** * Retrieves list of NFL teams */ var getDraftTeams = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/draft/teams' })); }; exports.getDraftTeams = getDraftTeams; /** * Retrieves list of player position categories for the NFL Draft */ var getDraftPositions = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/draft/positions' })); }; exports.getDraftPositions = getDraftPositions; /** * Retrieve historical NFL draft data */ var getDraftPicks = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/draft/picks' })); }; exports.getDraftPicks = getDraftPicks; /** * Retrieves historical head coach information and records */ var getCoaches = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/coaches' })); }; exports.getCoaches = getCoaches; /** * Retrieves an advanced box score for a game */ var getAdvancedBoxScore = function (options) { var _a; return ((_a = options === null || options === void 0 ? void 0 : options.client) !== null && _a !== void 0 ? _a : exports.client).get(__assign(__assign({}, options), { url: '/game/box/advanced' })); }; exports.getAdvancedBoxScore = getAdvancedBoxScore;