-
-
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
Conversation
Thank you for contributing! Looks pretty good overall - perhaps it would be good to support the |
should I just scrap the |
You could just ignore |
might need to remove the stopatyearend parameter. seems to be causing some issues edit: nvm some of the events were duplicating. fixed now. |
query must have either 'to' or 'years' parameter
routes/spec.js
Outdated
const result = buildSkyblockCalendar(events, from, to, years, stopatyearend); | ||
response.json(result); | ||
} catch (error) { | ||
response.status(500).json({ error: error.message }); |
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.
This should use status code 400 for user input errors
store/buildSkyblockCalendar.js
Outdated
}; | ||
|
||
function buildSkyblockCalendar(events = '', from = Date.now(), to, years, stopAtYearEnd = false) { | ||
if (Number.isNaN(Number(to)) && Number.isNaN(Number(years))) { |
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.
-
The
from
andto
parameter should use the custom format (i.e. callparseTimestamp()
) described here https://github.com/slothpixel/core/wiki/Using-custom-date-parameters -
Also querying only the
to
parameter causes an error -
After calling the timestamp parse for
from
parameter, it would be good to cap it atyearZero
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.
For some reason, the to
parameter currently works for me but I'll change it to match it as you said.
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.
for the from
parameter, do you want it to error out if its below or just set it to yearZero
if its below?
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.
I think just setting to yearZero
is fine
store/buildSkyblockCalendar.js
Outdated
? timeToSkyblockYear(to) - currentYear | ||
: years; | ||
|
||
if (toToYears <= 0) throw new Error('Years must be positive'); |
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.
We should probably add an upper bound to this as well
- fixed stopatyearend parameter finally - added some more errors - added from to be at least yearZero and years to maximum of 10
routes/spec.graphql
Outdated
""" | ||
The starting timestamp from which to get events. Uses a unix timestamp. | ||
""" | ||
from: Float |
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
and to
should be typed string to allow the custom syntax
routes/spec.js
Outdated
'/skyblock/events': { | ||
get: { | ||
summary: 'SkyBlock event spec', | ||
description: 'Returns SkyBlock events', |
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.
It would be good to mention here that these are used in the calendar endpoint
* added /skyblock/calendar and /skyblock/events endpoints * added from and to parameters query must have either 'to' or 'years' parameter * remove duplicate events * added special timestamps support - fixed stopatyearend parameter finally - added some more errors - added from to be at least yearZero and years to maximum of 10 * whoops fixed an error location & updated the spec * updated graphql to support custom date strings
…hpixel#683)" This reverts commit c84b08d.
* Revert "Fixed lint" This reverts commit d76d997. * Revert "Updated hypixelconstants" This reverts commit 681e2c4. * Revert "Update arcade games processor (slothpixel#713)" This reverts commit 3630094. * Revert "updated hypixelconstants" This reverts commit f323027. * Revert "skip linter on build" This reverts commit a7965a8. * Revert "removed legacy stuff (slothpixel#705)" This reverts commit a965cf3. * Revert "whitelist items route" This reverts commit d7a9abd. * Revert "fix skyblock/profiles endpoint returning empty object when uncached on graphql (slothpixel#703)" This reverts commit 4a33a62. * Revert "Fix graphql not working with the guilds endpoint (slothpixel#702)" This reverts commit d5aa338. * Revert "Fix graphql not working with the guilds endpoint (slothpixel#701)" This reverts commit 031a596. * Revert "bump node to 16" This reverts commit f734801. * Revert "[experimental] disable sentry" This reverts commit 3d2a3f4. * Revert "Fix rank sort function (slothpixel#699)" This reverts commit 8749c9e. * Revert "audit fix" This reverts commit 2330924. * Revert "Bump @sentry/node from 6.2.0 to 6.12.0 (slothpixel#698)" This reverts commit 4ba4c22. * Revert "update hypixelconstants" This reverts commit 51faccd. * Revert "Fix tag_formatted rendering when tag is null (slothpixel#696)" This reverts commit 37634f8. * Revert "Guild rewrite, fixes slothpixel#690" This reverts commit 63faa45. * Revert "fix lint" This reverts commit da5b6fe. * Revert "Improvements to the guild and player endpoints (slothpixel#691)" This reverts commit 122f272. * Revert "Added new profile endpoint to graphql" This reverts commit cddd130. * Revert "Fixed ESLint workflow" This reverts commit 87d818b. * Revert "stopatyearend param quick fix (slothpixel#688)" This reverts commit 6e4e1e3. * Revert "Added ranked and mega stats (slothpixel#687)" This reverts commit ba2ff84. * Revert "Added /skyblock/calendar and /skyblock/events endpoints (slothpixel#683)" This reverts commit c84b08d. * Revert "Added more murder mystery stats (slothpixel#685)" This reverts commit b10fdf0. * Revert "Added guild achievement stats (slothpixel#682)" This reverts commit bd5fc22. * Revert "fix lint" This reverts commit 704a05d. * Revert "fix lint" This reverts commit 5d5b792. * Revert "Fixed errors and added missing stats (slothpixel#681)" This reverts commit f858c23. * Revert "fix: monthlyPackageRank having priority over rank (slothpixel#680)" This reverts commit 8a0b0f2. * Revert "Updated SkyWars stats (slothpixel#679)" This reverts commit 63aae75. * Revert "Added k_d, w_l, final_k_d and bed_ratio to bedwars gamemodes (slothpixel#678)" This reverts commit 966824a. * Revert "Change updateQueue to a Set" This reverts commit 7e52927. * Revert "create fixItems" This reverts commit cd31c31. * Revert "remove itemlist update call" This reverts commit ff4c653. * Revert "Added updateQueue to items" This reverts commit 47416b5. * Revert "Fixed 4v4 stats (slothpixel#677)" This reverts commit 22ad0ea. * Revert "Create eslint.yml" This reverts commit 9e17ea0. * Revert "Fixed Clean name for updated hypixel constants (slothpixel#675)" This reverts commit a0a167c. * Revert "Added 4v4 stats for bedwars (slothpixel#673)" This reverts commit 28d88e8. * Revert "Support more gamemodes in the /status endpoint (slothpixel#668)" This reverts commit 94b2862. * Revert "Add correct bedwars games played (slothpixel#662)" This reverts commit 8a673dc. * Revert "Fix minutely rate limit" This reverts commit 7fb3ed3. * Revert "Updated skyblock item filter (slothpixel#658)" This reverts commit 9d72754. * Revert "Changes to filter for processSkyblock (slothpixel#657)" This reverts commit 287fdd0. * Revert "processSkyblock filter change (slothpixel#656)" This reverts commit d1b9686. * Revert "Dep updates" This reverts commit 7a36539. * Revert "Add 2v2v2v2 and 3v3v3v3 to Bridge stats to Duels (slothpixel#647)" This reverts commit bc7da5e. * Revert "Update tiered achievement data (slothpixel#644)" This reverts commit 96bf035. * Revert "Don't require MVP+ for MVP++" This reverts commit 0179d30. * Revert "Update docs with new parser data (slothpixel#637)" This reverts commit 5eb7190. * Revert "sb-parser 0.2.8" This reverts commit 9a5cc9a. * Revert "audit fix" This reverts commit 9d3f665. * Revert "Reworked skyblock profile processing" This reverts commit c9772a3. * Revert "unbreak changes from express-graphql v.0.10.0" This reverts commit bacbae3. * Revert "Bump graphql from 14.6.0 to 15.5.0" This reverts commit 02cb259. * Revert "Bump ioredis from 4.19.4 to 4.27.2" This reverts commit 5b089cd. * Revert "Fixed profile cache not updating" This reverts commit 154268b. * Revert "bump hypixelconstants" This reverts commit 0c291e1. * Revert "fix linting errors" This reverts commit c56e86a. * Revert "change TNT Tag key: TNTAG to TNTTAG" This reverts commit ef81163. * Revert "add my uuid" This reverts commit f19fe51. * Revert "added naming to party games and tnt tag" This reverts commit 2afbce6. * Revert "update hypixelconstants" This reverts commit d120443. * Revert "Add the new slayer tier to docs" This reverts commit 1108fb5. * Revert "sb-parser 0.2.6" This reverts commit 70cebc3. * Revert "Bump express-graphql from 0.9.0 to 0.12.0" This reverts commit ae23ccd. * Revert "sb-parser 0.2.5" This reverts commit b4e744a. * Revert "sb-parser 0.2.5" This reverts commit 5174bcc. * Revert "sb-parser 0.2.5" This reverts commit a9a940a. * Revert "minor changes" This reverts commit 186dd3f. * Revert "Update buildSkyBlockProfiles.js" This reverts commit b9e3abf. * Revert "Update buildSkyBlockProfiles.js" This reverts commit bd133ac. * Revert "Update buildSkyBlockProfiles.js" This reverts commit b9588aa. * Revert "Append content" This reverts commit a87e7bc. * Revert "Add profile name to /skyblock/profile/ endpoint" This reverts commit fe35a7c.
a few notes: