packages feed

hipchat-hs 0.0.3 → 0.0.4

raw patch · 5 files changed

+56/−14 lines, 5 filesdep +postgresql-simpledep ~base

Dependencies added: postgresql-simple

Dependency ranges changed: base

Files

hipchat-hs.cabal view
@@ -1,7 +1,7 @@ name:                hipchat-hs-version:             0.0.3+version:             0.0.4 synopsis:            Hipchat API bindings in Haskell-description:         Hipchat API bindings in Haskell +description:         Hipchat API bindings in Haskell license:             BSD3 license-file:        LICENSE author:              Oswyn Brent <oztastic703@gmail.com>@@ -22,6 +22,7 @@                        HipChat.Types.Common                        HipChat.Types.Dialog                        HipChat.Types.Extensions+                       HipChat.Types.ExternalPage                        HipChat.Types.Glance                        HipChat.Types.Icon                        HipChat.Types.Key@@ -38,8 +39,8 @@                        HipChat.Types.Rooms.GetAllRoomsResponse                        -- Other                        HipChat.Types.RoomAddonUIUpdateRequest-  -- other-extensions:    -  build-depends:       base >= 4.8 && < 4.9+  -- other-extensions:+  build-depends:       base >= 4.8 && < 5                      , aeson >= 0.11                      , aeson-casing                      , async@@ -48,6 +49,7 @@                      , http-client                      , lens                      , network-uri >= 2.6+                     , postgresql-simple                      , servant >= 0.6                      , servant-client >= 0.6                      , split@@ -55,5 +57,5 @@                      , text                      , time   hs-source-dirs:      lib-  ghc-options:         -rtsopts -with-rtsopts=-N -Wall+  ghc-options:         -Wall   default-language:    Haskell2010
lib/HipChat/Types/Auth.hs view
@@ -10,9 +10,11 @@ import           Data.Aeson.Casing import           Data.Aeson.Types import           Data.Monoid-import           Data.Text         (Text)-import qualified Data.Text         as T+import           Data.Text                          (Text)+import qualified Data.Text                          as T import           Data.Time+import           Database.PostgreSQL.Simple.FromRow+import           Database.PostgreSQL.Simple.ToRow import           GHC.Generics  --------------------------------------------------------------------------------@@ -105,6 +107,12 @@   { accessTokenAccessToken :: Text   , accessTokenExpires     :: UTCTime   } deriving (Generic, Show, Eq)++instance FromRow AccessToken where+  fromRow = AccessToken <$> field <*> field++instance ToRow AccessToken where+  toRow (AccessToken a b) = toRow (a, b)  data GrantType = AuthorizationCode                | RefreshToken
lib/HipChat/Types/Extensions.hs view
@@ -9,12 +9,15 @@ import           Data.Aeson.Types import           Data.Maybe import           Data.Monoid-import           Data.Text              (Text)+import           Data.Text                          (Text)+import           Database.PostgreSQL.Simple.FromRow+import           Database.PostgreSQL.Simple.ToRow import           GHC.Generics  import           HipChat.Types.Auth import           HipChat.Types.Common import           HipChat.Types.Dialog+import           HipChat.Types.ExternalPage import           HipChat.Types.Glance import           HipChat.Types.WebPanel @@ -71,13 +74,14 @@   , capabilitiesDialog             :: [Dialog]   , capabilitiesWebPanel           :: [WebPanel]   , capabilitiesGlance             :: [Glance]+  , capabilitiesExternalPage       :: [ExternalPage]   } deriving (Show, Eq)  defaultCapabilities :: Capabilities-defaultCapabilities = Capabilities Nothing Nothing Nothing [] Nothing [] [] []+defaultCapabilities = Capabilities Nothing Nothing Nothing [] Nothing [] [] [] []  instance ToJSON Capabilities where-  toJSON (Capabilities is con o hs cfg dlg wp gl) = object $ catMaybes+  toJSON (Capabilities is con o hs cfg dlg wp gl ep) = object $ catMaybes     [ ("installable" .=) <$> is     , ("hipchatApiConsumer" .=) <$> con     , ("oauth2Provider" .=) <$> o@@ -86,6 +90,7 @@     , ("dialog" .=) <$> excludeEmptyList dlg     , ("webPanel" .=) <$> excludeEmptyList wp     , ("glance" .=) <$> excludeEmptyList gl+    , ("externalPage" .=) <$> excludeEmptyList ep     ]  excludeEmptyList :: [a] -> Maybe [a]@@ -100,10 +105,9 @@     <*> o .:? "webhooks" .!= []     <*> o .:? "configurable"     <*> o .:? "dialog" .!= []-    <*> o .:? "webpanel" .!= []+    <*> o .:? "webPanel" .!= []     <*> o .:? "glance" .!= []--+    <*> o .:? "externalPage" .!= []  -------------------------------------------------------------------------------- @@ -212,6 +216,12 @@  instance FromJSON Registration where   parseJSON = genericParseJSON $ aesonPrefix camelCase++instance ToRow Registration where+  toRow (Registration a b c d e) = toRow (a, b, c, d, e)++instance FromRow Registration where+  fromRow = Registration <$> field <*> field <*> field <*> field <*> field  -------------------------------------------------------------------------------- 
+ lib/HipChat/Types/ExternalPage.hs view
@@ -0,0 +1,22 @@+{-# LANGUAGE DeriveGeneric #-}++module HipChat.Types.ExternalPage where++import           Data.Aeson+import           Data.Aeson.Casing+import           Data.Text            (Text)+import           GHC.Generics++import           HipChat.Types.Name++data ExternalPage = ExternalPage+  { externalPageKey  :: Text+  , externalPageName :: Name+  , externalPageUrl  :: Text+  } deriving (Eq, Generic, Show)++instance ToJSON ExternalPage where+  toJSON = genericToJSON $ aesonDrop 12 camelCase++instance FromJSON ExternalPage where+  parseJSON = genericParseJSON $ aesonDrop 12 camelCase
lib/HipChat/Types/Glance.hs view
@@ -44,7 +44,7 @@   } deriving (Eq, Generic, Show)  instance ToJSON GlanceData where-  toJSON = genericToJSON $ aesonDrop 10 camelCase+  toJSON = genericToJSON (aesonDrop 10 camelCase){omitNothingFields = True}  data GlanceUpdate = GlanceUpdate   { glanceUpdateContent :: GlanceData