Files
arcadia/backend/api/src/api_doc.rs
Pavlos Polianidis 4b7b226062 Refactor/split handlers (#325)
* chore: add AllowedTorrentClientSet

* chore: add dotenv

* feat: remove fields from Arcadia and use env

* feat: impl Arcadia::new

* refactor: rename to api

* feat: create storage lib crate

* feat: impl arcadia error in common

* chore: use the error from the common trate

* chore: move to forum models mod

* feat: add common models

* feat: add common services

* fix: use the correct imports in torrent_handler

* fix: use the correct imports in torrent_handler

* fix: announce handler

* fix: artist handler

* fix: auth handler

* fix: conversation handler

* fix: edition group handler

* fix: forum handler

* fix: gift handler

* fix: home handler

* fix: invitation handler

* fix: master groupp handler

* feat: add local user model to the api

* fix: subscription handler

* fix: title group handler

* fix: title group

* fix: torrent report handler

* fix: torrent request handler

* fix: torrent request vote handler

* fix: user application handler

* fix: user handler

* fix: wiki handler

* fix: some of the scraper handlers

* fix: isbn and music brainz

* fix: tmdb

* fix: periodic tasks

* fix: all api compiler errors

* feat: implement cron-jobs bin

* fix: compiler errors

* feat: impl connection pool for announce

* feat: impl connection pool for artist repo

* feat: impl connection pool for invitation and gift

* feat: impl connection pool for master group

* feat: impl connection pool for series and torrent

* feat: impl connection pool for subs

* feat: impl connection pool torrent report

* feat: impl connection for torrent request

* feat: impl connection for user

* feat: impl connection for wiki

* fix: use methods of connection pool

* chore: fmt the code

* chore: fmt the code

* chore: rename to database_rul

* chore: remove unwrap from endpoint

* fix: failing tests

* feat: impl Borrow and BorrowMut for connection pool

* chore: fmt the tcode

* fix: test setup

* test: use migration in sql::test

* chore: fmt the code

* chore: fmt the code

* chore: use dotenvy

* chore: use env error

* refactor: mv rust code to the backend folder

* chore: get last PR chnages

* fix: backend gh action

* chore: cp correct nev file

* chore: remove unused files

* fix: schema-check job

* chore: load env from the api folder

* chore: update the lint job's working directory

* chore: move patch.crates-io to the root manifest

* chore: remove self casting

* chore: fmt code

* chore: remove deleted files

* chore: update cache-workspace

* feat: add route config to the auth resource

* feat: move register to separate file

* feat: move login to separate file

* feat: move refresh-token to separate file

* chore: create jwt middleware

* chore: make fns private

* feat: create users resource

* feat: create user applications resources

* feat: create title group and search resources

* feat: add create_title_group_comment to title groupds

* feat: create edition group resource

* feat: create torrent resource

* feat: impl torrent requests resource

* feat: add artist and affiliated artist resources

* feat: add conversation endpoint

* feat: add subscriptions endpoint

* feat: add serries endpoint

* feat: add external db endpoints

* feat: add forum endpoint

* feat: add wiki endpoints

* feat: add home and invitation endpoints

* feat: add master groups endpoints

* feat: add figt handler

* feat: add create torrent report

* feat: create announce endpoint

* test: use correct path

* test: fix all tests

* fix: all utopia endpoint paths

* fix: endpoint paths in the front-end

* chore: exclude user-application from jwt middleware

* feat: add new schema ts

* fix: pr suggestions by coderabbit

* feat: add operation id and tags to api docs

* chore: update ts api schema

* chore: fix typo

* chore: update ts schema
2025-08-27 08:52:48 +00:00

210 lines
8.4 KiB
Rust

use utoipa::OpenApi;
use crate::handlers::{
artists::get_artist_publications::GetArtistPublicationsQuery,
auth::register::RegisterQuery,
home::get_home::HomePage,
scrapers::ExternalDBData,
search::search_torrent_requests::SearchTorrentRequestsQuery,
torrents::{
download_dottorrent_file::DownloadTorrentQuery, get_top_torrents::GetTopTorrentsQuery,
get_upload_information::UploadInformation,
},
user_applications::{
create_user_application::GetUserApplicationsQuery,
update_user_application_status::UpdateUserApplication,
},
};
use arcadia_storage::models::{
artist::{
AffiliatedArtist, AffiliatedArtistHierarchy, Artist, ArtistAndTitleGroupsLite, ArtistLite,
},
conversation::{
Conversation, ConversationHierarchy, ConversationMessage, ConversationMessageHierarchy,
ConversationOverview, ConversationsOverview, UserCreatedConversation,
UserCreatedConversationMessage,
},
edition_group::EditionGroup,
forum::{
ForumOverview, ForumPost, ForumSubCategoryHierarchy, ForumThreadAndPosts,
UserCreatedForumPost, UserCreatedForumThread,
},
gift::{Gift, UserCreatedGift},
invitation::{Invitation, SentInvitation},
master_group::{MasterGroup, UserCreatedMasterGroup},
series::{Series, SeriesAndTitleGroupHierarchyLite, SeriesLite, UserCreatedSeries},
title_group::{EditedTitleGroup, PublicRating, TitleGroupAndAssociatedData, TitleGroupLite},
title_group_comment::{TitleGroupComment, UserCreatedTitleGroupComment},
torrent::{
EditedTorrent, Extras, Torrent, TorrentSearch, TorrentSearchResults, TorrentToDelete,
UploadedTorrent,
},
torrent_report::{TorrentReport, UserCreatedTorrentReport},
torrent_request::{
TorrentRequest, TorrentRequestAndAssociatedData, TorrentRequestFill,
TorrentRequestHierarchyLite, TorrentRequestWithTitleGroupLite, UserCreatedTorrentRequest,
},
torrent_request_vote::{
TorrentRequestVote, TorrentRequestVoteHierarchy, UserCreatedTorrentRequestVote,
},
user::{
EditedUser, Login, LoginResponse, Profile, PublicProfile, PublicUser, RefreshToken,
Register, User, UserCreatedUserWarning, UserLite, UserWarning,
},
user_application::{UserApplication, UserApplicationStatus, UserCreatedUserApplication},
wiki::{UserCreatedWikiArticle, WikiArticle, WikiArticleHierarchy},
};
#[derive(OpenApi)]
#[openapi(
info(title = "arcadia-backend API",),
paths(
crate::handlers::auth::register::exec,
crate::handlers::auth::login::exec,
crate::handlers::auth::refresh_token::exec,
crate::handlers::users::get_user::exec,
crate::handlers::users::edit_user::exec,
crate::handlers::users::warn_user::exec,
crate::handlers::users::get_user_conversations::exec,
crate::handlers::users::get_me::exec,
crate::handlers::users::get_registered_users::exec,
crate::handlers::user_applications::create_user_application::exec,
crate::handlers::user_applications::get_user_applications::exec,
crate::handlers::user_applications::update_user_application_status::exec,
crate::handlers::home::get_home::exec,
crate::handlers::artists::get_artist_publications::exec,
crate::handlers::artists::create_artists::exec,
crate::handlers::affiliated_artists::create_affiliated_artists::exec,
crate::handlers::affiliated_artists::remove_affiliated_artists::exec,
crate::handlers::torrents::download_dottorrent_file::exec,
crate::handlers::torrents::create_torrent::exec,
crate::handlers::torrents::edit_torrent::exec,
crate::handlers::torrents::get_registered_torrents::exec,
crate::handlers::torrents::get_upload_information::exec,
crate::handlers::torrents::get_top_torrents::exec,
crate::handlers::torrents::delete_torrent::exec,
crate::handlers::torrents::create_torrent_report::exec,
crate::handlers::edition_groups::create_edition_group::exec,
crate::handlers::invitations::create_invitation::exec,
crate::handlers::master_groups::create_master_group::exec,
crate::handlers::series::create_series::exec,
crate::handlers::series::get_series::exec,
crate::handlers::subscriptions::create_subscription::exec,
crate::handlers::subscriptions::remove_subscription::exec,
crate::handlers::title_groups::create_title_group_comment::exec,
crate::handlers::title_groups::create_title_group::exec,
crate::handlers::title_groups::edit_title_group::exec,
crate::handlers::title_groups::get_title_group::exec,
crate::handlers::title_groups::get_title_group_info_lite::exec,
crate::handlers::search::search_torrents::exec,
crate::handlers::search::search_title_group_info_lite::exec,
crate::handlers::search::search_torrent_requests::exec,
crate::handlers::search::search_artists_lite::exec,
crate::handlers::search::search_forum_thread::exec,
crate::handlers::torrent_requests::create_torrent_request::exec,
crate::handlers::torrent_requests::get_torrent_request::exec,
crate::handlers::torrent_requests::fill_torrent_request::exec,
crate::handlers::torrent_requests::create_torrent_request_vote::exec,
crate::handlers::gifts::create_gift::exec,
crate::handlers::forum::get_forum::exec,
crate::handlers::forum::get_forum_sub_category_threads::exec,
crate::handlers::forum::get_forum_thread::exec,
crate::handlers::forum::create_forum_thread::exec,
crate::handlers::forum::create_forum_post::exec,
crate::handlers::wiki::create_wiki_article::exec,
crate::handlers::wiki::get_wiki_article::exec,
crate::handlers::conversations::create_conversation::exec,
crate::handlers::conversations::get_conversation::exec,
crate::handlers::conversations::create_conversation_message::exec,
crate::handlers::external_db::get_isbn_data::exec,
crate::handlers::external_db::get_musicbrainz_data::exec,
crate::handlers::external_db::get_tmdb_data::exec,
crate::handlers::external_db::get_comic_vine_data::exec,
),
components(schemas(
Register,
RegisterQuery,
Login,
LoginResponse,
RefreshToken,
GetArtistPublicationsQuery,
DownloadTorrentQuery,
TorrentSearch,
Artist,
AffiliatedArtist,
AffiliatedArtistHierarchy,
User,
PublicUser,
EditionGroup,
Invitation,
SentInvitation,
MasterGroup,
UserCreatedMasterGroup,
Series,
UserCreatedSeries,
UserCreatedTitleGroupComment,
TitleGroupComment,
TorrentRequest,
UserCreatedTorrentRequest,
TorrentRequestVote,
UserCreatedTorrentRequestVote,
UserCreatedTorrentReport,
TorrentReport,
ArtistLite,
SeriesAndTitleGroupHierarchyLite,
ArtistAndTitleGroupsLite,
TorrentSearchResults,
TitleGroupAndAssociatedData,
UploadedTorrent,
EditedTorrent,
Torrent,
TorrentToDelete,
Profile,
PublicProfile,
Gift,
UserCreatedGift,
GetTopTorrentsQuery,
ForumPost,
UserCreatedForumPost,
UserWarning,
UserCreatedUserWarning,
ForumOverview,
ForumSubCategoryHierarchy,
ForumThreadAndPosts,
UserCreatedForumThread,
WikiArticle,
UserCreatedWikiArticle,
WikiArticleHierarchy,
ConversationMessage,
UserCreatedConversation,
UserCreatedConversationMessage,
Conversation,
ConversationHierarchy,
ConversationMessageHierarchy,
ConversationOverview,
ConversationsOverview,
TorrentRequestHierarchyLite,
TorrentRequestFill,
UserApplication,
UserApplicationStatus,
UserCreatedUserApplication,
GetUserApplicationsQuery,
UpdateUserApplication,
ExternalDBData,
HomePage,
UploadInformation,
EditedUser,
PublicRating,
TorrentRequestWithTitleGroupLite,
TorrentRequestAndAssociatedData,
TitleGroupLite,
EditedTitleGroup,
Extras,
SearchTorrentRequestsQuery,
SeriesLite,
TorrentRequestVoteHierarchy,
UserLite,
),)
)]
pub struct ApiDoc;