1
0
Fork 0
tooty/src/Mastodon/ApiUrl.elm

214 lines
3.2 KiB
Elm
Raw Normal View History

2017-04-26 15:07:43 +00:00
module Mastodon.ApiUrl
exposing
( apps
, oauthAuthorize
, oauthToken
, userAccount
2017-04-26 15:07:43 +00:00
, account
2017-04-27 20:01:51 +00:00
, accountTimeline
, followers
, following
2017-04-29 07:20:26 +00:00
, status
2017-04-26 15:07:43 +00:00
, homeTimeline
, publicTimeline
, favouriteTimeline
, hashtag
, mutes
, blocks
2017-04-26 15:07:43 +00:00
, notifications
, relationships
2017-04-26 15:07:43 +00:00
, statuses
, context
2017-04-26 15:07:43 +00:00
, reblog
, unreblog
, favourite
, unfavourite
, follow
, unfollow
, mute
, unmute
, block
, unblock
2017-05-11 08:55:15 +00:00
, uploadMedia
2017-04-26 15:07:43 +00:00
, streaming
, searchAccount
, search
2017-04-26 15:07:43 +00:00
)
import Mastodon.Model exposing (StatusId(..))
2017-04-26 15:07:43 +00:00
apiPrefix : String
apiPrefix =
"/api/v1"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
apps : String
apps =
apiPrefix ++ "/apps"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
oauthAuthorize : String
oauthAuthorize =
"/oauth/authorize"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
oauthToken : String
oauthToken =
"/oauth/token"
2017-04-26 15:07:43 +00:00
accounts : String
accounts =
apiPrefix ++ "/accounts/"
2017-04-26 15:07:43 +00:00
account : String -> String
2017-04-26 15:07:43 +00:00
account id =
accounts ++ id
2017-04-26 15:07:43 +00:00
follow : String -> String
2017-05-02 20:05:46 +00:00
follow id =
accounts ++ id ++ "/follow"
unfollow : String -> String
2017-05-02 20:05:46 +00:00
unfollow id =
accounts ++ id ++ "/unfollow"
mute : String -> String
mute id =
accounts ++ id ++ "/mute"
unmute : String -> String
unmute id =
accounts ++ id ++ "/unmute"
block : String -> String
block id =
accounts ++ id ++ "/block"
unblock : String -> String
unblock id =
accounts ++ id ++ "/unblock"
2017-05-02 20:05:46 +00:00
userAccount : String
userAccount =
accounts ++ "verify_credentials"
search : String
search =
apiPrefix ++ "/search"
2017-05-02 20:05:46 +00:00
searchAccount : String
searchAccount =
accounts ++ "search"
relationships : String
relationships =
accounts ++ "relationships"
followers : String -> String
followers id =
account id ++ "/followers"
following : String -> String
following id =
account id ++ "/following"
2017-04-26 15:07:43 +00:00
homeTimeline : String
homeTimeline =
apiPrefix ++ "/timelines/home"
2017-04-26 15:07:43 +00:00
publicTimeline : String
publicTimeline =
apiPrefix ++ "/timelines/public"
2017-04-26 15:07:43 +00:00
accountTimeline : String -> String
2017-04-27 20:01:51 +00:00
accountTimeline id =
account id ++ "/statuses"
2017-04-27 20:01:51 +00:00
favouriteTimeline : String
favouriteTimeline =
apiPrefix ++ "/favourites"
hashtag : String -> String
hashtag tag =
apiPrefix ++ "/timelines/tag/" ++ tag
mutes : String
mutes =
apiPrefix ++ "/mutes"
blocks : String
blocks =
apiPrefix ++ "/blocks"
2017-04-26 15:07:43 +00:00
notifications : String
notifications =
apiPrefix ++ "/notifications"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
statuses : String
statuses =
apiPrefix ++ "/statuses"
2017-04-26 15:07:43 +00:00
context : StatusId -> String
context (StatusId id) =
statuses ++ "/" ++ id ++ "/context"
reblog : StatusId -> String
reblog (StatusId id) =
statuses ++ "/" ++ id ++ "/reblog"
2017-04-26 15:07:43 +00:00
status : StatusId -> String
status (StatusId id) =
statuses ++ "/" ++ id
2017-04-29 07:20:26 +00:00
unreblog : StatusId -> String
unreblog (StatusId id) =
statuses ++ "/" ++ id ++ "/unreblog"
2017-04-26 15:07:43 +00:00
favourite : StatusId -> String
favourite (StatusId id) =
statuses ++ "/" ++ id ++ "/favourite"
2017-04-26 15:07:43 +00:00
unfavourite : StatusId -> String
unfavourite (StatusId id) =
statuses ++ "/" ++ id ++ "/unfavourite"
2017-04-26 15:07:43 +00:00
2017-05-02 20:05:46 +00:00
streaming : String
streaming =
apiPrefix ++ "/streaming/"
2017-05-11 08:55:15 +00:00
uploadMedia : String
uploadMedia =
apiPrefix ++ "/media"