diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bfcdfb22..c067c9f0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -130,7 +130,7 @@ Tests **should** be written for all API routes and all functions that are not tr #### Adding per-route tests -To add tests for a route, create a `route_file_name.test.ts` file in the same directory as the route itself. See [this example](/server/api/api/v1/timelines/home.test.ts) for help writing tests. +To add tests for a route, create a `route_file_name.test.ts` file in the same directory as the route itself. See [this example](/api/api/v1/timelines/home.test.ts) for help writing tests. ### Writing documentation diff --git a/server/api/api/auth/login/index.test.ts b/api/api/auth/login/index.test.ts similarity index 100% rename from server/api/api/auth/login/index.test.ts rename to api/api/auth/login/index.test.ts diff --git a/server/api/api/auth/login/index.ts b/api/api/auth/login/index.ts similarity index 100% rename from server/api/api/auth/login/index.ts rename to api/api/auth/login/index.ts diff --git a/server/api/api/auth/mastodon-login/index.ts b/api/api/auth/mastodon-login/index.ts similarity index 100% rename from server/api/api/auth/mastodon-login/index.ts rename to api/api/auth/mastodon-login/index.ts diff --git a/server/api/api/auth/mastodon-logout/index.ts b/api/api/auth/mastodon-logout/index.ts similarity index 100% rename from server/api/api/auth/mastodon-logout/index.ts rename to api/api/auth/mastodon-logout/index.ts diff --git a/server/api/api/auth/redirect/index.ts b/api/api/auth/redirect/index.ts similarity index 100% rename from server/api/api/auth/redirect/index.ts rename to api/api/auth/redirect/index.ts diff --git a/server/api/api/auth/reset/index.test.ts b/api/api/auth/reset/index.test.ts similarity index 100% rename from server/api/api/auth/reset/index.test.ts rename to api/api/auth/reset/index.test.ts diff --git a/server/api/api/auth/reset/index.ts b/api/api/auth/reset/index.ts similarity index 100% rename from server/api/api/auth/reset/index.ts rename to api/api/auth/reset/index.ts diff --git a/server/api/api/v1/accounts/:id/block.test.ts b/api/api/v1/accounts/:id/block.test.ts similarity index 100% rename from server/api/api/v1/accounts/:id/block.test.ts rename to api/api/v1/accounts/:id/block.test.ts diff --git a/server/api/api/v1/accounts/:id/block.ts b/api/api/v1/accounts/:id/block.ts similarity index 100% rename from server/api/api/v1/accounts/:id/block.ts rename to api/api/v1/accounts/:id/block.ts diff --git a/server/api/api/v1/accounts/:id/follow.test.ts b/api/api/v1/accounts/:id/follow.test.ts similarity index 100% rename from server/api/api/v1/accounts/:id/follow.test.ts rename to api/api/v1/accounts/:id/follow.test.ts diff --git a/server/api/api/v1/accounts/:id/follow.ts b/api/api/v1/accounts/:id/follow.ts similarity index 100% rename from server/api/api/v1/accounts/:id/follow.ts rename to api/api/v1/accounts/:id/follow.ts diff --git a/server/api/api/v1/accounts/:id/followers.test.ts b/api/api/v1/accounts/:id/followers.test.ts similarity index 100% rename from server/api/api/v1/accounts/:id/followers.test.ts rename to api/api/v1/accounts/:id/followers.test.ts diff --git a/server/api/api/v1/accounts/:id/followers.ts b/api/api/v1/accounts/:id/followers.ts similarity index 100% rename from server/api/api/v1/accounts/:id/followers.ts rename to api/api/v1/accounts/:id/followers.ts diff --git a/server/api/api/v1/accounts/:id/following.test.ts b/api/api/v1/accounts/:id/following.test.ts similarity index 100% rename from server/api/api/v1/accounts/:id/following.test.ts rename to api/api/v1/accounts/:id/following.test.ts diff --git a/server/api/api/v1/accounts/:id/following.ts b/api/api/v1/accounts/:id/following.ts similarity index 100% rename from server/api/api/v1/accounts/:id/following.ts rename to api/api/v1/accounts/:id/following.ts diff --git a/server/api/api/v1/accounts/:id/index.test.ts b/api/api/v1/accounts/:id/index.test.ts similarity index 100% rename from server/api/api/v1/accounts/:id/index.test.ts rename to api/api/v1/accounts/:id/index.test.ts diff --git a/server/api/api/v1/accounts/:id/index.ts b/api/api/v1/accounts/:id/index.ts similarity index 100% rename from server/api/api/v1/accounts/:id/index.ts rename to api/api/v1/accounts/:id/index.ts diff --git a/server/api/api/v1/accounts/:id/mute.test.ts b/api/api/v1/accounts/:id/mute.test.ts similarity index 100% rename from server/api/api/v1/accounts/:id/mute.test.ts rename to api/api/v1/accounts/:id/mute.test.ts diff --git a/server/api/api/v1/accounts/:id/mute.ts b/api/api/v1/accounts/:id/mute.ts similarity index 100% rename from server/api/api/v1/accounts/:id/mute.ts rename to api/api/v1/accounts/:id/mute.ts diff --git a/server/api/api/v1/accounts/:id/note.ts b/api/api/v1/accounts/:id/note.ts similarity index 100% rename from server/api/api/v1/accounts/:id/note.ts rename to api/api/v1/accounts/:id/note.ts diff --git a/server/api/api/v1/accounts/:id/pin.ts b/api/api/v1/accounts/:id/pin.ts similarity index 100% rename from server/api/api/v1/accounts/:id/pin.ts rename to api/api/v1/accounts/:id/pin.ts diff --git a/server/api/api/v1/accounts/:id/refetch.ts b/api/api/v1/accounts/:id/refetch.ts similarity index 100% rename from server/api/api/v1/accounts/:id/refetch.ts rename to api/api/v1/accounts/:id/refetch.ts diff --git a/server/api/api/v1/accounts/:id/remove_from_followers.ts b/api/api/v1/accounts/:id/remove_from_followers.ts similarity index 100% rename from server/api/api/v1/accounts/:id/remove_from_followers.ts rename to api/api/v1/accounts/:id/remove_from_followers.ts diff --git a/server/api/api/v1/accounts/:id/statuses.test.ts b/api/api/v1/accounts/:id/statuses.test.ts similarity index 100% rename from server/api/api/v1/accounts/:id/statuses.test.ts rename to api/api/v1/accounts/:id/statuses.test.ts diff --git a/server/api/api/v1/accounts/:id/statuses.ts b/api/api/v1/accounts/:id/statuses.ts similarity index 100% rename from server/api/api/v1/accounts/:id/statuses.ts rename to api/api/v1/accounts/:id/statuses.ts diff --git a/server/api/api/v1/accounts/:id/unblock.ts b/api/api/v1/accounts/:id/unblock.ts similarity index 100% rename from server/api/api/v1/accounts/:id/unblock.ts rename to api/api/v1/accounts/:id/unblock.ts diff --git a/server/api/api/v1/accounts/:id/unfollow.ts b/api/api/v1/accounts/:id/unfollow.ts similarity index 100% rename from server/api/api/v1/accounts/:id/unfollow.ts rename to api/api/v1/accounts/:id/unfollow.ts diff --git a/server/api/api/v1/accounts/:id/unmute.test.ts b/api/api/v1/accounts/:id/unmute.test.ts similarity index 100% rename from server/api/api/v1/accounts/:id/unmute.test.ts rename to api/api/v1/accounts/:id/unmute.test.ts diff --git a/server/api/api/v1/accounts/:id/unmute.ts b/api/api/v1/accounts/:id/unmute.ts similarity index 100% rename from server/api/api/v1/accounts/:id/unmute.ts rename to api/api/v1/accounts/:id/unmute.ts diff --git a/server/api/api/v1/accounts/:id/unpin.ts b/api/api/v1/accounts/:id/unpin.ts similarity index 100% rename from server/api/api/v1/accounts/:id/unpin.ts rename to api/api/v1/accounts/:id/unpin.ts diff --git a/server/api/api/v1/accounts/familiar_followers/index.ts b/api/api/v1/accounts/familiar_followers/index.ts similarity index 100% rename from server/api/api/v1/accounts/familiar_followers/index.ts rename to api/api/v1/accounts/familiar_followers/index.ts diff --git a/server/api/api/v1/accounts/id/index.test.ts b/api/api/v1/accounts/id/index.test.ts similarity index 100% rename from server/api/api/v1/accounts/id/index.test.ts rename to api/api/v1/accounts/id/index.test.ts diff --git a/server/api/api/v1/accounts/id/index.ts b/api/api/v1/accounts/id/index.ts similarity index 100% rename from server/api/api/v1/accounts/id/index.ts rename to api/api/v1/accounts/id/index.ts diff --git a/server/api/api/v1/accounts/index.test.ts b/api/api/v1/accounts/index.test.ts similarity index 100% rename from server/api/api/v1/accounts/index.test.ts rename to api/api/v1/accounts/index.test.ts diff --git a/server/api/api/v1/accounts/index.ts b/api/api/v1/accounts/index.ts similarity index 100% rename from server/api/api/v1/accounts/index.ts rename to api/api/v1/accounts/index.ts diff --git a/server/api/api/v1/accounts/lookup/index.test.ts b/api/api/v1/accounts/lookup/index.test.ts similarity index 100% rename from server/api/api/v1/accounts/lookup/index.test.ts rename to api/api/v1/accounts/lookup/index.test.ts diff --git a/server/api/api/v1/accounts/lookup/index.ts b/api/api/v1/accounts/lookup/index.ts similarity index 100% rename from server/api/api/v1/accounts/lookup/index.ts rename to api/api/v1/accounts/lookup/index.ts diff --git a/server/api/api/v1/accounts/relationships/index.test.ts b/api/api/v1/accounts/relationships/index.test.ts similarity index 100% rename from server/api/api/v1/accounts/relationships/index.test.ts rename to api/api/v1/accounts/relationships/index.test.ts diff --git a/server/api/api/v1/accounts/relationships/index.ts b/api/api/v1/accounts/relationships/index.ts similarity index 100% rename from server/api/api/v1/accounts/relationships/index.ts rename to api/api/v1/accounts/relationships/index.ts diff --git a/server/api/api/v1/accounts/search/index.test.ts b/api/api/v1/accounts/search/index.test.ts similarity index 100% rename from server/api/api/v1/accounts/search/index.test.ts rename to api/api/v1/accounts/search/index.test.ts diff --git a/server/api/api/v1/accounts/search/index.ts b/api/api/v1/accounts/search/index.ts similarity index 100% rename from server/api/api/v1/accounts/search/index.ts rename to api/api/v1/accounts/search/index.ts diff --git a/server/api/api/v1/accounts/update_credentials/index.ts b/api/api/v1/accounts/update_credentials/index.ts similarity index 100% rename from server/api/api/v1/accounts/update_credentials/index.ts rename to api/api/v1/accounts/update_credentials/index.ts diff --git a/server/api/api/v1/accounts/verify_credentials/index.ts b/api/api/v1/accounts/verify_credentials/index.ts similarity index 100% rename from server/api/api/v1/accounts/verify_credentials/index.ts rename to api/api/v1/accounts/verify_credentials/index.ts diff --git a/server/api/api/v1/apps/index.ts b/api/api/v1/apps/index.ts similarity index 100% rename from server/api/api/v1/apps/index.ts rename to api/api/v1/apps/index.ts diff --git a/server/api/api/v1/apps/verify_credentials/index.ts b/api/api/v1/apps/verify_credentials/index.ts similarity index 100% rename from server/api/api/v1/apps/verify_credentials/index.ts rename to api/api/v1/apps/verify_credentials/index.ts diff --git a/server/api/api/v1/blocks/index.ts b/api/api/v1/blocks/index.ts similarity index 100% rename from server/api/api/v1/blocks/index.ts rename to api/api/v1/blocks/index.ts diff --git a/server/api/api/v1/challenges/index.test.ts b/api/api/v1/challenges/index.test.ts similarity index 100% rename from server/api/api/v1/challenges/index.test.ts rename to api/api/v1/challenges/index.test.ts diff --git a/server/api/api/v1/challenges/index.ts b/api/api/v1/challenges/index.ts similarity index 100% rename from server/api/api/v1/challenges/index.ts rename to api/api/v1/challenges/index.ts diff --git a/server/api/api/v1/custom_emojis/index.test.ts b/api/api/v1/custom_emojis/index.test.ts similarity index 100% rename from server/api/api/v1/custom_emojis/index.test.ts rename to api/api/v1/custom_emojis/index.test.ts diff --git a/server/api/api/v1/custom_emojis/index.ts b/api/api/v1/custom_emojis/index.ts similarity index 100% rename from server/api/api/v1/custom_emojis/index.ts rename to api/api/v1/custom_emojis/index.ts diff --git a/server/api/api/v1/emojis/:id/index.test.ts b/api/api/v1/emojis/:id/index.test.ts similarity index 100% rename from server/api/api/v1/emojis/:id/index.test.ts rename to api/api/v1/emojis/:id/index.test.ts diff --git a/server/api/api/v1/emojis/:id/index.ts b/api/api/v1/emojis/:id/index.ts similarity index 100% rename from server/api/api/v1/emojis/:id/index.ts rename to api/api/v1/emojis/:id/index.ts diff --git a/server/api/api/v1/emojis/index.test.ts b/api/api/v1/emojis/index.test.ts similarity index 100% rename from server/api/api/v1/emojis/index.test.ts rename to api/api/v1/emojis/index.test.ts diff --git a/server/api/api/v1/emojis/index.ts b/api/api/v1/emojis/index.ts similarity index 100% rename from server/api/api/v1/emojis/index.ts rename to api/api/v1/emojis/index.ts diff --git a/server/api/api/v1/favourites/index.ts b/api/api/v1/favourites/index.ts similarity index 100% rename from server/api/api/v1/favourites/index.ts rename to api/api/v1/favourites/index.ts diff --git a/server/api/api/v1/follow_requests/:account_id/authorize.ts b/api/api/v1/follow_requests/:account_id/authorize.ts similarity index 100% rename from server/api/api/v1/follow_requests/:account_id/authorize.ts rename to api/api/v1/follow_requests/:account_id/authorize.ts diff --git a/server/api/api/v1/follow_requests/:account_id/reject.ts b/api/api/v1/follow_requests/:account_id/reject.ts similarity index 100% rename from server/api/api/v1/follow_requests/:account_id/reject.ts rename to api/api/v1/follow_requests/:account_id/reject.ts diff --git a/server/api/api/v1/follow_requests/index.ts b/api/api/v1/follow_requests/index.ts similarity index 100% rename from server/api/api/v1/follow_requests/index.ts rename to api/api/v1/follow_requests/index.ts diff --git a/server/api/api/v1/frontend/config/index.ts b/api/api/v1/frontend/config/index.ts similarity index 100% rename from server/api/api/v1/frontend/config/index.ts rename to api/api/v1/frontend/config/index.ts diff --git a/server/api/api/v1/instance/extended_description.test.ts b/api/api/v1/instance/extended_description.test.ts similarity index 100% rename from server/api/api/v1/instance/extended_description.test.ts rename to api/api/v1/instance/extended_description.test.ts diff --git a/server/api/api/v1/instance/extended_description.ts b/api/api/v1/instance/extended_description.ts similarity index 100% rename from server/api/api/v1/instance/extended_description.ts rename to api/api/v1/instance/extended_description.ts diff --git a/server/api/api/v1/instance/index.ts b/api/api/v1/instance/index.ts similarity index 100% rename from server/api/api/v1/instance/index.ts rename to api/api/v1/instance/index.ts diff --git a/server/api/api/v1/instance/privacy_policy.test.ts b/api/api/v1/instance/privacy_policy.test.ts similarity index 100% rename from server/api/api/v1/instance/privacy_policy.test.ts rename to api/api/v1/instance/privacy_policy.test.ts diff --git a/server/api/api/v1/instance/privacy_policy.ts b/api/api/v1/instance/privacy_policy.ts similarity index 100% rename from server/api/api/v1/instance/privacy_policy.ts rename to api/api/v1/instance/privacy_policy.ts diff --git a/server/api/api/v1/instance/rules.test.ts b/api/api/v1/instance/rules.test.ts similarity index 100% rename from server/api/api/v1/instance/rules.test.ts rename to api/api/v1/instance/rules.test.ts diff --git a/server/api/api/v1/instance/rules.ts b/api/api/v1/instance/rules.ts similarity index 100% rename from server/api/api/v1/instance/rules.ts rename to api/api/v1/instance/rules.ts diff --git a/server/api/api/v1/instance/tos.test.ts b/api/api/v1/instance/tos.test.ts similarity index 100% rename from server/api/api/v1/instance/tos.test.ts rename to api/api/v1/instance/tos.test.ts diff --git a/server/api/api/v1/instance/tos.ts b/api/api/v1/instance/tos.ts similarity index 100% rename from server/api/api/v1/instance/tos.ts rename to api/api/v1/instance/tos.ts diff --git a/server/api/api/v1/markers/index.test.ts b/api/api/v1/markers/index.test.ts similarity index 100% rename from server/api/api/v1/markers/index.test.ts rename to api/api/v1/markers/index.test.ts diff --git a/server/api/api/v1/markers/index.ts b/api/api/v1/markers/index.ts similarity index 100% rename from server/api/api/v1/markers/index.ts rename to api/api/v1/markers/index.ts diff --git a/server/api/api/v1/media/:id/index.ts b/api/api/v1/media/:id/index.ts similarity index 100% rename from server/api/api/v1/media/:id/index.ts rename to api/api/v1/media/:id/index.ts diff --git a/server/api/api/v1/media/index.ts b/api/api/v1/media/index.ts similarity index 100% rename from server/api/api/v1/media/index.ts rename to api/api/v1/media/index.ts diff --git a/server/api/api/v1/mutes/index.test.ts b/api/api/v1/mutes/index.test.ts similarity index 100% rename from server/api/api/v1/mutes/index.test.ts rename to api/api/v1/mutes/index.test.ts diff --git a/server/api/api/v1/mutes/index.ts b/api/api/v1/mutes/index.ts similarity index 100% rename from server/api/api/v1/mutes/index.ts rename to api/api/v1/mutes/index.ts diff --git a/server/api/api/v1/notifications/:id/dismiss.test.ts b/api/api/v1/notifications/:id/dismiss.test.ts similarity index 100% rename from server/api/api/v1/notifications/:id/dismiss.test.ts rename to api/api/v1/notifications/:id/dismiss.test.ts diff --git a/server/api/api/v1/notifications/:id/dismiss.ts b/api/api/v1/notifications/:id/dismiss.ts similarity index 100% rename from server/api/api/v1/notifications/:id/dismiss.ts rename to api/api/v1/notifications/:id/dismiss.ts diff --git a/server/api/api/v1/notifications/:id/index.test.ts b/api/api/v1/notifications/:id/index.test.ts similarity index 100% rename from server/api/api/v1/notifications/:id/index.test.ts rename to api/api/v1/notifications/:id/index.test.ts diff --git a/server/api/api/v1/notifications/:id/index.ts b/api/api/v1/notifications/:id/index.ts similarity index 100% rename from server/api/api/v1/notifications/:id/index.ts rename to api/api/v1/notifications/:id/index.ts diff --git a/server/api/api/v1/notifications/clear/index.test.ts b/api/api/v1/notifications/clear/index.test.ts similarity index 100% rename from server/api/api/v1/notifications/clear/index.test.ts rename to api/api/v1/notifications/clear/index.test.ts diff --git a/server/api/api/v1/notifications/clear/index.ts b/api/api/v1/notifications/clear/index.ts similarity index 100% rename from server/api/api/v1/notifications/clear/index.ts rename to api/api/v1/notifications/clear/index.ts diff --git a/server/api/api/v1/notifications/destroy_multiple/index.test.ts b/api/api/v1/notifications/destroy_multiple/index.test.ts similarity index 100% rename from server/api/api/v1/notifications/destroy_multiple/index.test.ts rename to api/api/v1/notifications/destroy_multiple/index.test.ts diff --git a/server/api/api/v1/notifications/destroy_multiple/index.ts b/api/api/v1/notifications/destroy_multiple/index.ts similarity index 100% rename from server/api/api/v1/notifications/destroy_multiple/index.ts rename to api/api/v1/notifications/destroy_multiple/index.ts diff --git a/server/api/api/v1/notifications/index.test.ts b/api/api/v1/notifications/index.test.ts similarity index 100% rename from server/api/api/v1/notifications/index.test.ts rename to api/api/v1/notifications/index.test.ts diff --git a/server/api/api/v1/notifications/index.ts b/api/api/v1/notifications/index.ts similarity index 100% rename from server/api/api/v1/notifications/index.ts rename to api/api/v1/notifications/index.ts diff --git a/server/api/api/v1/profile/avatar.ts b/api/api/v1/profile/avatar.ts similarity index 100% rename from server/api/api/v1/profile/avatar.ts rename to api/api/v1/profile/avatar.ts diff --git a/server/api/api/v1/profile/header.ts b/api/api/v1/profile/header.ts similarity index 100% rename from server/api/api/v1/profile/header.ts rename to api/api/v1/profile/header.ts diff --git a/server/api/api/v1/roles/:id/index.test.ts b/api/api/v1/roles/:id/index.test.ts similarity index 100% rename from server/api/api/v1/roles/:id/index.test.ts rename to api/api/v1/roles/:id/index.test.ts diff --git a/server/api/api/v1/roles/:id/index.ts b/api/api/v1/roles/:id/index.ts similarity index 100% rename from server/api/api/v1/roles/:id/index.ts rename to api/api/v1/roles/:id/index.ts diff --git a/server/api/api/v1/roles/index.test.ts b/api/api/v1/roles/index.test.ts similarity index 100% rename from server/api/api/v1/roles/index.test.ts rename to api/api/v1/roles/index.test.ts diff --git a/server/api/api/v1/roles/index.ts b/api/api/v1/roles/index.ts similarity index 100% rename from server/api/api/v1/roles/index.ts rename to api/api/v1/roles/index.ts diff --git a/server/api/api/v1/sso/:id/index.test.ts b/api/api/v1/sso/:id/index.test.ts similarity index 100% rename from server/api/api/v1/sso/:id/index.test.ts rename to api/api/v1/sso/:id/index.test.ts diff --git a/server/api/api/v1/sso/:id/index.ts b/api/api/v1/sso/:id/index.ts similarity index 100% rename from server/api/api/v1/sso/:id/index.ts rename to api/api/v1/sso/:id/index.ts diff --git a/server/api/api/v1/sso/index.test.ts b/api/api/v1/sso/index.test.ts similarity index 100% rename from server/api/api/v1/sso/index.test.ts rename to api/api/v1/sso/index.test.ts diff --git a/server/api/api/v1/sso/index.ts b/api/api/v1/sso/index.ts similarity index 100% rename from server/api/api/v1/sso/index.ts rename to api/api/v1/sso/index.ts diff --git a/server/api/api/v1/statuses/:id/context.ts b/api/api/v1/statuses/:id/context.ts similarity index 100% rename from server/api/api/v1/statuses/:id/context.ts rename to api/api/v1/statuses/:id/context.ts diff --git a/server/api/api/v1/statuses/:id/favourite.test.ts b/api/api/v1/statuses/:id/favourite.test.ts similarity index 100% rename from server/api/api/v1/statuses/:id/favourite.test.ts rename to api/api/v1/statuses/:id/favourite.test.ts diff --git a/server/api/api/v1/statuses/:id/favourite.ts b/api/api/v1/statuses/:id/favourite.ts similarity index 100% rename from server/api/api/v1/statuses/:id/favourite.ts rename to api/api/v1/statuses/:id/favourite.ts diff --git a/server/api/api/v1/statuses/:id/favourited_by.test.ts b/api/api/v1/statuses/:id/favourited_by.test.ts similarity index 100% rename from server/api/api/v1/statuses/:id/favourited_by.test.ts rename to api/api/v1/statuses/:id/favourited_by.test.ts diff --git a/server/api/api/v1/statuses/:id/favourited_by.ts b/api/api/v1/statuses/:id/favourited_by.ts similarity index 100% rename from server/api/api/v1/statuses/:id/favourited_by.ts rename to api/api/v1/statuses/:id/favourited_by.ts diff --git a/server/api/api/v1/statuses/:id/index.ts b/api/api/v1/statuses/:id/index.ts similarity index 100% rename from server/api/api/v1/statuses/:id/index.ts rename to api/api/v1/statuses/:id/index.ts diff --git a/server/api/api/v1/statuses/:id/pin.ts b/api/api/v1/statuses/:id/pin.ts similarity index 100% rename from server/api/api/v1/statuses/:id/pin.ts rename to api/api/v1/statuses/:id/pin.ts diff --git a/server/api/api/v1/statuses/:id/reblog.ts b/api/api/v1/statuses/:id/reblog.ts similarity index 100% rename from server/api/api/v1/statuses/:id/reblog.ts rename to api/api/v1/statuses/:id/reblog.ts diff --git a/server/api/api/v1/statuses/:id/reblogged_by.test.ts b/api/api/v1/statuses/:id/reblogged_by.test.ts similarity index 100% rename from server/api/api/v1/statuses/:id/reblogged_by.test.ts rename to api/api/v1/statuses/:id/reblogged_by.test.ts diff --git a/server/api/api/v1/statuses/:id/reblogged_by.ts b/api/api/v1/statuses/:id/reblogged_by.ts similarity index 100% rename from server/api/api/v1/statuses/:id/reblogged_by.ts rename to api/api/v1/statuses/:id/reblogged_by.ts diff --git a/server/api/api/v1/statuses/:id/source.ts b/api/api/v1/statuses/:id/source.ts similarity index 100% rename from server/api/api/v1/statuses/:id/source.ts rename to api/api/v1/statuses/:id/source.ts diff --git a/server/api/api/v1/statuses/:id/unfavourite.test.ts b/api/api/v1/statuses/:id/unfavourite.test.ts similarity index 100% rename from server/api/api/v1/statuses/:id/unfavourite.test.ts rename to api/api/v1/statuses/:id/unfavourite.test.ts diff --git a/server/api/api/v1/statuses/:id/unfavourite.ts b/api/api/v1/statuses/:id/unfavourite.ts similarity index 100% rename from server/api/api/v1/statuses/:id/unfavourite.ts rename to api/api/v1/statuses/:id/unfavourite.ts diff --git a/server/api/api/v1/statuses/:id/unpin.ts b/api/api/v1/statuses/:id/unpin.ts similarity index 100% rename from server/api/api/v1/statuses/:id/unpin.ts rename to api/api/v1/statuses/:id/unpin.ts diff --git a/server/api/api/v1/statuses/:id/unreblog.ts b/api/api/v1/statuses/:id/unreblog.ts similarity index 100% rename from server/api/api/v1/statuses/:id/unreblog.ts rename to api/api/v1/statuses/:id/unreblog.ts diff --git a/server/api/api/v1/statuses/index.test.ts b/api/api/v1/statuses/index.test.ts similarity index 100% rename from server/api/api/v1/statuses/index.test.ts rename to api/api/v1/statuses/index.test.ts diff --git a/server/api/api/v1/statuses/index.ts b/api/api/v1/statuses/index.ts similarity index 100% rename from server/api/api/v1/statuses/index.ts rename to api/api/v1/statuses/index.ts diff --git a/server/api/api/v1/timelines/home.test.ts b/api/api/v1/timelines/home.test.ts similarity index 100% rename from server/api/api/v1/timelines/home.test.ts rename to api/api/v1/timelines/home.test.ts diff --git a/server/api/api/v1/timelines/home.ts b/api/api/v1/timelines/home.ts similarity index 100% rename from server/api/api/v1/timelines/home.ts rename to api/api/v1/timelines/home.ts diff --git a/server/api/api/v1/timelines/public.test.ts b/api/api/v1/timelines/public.test.ts similarity index 100% rename from server/api/api/v1/timelines/public.test.ts rename to api/api/v1/timelines/public.test.ts diff --git a/server/api/api/v1/timelines/public.ts b/api/api/v1/timelines/public.ts similarity index 100% rename from server/api/api/v1/timelines/public.ts rename to api/api/v1/timelines/public.ts diff --git a/server/api/api/v2/filters/:id/index.test.ts b/api/api/v2/filters/:id/index.test.ts similarity index 100% rename from server/api/api/v2/filters/:id/index.test.ts rename to api/api/v2/filters/:id/index.test.ts diff --git a/server/api/api/v2/filters/:id/index.ts b/api/api/v2/filters/:id/index.ts similarity index 100% rename from server/api/api/v2/filters/:id/index.ts rename to api/api/v2/filters/:id/index.ts diff --git a/server/api/api/v2/filters/index.test.ts b/api/api/v2/filters/index.test.ts similarity index 100% rename from server/api/api/v2/filters/index.test.ts rename to api/api/v2/filters/index.test.ts diff --git a/server/api/api/v2/filters/index.ts b/api/api/v2/filters/index.ts similarity index 100% rename from server/api/api/v2/filters/index.ts rename to api/api/v2/filters/index.ts diff --git a/server/api/api/v2/instance/index.test.ts b/api/api/v2/instance/index.test.ts similarity index 100% rename from server/api/api/v2/instance/index.test.ts rename to api/api/v2/instance/index.test.ts diff --git a/server/api/api/v2/instance/index.ts b/api/api/v2/instance/index.ts similarity index 100% rename from server/api/api/v2/instance/index.ts rename to api/api/v2/instance/index.ts diff --git a/server/api/api/v2/media/index.ts b/api/api/v2/media/index.ts similarity index 100% rename from server/api/api/v2/media/index.ts rename to api/api/v2/media/index.ts diff --git a/server/api/api/v2/search/index.ts b/api/api/v2/search/index.ts similarity index 100% rename from server/api/api/v2/search/index.ts rename to api/api/v2/search/index.ts diff --git a/server/api/media/:hash/:name/index.ts b/api/media/:hash/:name/index.ts similarity index 100% rename from server/api/media/:hash/:name/index.ts rename to api/media/:hash/:name/index.ts diff --git a/server/api/media/proxy/:id.ts b/api/media/proxy/:id.ts similarity index 100% rename from server/api/media/proxy/:id.ts rename to api/media/proxy/:id.ts diff --git a/server/api/oauth/authorize/index.ts b/api/oauth/authorize/index.ts similarity index 100% rename from server/api/oauth/authorize/index.ts rename to api/oauth/authorize/index.ts diff --git a/server/api/oauth/sso/:issuer/callback/index.ts b/api/oauth/sso/:issuer/callback/index.ts similarity index 100% rename from server/api/oauth/sso/:issuer/callback/index.ts rename to api/oauth/sso/:issuer/callback/index.ts diff --git a/server/api/oauth/sso/index.ts b/api/oauth/sso/index.ts similarity index 100% rename from server/api/oauth/sso/index.ts rename to api/oauth/sso/index.ts diff --git a/server/api/oauth/token/index.ts b/api/oauth/token/index.ts similarity index 100% rename from server/api/oauth/token/index.ts rename to api/oauth/token/index.ts diff --git a/server/api/objects/:id/index.ts b/api/objects/:id/index.ts similarity index 100% rename from server/api/objects/:id/index.ts rename to api/objects/:id/index.ts diff --git a/server/api/users/:uuid/inbox/index.ts b/api/users/:uuid/inbox/index.ts similarity index 100% rename from server/api/users/:uuid/inbox/index.ts rename to api/users/:uuid/inbox/index.ts diff --git a/server/api/users/:uuid/index.ts b/api/users/:uuid/index.ts similarity index 100% rename from server/api/users/:uuid/index.ts rename to api/users/:uuid/index.ts diff --git a/server/api/users/:uuid/outbox/index.ts b/api/users/:uuid/outbox/index.ts similarity index 100% rename from server/api/users/:uuid/outbox/index.ts rename to api/users/:uuid/outbox/index.ts diff --git a/server/api/well-known/host-meta/index.ts b/api/well-known/host-meta/index.ts similarity index 100% rename from server/api/well-known/host-meta/index.ts rename to api/well-known/host-meta/index.ts diff --git a/server/api/well-known/jwks/index.ts b/api/well-known/jwks/index.ts similarity index 100% rename from server/api/well-known/jwks/index.ts rename to api/well-known/jwks/index.ts diff --git a/server/api/well-known/nodeinfo/2.0/index.ts b/api/well-known/nodeinfo/2.0/index.ts similarity index 100% rename from server/api/well-known/nodeinfo/2.0/index.ts rename to api/well-known/nodeinfo/2.0/index.ts diff --git a/server/api/well-known/nodeinfo/index.ts b/api/well-known/nodeinfo/index.ts similarity index 100% rename from server/api/well-known/nodeinfo/index.ts rename to api/well-known/nodeinfo/index.ts diff --git a/server/api/well-known/openid-configuration/index.ts b/api/well-known/openid-configuration/index.ts similarity index 100% rename from server/api/well-known/openid-configuration/index.ts rename to api/well-known/openid-configuration/index.ts diff --git a/server/api/well-known/versia.ts b/api/well-known/versia.ts similarity index 100% rename from server/api/well-known/versia.ts rename to api/well-known/versia.ts diff --git a/server/api/well-known/webfinger/index.ts b/api/well-known/webfinger/index.ts similarity index 100% rename from server/api/well-known/webfinger/index.ts rename to api/well-known/webfinger/index.ts diff --git a/routes.ts b/routes.ts index 828479da..0d3bf54e 100644 --- a/routes.ts +++ b/routes.ts @@ -2,11 +2,11 @@ import { join } from "node:path"; // Returns the route filesystem path when given a URL export const routeMatcher = new Bun.FileSystemRouter({ style: "nextjs", - dir: `${process.cwd()}/server/api`, + dir: `${process.cwd()}/api`, fileExtensions: [".ts", ".js"], }); -// Transform routes to be relative to the server/api directory +// Transform routes to be relative to the api directory let routes = routeMatcher.routes; for (const [route, path] of Object.entries(routes)) { diff --git a/tsconfig.json b/tsconfig.json index 575a1c5d..86afbaec 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,7 +24,7 @@ "paths": { "@/*": ["./utils/*"], "~/*": ["./*"], - "+/*": ["./server/api/*"] + "+/*": ["./api/*"] }, "noUnusedLocals": true }, @@ -34,7 +34,7 @@ "*.d.ts", "**/*.ts", "**/*.d.ts", - "server/api/well-known/**/*.ts", + "api/well-known/**/*.ts", "packages/cli/index.mts" ] }