UNPKG

@balldontlie/sdk

Version:

Official TypeScript/JavaScript SDK for the balldontlie API

120 lines (119 loc) 4.35 kB
"use strict"; 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.NFLClient = void 0; const client_1 = require("./client"); class NFLClient extends client_1.BaseClient { getTeams(params) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/teams`, { method: "GET", params: this.buildQueryParams(params), }); }); } getTeam(id) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/teams/${id}`); }); } getPlayer(id) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/players/${id}`); }); } getPlayers(params) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/players`, { method: "GET", params: this.buildQueryParams(params), }); }); } getActivePlayers(params) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/players/active`, { method: "GET", params: this.buildQueryParams(params), }); }); } getGames(params) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/games`, { method: "GET", params: this.buildQueryParams(params), }); }); } getGame(id) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/games/${id}`); }); } getStats(params) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/stats`, { method: "GET", params: this.buildQueryParams(params), }); }); } getStandings(params) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/standings`, { method: "GET", params: this.buildQueryParams(params), }); }); } getPlayerInjuries(params) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/player_injuries`, { method: "GET", params: this.buildQueryParams(params), }); }); } getSeasonStats(params) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/season_stats`, { method: "GET", params: this.buildQueryParams(params), }); }); } getAdvancedRushingStats(params) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/advanced_stats/rushing`, { method: "GET", params: this.buildQueryParams(params), }); }); } getAdvancedPassingStats(params) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/advanced_stats/passing`, { method: "GET", params: this.buildQueryParams(params), }); }); } getAdvancedReceivingStats(params) { return __awaiter(this, void 0, void 0, function* () { return this.request(`/nfl/v1/advanced_stats/receiving`, { method: "GET", params: this.buildQueryParams(params), }); }); } } exports.NFLClient = NFLClient;