2023-02-07 11:07:15 -08:00
|
|
|
from django.urls import path
|
2023-02-13 18:40:10 -08:00
|
|
|
from hatchway import methods
|
2023-02-07 11:07:15 -08:00
|
|
|
|
|
|
|
from api.views import (
|
|
|
|
accounts,
|
|
|
|
announcements,
|
|
|
|
apps,
|
2023-03-09 13:36:24 -08:00
|
|
|
bookmarks,
|
2023-02-07 11:07:15 -08:00
|
|
|
emoji,
|
|
|
|
filters,
|
2023-03-09 13:36:24 -08:00
|
|
|
follow_requests,
|
2023-02-07 11:07:15 -08:00
|
|
|
instance,
|
2023-03-09 13:36:24 -08:00
|
|
|
lists,
|
2023-02-07 11:07:15 -08:00
|
|
|
media,
|
|
|
|
notifications,
|
2023-02-15 09:42:56 -08:00
|
|
|
polls,
|
2023-03-09 13:36:24 -08:00
|
|
|
preferences,
|
2023-07-15 11:37:34 -07:00
|
|
|
push,
|
2023-02-07 11:07:15 -08:00
|
|
|
search,
|
|
|
|
statuses,
|
2023-08-17 01:11:06 -07:00
|
|
|
suggestions,
|
2023-03-09 13:36:24 -08:00
|
|
|
tags,
|
2023-02-07 11:07:15 -08:00
|
|
|
timelines,
|
2023-02-10 15:10:53 -08:00
|
|
|
trends,
|
2023-02-07 11:07:15 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
urlpatterns = [
|
|
|
|
# Accounts
|
|
|
|
path("v1/accounts/verify_credentials", accounts.verify_credentials),
|
|
|
|
path("v1/accounts/update_credentials", accounts.update_credentials),
|
|
|
|
path("v1/accounts/relationships", accounts.account_relationships),
|
|
|
|
path("v1/accounts/familiar_followers", accounts.familiar_followers),
|
|
|
|
path("v1/accounts/search", accounts.accounts_search),
|
|
|
|
path("v1/accounts/lookup", accounts.lookup),
|
|
|
|
path("v1/accounts/<id>", accounts.account),
|
|
|
|
path("v1/accounts/<id>/statuses", accounts.account_statuses),
|
|
|
|
path("v1/accounts/<id>/follow", accounts.account_follow),
|
|
|
|
path("v1/accounts/<id>/unfollow", accounts.account_unfollow),
|
|
|
|
path("v1/accounts/<id>/block", accounts.account_block),
|
|
|
|
path("v1/accounts/<id>/unblock", accounts.account_unblock),
|
|
|
|
path("v1/accounts/<id>/mute", accounts.account_mute),
|
|
|
|
path("v1/accounts/<id>/unmute", accounts.account_unmute),
|
|
|
|
path("v1/accounts/<id>/following", accounts.account_following),
|
|
|
|
path("v1/accounts/<id>/followers", accounts.account_followers),
|
2023-03-09 13:36:24 -08:00
|
|
|
path("v1/accounts/<id>/featured_tags", accounts.account_featured_tags),
|
2023-02-07 11:07:15 -08:00
|
|
|
# Announcements
|
|
|
|
path("v1/announcements", announcements.announcement_list),
|
|
|
|
path("v1/announcements/<pk>/dismiss", announcements.announcement_dismiss),
|
|
|
|
# Apps
|
|
|
|
path("v1/apps", apps.add_app),
|
2023-07-15 11:37:34 -07:00
|
|
|
path("v1/apps/verify_credentials", apps.verify_credentials),
|
2023-03-09 13:36:24 -08:00
|
|
|
# Bookmarks
|
|
|
|
path("v1/bookmarks", bookmarks.bookmarks),
|
2023-02-10 15:10:53 -08:00
|
|
|
# Emoji
|
|
|
|
path("v1/custom_emojis", emoji.emojis),
|
2023-02-07 11:07:15 -08:00
|
|
|
# Filters
|
|
|
|
path("v2/filters", filters.list_filters),
|
|
|
|
path("v1/filters", filters.list_filters),
|
2023-03-09 13:36:24 -08:00
|
|
|
# Follow requests
|
|
|
|
path("v1/follow_requests", follow_requests.follow_requests),
|
2023-02-07 11:07:15 -08:00
|
|
|
# Instance
|
|
|
|
path("v1/instance", instance.instance_info_v1),
|
2023-07-15 11:37:34 -07:00
|
|
|
path("v1/instance/activity", instance.activity),
|
2023-03-09 13:36:24 -08:00
|
|
|
path("v1/instance/peers", instance.peers),
|
2023-02-07 11:07:15 -08:00
|
|
|
path("v2/instance", instance.instance_info_v2),
|
2023-03-09 13:36:24 -08:00
|
|
|
# Lists
|
|
|
|
path("v1/lists", lists.get_lists),
|
2023-02-10 15:10:53 -08:00
|
|
|
# Media
|
2023-02-07 11:07:15 -08:00
|
|
|
path("v1/media", media.upload_media),
|
|
|
|
path("v2/media", media.upload_media),
|
|
|
|
path("v1/media/<id>", methods(get=media.get_media, put=media.update_media)),
|
|
|
|
path(
|
|
|
|
"v1/statuses/<id>",
|
|
|
|
methods(
|
|
|
|
get=statuses.status,
|
2023-02-13 18:40:10 -08:00
|
|
|
put=statuses.edit_status,
|
2023-02-07 11:07:15 -08:00
|
|
|
delete=statuses.delete_status,
|
|
|
|
),
|
|
|
|
),
|
2023-02-13 18:40:10 -08:00
|
|
|
path("v1/statuses/<id>/source", statuses.status_source),
|
2023-02-10 15:10:53 -08:00
|
|
|
# Notifications
|
|
|
|
path("v1/notifications", notifications.notifications),
|
2023-07-11 15:37:03 -07:00
|
|
|
path("v1/notifications/clear", notifications.dismiss_notifications),
|
2023-07-04 07:06:31 -07:00
|
|
|
path("v1/notifications/<id>", notifications.get_notification),
|
2023-07-11 15:37:03 -07:00
|
|
|
path("v1/notifications/<id>/dismiss", notifications.dismiss_notification),
|
2023-02-15 09:42:56 -08:00
|
|
|
# Polls
|
|
|
|
path("v1/polls/<id>", polls.get_poll),
|
|
|
|
path("v1/polls/<id>/votes", polls.vote_poll),
|
2023-03-09 13:36:24 -08:00
|
|
|
# Preferences
|
|
|
|
path("v1/preferences", preferences.preferences),
|
2023-07-15 11:37:34 -07:00
|
|
|
# Push
|
|
|
|
path(
|
|
|
|
"v1/push/subscription",
|
|
|
|
methods(
|
|
|
|
get=push.get_subscription,
|
|
|
|
post=push.create_subscription,
|
|
|
|
put=push.update_subscription,
|
|
|
|
delete=push.delete_subscription,
|
|
|
|
),
|
|
|
|
),
|
2023-02-10 15:10:53 -08:00
|
|
|
# Search
|
2023-05-06 09:30:21 -07:00
|
|
|
path("v1/search", search.search),
|
2023-02-10 15:10:53 -08:00
|
|
|
path("v2/search", search.search),
|
|
|
|
# Statuses
|
|
|
|
path("v1/statuses", statuses.post_status),
|
2023-02-07 11:07:15 -08:00
|
|
|
path("v1/statuses/<id>/context", statuses.status_context),
|
|
|
|
path("v1/statuses/<id>/favourite", statuses.favourite_status),
|
|
|
|
path("v1/statuses/<id>/unfavourite", statuses.unfavourite_status),
|
|
|
|
path("v1/statuses/<id>/favourited_by", statuses.favourited_by),
|
|
|
|
path("v1/statuses/<id>/reblog", statuses.reblog_status),
|
|
|
|
path("v1/statuses/<id>/unreblog", statuses.unreblog_status),
|
2023-03-31 12:40:15 -07:00
|
|
|
path("v1/statuses/<id>/reblogged_by", statuses.reblogged_by),
|
2023-03-11 10:17:20 -08:00
|
|
|
path("v1/statuses/<id>/bookmark", statuses.bookmark_status),
|
|
|
|
path("v1/statuses/<id>/unbookmark", statuses.unbookmark_status),
|
2023-05-13 09:01:27 -07:00
|
|
|
path("v1/statuses/<id>/pin", statuses.pin_status),
|
|
|
|
path("v1/statuses/<id>/unpin", statuses.unpin_status),
|
2023-03-09 13:36:24 -08:00
|
|
|
# Tags
|
|
|
|
path("v1/followed_tags", tags.followed_tags),
|
2023-04-06 14:14:21 -07:00
|
|
|
path("v1/tags/<hashtag>", tags.hashtag),
|
2023-03-14 14:35:40 -07:00
|
|
|
path("v1/tags/<id>/follow", tags.follow),
|
|
|
|
path("v1/tags/<id>/unfollow", tags.unfollow),
|
2023-02-10 15:10:53 -08:00
|
|
|
# Timelines
|
|
|
|
path("v1/timelines/home", timelines.home),
|
|
|
|
path("v1/timelines/public", timelines.public),
|
|
|
|
path("v1/timelines/tag/<hashtag>", timelines.hashtag),
|
|
|
|
path("v1/conversations", timelines.conversations),
|
|
|
|
path("v1/favourites", timelines.favourites),
|
|
|
|
# Trends
|
|
|
|
path("v1/trends/tags", trends.trends_tags),
|
|
|
|
path("v1/trends/statuses", trends.trends_statuses),
|
|
|
|
path("v1/trends/links", trends.trends_links),
|
2023-08-17 01:11:06 -07:00
|
|
|
# Suggestions
|
|
|
|
path("v2/suggestions", suggestions.suggested_users),
|
2023-02-07 11:07:15 -08:00
|
|
|
]
|