pusher-http-haskell 1.5.1.11 → 1.5.1.12
raw patch · 6 files changed
+61/−57 lines, 6 filesdep ~aesondep ~basedep ~timePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, base, time
API changes (from Hackage documentation)
Files
- pusher-http-haskell.cabal +6/−6
- src/Network/Pusher/Data.hs +3/−0
- src/Network/Pusher/Internal.hs +4/−0
- src/Network/Pusher/Internal/Auth.hs +2/−0
- src/Network/Pusher/Internal/HTTP.hs +2/−0
- test/Push.hs +44/−51
pusher-http-haskell.cabal view
@@ -1,5 +1,5 @@ name: pusher-http-haskell-version: 1.5.1.11+version: 1.5.1.12 cabal-version: 1.18 build-type: Simple license: MIT@@ -22,7 +22,7 @@ library if impl(ghc >=8.0.0)- ghc-options: -Wcompat -Whi-shadowing -Wmissing-signatures+ ghc-options: -Wcompat -Wmissing-signatures else ghc-options: -fwarn-hi-shadowing -fwarn-missing-signatures -fwarn-tabs exposed-modules:@@ -32,8 +32,8 @@ Network.Pusher.Internal.HTTP Network.Pusher.Protocol build-depends:- aeson >=0.8 && <1.5,- base >=4.7 && <4.14,+ aeson >=0.8 && <1.6,+ base >=4.7 && <4.15, bytestring ==0.10.*, base16-bytestring ==0.1.*, cryptonite >= 0.6 && <0.27,@@ -42,7 +42,7 @@ http-types >=0.8 && <0.13, memory >= 0.7 && <0.16, text ==1.2.*,- time >=1.5 && <1.10,+ time >=1.5 && <1.11, transformers >=0.4 && <0.6, unordered-containers ==0.2.*, vector >=0.10 && <0.13@@ -59,7 +59,7 @@ test-suite tests if impl(ghc >=8.0.0)- ghc-options: -Wcompat -Whi-shadowing -Wmissing-signatures+ ghc-options: -Wcompat -Wmissing-signatures else ghc-options: -fwarn-hi-shadowing -fwarn-missing-signatures -fwarn-tabs type: exitcode-stdio-1.0
src/Network/Pusher/Data.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-|@@ -59,7 +60,9 @@ import qualified Data.HashSet as HS import Data.Hashable (Hashable) import Data.Maybe (fromMaybe)+#if !(MIN_VERSION_base(4,11,0)) import Data.Monoid ((<>))+#endif import qualified Data.Text as T import Data.Text.Encoding (encodeUtf8) import qualified Data.Vector as V
src/Network/Pusher/Internal.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ {-| Module : Network.Pusher.Internal Description : Pure functions called by the public interface@@ -19,7 +21,9 @@ import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL import Data.Maybe (maybeToList)+#if !(MIN_VERSION_base(4,11,0)) import Data.Monoid ((<>))+#endif import qualified Data.Text as T import Data.Text.Encoding (encodeUtf8)
src/Network/Pusher/Internal/Auth.hs view
@@ -24,7 +24,9 @@ import qualified Data.Aeson as A import Data.Char (toLower)+#if !(MIN_VERSION_base(4,11,0)) import Data.Monoid ((<>))+#endif import Data.Text.Encoding (encodeUtf8) import GHC.Exts (sortWith) #if MIN_VERSION_aeson(1,0,0)
src/Network/Pusher/Internal/HTTP.hs view
@@ -29,7 +29,9 @@ import qualified Data.Aeson as A import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL+#if !(MIN_VERSION_base(4,11,0)) import Data.Monoid ((<>))+#endif import qualified Data.Text as T import Data.Text.Encoding (decodeUtf8') import qualified Network.HTTP.Client as HTTP.Client
test/Push.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ module Push where import Data.Aeson ((.=))@@ -6,7 +8,9 @@ import qualified Data.ByteString.Lazy.Char8 as B import qualified Data.HashMap.Strict as HM import Data.Maybe (fromJust)+#if !(MIN_VERSION_base(4,11,0)) import Data.Monoid ((<>))+#endif import Data.Scientific import qualified Data.Text as T import qualified Data.Vector as V@@ -62,15 +66,17 @@ validFCMDecoding :: (B.ByteString, Notification) validFCMDecoding = let bs =- "{\- \ \"interests\": [\"interestOne\"]\- \ ,\"fcm\": {\- \ \"notification\":\- \ {\"title\":\"titleText\"\- \ ,\"body\":\"bodyText\"\- \ }\- \ }\- \}"+ B.unlines+ [ "{"+ , " \"interests\": [\"interestOne\"],"+ , " \"fcm\": {"+ , " \"notification\": {"+ , " \"title\": \"titleText\","+ , " \"body\": \"bodyText\""+ , " }"+ , " }"+ , "}"+ ] notification = Notification { notificationInterest = fromJust . mkInterest $ "interestOne"@@ -122,22 +128,17 @@ let apns = APNSPayload payload bs :: ByteString bs =- "{\- \ \"aps\":\- \ {\- \ \"alert\":\- \ {\"title\":\"" <>- (B.pack . T.unpack $ titleText) <>- "\"\- \ ,\"body\":\"" <>- (B.pack . T.unpack $ bodyText) <>- "\"\- \ }\- \ }\- \ ,\"data\":" <>- (A.encode dataJSON) <>- "\- \}"+ B.unlines+ [ "{"+ , " \"aps\": {"+ , " \"alert\": {"+ , " \"title\": \"" <> (B.pack . T.unpack $ titleText) <> "\","+ , " \"body\": \"" <> (B.pack . T.unpack $ bodyText) <> "\""+ , " }"+ , " },"+ , " \"data\": " <> (A.encode dataJSON)+ , "}"+ ] return $ APNSDecoding (bs, Just apns) instance Arbitrary GCMDecoding where@@ -153,19 +154,15 @@ gcm = GCMPayload payload bs :: ByteString bs =- "{\- \ \"notification\":\- \ {\"title\":\"" <>- (B.pack . T.unpack $ titleText) <>- "\"\- \ ,\"body\":\"" <>- (B.pack . T.unpack $ bodyText) <>- "\"\- \ }\- \ ,\"data\":" <>- (A.encode dataJSON) <>- "\- \}"+ B.unlines+ [ "{"+ , " \"notification\": {"+ , " \"title\": \"" <> (B.pack . T.unpack $ titleText) <> "\","+ , " \"body\": \"" <> (B.pack . T.unpack $ bodyText) <> "\""+ , " },"+ , " \"data\": " <> (A.encode dataJSON)+ , "}"+ ] return $ GCMDecoding (bs, Just gcm) instance Arbitrary FCMDecoding where@@ -181,19 +178,15 @@ gcm = FCMPayload payload bs :: ByteString bs =- "{\- \ \"notification\":\- \ {\"title\":\"" <>- (B.pack . T.unpack $ titleText) <>- "\"\- \ ,\"body\":\"" <>- (B.pack . T.unpack $ bodyText) <>- "\"\- \ }\- \ ,\"data\":" <>- (A.encode dataJSON) <>- "\- \}"+ B.unlines+ [ "{"+ , " \"notification\": {"+ , " \"title\": \"" <> (B.pack . T.unpack $ titleText) <> "\","+ , " \"body\": \"" <> (B.pack . T.unpack $ bodyText) <> "\""+ , " },"+ , " \"data\": " <> (A.encode dataJSON)+ , "}"+ ] return $ FCMDecoding (bs, Just gcm) instance Arbitrary NotificationDecoding where