<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\Module;
$profileRoutes = [
- '' => [Module\Profile\Index::class, [R::GET]],
- '/attachment/upload' => [Module\Profile\Attachment\Upload::class, [ R::POST]],
- '/contacts/common' => [Module\Profile\Common::class, [R::GET]],
- '/contacts[/{type}]' => [Module\Profile\Contacts::class, [R::GET]],
- '/media' => [Module\Profile\Media::class, [R::GET]],
- '/photos/upload' => [Module\Profile\Photos\Upload::class, [ R::POST]],
- '/profile' => [Module\Profile\Profile::class, [R::GET]],
- '/remote_follow' => [Module\Profile\RemoteFollow::class, [R::GET, R::POST]],
- '/schedule' => [Module\Profile\Schedule::class, [R::GET, R::POST]],
- '/status[/{category}[/{date1}[/{date2}]]]' => [Module\Profile\Status::class, [R::GET]],
- '/unkmail' => [Module\Profile\UnkMail::class, [R::GET, R::POST]],
+ '' => [Module\Profile\Index::class, [R::GET]],
+ '/contacts/common' => [Module\Profile\Common::class, [R::GET]],
+ '/contacts[/{type}]' => [Module\Profile\Contacts::class, [R::GET]],
+ '/media' => [Module\Profile\Media::class, [R::GET]],
+ '/photos' => [Module\Profile\Photos::class, [R::GET, R::POST]],
+ '/profile' => [Module\Profile\Profile::class, [R::GET]],
+ '/remote_follow' => [Module\Profile\RemoteFollow::class, [R::GET, R::POST]],
+ '/restricted' => [Module\Profile\Restricted::class, [R::GET ]],
+ '/schedule' => [Module\Profile\Schedule::class, [R::GET, R::POST]],
+ '/conversations[/{category}[/{date1}[/{date2}]]]' => [Module\Profile\Conversations::class, [R::GET]],
+ '/unkmail' => [Module\Profile\UnkMail::class, [R::GET, R::POST]],
];
$apiRoutes = [
'/group_delete[.{extension:json|xml|rss|atom}]' => [Module\Api\Friendica\Group\Delete::class, [ R::POST]],
'/group_update[.{extension:json|xml|rss|atom}]' => [Module\Api\Friendica\Group\Update::class, [ R::POST]],
'/profile/show[.{extension:json|xml|rss|atom}]' => [Module\Api\Friendica\Profile\Show::class, [R::GET ]],
+ '/photoalbums[.{extension:json|xml|rss|atom}]' => [Module\Api\Friendica\Photoalbum\Index::class, [R::GET ]],
+ '/photoalbum[.{extension:json|xml|rss|atom}]' => [Module\Api\Friendica\Photoalbum\Show::class, [R::GET ]],
'/photoalbum/delete[.{extension:json|xml|rss|atom}]' => [Module\Api\Friendica\Photoalbum\Delete::class, [ R::POST]],
'/photoalbum/update[.{extension:json|xml|rss|atom}]' => [Module\Api\Friendica\Photoalbum\Update::class, [ R::POST]],
'/photos/list[.{extension:json|xml|rss|atom}]' => [Module\Api\Friendica\Photo\Lists::class, [R::GET ]],
'/featured_tags' => [Module\Api\Mastodon\Unimplemented::class, [R::GET, R::POST]], // not supported
'/featured_tags/{id:\d+}' => [Module\Api\Mastodon\Unimplemented::class, [R::DELETE ]], // not supported
'/featured_tags/suggestions' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not supported
- '/filters' => [Module\Api\Mastodon\Filters::class, [R::GET ]], // Dummy, not supported
'/filters/{id:\d+}' => [Module\Api\Mastodon\Unimplemented::class, [R::GET, R::POST, R::PUT, R::DELETE]], // not supported
'/follow_requests' => [Module\Api\Mastodon\FollowRequests::class, [R::GET ]],
'/follow_requests/{id:\d+}/{action}' => [Module\Api\Mastodon\FollowRequests::class, [ R::POST]],
+ '/followed_tags' => [Module\Api\Mastodon\FollowedTags::class, [R::GET ]],
'/instance' => [Module\Api\Mastodon\Instance::class, [R::GET ]],
'/instance/activity' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // @todo
+ '/instance/domain_blocks' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // @todo
+ '/instance/extended_description' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // @todo
'/instance/peers' => [Module\Api\Mastodon\Instance\Peers::class, [R::GET ]],
'/instance/rules' => [Module\Api\Mastodon\Instance\Rules::class, [R::GET ]],
'/lists' => [Module\Api\Mastodon\Lists::class, [R::GET, R::POST]],
'/polls/{id:\d+}/votes' => [Module\Api\Mastodon\Unimplemented::class, [ R::POST]], // not supported
'/preferences' => [Module\Api\Mastodon\Preferences::class, [R::GET ]],
'/push/subscription' => [Module\Api\Mastodon\PushSubscription::class, [R::GET, R::POST, R::PUT, R::DELETE]],
- '/reports' => [Module\Api\Mastodon\Unimplemented::class, [ R::POST]], // not supported
+ '/reports' => [Module\Api\Mastodon\Reports::class, [ R::POST]],
'/scheduled_statuses' => [Module\Api\Mastodon\ScheduledStatuses::class, [R::GET ]],
'/scheduled_statuses/{id:\d+}' => [Module\Api\Mastodon\ScheduledStatuses::class, [R::GET, R::PUT, R::DELETE]],
'/statuses' => [Module\Api\Mastodon\Statuses::class, [ R::POST]],
'/statuses/{id:\d+}/pin' => [Module\Api\Mastodon\Statuses\Pin::class, [ R::POST]],
'/statuses/{id:\d+}/unpin' => [Module\Api\Mastodon\Statuses\Unpin::class, [ R::POST]],
'/statuses/{id:\d+}/history' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not implemented
- '/statuses/{id:\d+}/source' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not implemented
+ '/statuses/{id:\d+}/source' => [Module\Api\Mastodon\Statuses\Source::class, [R::GET ]],
'/streaming/direct' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not implemented
'/streaming/hashtag' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not implemented
'/streaming/hashtag/local' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not implemented
'/streaming/user' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not implemented
'/streaming/user/notification' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not implemented
'/suggestions/{id:\d+}' => [Module\Api\Mastodon\Unimplemented::class, [R::DELETE ]], // not implemented
+ '/tags/{hashtag}' => [Module\Api\Mastodon\Tags::class, [R::GET ]],
+ '/tags/{hashtag}/follow' => [Module\Api\Mastodon\Tags\Follow::class, [ R::POST]],
+ '/tags/{hashtag}/unfollow' => [Module\Api\Mastodon\Tags\Unfollow::class, [ R::POST]],
'/timelines/direct' => [Module\Api\Mastodon\Timelines\Direct::class, [R::GET ]],
'/timelines/home' => [Module\Api\Mastodon\Timelines\Home::class, [R::GET ]],
'/timelines/list/{id:\d+}' => [Module\Api\Mastodon\Timelines\ListTimeline::class, [R::GET ]],
'/timelines/public' => [Module\Api\Mastodon\Timelines\PublicTimeline::class, [R::GET ]],
'/timelines/tag/{hashtag}' => [Module\Api\Mastodon\Timelines\Tag::class, [R::GET ]],
- '/trends' => [Module\Api\Mastodon\Trends::class, [R::GET ]],
- '/trends/links' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not implemented
- '/trends/statuses' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not implemented
- '/trends/tags' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not implemented
+ '/trends' => [Module\Api\Mastodon\Trends\Tags::class, [R::GET ]],
+ '/trends/links' => [Module\Api\Mastodon\Trends\Links::class, [R::GET ]],
+ '/trends/statuses' => [Module\Api\Mastodon\Trends\Statuses::class, [R::GET ]],
+ '/trends/tags' => [Module\Api\Mastodon\Trends\Tags::class, [R::GET ]],
+ ],
+ '/v2' => [
+ '/instance' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not supported
],
'/v{version:\d+}' => [
'/admin/accounts' => [Module\Api\Mastodon\Unimplemented::class, [R::GET ]], // not supported
+ '/filters' => [Module\Api\Mastodon\Filters::class, [R::GET ]], // Dummy, not supported
'/media' => [Module\Api\Mastodon\Media::class, [ R::POST]],
'/search' => [Module\Api\Mastodon\Search::class, [R::GET ]],
'/suggestions' => [Module\Api\Mastodon\Suggestions::class, [R::GET ]],
'/proofs' => [Module\Api\Mastodon\Proofs::class, [R::GET ]], // Dummy, not supported
],
+ '/about[/more]' => [Module\About::class, [R::GET]],
+
'/admin' => [
'[/]' => [Module\Admin\Summary::class, [R::GET]],
'/acctlink' => [Module\Acctlink::class, [R::GET]],
'/apps' => [Module\Apps::class, [R::GET]],
'/attach/{item:\d+}' => [Module\Attach::class, [R::GET]],
+
+ // Mastodon route used by Fedifind to follow people who set their Webfinger address in their Twitter bio
+ '/authorize_interaction' => [Module\Contact\Follow::class, [R::GET, R::POST]],
+
'/babel' => [Module\Debug\Babel::class, [R::GET, R::POST]],
'/debug/ap' => [Module\Debug\ActivityPubConversion::class, [R::GET, R::POST]],
'/compose[/{type}]' => [Module\Item\Compose::class, [R::GET, R::POST]],
'/contact' => [
- '[/]' => [Module\Contact::class, [R::GET]],
- '/{id:\d+}[/]' => [Module\Contact\Profile::class, [R::GET, R::POST]],
- '/{id:\d+}/{action:block|ignore|update|updateprofile}'
- => [Module\Contact\Profile::class, [R::GET]],
- '/{id:\d+}/advanced' => [Module\Contact\Advanced::class, [R::GET, R::POST]],
- '/{id:\d+}/conversations' => [Module\Contact\Conversations::class, [R::GET]],
- '/{id:\d+}/contacts[/{type}]' => [Module\Contact\Contacts::class, [R::GET]],
- '/{id:\d+}/media' => [Module\Contact\Media::class, [R::GET]],
- '/{id:\d+}/posts' => [Module\Contact\Posts::class, [R::GET]],
- '/{id:\d+}/revoke' => [Module\Contact\Revoke::class, [R::GET, R::POST]],
- '/archived' => [Module\Contact::class, [R::GET]],
- '/batch' => [Module\Contact::class, [R::GET, R::POST]],
- '/blocked' => [Module\Contact::class, [R::GET]],
- '/follow' => [Module\Contact\Follow::class, [R::GET, R::POST]],
- '/hidden' => [Module\Contact::class, [R::GET]],
- '/hovercard' => [Module\Contact\Hovercard::class, [R::GET]],
- '/ignored' => [Module\Contact::class, [R::GET]],
- '/pending' => [Module\Contact::class, [R::GET]],
- '/redir/{id:\d+}' => [Module\Contact\Redir::class, [R::GET]],
- '/suggestions' => [Module\Contact\Suggestions::class, [R::GET]],
- '/unfollow' => [Module\Contact\Unfollow::class, [R::GET, R::POST]],
+ '[/]' => [Module\Contact::class, [R::GET]],
+ '/{id:\d+}[/]' => [Module\Contact\Profile::class, [R::GET, R::POST]],
+ '/{id:\d+}/{action:block|ignore|collapse|update|updateprofile}'
+ => [Module\Contact\Profile::class, [R::GET]],
+ '/{id:\d+}/advanced' => [Module\Contact\Advanced::class, [R::GET, R::POST]],
+ '/{id:\d+}/conversations' => [Module\Contact\Conversations::class, [R::GET]],
+ '/{id:\d+}/contacts[/{type}]' => [Module\Contact\Contacts::class, [R::GET]],
+ '/{id:\d+}/media' => [Module\Contact\Media::class, [R::GET]],
+ '/{id:\d+}/posts' => [Module\Contact\Posts::class, [R::GET]],
+ '/{id:\d+}/revoke' => [Module\Contact\Revoke::class, [R::GET, R::POST]],
+ '/archived' => [Module\Contact::class, [R::GET]],
+ '/batch' => [Module\Contact::class, [R::GET, R::POST]],
+ '/blocked' => [Module\Contact::class, [R::GET]],
+ '/follow' => [Module\Contact\Follow::class, [R::GET, R::POST]],
+ '/hidden' => [Module\Contact::class, [R::GET]],
+ '/hovercard' => [Module\Contact\Hovercard::class, [R::GET]],
+ '/ignored' => [Module\Contact::class, [R::GET]],
+ '/collapsed' => [Module\Contact::class, [R::GET]],
+ '/match' => [Module\Contact\MatchInterests::class, [R::GET]],
+ '/pending' => [Module\Contact::class, [R::GET]],
+ '/redir/{id:\d+}' => [Module\Contact\Redir::class, [R::GET]],
+ '/suggestions' => [Module\Contact\Suggestions::class, [R::GET]],
+ '/unfollow' => [Module\Contact\Unfollow::class, [R::GET, R::POST]],
],
'/credits' => [Module\Credits::class, [R::GET]],
'/dirfind' => [Module\Search\Directory::class, [R::GET]],
'/directory' => [Module\Directory::class, [R::GET]],
+ '/display/{guid}' => [Module\Item\Display::class, [R::GET]],
+ '/display/feed-item/{uri-id}[.atom]' => [Module\Item\Feed::class, [R::GET]],
+ '/display/feed-item/{uri-id}/{mode:conversation}[.atom]' => [Module\Item\Feed::class, [R::GET]],
+
'/featured/{nickname}' => [Module\ActivityPub\Featured::class, [R::GET]],
- '/feed' => [
- '/{nickname}' => [Module\Feed::class, [R::GET]],
- '/{nickname}/posts' => [Module\Feed::class, [R::GET]],
- '/{nickname}/comments' => [Module\Feed::class, [R::GET]],
- '/{nickname}/replies' => [Module\Feed::class, [R::GET]],
- '/{nickname}/activity' => [Module\Feed::class, [R::GET]],
- ],
+ '/feed/{nickname}[/{type:posts|comments|replies|activity}]' => [Module\Feed::class, [R::GET]],
+
'/feedtest' => [Module\Debug\Feed::class, [R::GET]],
'/fetch' => [
'/magic' => [Module\Magic::class, [R::GET]],
'/manifest' => [Module\Manifest::class, [R::GET]],
'/friendica.webmanifest' => [Module\Manifest::class, [R::GET]],
+
+ '/media' => [
+ '/attachment/browser' => [Module\Media\Attachment\Browser::class, [R::GET]],
+ '/attachment/upload' => [Module\Media\Attachment\Upload::class, [ R::POST]],
+ '/photo/browser[/{album}]' => [Module\Media\Photo\Browser::class, [R::GET]],
+ '/photo/upload' => [Module\Media\Photo\Upload::class, [ R::POST]],
+ ],
+
'/moderation' => [
'[/]' => [Module\Moderation\Summary::class, [R::GET]],
'/openid' => [Module\Security\OpenID::class, [R::GET]],
'/opensearch' => [Module\OpenSearch::class, [R::GET]],
- '/ostatus/repair' => [Module\OStatus\Repair::class, [R::GET]],
-
'/parseurl' => [Module\ParseUrl::class, [R::GET]],
'/permission/tooltip/{type}/{id:\d+}' => [Module\PermissionTooltip::class, [R::GET]],
'/photo' => [
+ '/{size:thumb_small|scaled_full}_{name}' => [Module\Photo::class, [R::GET]],
'/{name}' => [Module\Photo::class, [R::GET]],
'/{type}/{id:\d+}' => [Module\Photo::class, [R::GET]],
'/{type:contact|header}/{guid}' => [Module\Photo::class, [R::GET]],
'/{type}/{customsize:\d+}/{nickname_ext}' => [Module\Photo::class, [R::GET]],
],
+ // Kept for backwards-compatibility
+ // @TODO remove by version 2023.12
+ '/photos/{nickname}' => [Module\Profile\Photos::class, [R::GET]],
+
'/ping' => [Module\Notifications\Ping::class, [R::GET]],
'/post' => [
+ '/{post_id}/edit' => [Module\Post\Edit::class, [R::GET ]],
'/{post_id}/share' => [Module\Post\Share::class, [R::GET ]],
'/{item_id}/tag/add' => [Module\Post\Tag\Add::class, [ R::POST]],
'/{item_id}/tag/remove[/{tag_name}]' => [Module\Post\Tag\Remove::class, [R::GET, R::POST]],
'/{sub1}/{sub2}/{url}' => [Module\Proxy::class, [R::GET]],
],
- '/salmon/{nickname}' => [Module\OStatus\Salmon::class, [ R::POST]],
+ // OStatus stack modules
+ '/ostatus/repair' => [Module\OStatus\Repair::class, [R::GET ]],
+ '/ostatus/subscribe' => [Module\OStatus\Subscribe::class, [R::GET ]],
+ '/poco' => [Module\User\PortableContacts::class, [R::GET ]],
+ '/pubsub' => [Module\OStatus\PubSub::class, [R::GET, R::POST]],
+ '/pubsub/{nickname}[/{cid:\d+}]' => [Module\OStatus\PubSub::class, [R::GET, R::POST]],
+ '/pubsubhubbub[/{nickname}]' => [Module\OStatus\PubSubHubBub::class, [ R::POST]],
+ '/salmon[/{nickname}]' => [Module\OStatus\Salmon::class, [ R::POST]],
'/search' => [
- '[/]' => [Module\Search\Index::class, [R::GET]],
+ '[/]' => [Module\Search\Index::class, [R::GET ]],
'/acl' => [Module\Search\Acl::class, [R::GET, R::POST]],
- '/saved/add' => [Module\Search\Saved::class, [R::GET]],
- '/saved/remove' => [Module\Search\Saved::class, [R::GET]],
+ '/saved/add' => [Module\Search\Saved::class, [R::GET ]],
+ '/saved/remove' => [Module\Search\Saved::class, [R::GET ]],
+ '/user/tags' => [Module\Search\Tags::class, [ R::POST]],
],
'/receive' => [
'/connectors[/{connector}]' => [Module\Settings\Connectors::class, [R::GET, R::POST]],
'/delegation[/{action}/{user_id}]' => [Module\Settings\Delegation::class, [R::GET, R::POST]],
'/display' => [Module\Settings\Display::class, [R::GET, R::POST]],
+ '/features' => [Module\Settings\Features::class, [R::GET, R::POST]],
'/oauth' => [Module\Settings\OAuth::class, [R::GET, R::POST]],
'/profile' => [
'[/]' => [Module\Settings\Profile\Index::class, [R::GET, R::POST]],
'/update_community[/{content}]' => [Module\Update\Community::class, [R::GET]],
+ '/update_display' => [Module\Update\Display::class, [R::GET]],
+
'/update_network' => [
'[/]' => [Module\Update\Network::class, [R::GET]],
'/archive/{from:\d\d\d\d-\d\d-\d\d}[/{to:\d\d\d\d-\d\d-\d\d}]' => [Module\Update\Network::class, [R::GET]],