pushbullet-types 0.4.0.0 → 0.4.0.2
raw patch · 4 files changed
+34/−26 lines, 4 filesdep ~aesondep ~basedep ~http-api-dataPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: aeson, base, http-api-data, microlens, microlens-th, scientific, text, time, unordered-containers
API changes (from Hackage documentation)
- Network.Pushbullet.Types: [pushFileTitle] :: PushData -> !(EqT Existing s (Maybe Text))
+ Network.Pushbullet.Types: ReceivedByUser :: !UserId -> !EmailAddress -> !EmailAddress -> PushReceiver
+ Network.Pushbullet.Types: SentByChannel :: !ChannelId -> !Name -> PushSender
+ Network.Pushbullet.Types: SentByUser :: !UserId -> !(Maybe ClientId) -> !EmailAddress -> !EmailAddress -> !Name -> PushSender
+ Network.Pushbullet.Types: [pushReceiverEmailNormalized] :: PushReceiver -> !EmailAddress
+ Network.Pushbullet.Types: [pushReceiverEmail] :: PushReceiver -> !EmailAddress
+ Network.Pushbullet.Types: [pushReceiverUserId] :: PushReceiver -> !UserId
+ Network.Pushbullet.Types: [pushSenderChannelId] :: PushSender -> !ChannelId
+ Network.Pushbullet.Types: [pushSenderClientId] :: PushSender -> !(Maybe ClientId)
+ Network.Pushbullet.Types: [pushSenderName] :: PushSender -> !Name
+ Network.Pushbullet.Types: [pushSenderUserEmailNormalized] :: PushSender -> !EmailAddress
+ Network.Pushbullet.Types: [pushSenderUserEmail] :: PushSender -> !EmailAddress
+ Network.Pushbullet.Types: [pushSenderUserId] :: PushSender -> !UserId
+ Network.Pushbullet.Types: data PushReceiver
+ Network.Pushbullet.Types: data PushSender
- Network.Pushbullet.Internal.Reflection: type Demote (a :: k) = Demote' (KProxy :: KProxy k)
+ Network.Pushbullet.Internal.Reflection: type Demote (a :: k) = Demote' ( 'KProxy :: KProxy k)
- Network.Pushbullet.Types: Device :: !(EqT Existing s DeviceId) -> !(EqT Existing s Bool) -> !(EqT Existing s PushbulletTime) -> !(EqT Existing s PushbulletTime) -> !DeviceIcon -> !(Maybe Nickname) -> !(EqT Existing s Bool) -> !(Maybe Manufacturer) -> !(Maybe Model) -> !(Maybe AppVersion) -> !(EqT Existing s (Maybe Fingerprint)) -> !(EqT Existing s (Maybe KeyFingerprint)) -> !HasSms -> !(Maybe PushToken) -> Device
+ Network.Pushbullet.Types: Device :: !(EqT 'Existing s DeviceId) -> !(EqT 'Existing s Bool) -> !(EqT 'Existing s PushbulletTime) -> !(EqT 'Existing s PushbulletTime) -> !DeviceIcon -> !(Maybe Nickname) -> !(EqT 'Existing s Bool) -> !(Maybe Manufacturer) -> !(Maybe Model) -> !(Maybe AppVersion) -> !(EqT 'Existing s (Maybe Fingerprint)) -> !(EqT 'Existing s (Maybe KeyFingerprint)) -> !HasSms -> !(Maybe PushToken) -> Device
- Network.Pushbullet.Types: ExistingDevices :: [Device Existing] -> ExistingDevices
+ Network.Pushbullet.Types: ExistingDevices :: [Device 'Existing] -> ExistingDevices
- Network.Pushbullet.Types: ExistingPushes :: [Push Existing] -> ExistingPushes
+ Network.Pushbullet.Types: ExistingPushes :: [Push 'Existing] -> ExistingPushes
- Network.Pushbullet.Types: FilePush :: !(Maybe Text) -> !Text -> !MimeType -> !Url -> !(EqT Existing s (Maybe Text)) -> !(EqT Existing s (Maybe Url)) -> !(EqT Existing s (Maybe Int)) -> !(EqT Existing s (Maybe Int)) -> PushData
+ Network.Pushbullet.Types: FilePush :: !(Maybe Text) -> !(Maybe Text) -> !Text -> !MimeType -> !Url -> !(EqT 'Existing s (Maybe Url)) -> !(EqT 'Existing s (Maybe Int)) -> !(EqT 'Existing s (Maybe Int)) -> PushData
- Network.Pushbullet.Types: Push :: !(PushData s) -> !(Maybe DeviceId) -> !(PushTarget s) -> !(Maybe Guid) -> !(EqT Existing s PushId) -> !(EqT Existing s Bool) -> !(EqT Existing s PushbulletTime) -> !(EqT Existing s PushbulletTime) -> !(EqT Existing s Bool) -> !(EqT Existing s PushDirection) -> !(EqT Existing s PushSender) -> !(EqT Existing s (Maybe PushReceiver)) -> Push
+ Network.Pushbullet.Types: Push :: !(PushData s) -> !(Maybe DeviceId) -> !(PushTarget s) -> !(Maybe Guid) -> !(EqT 'Existing s PushId) -> !(EqT 'Existing s Bool) -> !(EqT 'Existing s PushbulletTime) -> !(EqT 'Existing s PushbulletTime) -> !(EqT 'Existing s Bool) -> !(EqT 'Existing s PushDirection) -> !(EqT 'Existing s PushSender) -> !(EqT 'Existing s (Maybe PushReceiver)) -> Push
- Network.Pushbullet.Types: [MessagesIn] :: !DeviceId -> !SmsThreadId -> Permanent MessageList
+ Network.Pushbullet.Types: [MessagesIn] :: !DeviceId -> !SmsThreadId -> Permanent 'MessageList
- Network.Pushbullet.Types: [SentBroadcast] :: PushTarget Existing
+ Network.Pushbullet.Types: [SentBroadcast] :: PushTarget 'Existing
- Network.Pushbullet.Types: [SentToDevice] :: !DeviceId -> PushTarget Existing
+ Network.Pushbullet.Types: [SentToDevice] :: !DeviceId -> PushTarget 'Existing
- Network.Pushbullet.Types: [ThreadsOf] :: !DeviceId -> Permanent ThreadList
+ Network.Pushbullet.Types: [ThreadsOf] :: !DeviceId -> Permanent 'ThreadList
- Network.Pushbullet.Types: [ToAll] :: PushTarget New
+ Network.Pushbullet.Types: [ToAll] :: PushTarget 'New
- Network.Pushbullet.Types: [ToChannel] :: !ChannelTag -> PushTarget New
+ Network.Pushbullet.Types: [ToChannel] :: !ChannelTag -> PushTarget 'New
- Network.Pushbullet.Types: [ToClient] :: !ClientId -> PushTarget New
+ Network.Pushbullet.Types: [ToClient] :: !ClientId -> PushTarget 'New
- Network.Pushbullet.Types: [ToDevice] :: !DeviceId -> PushTarget New
+ Network.Pushbullet.Types: [ToDevice] :: !DeviceId -> PushTarget 'New
- Network.Pushbullet.Types: [ToEmail] :: !EmailAddress -> PushTarget New
+ Network.Pushbullet.Types: [ToEmail] :: !EmailAddress -> PushTarget 'New
- Network.Pushbullet.Types: [_deviceActive] :: Device -> !(EqT Existing s Bool)
+ Network.Pushbullet.Types: [_deviceActive] :: Device -> !(EqT 'Existing s Bool)
- Network.Pushbullet.Types: [_deviceCreated] :: Device -> !(EqT Existing s PushbulletTime)
+ Network.Pushbullet.Types: [_deviceCreated] :: Device -> !(EqT 'Existing s PushbulletTime)
- Network.Pushbullet.Types: [_deviceFingerprint] :: Device -> !(EqT Existing s (Maybe Fingerprint))
+ Network.Pushbullet.Types: [_deviceFingerprint] :: Device -> !(EqT 'Existing s (Maybe Fingerprint))
- Network.Pushbullet.Types: [_deviceGeneratedNickname] :: Device -> !(EqT Existing s Bool)
+ Network.Pushbullet.Types: [_deviceGeneratedNickname] :: Device -> !(EqT 'Existing s Bool)
- Network.Pushbullet.Types: [_deviceId] :: Device -> !(EqT Existing s DeviceId)
+ Network.Pushbullet.Types: [_deviceId] :: Device -> !(EqT 'Existing s DeviceId)
- Network.Pushbullet.Types: [_deviceKeyFingerprint] :: Device -> !(EqT Existing s (Maybe KeyFingerprint))
+ Network.Pushbullet.Types: [_deviceKeyFingerprint] :: Device -> !(EqT 'Existing s (Maybe KeyFingerprint))
- Network.Pushbullet.Types: [_deviceModified] :: Device -> !(EqT Existing s PushbulletTime)
+ Network.Pushbullet.Types: [_deviceModified] :: Device -> !(EqT 'Existing s PushbulletTime)
- Network.Pushbullet.Types: [pushActive] :: Push -> !(EqT Existing s Bool)
+ Network.Pushbullet.Types: [pushActive] :: Push -> !(EqT 'Existing s Bool)
- Network.Pushbullet.Types: [pushCreated] :: Push -> !(EqT Existing s PushbulletTime)
+ Network.Pushbullet.Types: [pushCreated] :: Push -> !(EqT 'Existing s PushbulletTime)
- Network.Pushbullet.Types: [pushDirection] :: Push -> !(EqT Existing s PushDirection)
+ Network.Pushbullet.Types: [pushDirection] :: Push -> !(EqT 'Existing s PushDirection)
- Network.Pushbullet.Types: [pushDismissed] :: Push -> !(EqT Existing s Bool)
+ Network.Pushbullet.Types: [pushDismissed] :: Push -> !(EqT 'Existing s Bool)
- Network.Pushbullet.Types: [pushId] :: Push -> !(EqT Existing s PushId)
+ Network.Pushbullet.Types: [pushId] :: Push -> !(EqT 'Existing s PushId)
- Network.Pushbullet.Types: [pushImageHeight] :: PushData -> !(EqT Existing s (Maybe Int))
+ Network.Pushbullet.Types: [pushImageHeight] :: PushData -> !(EqT 'Existing s (Maybe Int))
- Network.Pushbullet.Types: [pushImageUrl] :: PushData -> !(EqT Existing s (Maybe Url))
+ Network.Pushbullet.Types: [pushImageUrl] :: PushData -> !(EqT 'Existing s (Maybe Url))
- Network.Pushbullet.Types: [pushImageWidth] :: PushData -> !(EqT Existing s (Maybe Int))
+ Network.Pushbullet.Types: [pushImageWidth] :: PushData -> !(EqT 'Existing s (Maybe Int))
- Network.Pushbullet.Types: [pushModified] :: Push -> !(EqT Existing s PushbulletTime)
+ Network.Pushbullet.Types: [pushModified] :: Push -> !(EqT 'Existing s PushbulletTime)
- Network.Pushbullet.Types: [pushReceiver] :: Push -> !(EqT Existing s (Maybe PushReceiver))
+ Network.Pushbullet.Types: [pushReceiver] :: Push -> !(EqT 'Existing s (Maybe PushReceiver))
- Network.Pushbullet.Types: [pushSender] :: Push -> !(EqT Existing s PushSender)
+ Network.Pushbullet.Types: [pushSender] :: Push -> !(EqT 'Existing s PushSender)
- Network.Pushbullet.Types: [unExistingDevices] :: ExistingDevices -> [Device Existing]
+ Network.Pushbullet.Types: [unExistingDevices] :: ExistingDevices -> [Device 'Existing]
- Network.Pushbullet.Types: [unExistingPushes] :: ExistingPushes -> [Push Existing]
+ Network.Pushbullet.Types: [unExistingPushes] :: ExistingPushes -> [Push 'Existing]
- Network.Pushbullet.Types: deviceActive :: forall s_arON. Lens' (Device s_arON) (EqT Existing s_arON Bool)
+ Network.Pushbullet.Types: deviceActive :: forall s_apu2. Lens' (Device s_apu2) (EqT Existing s_apu2 Bool)
- Network.Pushbullet.Types: deviceAppVersion :: forall s_arON. Lens' (Device s_arON) (Maybe AppVersion)
+ Network.Pushbullet.Types: deviceAppVersion :: forall s_apu2. Lens' (Device s_apu2) (Maybe AppVersion)
- Network.Pushbullet.Types: deviceCreated :: forall s_arON. Lens' (Device s_arON) (EqT Existing s_arON PushbulletTime)
+ Network.Pushbullet.Types: deviceCreated :: forall s_apu2. Lens' (Device s_apu2) (EqT Existing s_apu2 PushbulletTime)
- Network.Pushbullet.Types: deviceFingerprint :: forall s_arON. Lens' (Device s_arON) (EqT Existing s_arON (Maybe Fingerprint))
+ Network.Pushbullet.Types: deviceFingerprint :: forall s_apu2. Lens' (Device s_apu2) (EqT Existing s_apu2 (Maybe Fingerprint))
- Network.Pushbullet.Types: deviceGeneratedNickname :: forall s_arON. Lens' (Device s_arON) (EqT Existing s_arON Bool)
+ Network.Pushbullet.Types: deviceGeneratedNickname :: forall s_apu2. Lens' (Device s_apu2) (EqT Existing s_apu2 Bool)
- Network.Pushbullet.Types: deviceHasSms :: forall s_arON. Lens' (Device s_arON) HasSms
+ Network.Pushbullet.Types: deviceHasSms :: forall s_apu2. Lens' (Device s_apu2) HasSms
- Network.Pushbullet.Types: deviceIcon :: forall s_arON. Lens' (Device s_arON) DeviceIcon
+ Network.Pushbullet.Types: deviceIcon :: forall s_apu2. Lens' (Device s_apu2) DeviceIcon
- Network.Pushbullet.Types: deviceId :: forall s_arON. Lens' (Device s_arON) (EqT Existing s_arON DeviceId)
+ Network.Pushbullet.Types: deviceId :: forall s_apu2. Lens' (Device s_apu2) (EqT Existing s_apu2 DeviceId)
- Network.Pushbullet.Types: deviceKeyFingerprint :: forall s_arON. Lens' (Device s_arON) (EqT Existing s_arON (Maybe KeyFingerprint))
+ Network.Pushbullet.Types: deviceKeyFingerprint :: forall s_apu2. Lens' (Device s_apu2) (EqT Existing s_apu2 (Maybe KeyFingerprint))
- Network.Pushbullet.Types: deviceManufacturer :: forall s_arON. Lens' (Device s_arON) (Maybe Manufacturer)
+ Network.Pushbullet.Types: deviceManufacturer :: forall s_apu2. Lens' (Device s_apu2) (Maybe Manufacturer)
- Network.Pushbullet.Types: deviceModel :: forall s_arON. Lens' (Device s_arON) (Maybe Model)
+ Network.Pushbullet.Types: deviceModel :: forall s_apu2. Lens' (Device s_apu2) (Maybe Model)
- Network.Pushbullet.Types: deviceModified :: forall s_arON. Lens' (Device s_arON) (EqT Existing s_arON PushbulletTime)
+ Network.Pushbullet.Types: deviceModified :: forall s_apu2. Lens' (Device s_apu2) (EqT Existing s_apu2 PushbulletTime)
- Network.Pushbullet.Types: deviceNickname :: forall s_arON. Lens' (Device s_arON) (Maybe Nickname)
+ Network.Pushbullet.Types: deviceNickname :: forall s_apu2. Lens' (Device s_apu2) (Maybe Nickname)
- Network.Pushbullet.Types: devicePushToken :: forall s_arON. Lens' (Device s_arON) (Maybe PushToken)
+ Network.Pushbullet.Types: devicePushToken :: forall s_apu2. Lens' (Device s_apu2) (Maybe PushToken)
- Network.Pushbullet.Types: newDevice :: HasSms -> DeviceIcon -> Nickname -> Maybe Manufacturer -> Maybe Model -> Maybe AppVersion -> Device New
+ Network.Pushbullet.Types: newDevice :: HasSms -> DeviceIcon -> Nickname -> Maybe Manufacturer -> Maybe Model -> Maybe AppVersion -> Device 'New
- Network.Pushbullet.Types: pageCursor :: forall a_abA3. Lens' (Paginated a_abA3) (Maybe Cursor)
+ Network.Pushbullet.Types: pageCursor :: forall a_ae3u. Lens' (Paginated a_ae3u) (Maybe Cursor)
- Network.Pushbullet.Types: pageData :: forall a_abA3 a_aeMj. Lens (Paginated a_abA3) (Paginated a_aeMj) a_abA3 a_aeMj
+ Network.Pushbullet.Types: pageData :: forall a_ae3u a_ahwO. Lens (Paginated a_ae3u) (Paginated a_ahwO) a_ae3u a_ahwO
- Network.Pushbullet.Types: simpleNewPush :: PushTarget New -> PushData New -> Push New
+ Network.Pushbullet.Types: simpleNewPush :: PushTarget 'New -> PushData 'New -> Push 'New
Files
- ChangeLog.md +8/−0
- pushbullet-types.cabal +15/−20
- src/Network/Pushbullet/Types.hs +2/−0
- src/Network/Pushbullet/Types/Push.hs +9/−6
ChangeLog.md view
@@ -1,5 +1,13 @@ # Revision history for pushbullet-types +## 0.4.0.2 -- 2018-02-11++* Derive `ToHttpApiData` for `PushId`.++## 0.4.0.1 -- 2018-02-08++* Drop upper bounds on dependencies.+ ## 0.4.0.0 -- 2017-08-01 * Make `body` field of link pushes optional. Many channel pushes do not include
pushbullet-types.cabal view
@@ -1,15 +1,15 @@--- Initial pushbullet-types.cabal generated by cabal init. For further +-- Initial pushbullet-types.cabal generated by cabal init. For further -- documentation, see http://haskell.org/cabal/users-guide/ name: pushbullet-types-version: 0.4.0.0+version: 0.4.0.2 synopsis: Datatypes used by the Pushbullet APIs--- description: +-- description: license: MIT license-file: LICENSE author: Jacob Thomas Errington-maintainer: hackage@mail.jerrington.me-copyright: Jacob Thomas Errington 2017+maintainer: pushbullet-hs@mail.jerrington.me+copyright: Jacob Thomas Errington 2017-2018 category: Web build-type: Simple extra-source-files: ChangeLog.md@@ -17,12 +17,7 @@ source-repository head type: git- location: https://github.com/tsani/pushbullet-types--source-repository this- type: git- location: https://github.com/tsani/pushbullet-types/releases/tag/v0.4.0.0- tag: v0.4.0.0+ location: https://github.com/tsani/pushbullet-hs library default-language: Haskell2010@@ -53,12 +48,12 @@ Network.Pushbullet.Types.Time, Network.Pushbullet.Types.User build-depends:- aeson >=0.11 && <1.2,- base >=4.9 && <4.10,- http-api-data >=0.3 && <0.4,- microlens >=0.4 && <0.5,- microlens-th >=0.4 && <0.5,- scientific >=0.3 && <0.4,- text >=1.0 && <1.3,- time >=1.6 && <1.7,- unordered-containers >=0.2 && <0.3+ aeson >=0.11,+ base >=4.9 && <5,+ http-api-data >=0.3,+ microlens >=0.4,+ microlens-th >=0.4,+ scientific >=0.3,+ text >=1.0,+ time >=1.6,+ unordered-containers >=0.2
src/Network/Pushbullet/Types.hs view
@@ -6,6 +6,8 @@ , Push(..) , PushData(..) , PushTarget(..)+, PushSender(..)+, PushReceiver(..) , simpleNewPush , ExistingPushes(..) -- * Ephemerals
src/Network/Pushbullet/Types/Push.hs view
@@ -6,6 +6,7 @@ , PushDirection(..) , PushSender(..) , PushTarget(..)+, PushReceiver(..) , PushData(..) , ExistingPushes(..) , simpleNewPush@@ -20,6 +21,7 @@ import Control.Applicative ( (<|>) ) import Data.Aeson import Data.Text ( Text )+import Web.HttpApiData ( ToHttpApiData ) -- | A push. We reuse the same datatype for representing new pushes and -- existing pushes. The 'EqT' type family is used to enable fields selectively@@ -52,7 +54,7 @@ data PushSender = SentByUser { pushSenderUserId :: !UserId- , pushSenderClientId :: !ClientId+ , pushSenderClientId :: !(Maybe ClientId) , pushSenderUserEmail :: !EmailAddress , pushSenderUserEmailNormalized :: !EmailAddress , pushSenderName :: !Name@@ -65,7 +67,7 @@ -- | Unique identifier for a push. newtype PushId = PushId Text- deriving (Eq, FromJSON, Show, ToJSON)+ deriving (Eq, FromJSON, Show, ToJSON, ToHttpApiData) -- | The direction of a push. data PushDirection@@ -96,11 +98,11 @@ , pushUrl :: !Url } | FilePush- { pushFileBody :: !(Maybe Text)+ { pushTitle :: !(Maybe Text)+ , pushFileBody :: !(Maybe Text) , pushFileName :: !Text , pushFileType :: !MimeType , pushFileUrl :: !Url- , pushFileTitle :: !(EqT 'Existing s (Maybe Text)) , pushImageUrl :: !(EqT 'Existing s (Maybe Url)) , pushImageWidth :: !(EqT 'Existing s (Maybe Int)) , pushImageHeight :: !(EqT 'Existing s (Maybe Int))@@ -167,11 +169,11 @@ <*> o .:? "title" <*> o .: "body" "file" -> pure FilePush+ <*> o .:? "file_title" <*> o .:? "body" <*> o .: "file_name" <*> o .: "file_type" <*> o .: "file_url"- <*> o .:? "file_title" <*> o .:? "image_url" <*> o .:? "image_width" <*> o .:? "image_height"@@ -188,7 +190,8 @@ user <- o .:? "sender_iden" name <- o .:? "sender_name" - let u = SentByUser <$> user <*> client <*> email <*> emailNorm <*> name+ let f x1 x2 x3 x4 = SentByUser x1 client x2 x3 x4+ let u = f <$> user <*> email <*> emailNorm <*> name let c = SentByChannel <$> channel <*> name sender <- maybe (fail "push not sent by channel or by user") pure (u <|> c)