advent-of-code-api 0.2.8.0 → 0.2.8.1
raw patch · 3 files changed
+24/−7 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +9/−0
- advent-of-code-api.cabal +5/−4
- src/Advent/Types.hs +10/−3
CHANGELOG.md view
@@ -1,6 +1,15 @@ Changelog ========= +Version 0.2.8.1+---------------++*November 30, 2021*++<https://github.com/mstksg/advent-of-code-api/releases/tag/v0.2.8.1>++* Account for new json schema for private leaderboard stats+ Version 0.2.8.0 ---------------
advent-of-code-api.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.2.+-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack ----- hash: 6cf4283a8e57b7716c98e2f2914b0396dc18f396a3ff0bb7f5df28750eefbb92+-- hash: 5c893e7ec84a62712610c23ec46f87df729f7c6f583730b172962c96971c4df6 name: advent-of-code-api-version: 0.2.8.0+version: 0.2.8.1 synopsis: Advent of Code REST API bindings and servant API description: Haskell bindings for Advent of Code REST API and a servant API. Please use responsibly! See README.md or "Advent" module for an introduction and@@ -20,7 +20,8 @@ copyright: (c) Justin Le 2018 license: BSD3 license-file: LICENSE-tested-with: GHC >= 8.0+tested-with:+ GHC >= 8.0 build-type: Simple extra-source-files: README.md
src/Advent/Types.hs view
@@ -287,18 +287,25 @@ <*> optional (o .: "name") <*> o .: "local_score" <*> (strInt =<< (o .: "id"))- <*> optional (fromEpoch =<< (o .: "last_star_ts"))+ <*> optional (+ (fromEpochText =<< (o .: "last_star_ts"))+ <|> (fromEpochNumber <$> (o .: "last_star_ts"))+ ) <*> o .: "stars" <*> (do cdl <- o .: "completion_day_level"- (traverse . traverse) ((fromEpoch =<<) . (.: "get_star_ts")) cdl+ (traverse . traverse) (\c ->+ (fromEpochText =<< (c .: "get_star_ts"))+ <|> (fromEpochNumber <$> (c .: "get_star_ts"))+ ) cdl ) where strInt t = case readMaybe t of Nothing -> fail "bad int" Just i -> pure i- fromEpoch t = case readMaybe t of+ fromEpochText t = case readMaybe t of Nothing -> fail "bad stamp" Just i -> pure . posixSecondsToUTCTime $ fromInteger i+ fromEpochNumber = posixSecondsToUTCTime -- | @since 0.2.4.2 instance ToJSONKey Day where