-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Bindings to Facebook's API. -- -- This package exports bindings to Facebook's APIs (see -- http://developers.facebook.com/). Does not have any external -- dependencies and tries to use as little resources (such as memory, -- sockets and CPU) as possible by using packages such as aeson, -- attoparsec, bytestring, conduit, -- http-conduit, text and others. -- -- While we would like to have a complete binding to Facebook's API, this -- package is being developed on demand. If you need something that has -- not been implemented yet, please send a pull request or file an issue -- on GitHub (https://github.com/psibi/fb/issues). @package fb @version 2.0.0 module Facebook -- | FacebookT auth m a is this library's monad transformer. -- Contains information needed to issue commands and queries to Facebook. -- The phantom type auth may be either Auth (you have -- supplied your Credentials) or NoAuth (you have not -- supplied any Credentials). data FacebookT auth m a -- | Run a computation in the FacebookT monad transformer with your -- credentials. runFacebookT :: MonadIO m => Credentials -> Manager -> FacebookT Auth m a -> m a -- | Run a computation in the FacebookT monad without credentials. runNoAuthFacebookT :: MonadIO m => Manager -> FacebookT NoAuth m a -> m a -- | Transform the computation inside a FacebookT. mapFacebookT :: (m a -> n b) -> FacebookT anyAuth m a -> FacebookT anyAuth n b -- | Same as runFacebookT, but uses Facebook's beta tier (see -- https://developers.facebook.com/support/beta-tier/). beta_runFacebookT :: MonadIO m => Credentials -> Manager -> FacebookT Auth m a -> m a -- | Same as runNoAuthFacebookT, but uses Facebook's beta tier (see -- https://developers.facebook.com/support/beta-tier/). beta_runNoAuthFacebookT :: MonadIO m => Manager -> FacebookT NoAuth m a -> m a -- | Phantom type stating that you have provided your Credentials -- and thus have access to the whole API. data Auth -- | Phantom type stating that you have not provided your -- Credentials. This means that you'll be limited about which APIs -- you'll be able use. data NoAuth -- | Credentials that you get for your app when you register on Facebook. data Credentials Credentials :: Text -> Text -> Text -> Bool -> Credentials -- | Your application name (e.g. for Open Graph calls). [appName] :: Credentials -> Text -- | Your application ID. [appId] :: Credentials -> Text -- | Your application secret key. [appSecret] :: Credentials -> Text -- | To enable app secret proof verification [appSecretProof] :: Credentials -> Bool -- | An access token. While you can make some API calls without an access -- token, many require an access token and some will give you more -- information with an appropriate access token. -- -- There are two kinds of access tokens: -- -- -- -- These two kinds of access tokens are distinguished by the phantom type -- on AccessToken, which can be UserKind or AppKind. data AccessToken kind [UserAccessToken] :: UserId -> AccessTokenData -> UTCTime -> AccessToken UserKind [AppAccessToken] :: AccessTokenData -> AccessToken AppKind -- | Type synonym for AccessToken UserKind. type UserAccessToken = AccessToken UserKind -- | Type synonym for AccessToken AppKind. type AppAccessToken = AccessToken AppKind -- | The access token data that is passed to Facebook's API calls. type AccessTokenData = Text -- | Graph API version. See: -- https://developers.facebook.com/docs/graph-api/changelog type ApiVersion = Text -- | True if the access token has expired, otherwise -- False. hasExpired :: (Functor m, MonadIO m) => AccessToken anyKind -> m Bool -- | True if the access token is valid. An expired access token is -- not valid (see hasExpired). However, a non-expired access token -- may not be valid as well. For example, in the case of an user access -- token, they may have changed their password, logged out from Facebook -- or blocked your app. isValid :: (MonadResource m, MonadUnliftIO m) => AccessToken anyKind -> FacebookT anyAuth m Bool -- | Set the Graph API version. setApiVersion :: MonadIO m => ApiVersion -> FacebookT anyAuth m () -- | Get the Graph API version. getApiVersion :: MonadIO m => FacebookT anyAuth m ApiVersion -- | Phantom type used mark an AccessToken as an app access token. data AppKind -- | Get an app access token from Facebook using your credentials. Ref: -- https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow getAppAccessToken :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => FacebookT Auth m AppAccessToken -- | Phantom type used mark an AccessToken as an user access token. data UserKind -- | URL where the user is redirected to after Facebook authenticates the -- user authorizes your application. This URL should be inside the domain -- registered for your Facebook application. type RedirectUrl = Text -- | A permission that is asked for the user when he authorizes your app. -- Please refer to Facebook's documentation at -- https://developers.facebook.com/docs/reference/api/permissions/ -- to see which permissions are available. -- -- This is a newtype of Text that supports only -- IsString. This means that to create a Permission you -- should use the OverloadedStrings language extension. For -- example, -- --
--   {-# LANGUAGE OverloadedStrings #-}
--   
--   perms :: [Permission]
--   perms = ["user_about_me", "email", "offline_access"]
--   
data Permission -- | The first step to get an user access token. Returns the Facebook URL -- you should redirect you user to. Facebook will authenticate the user, -- authorize your app and then redirect the user back into the provider -- RedirectUrl. getUserAccessTokenStep1 :: (Monad m, MonadIO m) => RedirectUrl -> [Permission] -> FacebookT Auth m Text -- | The second step to get an user access token. If the user is -- successfully authenticate and they authorize your application, then -- they'll be redirected back to the RedirectUrl you've passed to -- getUserAccessTokenStep1. You should take the request query -- parameters passed to your RedirectUrl and give to this function -- that will complete the user authentication flow and give you an -- AccessToken. getUserAccessTokenStep2 :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => RedirectUrl -> [Argument] -> FacebookT Auth m UserAccessToken -- | The URL an user should be redirected to in order to log them out of -- their Facebook session. Facebook will then redirect the user to the -- provided URL after logging them out. Note that, at the time of this -- writing, Facebook's policies require you to log the user out of -- Facebook when they ask to log out of your site. -- -- Note also that Facebook may refuse to redirect the user to the -- provided URL if their user access token is invalid. In order to -- prevent this bug, we suggest that you use isValid before -- redirecting the user to the URL provided by getUserLogoutUrl -- since this function doesn't do any validity checks. getUserLogoutUrl :: Monad m => UserAccessToken -> RedirectUrl -> FacebookT Auth m Text -- | Extend the expiration time of an user access token (see -- https://developers.facebook.com/docs/offline-access-deprecation/, -- https://developers.facebook.com/roadmap/offline-access-removal/). -- Only short-lived user access tokens may extended into long-lived user -- access tokens, you must get a new short-lived user access token if you -- need to extend a long-lived one. Returns Left exc if there is -- an error while extending, or Right token with the new user -- access token (which could have the same data and expiration time as -- before, but you can't assume this). Note that expired access tokens -- can't be extended, only valid tokens. extendUserAccessToken :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => UserAccessToken -> FacebookT Auth m (Either FacebookException UserAccessToken) -- | Get detailed information about an access token. debugToken :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => AppAccessToken -> AccessTokenData -> FacebookT Auth m DebugToken -- | Detailed information about an access token (cf. debugToken). data DebugToken DebugToken :: Maybe Text -> Maybe Text -> Maybe UTCTime -> Maybe Bool -> Maybe UTCTime -> Maybe [Permission] -> Maybe Id -> Maybe UserAccessToken -> DebugToken [dtAppId] :: DebugToken -> Maybe Text [dtAppName] :: DebugToken -> Maybe Text [dtExpiresAt] :: DebugToken -> Maybe UTCTime [dtIsValid] :: DebugToken -> Maybe Bool [dtIssuedAt] :: DebugToken -> Maybe UTCTime [dtScopes] :: DebugToken -> Maybe [Permission] [dtUserId] :: DebugToken -> Maybe Id [dtAccessToken] :: DebugToken -> Maybe UserAccessToken -- | Parses a Facebook signed request -- (https://developers.facebook.com/docs/authentication/signed_request/), -- verifies its authencity and integrity using the HMAC and decodes its -- JSON object. parseSignedRequest :: (FromJSON a, Monad m, MonadIO m) => ByteString -> FacebookT Auth m (Maybe a) addAppSecretProof :: Credentials -> Maybe (AccessToken anykind) -> SimpleQuery -> SimpleQuery -- | Make an appsecret_proof in case the given credentials access token is -- a user access token. See: -- https://developers.facebook.com/docs/graph-api/securing-requests/#appsecret_proof makeAppSecretProof :: Credentials -> Maybe (AccessToken anyKind) -> SimpleQuery -- | A Facebook user profile (see -- https://developers.facebook.com/docs/reference/api/user/). -- -- NOTE: We still don't support all fields supported by Facebook. -- Please fill an issue if you need access to any other fields. data User User :: UserId -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Gender -> Maybe Text -> Maybe Text -> Maybe Bool -> Maybe Text -> Maybe Place -> User [userId] :: User -> UserId [userName] :: User -> Maybe Text [userFirstName] :: User -> Maybe Text [userMiddleName] :: User -> Maybe Text [userLastName] :: User -> Maybe Text [userGender] :: User -> Maybe Gender [userLocale] :: User -> Maybe Text [userUsername] :: User -> Maybe Text [userVerified] :: User -> Maybe Bool [userEmail] :: User -> Maybe Text [userLocation] :: User -> Maybe Place -- | A Facebook user ID such as 1008905713901. type UserId = Id -- | An user's gender. data Gender Male :: Gender Female :: Gender -- | Get an user using his user ID. The user access token is optional, but -- when provided more information can be returned back by Facebook. The -- user ID may be "me", in which case you must provide an user -- access token and information about the token's owner is given. getUser :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => UserId -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m User -- | Search users by keyword. searchUsers :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Text -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m (Pager User) -- | Get a list of check-ins made by a given user. getUserCheckins :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => UserId -> [Argument] -> UserAccessToken -> FacebookT anyAuth m (Pager Checkin) -- | A friend connection of a User. data Friend Friend :: UserId -> Text -> Friend [friendId] :: Friend -> UserId [friendName] :: Friend -> Text -- | Get the list of friends of the given user. getUserFriends :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => UserId -> [Argument] -> UserAccessToken -> FacebookT anyAuth m (Pager Friend) -- | Get the friend lists of the given user. getUserFriendLists :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => UserId -> [Argument] -> UserAccessToken -> FacebookT anyAuth m (Pager FriendList) -- | A Facebook page (see -- https://developers.facebook.com/docs/reference/api/page/). -- -- NOTE: Does not yet support all fields. Please file an issue if -- you need any other fields. data Page Page :: Id -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Bool -> Maybe Bool -> Maybe Integer -> Maybe Location -> Maybe Text -> Maybe Integer -> Maybe Text -> Maybe Text -> Maybe Integer -> Page [pageId] :: Page -> Id [pageName] :: Page -> Maybe Text [pageLink] :: Page -> Maybe Text [pageCategory] :: Page -> Maybe Text [pageIsPublished] :: Page -> Maybe Bool [pageCanPost] :: Page -> Maybe Bool [pageLikes] :: Page -> Maybe Integer [pageLocation] :: Page -> Maybe Location [pagePhone] :: Page -> Maybe Text [pageCheckins] :: Page -> Maybe Integer [pagePicture] :: Page -> Maybe Text [pageWebsite] :: Page -> Maybe Text [pageTalkingAboutCount] :: Page -> Maybe Integer -- | Get a page using its ID. The user access token is optional. getPage :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Id -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m Page -- | Get a page using its ID. The user access token is optional. getPage_ :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Id -> [Argument] -> Maybe AppAccessToken -> FacebookT anyAuth m Page -- | Search pages by keyword. The user access token is optional. searchPages :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Text -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m (Pager Page) -- | An action of your app. Please refer to Facebook's documentation at -- https://developers.facebook.com/docs/opengraph/keyconcepts/#actions-objects -- to see how you can create actions. -- -- This is a newtype of Text that supports only -- IsString. This means that to create an Action you should -- use the OverloadedStrings language extension. For example, -- --
--   {-# LANGUAGE OverloadedStrings #-}
--   
--   foo token = do
--     ...
--     createAction "cook" [...] token
--   
data Action -- | Creates an Open Graph action on the user's timeline. Returns the -- Id of the newly created action. For example: -- --
--   now <- liftIO getCurrentTime
--   createAction "cook"
--                [ "recipe" #= "http://example.com/cookie.html"
--                , "when"   #= now ]
--                token
--   
createAction :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => Action -> [Argument] -> Maybe AppAccessToken -> UserAccessToken -> FacebookT Auth m Id -- | A Facebook check-in (see -- https://developers.facebook.com/docs/reference/api/checkin/). -- -- NOTE: We still don't support all fields supported by Facebook. -- Please fill an issue if you need access to any other fields. data Checkin Checkin :: Id -> Maybe CheckinFrom -> Maybe Place -> Maybe UTCTime -> Maybe (Pager Tag) -> Maybe Text -> Checkin [checkinId] :: Checkin -> Id [checkinFrom] :: Checkin -> Maybe CheckinFrom [checkinPlace] :: Checkin -> Maybe Place [checkinCreatedTime] :: Checkin -> Maybe UTCTime [checkinTags] :: Checkin -> Maybe (Pager Tag) [checkinMessage] :: Checkin -> Maybe Text -- | Information about the user who made the check-in. data CheckinFrom CheckinFrom :: UserId -> Text -> CheckinFrom [checkinFromId] :: CheckinFrom -> UserId [checkinFromName] :: CheckinFrom -> Text -- | Get a checkin from its ID. The user access token is optional, but when -- provided more information can be returned back by Facebook. getCheckin :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Id -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m Checkin -- | Creates a 'check-in' and returns its ID. Place and coordinates are -- both required by Facebook. createCheckin :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Id -> GeoCoordinates -> [Argument] -> UserAccessToken -> FacebookT Auth m Id -- | A Facebook Order oject. data Order Order :: OrderId -> UserId -> UserId -> Integer -> OrderStatus -> OrderApplication -> Text -> Maybe Text -> ZonedTime -> ZonedTime -> Order [orderId] :: Order -> OrderId [orderFrom] :: Order -> UserId [orderTo] :: Order -> UserId [orderAmount] :: Order -> Integer [orderStatus] :: Order -> OrderStatus [orderApplication] :: Order -> OrderApplication [orderCountry] :: Order -> Text [orderRefundCode] :: Order -> Maybe Text [orderCreatedTime] :: Order -> ZonedTime [orderUpdatedTime] :: Order -> ZonedTime -- | Order Id type. type OrderId = Id -- | A trimmed down version of Facebook Application as it is used in -- Order. data OrderApplication -- | A Facebook Order status type. data OrderStatus -- | Get an Order using its OrderId. The user access token is -- mandatory. getOrder :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => OrderId -> UserAccessToken -> FacebookT anyAuth m Order -- | A friend list for a User. data FriendList FriendList :: Id -> Text -> FriendListType -> FriendList [friendListId] :: FriendList -> Id [friendListName] :: FriendList -> Text [friendListType] :: FriendList -> FriendListType data FriendListType CloseFriendsList :: FriendListType AcquaintancesList :: FriendListType RestrictedList :: FriendListType UserCreatedList :: FriendListType EducationList :: FriendListType WorkList :: FriendListType CurrentCityList :: FriendListType FamilyList :: FriendListType -- | Get the members of a friend list. getFriendListMembers :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => Id -> [Argument] -> UserAccessToken -> FacebookT anyAuth m (Pager Friend) -- | Create an Argument with a SimpleType. See the docs on -- createAction for an example. (#=) :: SimpleType a => ByteString -> a -> Argument -- | Class for data types that may be represented as a Facebook simple -- type. (see -- https://developers.facebook.com/docs/opengraph/simpletypes/). class SimpleType a encodeFbParam :: SimpleType a => a -> ByteString -- | newtype for UTCTime that follows Facebook's -- conventions of JSON parsing. -- -- newtype FbUTCTime FbUTCTime :: UTCTime -> FbUTCTime [unFbUTCTime] :: FbUTCTime -> UTCTime -- | Information about a place. This is not a Graph Object, instead it's -- just a field of a Object. (Not to be confused with the Page -- object.) data Place Place :: Id -> Maybe Text -> Maybe Location -> Place -- | Page ID. [placeId] :: Place -> Id -- | Page name. [placeName] :: Place -> Maybe Text [placeLocation] :: Place -> Maybe Location -- | A geographical location. data Location Location :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe GeoCoordinates -> Location [locationStreet] :: Location -> Maybe Text [locationCity] :: Location -> Maybe Text [locationState] :: Location -> Maybe Text [locationCountry] :: Location -> Maybe Text [locationZip] :: Location -> Maybe Text [locationCoords] :: Location -> Maybe GeoCoordinates -- | Geographical coordinates. data GeoCoordinates GeoCoordinates :: !Double -> !Double -> GeoCoordinates [latitude] :: GeoCoordinates -> !Double [longitude] :: GeoCoordinates -> !Double -- | A tag (i.e. "I'll tag you on my post"). data Tag Tag :: Id -> Text -> Tag -- | Who is tagged. [tagId] :: Tag -> Id -- | Name of the tagged person. [tagName] :: Tag -> Text -- | Many Graph API results are returned as a JSON object with the -- following structure: -- --
--   {
--     "data": [
--       ...item 1...,
--            :
--       ...item n...
--     ],
--     "paging": {
--       "previous": "http://...link to previous page...",
--       "next":     "http://...link to next page..."
--     }
--   }
--   
-- -- Only the "data" field is required, the others may or may not -- appear. -- -- A Pager a datatype encodes such result where each item has -- type a. You may use functions fetchNextPage and -- fetchPreviousPage to navigate through the results. data Pager a Pager :: [a] -> Maybe String -> Maybe String -> Pager a [pagerData] :: Pager a -> [a] [pagerPrevious] :: Pager a -> Maybe String [pagerNext] :: Pager a -> Maybe String -- | Tries to fetch the next page of a Pager. Returns Nothing -- whenever the current Pager does not have a pagerNext. fetchNextPage :: (MonadResource m, FromJSON a, MonadThrow m, MonadUnliftIO m) => Pager a -> FacebookT anyAuth m (Maybe (Pager a)) -- | Tries to fetch the previous page of a Pager. Returns -- Nothing whenever the current Pager does not have a -- pagerPrevious. fetchPreviousPage :: (MonadResource m, FromJSON a, MonadThrow m, MonadUnliftIO m) => Pager a -> FacebookT anyAuth m (Maybe (Pager a)) -- | Tries to fetch all next pages and returns a Source with all -- results. The Source will include the results from this page as -- well. Previous pages will not be considered. Next pages will be -- fetched on-demand. fetchAllNextPages :: (Monad m, FromJSON a, MonadUnliftIO n, MonadThrow n) => Pager a -> FacebookT anyAuth m (ConduitT () a n ()) -- | Tries to fetch all previous pages and returns a Source with all -- results. The Source will include the results from this page as -- well. Next pages will not be considered. Previous pages will be -- fetched on-demand. fetchAllPreviousPages :: (Monad m, FromJSON a, MonadUnliftIO n, MonadThrow n) => Pager a -> FacebookT anyAuth m (ConduitT () a n ()) -- | Add or modify a subscription for real-time updates. If there were no -- previous subscriptions for the given RealTimeUpdateObject, then -- a new subscription is created. If there was any previous subscription -- for the given RealTimeUpdateObject, it's overriden by this one -- (even if the other subscription had a different callback URL). modifySubscription :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => RealTimeUpdateObject -> [RealTimeUpdateField] -> RealTimeUpdateUrl -> RealTimeUpdateToken -> AppAccessToken -> FacebookT Auth m () -- | List current real-time update subscriptions. listSubscriptions :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => AppAccessToken -> FacebookT Auth m [RealTimeUpdateSubscription] -- | The type of objects that a real-time update refers to. data RealTimeUpdateObject UserRTUO :: RealTimeUpdateObject PermissionsRTUO :: RealTimeUpdateObject PageRTUO :: RealTimeUpdateObject ErrorsRTUO :: RealTimeUpdateObject OtherRTUO :: Text -> RealTimeUpdateObject -- | A field of a RealTimeUpdateObject that you would like to -- receive notifications when changed. type RealTimeUpdateField = ByteString -- | The URL on your server that will receive the real-time updates. Please -- refer to Facebook's documentation in order to see what this URL needs -- to implement. type RealTimeUpdateUrl = Text -- | A token that is sent back by Facebook's servers to your server in -- order to verify that you really were trying to modify your -- subscription. type RealTimeUpdateToken = ByteString -- | Information returned by Facebook about a real-time update notification -- subscription. data RealTimeUpdateSubscription RealTimeUpdateSubscription :: RealTimeUpdateObject -> RealTimeUpdateUrl -> [RealTimeUpdateField] -> Bool -> RealTimeUpdateSubscription [rtusObject] :: RealTimeUpdateSubscription -> RealTimeUpdateObject [rtusCallbackUrl] :: RealTimeUpdateSubscription -> RealTimeUpdateUrl [rtusFields] :: RealTimeUpdateSubscription -> [RealTimeUpdateField] [rtusActive] :: RealTimeUpdateSubscription -> Bool -- | Verifi(es the input's authenticity (i.e. it comes from, MonadIO m) -- Facebook) and integrity by calculating its HMAC-SHA1 (using your -- application secret as the key) and verifying that it matches the value -- from the HTTP request's X-Hub-Signature header's value. If -- it's not valid, Nothing is returned, otherwise Just -- data is returned where data is the original data. verifyRealTimeUpdateNotifications :: (Monad m, MonadIO m) => ByteString -> ByteString -> FacebookT Auth m (Maybe ByteString) -- | Same as verifyRealTimeUpdateNotifications but also parses the -- response as JSON. Returns Nothing if either the signature is -- invalid or the data can't be parsed (use -- verifyRealTimeUpdateNotifications if you need to distinguish -- between these two error conditions). getRealTimeUpdateNotifications :: (Monad m, FromJSON a, MonadIO m) => ByteString -> ByteString -> FacebookT Auth m (Maybe (RealTimeUpdateNotification a)) -- | When data changes and there's a valid subscription, Facebook will -- POST to your RealTimeUpdateUrl with a JSON-encoded -- object containing the notifications. A 'RealTimeUpdateNotification a' -- represents such object where a is type of the entries (e.g., -- RealTimeUpdateNotificationUserEntry). -- -- If you have a single RealTimeUpdateUrl for different kinds of -- notifications, you may parse a RealTimeUpdateNotification -- Value and then manually parse the Value depending -- on the value of rtunObject. -- -- We recommend using getRealTimeUpdateNotifications. data RealTimeUpdateNotification a RealTimeUpdateNotification :: RealTimeUpdateObject -> [a] -> RealTimeUpdateNotification a [rtunObject] :: RealTimeUpdateNotification a -> RealTimeUpdateObject [rtunEntries] :: RealTimeUpdateNotification a -> [a] -- | A notification for the UserRTUO object. data RealTimeUpdateNotificationUserEntry RealTimeUpdateNotificationUserEntry :: Id -> [RealTimeUpdateField] -> Integer -> RealTimeUpdateNotificationUserEntry [rtuneUserId] :: RealTimeUpdateNotificationUserEntry -> Id [rtuneChangedFields] :: RealTimeUpdateNotificationUserEntry -> [RealTimeUpdateField] [rtuneTime] :: RealTimeUpdateNotificationUserEntry -> Integer -- | Query the Facebook Graph using FQL. fqlQuery :: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) => Text -> Maybe (AccessToken anyKind) -> FacebookT anyAuth m (Pager a) -- | newtype wrapper around UTCTime that is able to parse -- FQL's time representation as seconds since the Unix epoch. -- | Deprecated: Deprecated since fb 0.14.7, please use FbUTCTime -- instead. newtype FQLTime -- | Deprecated: Deprecated since fb 0.14.7, please use FbUTCTime -- instead. FQLTime :: UTCTime -> FQLTime [unFQLTime] :: FQLTime -> UTCTime -- | newtype wrapper around lists that works around FQL's strange -- lists. -- -- For example, if you fetch the tagged_uids field from -- location_post, you'll find that Facebook's FQL represents an -- empty list of tagged UIDs as plain JSON array ([]). However, -- it represents a singleton list as an object {"1234": 1234} -- instead of the much more correct [1234]. -- -- On the other hand, not all FQL arrays are represented in this bogus -- manner. Also, some so-called arrays by FQL's documentation are -- actually objects, see FQLObject. newtype FQLList a FQLList :: [a] -> FQLList a [unFQLList] :: FQLList a -> [a] -- | newtype wrapper around any object that works around FQL's -- strange objects. -- -- For example, if you fetch the app_data field from -- stream, you'll find that empty objects are actually -- represented as empty lists [] instead of a proper empty -- object {}. Also note that FQL's documentation says that -- app_data is an array, which it clear is not. See also -- FQLList. newtype FQLObject a FQLObject :: a -> FQLObject a [unFQLObject] :: FQLObject a -> a -- | Get a list of test users. getTestUsers :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => AppAccessToken -> FacebookT Auth m (Pager TestUser) disassociateTestuser :: (MonadUnliftIO m, MonadThrow m, MonadResource m, MonadIO m) => TestUser -> AppAccessToken -> FacebookT Auth m Bool -- | Remove an existing test user. removeTestUser :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => TestUser -> AppAccessToken -> FacebookT Auth m Bool -- | Create a new test user. Ref: -- https://developers.facebook.com/docs/graph-api/reference/v2.8/app/accounts/test-users#publish createTestUser :: (MonadResource m, MonadUnliftIO m, MonadThrow m, MonadIO m) => CreateTestUser -> AppAccessToken -> FacebookT Auth m TestUser -- | Make a friend connection between two test users. -- -- This is how Facebook's API work: two calls must be made. The first -- call has the format: "/userA_id/friends/userB_id" with the access -- token of user A as query parameter. The second call has the format: -- "/userB_id/friends/userA_id" with the access token of user B as query -- parameter. The first call creates a friend request and the second call -- accepts the friend request. makeFriendConn :: (MonadResource m, MonadUnliftIO m, MonadThrow m) => TestUser -> TestUser -> FacebookT Auth m () -- | Create an AccessToken from a TestUser. It's incomplete -- because it will not have the right expiration time. incompleteTestUserAccessToken :: TestUser -> Maybe UserAccessToken -- | A Facebook test user. Ref: -- https://developers.facebook.com/docs/graph-api/reference/v2.8/app/accounts/test-users data TestUser TestUser :: UserId -> Maybe AccessTokenData -> Maybe Text -> Maybe Text -> Maybe Text -> TestUser [tuId] :: TestUser -> UserId [tuAccessToken] :: TestUser -> Maybe AccessTokenData [tuLoginUrl] :: TestUser -> Maybe Text [tuEmail] :: TestUser -> Maybe Text [tuPassword] :: TestUser -> Maybe Text -- | Data type used to hold information of a new test user. This type also -- accepts a Data.Default value. data CreateTestUser CreateTestUser :: CreateTestUserInstalled -> Maybe Text -> Maybe Text -> CreateTestUser [ctuInstalled] :: CreateTestUser -> CreateTestUserInstalled [ctuName] :: CreateTestUser -> Maybe Text [ctuLocale] :: CreateTestUser -> Maybe Text -- | Specify if the app is to be installed on the new test user. If it is, -- then you must tell what permissions should be given. data CreateTestUserInstalled CreateTestUserNotInstalled :: CreateTestUserInstalled CreateTestUserInstalled :: [Permission] -> CreateTestUserInstalled [ctuiPermissions] :: CreateTestUserInstalled -> [Permission] -- | Uses Facebook's default. It seems that this is equivalent to CreateTestUserFbDefault :: CreateTestUserInstalled -- | Make a raw GET request to Facebook's Graph API. getObject :: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) => Text -> [Argument] -> Maybe (AccessToken anyKind) -> FacebookT anyAuth m a -- | Make a raw POST request to Facebook's Graph API. postObject :: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) => Text -> [Argument] -> AccessToken anyKind -> FacebookT Auth m a -- | Make a raw DELETE request to Facebook's Graph API. deleteObject :: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) => Text -> [Argument] -> AccessToken anyKind -> FacebookT Auth m a -- | Make a raw GET request to the /search endpoint of Facebook’s -- Graph API. Returns a raw JSON Value. searchObjects :: (MonadResource m, MonadUnliftIO m, MonadThrow m, FromJSON a) => Text -> Text -> [Argument] -> Maybe UserAccessToken -> FacebookT anyAuth m (Pager a) -- | The identification code of an object. newtype Id Id :: Text -> Id [idCode] :: Id -> Text -- | An argument given to an API call. type Argument = (ByteString, ByteString) -- | An exception that may be thrown by functions on this package. Includes -- any information provided by Facebook. data FacebookException -- | An exception coming from Facebook. FacebookException :: Text -> Text -> FacebookException [fbeType] :: FacebookException -> Text [fbeMessage] :: FacebookException -> Text -- | An exception coming from the fb package's code. FbLibraryException :: Text -> FacebookException [fbeMessage] :: FacebookException -> Text -- | Retrieves the Text back from a Permission. Most of the -- time you won't need to use this function, but you may need it if -- you're a library author. unPermission :: Permission -> Text