packages feed

telegram-raw-api 0.1.0 → 0.2.0

raw patch · 9 files changed

+34/−104 lines, 9 filesdep +hashabledep ~telegram-typesPVP ok

version bump matches the API change (PVP)

Dependencies added: hashable

Dependency ranges changed: telegram-types

API changes (from Hackage documentation)

- Web.Telegram.API.Lens: action :: HasField "action" s t a b => Lens s t a b
- Web.Telegram.API.Lens: allowedUpdates :: HasField "allowedUpdates" s t a b => Lens s t a b
- Web.Telegram.API.Lens: cacheTime :: HasField "cacheTime" s t a b => Lens s t a b
- Web.Telegram.API.Lens: disableNotification :: HasField "disableNotification" s t a b => Lens s t a b
- Web.Telegram.API.Lens: disableWebPagePreview :: HasField "disableWebPagePreview" s t a b => Lens s t a b
- Web.Telegram.API.Lens: fromChatId :: HasField "fromChatId" s t a b => Lens s t a b
- Web.Telegram.API.Lens: inlineMessageId :: HasField "inlineMessageId" s t a b => Lens s t a b
- Web.Telegram.API.Lens: inlineQueryId :: HasField "inlineQueryId" s t a b => Lens s t a b
- Web.Telegram.API.Lens: isPersonal :: HasField "isPersonal" s t a b => Lens s t a b
- Web.Telegram.API.Lens: limit :: HasField "limit" s t a b => Lens s t a b
- Web.Telegram.API.Lens: maxConnections :: HasField "maxConnections" s t a b => Lens s t a b
- Web.Telegram.API.Lens: nextOffset :: HasField "nextOffset" s t a b => Lens s t a b
- Web.Telegram.API.Lens: offset :: HasField "offset" s t a b => Lens s t a b
- Web.Telegram.API.Lens: parseMode :: HasField "parseMode" s t a b => Lens s t a b
- Web.Telegram.API.Lens: replyToMessageId :: HasField "replyToMessageId" s t a b => Lens s t a b
- Web.Telegram.API.Lens: results :: HasField "results" s t a b => Lens s t a b
- Web.Telegram.API.Lens: switchPmParameter :: HasField "switchPmParameter" s t a b => Lens s t a b
- Web.Telegram.API.Lens: switchPmText :: HasField "switchPmText" s t a b => Lens s t a b
- Web.Telegram.API.Lens: timeout :: HasField "timeout" s t a b => Lens s t a b
- Web.Telegram.API.Lens: url :: HasField "url" s t a b => Lens s t a b
+ Web.Telegram.API: ChanId :: Text -> ChatId
+ Web.Telegram.API: ChatId :: Int64 -> ChatId
+ Web.Telegram.API: data ChatId
+ Web.Telegram.API.Actions: data CallbackQueryAnswer
+ Web.Telegram.API.Actions: type AnswerCallbackQuery = Base :> "answerCallbackQuery" :> ReqBody '[JSON] CallbackQueryAnswer :> Get '[JSON] (ReqResult Bool)
+ Web.Telegram.API.Actions: type SetMyCommands = Base :> "setMyCommands" :> ReqBody '[JSON] CommandSet :> Get '[JSON] (ReqResult Bool)

Files

