Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yahoo-fantasy

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yahoo-fantasy - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

2

jasmine-runner.js
var Jasmine = require('jasmine');
var SpecReporter = require('jasmine-spec-reporter');
var { SpecReporter } = require('jasmine-spec-reporter');
var noop = function () {};

@@ -4,0 +4,0 @@

{
"name": "yahoo-fantasy",
"version": "3.0.2",
"description":
"An API to help facilitate the use of the Yahoo! Fantasy Sports API in NodeJS projects.",
"version": "3.0.3",
"description": "An API to help facilitate the use of the Yahoo! Fantasy Sports API in NodeJS projects.",
"main": "index.js",
"scripts": {
"test": "node -r @std/esm jasmine-runner.js",
"test": "node -r esm jasmine-runner.js",
"istanbul": "istanbul cover --include-all-sources jasmine-node tests"

@@ -15,3 +14,8 @@ },

},
"keywords": ["yahoo", "fantasy sports", "sports", "fantasy"],
"keywords": [
"yahoo",
"fantasy sports",
"sports",
"fantasy"
],
"author": "Luke DeWitt <dewittl@gmail.com> (http://www.whatadewitt.ca/)",

@@ -25,3 +29,3 @@ "license": "MIT",

"esm": "^3.0.14",
"request": "^2.78.0"
"request": "^2.87.0"
},

@@ -32,3 +36,3 @@ "devDependencies": {

"jasmine-spec-reporter": "^4.2.1",
"nock": "^3.3.2",
"nock": "^9.3.0",
"q": "^1.4.1"

@@ -35,0 +39,0 @@ },

@@ -56,122 +56,128 @@ # Yahoo! Fantasy API Node Module

