2017-04-26 11:07:43 -04:00
|
|
|
module Mastodon.ApiUrl
|
|
|
|
exposing
|
|
|
|
( apps
|
|
|
|
, oauthAuthorize
|
|
|
|
, oauthToken
|
2017-04-28 05:21:54 -04:00
|
|
|
, userAccount
|
2017-04-26 11:07:43 -04:00
|
|
|
, account
|
2017-04-27 16:01:51 -04:00
|
|
|
, accountTimeline
|
2017-04-29 12:05:06 -04:00
|
|
|
, followers
|
|
|
|
, following
|
2017-04-29 03:20:26 -04:00
|
|
|
, status
|
2017-04-26 11:07:43 -04:00
|
|
|
, homeTimeline
|
|
|
|
, publicTimeline
|
2017-05-13 09:55:46 -04:00
|
|
|
, favouriteTimeline
|
2017-04-26 11:07:43 -04:00
|
|
|
, notifications
|
2017-04-29 16:48:55 -04:00
|
|
|
, relationships
|
2017-04-26 11:07:43 -04:00
|
|
|
, statuses
|
2017-04-27 12:39:14 -04:00
|
|
|
, context
|
2017-04-26 11:07:43 -04:00
|
|
|
, reblog
|
|
|
|
, unreblog
|
|
|
|
, favourite
|
|
|
|
, unfavourite
|
2017-04-29 16:48:55 -04:00
|
|
|
, follow
|
|
|
|
, unfollow
|
2017-05-11 04:55:15 -04:00
|
|
|
, uploadMedia
|
2017-04-26 11:07:43 -04:00
|
|
|
, streaming
|
2017-05-01 16:10:34 -04:00
|
|
|
, searchAccount
|
2017-04-26 11:07:43 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2017-05-03 02:52:39 -04:00
|
|
|
apiPrefix : String
|
|
|
|
apiPrefix =
|
2017-05-03 03:11:52 -04:00
|
|
|
"/api/v1"
|
2017-04-26 11:07:43 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
apps : String
|
|
|
|
apps =
|
2017-05-03 02:52:39 -04:00
|
|
|
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 =
|
2017-05-03 02:52:39 -04:00
|
|
|
apiPrefix ++ "/accounts/"
|
2017-04-26 11:07:43 -04:00
|
|
|
|
|
|
|
|
|
|
|
account : Int -> String
|
|
|
|
account id =
|
|
|
|
accounts ++ (toString id)
|
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
follow : Int -> String
|
|
|
|
follow id =
|
|
|
|
accounts ++ (toString id) ++ "/follow"
|
2017-04-29 16:48:55 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
unfollow : Int -> String
|
|
|
|
unfollow id =
|
|
|
|
accounts ++ (toString id) ++ "/unfollow"
|
2017-04-29 16:48:55 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
userAccount : String
|
|
|
|
userAccount =
|
|
|
|
accounts ++ "verify_credentials"
|
2017-04-28 05:21:54 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
searchAccount : String
|
|
|
|
searchAccount =
|
|
|
|
accounts ++ "search"
|
2017-05-01 16:10:34 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:31:15 -04:00
|
|
|
relationships : String
|
|
|
|
relationships =
|
|
|
|
accounts ++ "relationships"
|
2017-04-29 16:48:55 -04:00
|
|
|
|
|
|
|
|
2017-04-29 12:05:06 -04:00
|
|
|
followers : Int -> String
|
|
|
|
followers id =
|
|
|
|
(account id) ++ "/followers"
|
|
|
|
|
|
|
|
|
|
|
|
following : Int -> String
|
|
|
|
following id =
|
|
|
|
(account id) ++ "/following"
|
|
|
|
|
|
|
|
|
2017-04-26 11:07:43 -04:00
|
|
|
homeTimeline : String
|
|
|
|
homeTimeline =
|
2017-05-03 02:52:39 -04:00
|
|
|
apiPrefix ++ "/timelines/home"
|
2017-04-26 11:07:43 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:31:15 -04:00
|
|
|
publicTimeline : String
|
|
|
|
publicTimeline =
|
2017-05-03 02:52:39 -04:00
|
|
|
apiPrefix ++ "/timelines/public"
|
2017-04-26 11:07:43 -04:00
|
|
|
|
|
|
|
|
2017-04-27 16:01:51 -04:00
|
|
|
accountTimeline : Int -> String
|
|
|
|
accountTimeline id =
|
|
|
|
(account id) ++ "/statuses"
|
|
|
|
|
|
|
|
|
2017-05-13 09:55:46 -04:00
|
|
|
favouriteTimeline : String
|
|
|
|
favouriteTimeline =
|
|
|
|
apiPrefix ++ "/favourites"
|
|
|
|
|
|
|
|
|
2017-04-26 11:07:43 -04:00
|
|
|
notifications : String
|
|
|
|
notifications =
|
2017-05-03 02:52:39 -04:00
|
|
|
apiPrefix ++ "/notifications"
|
2017-04-26 11:07:43 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
statuses : String
|
|
|
|
statuses =
|
2017-05-03 02:52:39 -04:00
|
|
|
apiPrefix ++ "/statuses"
|
2017-04-26 11:07:43 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
context : Int -> String
|
|
|
|
context id =
|
|
|
|
statuses ++ "/" ++ (toString id) ++ "/context"
|
2017-04-27 12:39:14 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
reblog : Int -> String
|
|
|
|
reblog id =
|
|
|
|
statuses ++ "/" ++ (toString id) ++ "/reblog"
|
2017-04-26 11:07:43 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
status : Int -> String
|
|
|
|
status id =
|
|
|
|
statuses ++ "/" ++ (toString id)
|
2017-04-29 03:20:26 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
unreblog : Int -> String
|
|
|
|
unreblog id =
|
|
|
|
statuses ++ "/" ++ (toString id) ++ "/unreblog"
|
2017-04-26 11:07:43 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
favourite : Int -> String
|
|
|
|
favourite id =
|
|
|
|
statuses ++ "/" ++ (toString id) ++ "/favourite"
|
2017-04-26 11:07:43 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
unfavourite : Int -> String
|
|
|
|
unfavourite id =
|
|
|
|
statuses ++ "/" ++ (toString id) ++ "/unfavourite"
|
2017-04-26 11:07:43 -04:00
|
|
|
|
|
|
|
|
2017-05-02 16:05:46 -04:00
|
|
|
streaming : String
|
|
|
|
streaming =
|
2017-05-03 02:52:39 -04:00
|
|
|
apiPrefix ++ "/streaming/"
|
2017-05-11 04:55:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
uploadMedia : String
|
|
|
|
uploadMedia =
|
|
|
|
apiPrefix ++ "/media"
|