src/Web/Telegram/API.hs view
@@ -5,6 +5,7 @@     module Web.Telegram.API.Actions,     module Web.Telegram.API.Editing,     Token (..),+    ChatId (..),   ) where 
src/Web/Telegram/API/Actions.hs view
@@ -37,8 +37,11 @@     DeleteStickerFromSet,     SetStickerSetThumbU,     SetStickerSetThumb,+    SetMyCommands,     AnswerInlineQuery,     InlineQueryAnswer,+    AnswerCallbackQuery,+    CallbackQueryAnswer,   ) where 
src/Web/Telegram/API/Actions/Data.hs view
@@ -7,6 +7,7 @@  import Data.Text (Text) import Deriving.Aeson+import Web.Telegram.API.Common import Web.Telegram.Types import Web.Telegram.Types.Inline import Web.Telegram.Types.Stock
src/Web/Telegram/API/Common.hs view
@@ -1,17 +1,32 @@ {-# LANGUAGE DataKinds #-}-{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DerivingVia #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE OverloadedStrings #-}  module Web.Telegram.API.Common where -import Data.Text (Text)-import GHC.Generics-import Servant.API import Data.Aeson+import Data.Hashable+import Data.Int import Data.String+import Data.Text (Text)+import Deriving.Aeson+import Servant.API import Web.Telegram.Types+import Web.Telegram.Types.Stock++data ChatId+  = ChatId Int64+  | ChanId Text+  deriving (Show, Eq, Generic, Default, Hashable)+  deriving (FromJSON, ToJSON) via UntaggedSum ChatId++instance ToHttpApiData ChatId where+  toQueryParam (ChatId i) = toQueryParam i+  toQueryParam (ChanId t) = t  newtype Token = Token Text   deriving (Show, Eq, Generic)
src/Web/Telegram/API/Editing/Data.hs view
@@ -7,6 +7,7 @@  import Data.Text (Text) import Deriving.Aeson+import Web.Telegram.API.Common import Web.Telegram.Types import Web.Telegram.Types.Input import Web.Telegram.Types.Interaction
− src/Web/Telegram/API/Lens.hs
@@ -1,92 +0,0 @@-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE TypeApplications #-}--module Web.Telegram.API.Lens {-# DEPRECATED "Use labels from generics-lens instead" #-}-  ( module Web.Telegram.Types.Lens,-    disableWebPagePreview,-    parseMode,-    disableNotification,-    replyToMessageId,-    fromChatId,-    action,-    inlineMessageId,-    inlineQueryId,-    results,-    cacheTime,-    isPersonal,-    nextOffset,-    switchPmText,-    switchPmParameter,-    offset,-    limit,-    timeout,-    allowedUpdates,-    url,-    maxConnections,-  )-where--import Control.Lens-import Data.Generics.Product-import Web.Telegram.Types.Lens--disableWebPagePreview :: HasField "disableWebPagePreview" s t a b => Lens s t a b-disableWebPagePreview = field @"disableWebPagePreview"--parseMode :: HasField "parseMode" s t a b => Lens s t a b-parseMode = field @"parseMode"--disableNotification :: HasField "disableNotification" s t a b => Lens s t a b-disableNotification = field @"disableNotification"--replyToMessageId :: HasField "replyToMessageId" s t a b => Lens s t a b-replyToMessageId = field @"replyToMessageId"--fromChatId :: HasField "fromChatId" s t a b => Lens s t a b-fromChatId = field @"fromChatId"--action :: HasField "action" s t a b => Lens s t a b-action = field @"action"--inlineMessageId :: HasField "inlineMessageId" s t a b => Lens s t a b-inlineMessageId = field @"inlineMessageId"--inlineQueryId :: HasField "inlineQueryId" s t a b => Lens s t a b-inlineQueryId = field @"inlineQueryId"--results :: HasField "results" s t a b => Lens s t a b-results = field @"results"--cacheTime :: HasField "cacheTime" s t a b => Lens s t a b-cacheTime = field @"cacheTime"--isPersonal :: HasField "isPersonal" s t a b => Lens s t a b-isPersonal = field @"isPersonal"--nextOffset :: HasField "nextOffset" s t a b => Lens s t a b-nextOffset = field @"nextOffset"--switchPmText :: HasField "switchPmText" s t a b => Lens s t a b-switchPmText = field @"switchPmText"--switchPmParameter :: HasField "switchPmParameter" s t a b => Lens s t a b-switchPmParameter = field @"switchPmParameter"--offset :: HasField "offset" s t a b => Lens s t a b-offset = field @"offset"--limit :: HasField "limit" s t a b => Lens s t a b-limit = field @"limit"--timeout :: HasField "timeout" s t a b => Lens s t a b-timeout = field @"timeout"--allowedUpdates :: HasField "allowedUpdates" s t a b => Lens s t a b-allowedUpdates = field @"allowedUpdates"--url :: HasField "url" s t a b => Lens s t a b-url = field @"url"--maxConnections :: HasField "maxConnections" s t a b => Lens s t a b-maxConnections = field @"maxConnections"
src/Web/Telegram/API/Sending.hs view
@@ -61,8 +61,7 @@ import Web.Telegram.API.CompoundParam import Web.Telegram.API.Sending.Data import Web.Telegram.Types-  ( ChatId (..),-    ParseMode (..),+  ( ParseMode (..),     QueryR,   ) import qualified Web.Telegram.Types as T
src/Web/Telegram/API/Sending/Data.hs view
@@ -1,13 +1,14 @@+{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE DuplicateRecordFields #-}-{-# LANGUAGE DataKinds #-}  module Web.Telegram.API.Sending.Data where  import Data.Text (Text) import Deriving.Aeson+import Web.Telegram.API.Common import Web.Telegram.Types import Web.Telegram.Types.Interaction import Web.Telegram.Types.Stock
telegram-raw-api.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 282bb771376474f83c73fb2c19027d63102ea658b203ce2b189f30c3c380d69f+-- hash: f86f282035a38c0679901505685391ac2f961d5101b37194b9445a35ac2fdac8  name:           telegram-raw-api-version:        0.1.0+version:        0.2.0 synopsis:       Servant bindings to the Telegram bot API description:    Please see the README on GitHub at <https://github.com/poscat0x04/telegram-raw-api#readme> category:       Web@@ -36,7 +36,6 @@       Web.Telegram.API.Sending.Data       Web.Telegram.API.CompoundParam       Web.Telegram.API.Getting-      Web.Telegram.API.Lens       Web.Telegram.API.Update       Web.Telegram.API   other-modules:@@ -51,12 +50,13 @@     , connection >=0.3.1 && <0.4     , deriving-aeson >=0.2.3 && <0.3     , generic-lens >=1.2.0.1 && <1.3+    , hashable >=1.3.0.0 && <1.4     , http-media >=0.8.0.0 && <0.9     , lens >=4.18.1 && <4.19     , servant >=0.16.2 && <0.17     , servant-client >=0.16.0.1 && <0.17     , servant-multipart >=0.11.5 && <0.12-    , telegram-types >=0.1.0 && <0.2+    , telegram-types >=0.4.0 && <0.5     , text >=1.2.4.0 && <1.3   default-language: Haskell2010 @@ -75,6 +75,7 @@     , connection >=0.3.1 && <0.4     , deriving-aeson >=0.2.3 && <0.3     , generic-lens >=1.2.0.1 && <1.3+    , hashable >=1.3.0.0 && <1.4     , http-client >=0.6.4.1 && <0.7     , http-client-tls >=0.3.5.3 && <0.4     , http-media >=0.8.0.0 && <0.9@@ -84,6 +85,6 @@     , servant-client-core >=0.16 && <0.17     , servant-multipart >=0.11.5 && <0.12     , telegram-raw-api-    , telegram-types >=0.1.0 && <0.2+    , telegram-types >=0.4.0 && <0.5     , text >=1.2.4.0 && <1.3   default-language: Haskell2010