#### 3.0.3
- Added the ability to specify a date or week when querying the `team.stats` resource.
- Unit test fixes ([Issue #42](https://github.com/whatadewitt/yfsapi/issues/42)). Thanks [Marios](https://github.com/ryus08)!
- Updated "vulnerable" dependencies.
#### 3.0.2
* Fixed an issue with the `user.game_leagues` resource, where the data was not at all user friendly (renamed `leagues` to `games` at the top level of the return object)
- Fixed an issue with the `user.game_leagues` resource, where the data was not at all user friendly (renamed `leagues` to `games` at the top level of the return object)
#### 3.0.1
* Fixed some typos in some import statements which caused issues on some servers
- Fixed some typos in some import statements which caused issues on some servers
#### 3.0.0
* Major refactor to use ES6?... 2015? ...2018? Whatever the hell they're calling it now...
* Using ES Modules (mjs) files where possible
* Removed transactions collections (they'll be back!)
- Major refactor to use ES6?... 2015? ...2018? Whatever the hell they're calling it now...
- Using ES Modules (mjs) files where possible
- Removed transactions collections (they'll be back!)
#### 2.0.4
* Added a fix to give a cleaner value for the new "batting order" attribute in the player oject.
- Added a fix to give a cleaner value for the new "batting order" attribute in the player oject.
#### 2.0.3
* Fixed a bug where the league players collection was not properly parsing the ownership subresource
- Fixed a bug where the league players collection was not properly parsing the ownership subresource
#### 2.0.2
* Fixed a bug where "mapTeamPoints" helper function was not defining "self". Thanks [platky](https://github.com/platky)!
- Fixed a bug where "mapTeamPoints" helper function was not defining "self". Thanks [platky](https://github.com/platky)!
#### 2.0.1
* Removed the code that added a "reason" to errors coming from Yahoo! as it was breaking other errors. Retry notifications should now be handled within the application using the module.
- Removed the code that added a "reason" to errors coming from Yahoo! as it was breaking other errors. Retry notifications should now be handled within the application using the module.
#### 2.0.0
* Moved to Yahoo!'s OAuth2.0 authentication mechanism.
- Moved to Yahoo!'s OAuth2.0 authentication mechanism.
#### 1.0.2
* Fixed game resource roster postions callback bug.
- Fixed game resource roster postions callback bug.
#### 1.0.1
* Fixed a typo that was breaking team mapping.
- Fixed a typo that was breaking team mapping.
#### 1.0.0
* Breaking changes
* Fixed NFL scoreboard/matchups bug ([Issue #19](https://github.com/whatadewitt/yfsapi/issues/19))
* In fixing this bug I realized that my "team" set up was really only useful for MLB fantasy, so I rewrote team mapping to work better across all sports and give additional details that weren't previously reported. This will cause errors if you are using the team.manager attribute in your code.
- Breaking changes
- Fixed NFL scoreboard/matchups bug ([Issue #19](https://github.com/whatadewitt/yfsapi/issues/19))
- In fixing this bug I realized that my "team" set up was really only useful for MLB fantasy, so I rewrote team mapping to work better across all sports and give additional details that weren't previously reported. This will cause errors if you are using the team.manager attribute in your code.
#### 0.5.3
* Fixed a bug where leagueFetch was throwing an error, thanks [danielspector](https://github.com/danielspector)!
- Fixed a bug where leagueFetch was throwing an error, thanks [danielspector](https://github.com/danielspector)!
#### 0.5.2
* Fixed a bug where player stats by week url was not being created properly, thanks [withsmilo](https://github.com/withsmilo)!
- Fixed a bug where player stats by week url was not being created properly, thanks [withsmilo](https://github.com/withsmilo)!
#### 0.5.1
* Fixed a bug where collections that contained subresources would return no data.
- Fixed a bug where collections that contained subresources would return no data.
#### 0.5.0
* Added "Transactions" collection with functionality to add players, drop players, and add/drop players, thanks again [githubsmilo](https://github.com/githubsmilo)!
- Added "Transactions" collection with functionality to add players, drop players, and add/drop players, thanks again [githubsmilo](https://github.com/githubsmilo)!
#### 0.4.4
* Fixed a bug in player.draft_analysis, thanks [githubsmilo](https://github.com/githubsmilo)!
- Fixed a bug in player.draft_analysis, thanks [githubsmilo](https://github.com/githubsmilo)!
#### 0.4.3
* Added weeks param for league.scoreboard
* Added weeks param for team.matchups
* Fixed a bug where individual players weren't mapping properly
* Minor code cleanup
- Added weeks param for league.scoreboard
- Added weeks param for team.matchups
- Fixed a bug where individual players weren't mapping properly
- Minor code cleanup
#### 0.4.2
* Added the ability to specify a date or week when querying the roster resource.
* Cleaned up the player normalization model
* Fixed a bug where the team.roster call was erroring
- Added the ability to specify a date or week when querying the roster resource.
- Cleaned up the player normalization model
- Fixed a bug where the team.roster call was erroring
#### 0.4.1
* Fixes to how POST data is handled
- Fixes to how POST data is handled
#### 0.4.0
* Significantly restructured the code to have more consistency and set it up better for future plans, namely POST methods and proper unit testing
* Removed the "refresh user token" and instead return the error to the user who can handle the refresh within their application.
- Significantly restructured the code to have more consistency and set it up better for future plans, namely POST methods and proper unit testing
- Removed the "refresh user token" and instead return the error to the user who can handle the refresh within their application.
#### 0.3.1
* Additional player attributes added, thanks [ryus08](https://github.com/ryus08)!
- Additional player attributes added, thanks [ryus08](https://github.com/ryus08)!
#### 0.3.0
* Added a method to refresh the user's token if it has expired.
- Added a method to refresh the user's token if it has expired.
#### 0.2.2
* Hotfix to fix "Teams" collection - use error first convention
- Hotfix to fix "Teams" collection - use error first convention
#### 0.2.0
* Made helper classes more consistent
* Added collections for games, leagues, players, and teams
* Moved to error first convention because JavaScript
- Made helper classes more consistent
- Added collections for games, leagues, players, and teams
- Moved to error first convention because JavaScript
#### 0.1.2
* Added 'Team Matchups' subresource
* Added 'League Scoreboard' subresource
* Minor code cleanup and improvements
- Added 'Team Matchups' subresource
- Added 'League Scoreboard' subresource
- Minor code cleanup and improvements
#### 0.1.1
* Refactored module to fix a bug where user sessions were not necessarily unique because of require caching.
- Refactored module to fix a bug where user sessions were not necessarily unique because of require caching.
#### 0.1
* Initial release.
- Initial release.

@@ -76,3 +76,3 @@ import YahooFantasy from "../YahooFantasy.mjs";

it("should build a proper url to retrieve league data for a single league using a numeric game key", function() {
game.leagues(328, "328.l.34014", null);
game.leagues(328, "328.l.34014", () => {});

@@ -87,3 +87,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve league data for a single league using a string game key", function() {
game.leagues("mlb", "mlb.l.34014", null);
game.leagues("mlb", "mlb.l.34014", () => {});

@@ -98,3 +98,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve league data for a single league using a numeric game key and league as an array", function() {
game.leagues(328, ["328.l.34014"], null);
game.leagues(328, ["328.l.34014"], () => {});

@@ -109,3 +109,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve league data for a single league using a string game key and league as an array", function() {
game.leagues("mlb", ["mlb.l.34014"], null);
game.leagues("mlb", ["mlb.l.34014"], () => {});

@@ -120,3 +120,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve league data for a multiple leagues using a numeric game key", function() {
game.leagues(328, ["328.l.34014", "328.l.24281"], null);
game.leagues(328, ["328.l.34014", "328.l.24281"], () => {});

@@ -131,3 +131,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve league data for a multiple leagues using a string game key", function() {
game.leagues("mlb", ["mlb.l.34014", "mlb.l.24281"], null);
game.leagues("mlb", ["mlb.l.34014", "mlb.l.24281"], () => {});

@@ -144,3 +144,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve player data for a single player using a numeric game key", function() {
game.players(328, "328.p.6619", null);
game.players(328, "328.p.6619", () => {});

@@ -155,3 +155,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve player data for a single player using a string game key", function() {
game.players("mlb", "mlb.p.6619", null);
game.players("mlb", "mlb.p.6619", () => {});

@@ -166,3 +166,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve player data for a single player using a numeric game key and player as an array", function() {
game.players(328, ["328.p.6619"], null);
game.players(328, ["328.p.6619"], () => {});

@@ -177,3 +177,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve player data for a single player using a string game key and player as an array", function() {
game.players("mlb", ["mlb.p.6619"], null);
game.players("mlb", ["mlb.p.6619"], () => {});

@@ -188,3 +188,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve player data for a multiple players using a numeric game key", function() {
game.players(328, ["328.p.6619", "328.p.8172"], null);
game.players(328, ["328.p.6619", "328.p.8172"], () => {});

@@ -199,3 +199,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve player data for a multiple players using a string game key", function() {
game.players("mlb", ["mlb.p.6619", "mlb.p.8172"], null);
game.players("mlb", ["mlb.p.6619", "mlb.p.8172"], () => {});

@@ -211,3 +211,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve game weeks using a numeric game key", function() {
game.game_weeks(328, null);
game.game_weeks(328, () => {});

@@ -222,3 +222,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve game weeks using a string game key", function() {
game.game_weeks("nfl", null);
game.game_weeks("nfl", () => {});

@@ -234,3 +234,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve stat categories using a numeric game key", function() {
game.stat_categories(328, null);
game.stat_categories(328, () => {});

@@ -245,3 +245,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve stat categories using a string game key", function() {
game.stat_categories("nfl", null);
game.stat_categories("nfl", () => {});

@@ -257,3 +257,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve position types using a numeric game key", function() {
game.position_types(328, null);
game.position_types(328, () => {});

@@ -268,3 +268,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve position types using a string game key", function() {
game.position_types("nfl", null);
game.position_types("nfl", () => {});

@@ -280,3 +280,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve roster positions using a numeric game key", function() {
game.roster_positions(328, null);
game.roster_positions(328, () => {});

@@ -291,3 +291,3 @@ expect(yf.api).toHaveBeenCalledWith(

it("should build a proper url to retrieve roster positions using a string game key", function() {
game.roster_positions("nfl", null);
game.roster_positions("nfl", () => {});

@@ -294,0 +294,0 @@ expect(yf.api).toHaveBeenCalledWith(

@@ -36,3 +36,3 @@ import YahooFantasy from "../YahooFantasy.mjs";

games.fetch(328, null);
games.fetch(328, () => {});

@@ -39,0 +39,0 @@ // expect(yf.api)

@@ -54,5 +54,5 @@ import YahooFantasy from "../YahooFantasy.mjs";

.get("/fantasy/v2/league/328.l.34014/metadata?format=json")
.reply(200, {});
.reply(200, require("./nock-data/leagueMeta").meta);
league.meta("328.l.34014", null);
league.meta("328.l.34014", () => {});

@@ -70,5 +70,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/league/328.l.34014/settings?format=json")
.reply(200, {});
.reply(200, require("./nock-data/leagueSettings"));
league.settings("328.l.34014", null);
league.settings("328.l.34014", () => {});

@@ -86,5 +86,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/league/328.l.34014/standings?format=json")
.reply(200, {});
.reply(200, require("./nock-data/leagueStandings"));
league.standings("328.l.34014", null);
league.standings("328.l.34014", () => {});

@@ -102,5 +102,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/league/328.l.34014/scoreboard?format=json")
.reply(200, {});
.reply(200, require("./nock-data/leagueScoreboard"));
league.scoreboard("328.l.34014", null);
league.scoreboard("328.l.34014", () => {});

@@ -118,5 +118,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/league/328.l.34014/teams?format=json")
.reply(200, {});
.reply(200, require("./nock-data/leagueTeams"));
league.teams("328.l.34014", null);
league.teams("328.l.34014", () => {});

@@ -130,16 +130,16 @@ expect(yf.api).toHaveBeenCalledWith(

// players
it("should build a proper url to retrieve players via a league key", function() {
nock("https://fantasysports.yahooapis.com")
.get("/fantasy/v2/league/328.l.34014/players?format=json")
.reply(200, {});
// // players
// it("should build a proper url to retrieve players via a league key", function() {
// nock("https://fantasysports.yahooapis.com")
// .get("/fantasy/v2/league/328.l.34014/players?format=json")
// .reply(200, {});
league.players("328.l.34014", null);
// league.players("328.l.34014", () => {});
expect(yf.api).toHaveBeenCalledWith(
"GET",
"https://fantasysports.yahooapis.com/fantasy/v2/league/328.l.34014/players?format=json",
jasmine.any(Function)
);
});
// expect(yf.api).toHaveBeenCalledWith(
// "GET",
// "https://fantasysports.yahooapis.com/fantasy/v2/league/328.l.34014/players?format=json",
// jasmine.any(Function)
// );
// });

@@ -150,5 +150,5 @@ // draft_results

.get("/fantasy/v2/league/328.l.34014/draft_results?format=json")
.reply(200, {});
.reply(200, require("./nock-data/leagueDraftResults"));
league.draft_results("328.l.34014", null);
league.draft_results("328.l.34014", () => {});

@@ -166,5 +166,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/league/328.l.34014/transactions?format=json")
.reply(200, {});
.reply(200, require("./nock-data/leagueTransaction"));
league.transactions("328.l.34014", null);
league.transactions("328.l.34014", () => {});

@@ -171,0 +171,0 @@ expect(yf.api).toHaveBeenCalledWith(

@@ -46,5 +46,5 @@ var YahooFantasy = require("../index.js");

.get("/fantasy/v2/player/328.p.6619/metadata?format=json")
.reply(200, {});
.reply(200, require("./nock-data/playerMeta"));
player.meta("328.p.6619", null);
player.meta("328.p.6619", () => {});

@@ -62,5 +62,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/player/328.p.6619/stats?format=json")
.reply(200, {});
.reply(200, require("./nock-data/playerStats"));
player.stats("328.p.6619", null);
player.stats("328.p.6619", () => {});

@@ -78,5 +78,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/player/328.p.6619/percent_owned?format=json")
.reply(200, {});
.reply(200, require("./nock-data/playerPercentOwned"));
player.percent_owned("328.p.6619", null);
player.percent_owned("328.p.6619", () => {});

@@ -96,5 +96,5 @@ expect(yf.api).toHaveBeenCalledWith(

)
.reply(200, {});
.reply(200, require("./nock-data/playerOwnershipOwned"));
player.ownership("328.p.6619", "328.l.34014", null);
player.ownership("328.p.6619", "328.l.34014", () => {});

@@ -114,5 +114,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/player/328.p.6619/teams?format=json")
.reply(200, {});
.reply(200, require("./nock-data/playerDraftAnalysis"));
player.draft_analysis("328.p.6619", null);
player.draft_analysis("328.p.6619", () => {});

@@ -119,0 +119,0 @@ expect(yf.api).toHaveBeenCalledWith(

@@ -28,3 +28,3 @@ var YahooFantasy = require("../index.js");

roster.players("328.l.34014.t.1", null);
roster.players("328.l.34014.t.1", () => {});

@@ -31,0 +31,0 @@ expect(yf.api).toHaveBeenCalledWith(

@@ -46,5 +46,5 @@ var YahooFantasy = require("../index.js");

.get("/fantasy/v2/team/328.l.34014.t.1/metadata?format=json")
.reply(200, {});
.reply(200, require("./nock-data/teamMeta"));
team.meta("328.l.34014.t.1", null);
team.meta("328.l.34014.t.1", () => {});

@@ -62,5 +62,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/team/328.l.34014.t.1/stats?format=json")
.reply(200, {});
.reply(200, require("./nock-data/teamStats"));
team.stats("328.l.34014.t.1", null);
team.stats("328.l.34014.t.1", () => {});

@@ -78,5 +78,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/team/328.l.34014.t.1/standings?format=json")
.reply(200, {});
.reply(200, require("./nock-data/teamStandings"));
team.standings("328.l.34014.t.1", null);
team.standings("328.l.34014.t.1", () => {});

@@ -94,5 +94,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/team/328.l.34014.t.1/roster?format=json")
.reply(200, {});
.reply(200, require("./nock-data/teamRoster"));
team.roster("328.l.34014.t.1");
team.roster("328.l.34014.t.1", () => {});

@@ -110,5 +110,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/team/328.l.34014.t.1/draftresults?format=json")
.reply(200, {});
.reply(200, require("./nock-data/teamDraftResults"));
team.draft_results("328.l.34014.t.1", null);
team.draft_results("328.l.34014.t.1", () => {});

@@ -126,5 +126,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/team/328.l.34014.t.1/matchups?format=json")
.reply(200, {});
.reply(200, require("./nock-data/teamMatchups"));
team.matchups("328.l.34014.t.1", null);
team.matchups("328.l.34014.t.1", () => {});

@@ -131,0 +131,0 @@ expect(yf.api).toHaveBeenCalledWith(

@@ -30,5 +30,5 @@ var YahooFantasy = require("../index.js");

.get("/fantasy/v2/transaction/328.l.34014.tr.237/players?format=json")
.reply(200, {});
.reply(200, require("./nock-data/transactionMeta"));
transaction.meta("328.l.34014.tr.237", null);
transaction.meta("328.l.34014.tr.237", () => {});

@@ -46,5 +46,5 @@ expect(yf.api).toHaveBeenCalledWith(

.get("/fantasy/v2/transaction/328.l.34014.tr.237/players?format=json")
.reply(200, {});
.reply(200, require("./nock-data/transactionPlayers"));
transaction.players("328.l.34014.tr.237", null);
transaction.players("328.l.34014.tr.237", () => {});

@@ -51,0 +51,0 @@ expect(yf.api).toHaveBeenCalledWith(

@@ -34,5 +34,5 @@ var YahooFantasy = require("../index.js");

.get("/fantasy/v2/users;use_login=1/games?format=json")
.reply(200, {});
.reply(200, require("./nock-data/userGames"));
user.games(null);
user.games(() => {});

@@ -52,5 +52,5 @@ expect(yf.api).toHaveBeenCalledWith(

)
.reply(200, {});
.reply(200, require("./nock-data/userLeagues"));
user.game_leagues("328", null);
user.game_leagues("328", () => {});

@@ -69,5 +69,5 @@ expect(yf.api).toHaveBeenCalledWith(

)
.reply(200, {});
.reply(200, require("./nock-data/userLeagues"));
user.game_leagues(["328", "242"], null);
user.game_leagues(["328", "242"], () => {});

@@ -87,5 +87,5 @@ expect(yf.api).toHaveBeenCalledWith(

)
.reply(200, {});
.reply(200, require("./nock-data/userTeams"));
user.game_teams("328", null);
user.game_teams("328", () => {});

@@ -104,5 +104,5 @@ expect(yf.api).toHaveBeenCalledWith(

)
.reply(200, {});
.reply(200, require("./nock-data/userTeams"));
user.game_teams(["328", "242"], null);
user.game_teams(["328", "242"], () => {});

@@ -109,0 +109,0 @@ expect(yf.api).toHaveBeenCalledWith(

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc