-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added /skyblock/calendar and /skyblock/events endpoints #683
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d5f923f
added /skyblock/calendar and /skyblock/events endpoints
camnwalter ef07028
added from and to parameters
camnwalter 9a47c45
remove duplicate events
camnwalter f0f2876
added special timestamps support
camnwalter 0187740
whoops
camnwalter 96ba899
updated graphql to support custom date strings
camnwalter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ const buildCounts = require('../store/buildCounts'); | |
const { queryAuctionId } = require('../store/queryAuctions'); | ||
const { getGuildFromPlayer, getGuildFromName, getGuildFromID } = require('../store/buildGuild'); | ||
const { buildProfileList, buildProfile } = require('../store/buildSkyBlockProfiles'); | ||
const { buildSkyblockCalendar, buildSkyblockEvents } = require('../store/buildSkyblockCalendar'); | ||
const { playerObject } = require('./objects'); | ||
const { populatePlayers, getPlayer, PlayerError } = require('../store/buildPlayer'); | ||
const { getMetadata } = require('../store/queries'); | ||
|
@@ -22,7 +23,8 @@ const { | |
playerNameParam, gameNameParam, typeParam, columnParam, filterParam, sortByParam, | ||
limitParam, significantParam, populatePlayersParam, templateParam, itemIdParam, bazaarItemIdParam, | ||
fromParam, toParam, auctionUUIDParam, itemUUIDParam, activeParam, pageParam, sortOrderParam, | ||
profileIdParam, guildNameParam, guildIDParam, | ||
profileIdParam, guildNameParam, guildIDParam, calendarEventsParam, calendarFromParam, calendarToParam, | ||
calendarYearsParam, calendarStopAtYearEndParam, | ||
} = require('./parameters'); | ||
const packageJson = require('../package.json'); | ||
|
||
|
@@ -2285,6 +2287,171 @@ Consider supporting The Slothpixel Project on Patreon to help cover the hosting | |
}, | ||
}, | ||
}, | ||
'/skyblock/events': { | ||
get: { | ||
summary: 'SkyBlock event spec', | ||
description: 'Returns SkyBlock events', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be good to mention here that these are used in the calendar endpoint |
||
operationId: 'getSkyblockEvents', | ||
tags: [ | ||
'skyblock', | ||
], | ||
responses: { | ||
200: { | ||
description: 'successful operation', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
EVENT_ENUM: { | ||
description: 'The cleaner name of the event. Use key for the events parameter in /calendar/events endpoint', | ||
type: 'string', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
route: () => '/skyblock/events', | ||
func: (_, response) => { | ||
return response.json(buildSkyblockEvents()); | ||
}, | ||
}, | ||
}, | ||
'/skyblock/calendar': { | ||
get: { | ||
summary: 'Get Skyblock calendar information', | ||
description: 'Returns information about the SkyBlock calendar', | ||
operationId: 'getSkyblockCalendar', | ||
tags: [ | ||
'skyblock', | ||
], | ||
parameters: [ | ||
calendarEventsParam, calendarFromParam, calendarToParam, calendarYearsParam, calendarStopAtYearEndParam, | ||
], | ||
responses: { | ||
200: { | ||
description: 'successful operation', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
type: 'object', | ||
properties: { | ||
from: { | ||
description: 'The timestamp of the \'from\' parameter', | ||
type: 'integer', | ||
}, | ||
to: { | ||
description: 'The timestamp of the \'to\' parameter', | ||
type: 'integer', | ||
}, | ||
date: { | ||
description: 'The date based on \'from\' parameter, e.g Early Winter 14th', | ||
type: 'string', | ||
}, | ||
day: { | ||
description: 'The current day based on \'from\' parameter', | ||
type: 'integer', | ||
}, | ||
month: { | ||
description: 'The current month based on \'from\' parameter', | ||
type: 'string', | ||
}, | ||
year: { | ||
description: 'The current year based on \'from\' parameter', | ||
type: 'integer', | ||
}, | ||
time: { | ||
description: 'The current time based on \'from\' parameter', | ||
type: 'string', | ||
}, | ||
minute: { | ||
description: 'The current minute based on \'from\' parameter', | ||
type: 'integer', | ||
}, | ||
hour: { | ||
description: 'The current hour based on \'from\' parameter', | ||
type: 'integer', | ||
}, | ||
next_day_countdown: { | ||
description: 'The time until the next day based on \'from\' parameter', | ||
type: 'integer', | ||
}, | ||
next_month_countdown: { | ||
description: 'The time until the next month based on \'from\' parameter', | ||
type: 'integer', | ||
}, | ||
next_year_countdown: { | ||
description: 'The time until the next year based on \'from\' parameter', | ||
type: 'integer', | ||
}, | ||
events: { | ||
type: 'object', | ||
properties: { | ||
EVENT_ENUM: { | ||
type: 'object', | ||
properties: { | ||
name: { | ||
description: 'The cleaner name of the event', | ||
type: 'string', | ||
}, | ||
duration: { | ||
description: 'The time the event is active', | ||
type: 'integer', | ||
}, | ||
events: { | ||
type: 'array', | ||
items: { | ||
type: 'object', | ||
properties: { | ||
start_timestamp: { | ||
description: 'The starting timestamp of the event', | ||
type: 'integer', | ||
}, | ||
end_timestamp: { | ||
description: 'The ending timestamp of the event', | ||
type: 'integer', | ||
}, | ||
starting_in: { | ||
description: 'The time until the event starts', | ||
type: 'integer', | ||
}, | ||
ending_in: { | ||
description: 'The time until the event ends', | ||
type: 'integer', | ||
}, | ||
pet: { | ||
description: 'The type of pet if the event is a Traveling Zoo', | ||
type: 'string', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
route: () => '/skyblock/calendar', | ||
func: (request, response) => { | ||
const { | ||
events, from, to, years, stopatyearend, | ||
} = request.query; | ||
try { | ||
const result = buildSkyblockCalendar(events, from, to, years, stopatyearend); | ||
response.json(result); | ||
} catch (error) { | ||
response.status(400).json({ error: error.message }); | ||
} | ||
}, | ||
}, | ||
}, | ||
'/leaderboards': { | ||
get: { | ||
summary: 'Allows query of dynamic leaderboards', | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from
andto
should be typed string to allow the custom syntax