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

218 lines
3.3 KiB
Elm
Raw Normal View History

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