-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR introduces the following new routes: - [X] `/seasons/challonge` POST call - requires a `tournament_id` and `import_teams`. Tournament ID is defined as per [Challonge's API](https://api.challonge.com/v1/documents/tournaments/show) - [x] `/teams/challonge` POST call - allows a user to import teams from a tournament ID if it was missed on the initial import. This will import _all_ teams again, so be warned. You either want to import them during the season import, or after. Not both. - [x] Additional features in the map and series finalizing calls to auto-update the Challonge bracket. - [X] Update scores in the bracket on each round if a BO1, or update map scores if BO3/5/7 - [X] Update the matches route to include a pagination call for matches. - [X] Close out a season when matches are all played out. There are a few new database table adjustments as well: - [X] Users now have a `challonge_api` field in the table. Individual users can have their own API keys, allowing for multiple users on a single panel to use their own API key. This is stored and encrypted. - [X] Boolean value for telling if a season was imported from Challonge in the season table. - [X] String value that stores the URL of the bracket's SVG, allowing it to be implemented on a front end without having to call Challonge every time. - [X] Teams now have an Int value stored in the table as well to show if it is a team brought in by Challonge or not. Used by challonge calls only, so it shouldn't have to be made public at all. - [x] End a season when the last match is completed. And some minor test adjustments: - [X] Include a global teardown for each Jest test, so we don't have open handles and are able to close the tests successfully without forcing an exit. All these changes are also reflected in the API documentation as well. Please note this is only the API right now, and the front end may come shortly once this has been tested and implemented. Closes #175
- Loading branch information
Showing
25 changed files
with
1,359 additions
and
991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# These are supported funding model platforms | ||
|
||
ko_fi: phlexplexico | ||
patreon: phlexplexico | ||
github: phlexplexico | ||
custom: https://steamcommunity.com/tradeoffer/new/?partner=65378466&token=G3t4Gn5V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Forgive me for this, maybe it's time to rewrite the unit tests. | ||
module.exports = () => { | ||
process.exit(0) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use strict'; | ||
|
||
var dbm; | ||
var type; | ||
var seed; | ||
var async = require('async'); | ||
|
||
/** | ||
* We receive the dbmigrate dependency from dbmigrate initially. | ||
* This enables us to not have to rely on NODE_PATH. | ||
*/ | ||
exports.setup = function(options, seedLink) { | ||
dbm = options.dbmigrate; | ||
type = dbm.dataType; | ||
seed = seedLink; | ||
}; | ||
|
||
exports.up = function(db, callback) { | ||
async.series([ | ||
db.runSql('ALTER TABLE season ADD COLUMN is_challonge boolean AFTER end_date;'), | ||
db.runSql('ALTER TABLE season ADD COLUMN challonge_svg VARCHAR(256) AFTER is_challonge;'), | ||
db.runSql('ALTER TABLE season ADD COLUMN challonge_url VARCHAR(256) AFTER challonge_svg;'), | ||
db.runSql('ALTER TABLE team ADD COLUMN challonge_team_id INT AFTER public_team;'), | ||
db.addColumn('user', 'challonge_api_key', { type: 'string', length: 170, unique: true }), | ||
], callback()); | ||
}; | ||
|
||
exports.down = function(db, callback) { | ||
async.series([ | ||
db.removeColumn('season', 'is_challonge'), | ||
db.removeColumn('season', 'challonge_svg'), | ||
db.removeColumn('season', 'challonge_url'), | ||
db.removeColumn('team', 'challonge_team_id'), | ||
db.removeColumn('user', 'challonge_api_key'), | ||
], callback()); | ||
}; | ||
exports._meta = { | ||
"version": 19 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use strict'; | ||
|
||
var dbm; | ||
var type; | ||
var seed; | ||
var async = require('async'); | ||
|
||
/** | ||
* We receive the dbmigrate dependency from dbmigrate initially. | ||
* This enables us to not have to rely on NODE_PATH. | ||
*/ | ||
exports.setup = function(options, seedLink) { | ||
dbm = options.dbmigrate; | ||
type = dbm.dataType; | ||
seed = seedLink; | ||
}; | ||
|
||
exports.up = function(db, callback) { | ||
async.series([ | ||
db.runSql('ALTER TABLE season ADD COLUMN is_challonge boolean AFTER end_date;'), | ||
db.runSql('ALTER TABLE season ADD COLUMN challonge_svg VARCHAR(256) AFTER is_challonge;'), | ||
db.runSql('ALTER TABLE season ADD COLUMN challonge_url VARCHAR(256) AFTER challonge_svg;'), | ||
db.runSql('ALTER TABLE team ADD COLUMN challonge_team_id INT AFTER public_team;'), | ||
db.addColumn('user', 'challonge_api_key', { type: 'string', length: 170, unique: true }), | ||
], callback()); | ||
}; | ||
|
||
exports.down = function(db, callback) { | ||
async.series([ | ||
db.removeColumn('season', 'is_challonge'), | ||
db.removeColumn('season', 'challonge_svg'), | ||
db.removeColumn('season', 'challonge_url'), | ||
db.removeColumn('team', 'challonge_team_id'), | ||
db.removeColumn('user', 'challonge_api_key'), | ||
], callback()); | ||
}; | ||
exports._meta = { | ||
"version": 19 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use strict'; | ||
|
||
var dbm; | ||
var type; | ||
var seed; | ||
var async = require('async'); | ||
|
||
/** | ||
* We receive the dbmigrate dependency from dbmigrate initially. | ||
* This enables us to not have to rely on NODE_PATH. | ||
*/ | ||
exports.setup = function(options, seedLink) { | ||
dbm = options.dbmigrate; | ||
type = dbm.dataType; | ||
seed = seedLink; | ||
}; | ||
|
||
exports.up = function(db, callback) { | ||
async.series([ | ||
db.runSql('ALTER TABLE season ADD COLUMN is_challonge boolean AFTER end_date;'), | ||
db.runSql('ALTER TABLE season ADD COLUMN challonge_svg VARCHAR(256) AFTER is_challonge;'), | ||
db.runSql('ALTER TABLE season ADD COLUMN challonge_url VARCHAR(256) AFTER challonge_svg;'), | ||
db.runSql('ALTER TABLE team ADD COLUMN challonge_team_id INT AFTER public_team;'), | ||
db.addColumn('user', 'challonge_api_key', { type: 'string', length: 170, unique: true }), | ||
], callback()); | ||
}; | ||
|
||
exports.down = function(db, callback) { | ||
async.series([ | ||
db.removeColumn('season', 'is_challonge'), | ||
db.removeColumn('season', 'challonge_svg'), | ||
db.removeColumn('season', 'challonge_url'), | ||
db.removeColumn('team', 'challonge_team_id'), | ||
db.removeColumn('user', 'challonge_api_key'), | ||
], callback()); | ||
}; | ||
exports._meta = { | ||
"version": 19 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.