Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Apr 7, 2024
1 parent 5270c7a commit a624c50
Show file tree
Hide file tree
Showing 37 changed files with 56 additions and 93 deletions.
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/kitsune-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ redis = { version = "0.25.3", default-features = false, features = [
rsa = "0.9.6"
rusty-s3 = { version = "0.5.0", default-features = false }
serde = "1.0.197"
simd-json = "0.13.9"
smol_str = "0.2.1"
speedy-uuid = { path = "../../lib/speedy-uuid" }
tokio = { version = "1.37.0", features = ["macros", "sync"] }
Expand Down
2 changes: 0 additions & 2 deletions kitsune/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ chrono = { version = "0.4.37", default-features = false }
clap = { version = "4.5.4", features = ["derive", "wrap_help"] }
color-eyre = "0.6.3"
cursiv = { path = "../lib/cursiv", features = ["axum"] }
der = { version = "0.7.9", features = ["std"] }
diesel = "2.1.5"
diesel-async = "0.4.1"
futures-util = "0.3.30"
Expand Down Expand Up @@ -88,7 +87,6 @@ simdutf8 = { version = "0.1.4", features = ["aarch64_neon"] }
speedy-uuid = { path = "../lib/speedy-uuid" }
strum = { version = "0.26.2", features = ["derive", "phf"] }
tempfile = "3.10.1"
thiserror = "1.0.58"
time = "0.3.34"
tokio = { version = "1.37.0", features = ["full"] }
tokio-util = { version = "0.7.10", features = ["compat"] }
Expand Down
6 changes: 2 additions & 4 deletions kitsune/src/http/handler/mastodon/api/v1/accounts/follow.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::{
error::Result,
http::extractor::{AgnosticForm, AuthExtractor, MastodonAuthExtractor},
};
use crate::http::extractor::{AgnosticForm, AuthExtractor, MastodonAuthExtractor};
use axum::{
debug_handler,
extract::{Path, State},
Json,
};
use kitsune_core::error::HttpError;
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_service::account::{AccountService, Follow};
use kitsune_type::mastodon::relationship::Relationship;
Expand Down
3 changes: 2 additions & 1 deletion kitsune/src/http/handler/mastodon/api/v1/accounts/lookup.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use crate::{error::Result, http::extractor::MastodonAuthExtractor};
use crate::http::extractor::MastodonAuthExtractor;
use axum::{
debug_handler,
extract::{Query, State},
Json,
};
use kitsune_core::error::HttpError;
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_service::account::{AccountService, GetUser};
use kitsune_type::mastodon::Account;
Expand Down
3 changes: 2 additions & 1 deletion kitsune/src/http/handler/mastodon/api/v1/accounts/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use crate::{error::Result, state::Zustand};
use crate::state::Zustand;
use axum::{
extract::{Path, State},
routing, Json, Router,
};
use kitsune_core::error::HttpError;
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_service::account::AccountService;
use kitsune_type::mastodon;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::{
error::Result,
http::extractor::{AuthExtractor, MastodonAuthExtractor},
};
use crate::http::extractor::{AuthExtractor, MastodonAuthExtractor};
use axum::{debug_handler, extract::State, Json};
use axum_extra::extract::Query;
use diesel::{ExpressionMethods, QueryDsl, SelectableHelper};
use diesel_async::RunQueryDsl;
use futures_util::StreamExt;
use kitsune_db::{model::account::Account, schema::accounts, with_connection, PgPool};
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_type::mastodon::relationship::Relationship;
use serde::Deserialize;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{
consts::default_limit,
error::{Error, Result},
http::{
extractor::{AuthExtractor, MastodonAuthExtractor},
pagination::{LinkHeader, PaginatedJsonResponse},
Expand All @@ -11,6 +10,7 @@ use axum::{
Json,
};
use futures_util::{FutureExt, TryFutureExt, TryStreamExt};
use kitsune_error::{Error, Result};
use kitsune_mastodon::MastodonMapper;
use kitsune_service::account::{AccountService, GetPosts};
use kitsune_type::mastodon::Status;
Expand Down
6 changes: 2 additions & 4 deletions kitsune/src/http/handler/mastodon/api/v1/accounts/unfollow.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::{
error::Result,
http::extractor::{AuthExtractor, MastodonAuthExtractor},
};
use crate::http::extractor::{AuthExtractor, MastodonAuthExtractor};
use axum::{
debug_handler,
extract::{Path, State},
Json,
};
use kitsune_core::error::HttpError;
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_service::account::{AccountService, Unfollow};
use kitsune_type::mastodon::relationship::Relationship;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
use crate::{
error::Result,
http::{
extractor::{AuthExtractor, MastodonAuthExtractor},
util::buffer_multipart_to_tempfile,
},
use crate::http::{
extractor::{AuthExtractor, MastodonAuthExtractor},
util::buffer_multipart_to_tempfile,
};
use axum::{
extract::{Multipart, State},
Json,
};
use kitsune_core::error::HttpError;
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_service::{
account::{AccountService, Update},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
error::Result,
http::extractor::{AuthExtractor, MastodonAuthExtractor},
};
use crate::http::extractor::{AuthExtractor, MastodonAuthExtractor};
use axum::{extract::State, Json};
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_type::mastodon::Account;

Expand Down
2 changes: 1 addition & 1 deletion kitsune/src/http/handler/mastodon/api/v1/apps.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::state::Zustand;
use crate::{
error::Result,
http::extractor::AgnosticForm,
oauth2::{CreateApp, OAuth2Service},
};
use axum::{extract::State, routing, Json, Router};
use kitsune_error::Result;
use kitsune_type::mastodon::App;
use serde::Deserialize;
use utoipa::ToSchema;
Expand Down
7 changes: 2 additions & 5 deletions kitsune/src/http/handler/mastodon/api/v1/custom_emojis.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use crate::{
error::{Error, Result},
http::extractor::MastodonAuthExtractor,
state::Zustand,
};
use crate::{http::extractor::MastodonAuthExtractor, state::Zustand};
use axum::{debug_handler, extract::State, routing, Json, Router};
use futures_util::{TryFutureExt, TryStreamExt};
use kitsune_error::{Error, Result};
use kitsune_mastodon::MastodonMapper;
use kitsune_service::custom_emoji::{CustomEmojiService, GetEmojiList};
use kitsune_type::mastodon::CustomEmoji;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::{
error::Result,
http::extractor::{AuthExtractor, MastodonAuthExtractor},
};
use crate::http::extractor::{AuthExtractor, MastodonAuthExtractor};
use axum::{
debug_handler,
extract::{Path, State},
Json,
};
use kitsune_core::error::HttpError;
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_service::account::{AccountService, FollowRequest};
use kitsune_type::mastodon::relationship::Relationship;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{
consts::default_limit,
error::{Error, Result},
http::{
extractor::{AuthExtractor, MastodonAuthExtractor},
pagination::{LinkHeader, PaginatedJsonResponse},
Expand All @@ -14,6 +13,7 @@ use axum::{
};
use axum_extra::extract::Query;
use futures_util::{TryFutureExt, TryStreamExt};
use kitsune_error::{Error, Result};
use kitsune_mastodon::MastodonMapper;
use kitsune_service::account::{AccountService, GetFollowRequests};
use kitsune_type::mastodon::Account;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::{
error::Result,
http::extractor::{AuthExtractor, MastodonAuthExtractor},
};
use crate::http::extractor::{AuthExtractor, MastodonAuthExtractor};
use axum::{
debug_handler,
extract::{Path, State},
Json,
};
use kitsune_core::error::HttpError;
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_service::account::{AccountService, FollowRequest};
use kitsune_type::mastodon::relationship::Relationship;
Expand Down
3 changes: 2 additions & 1 deletion kitsune/src/http/handler/mastodon/api/v1/instance.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{error::Result, state::Zustand};
use crate::state::Zustand;
use axum::{extract::State, routing, Json, Router};
use kitsune_core::consts::VERSION;
use kitsune_error::Result;
use kitsune_service::instance::InstanceService;
use kitsune_type::mastodon::{
instance::{Stats, Urls},
Expand Down
2 changes: 1 addition & 1 deletion kitsune/src/http/handler/mastodon/api/v1/media.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{
error::{Error, Result},
http::{
extractor::{AgnosticForm, AuthExtractor, MastodonAuthExtractor},
util::buffer_multipart_to_tempfile,
Expand All @@ -13,6 +12,7 @@ use axum::{
};
use futures_util::TryFutureExt;
use kitsune_core::error::HttpError;
use kitsune_error::{Error, Result};
use kitsune_mastodon::MastodonMapper;
use kitsune_service::attachment::{AttachmentService, Update, Upload};
use kitsune_type::mastodon::MediaAttachment;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use crate::{
error::Result,
http::extractor::{AuthExtractor, MastodonAuthExtractor},
};
use crate::http::extractor::{AuthExtractor, MastodonAuthExtractor};
use axum::{debug_handler, extract::State};
use http::StatusCode;
use kitsune_error::Result;
use kitsune_service::notification::NotificationService;

#[debug_handler(state = crate::state::Zustand)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use crate::{
error::Result,
http::extractor::{AuthExtractor, MastodonAuthExtractor},
};
use crate::http::extractor::{AuthExtractor, MastodonAuthExtractor};
use axum::{
debug_handler,
extract::{Path, State},
};
use http::StatusCode;
use kitsune_error::Result;
use kitsune_service::notification::NotificationService;
use speedy_uuid::Uuid;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{
consts::default_limit,
error::{Error, Result},
http::{
extractor::{AuthExtractor, MastodonAuthExtractor},
pagination::{LinkHeader, PaginatedJsonResponse},
Expand All @@ -15,6 +14,7 @@ use axum::{
use axum_extra::extract::Query;
use futures_util::{TryFutureExt, TryStreamExt};
use kitsune_core::error::HttpError;
use kitsune_error::{Error, Result};
use kitsune_mastodon::MastodonMapper;
use kitsune_service::notification::{GetNotifications, NotificationService};
use kitsune_type::mastodon::{notification::NotificationType, Notification};
Expand Down
6 changes: 2 additions & 4 deletions kitsune/src/http/handler/mastodon/api/v1/statuses/context.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::{
error::{Error, Result},
http::extractor::MastodonAuthExtractor,
};
use crate::http::extractor::MastodonAuthExtractor;
use axum::{
debug_handler,
extract::{Path, State},
Json,
};
use futures_util::{TryFutureExt, TryStreamExt};
use kitsune_error::{Error, Result};
use kitsune_mastodon::MastodonMapper;
use kitsune_service::post::PostService;
use kitsune_type::mastodon::status::Context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use crate::{
error::Result,
http::extractor::{AuthExtractor, MastodonAuthExtractor},
};
use crate::http::extractor::{AuthExtractor, MastodonAuthExtractor};
use axum::{
debug_handler,
extract::{Path, State},
Json,
};
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_service::post::PostService;
use kitsune_type::mastodon::Status;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{
consts::default_limit,
error::{Error, Result},
http::{
extractor::MastodonAuthExtractor,
pagination::{LinkHeader, PaginatedJsonResponse},
Expand All @@ -13,6 +12,7 @@ use axum::{
};
use axum_extra::extract::Query;
use futures_util::{TryFutureExt, TryStreamExt};
use kitsune_error::{Error, Result};
use kitsune_mastodon::MastodonMapper;
use kitsune_service::post::{GetAccountsInteractingWithPost, PostService};
use kitsune_type::mastodon::Account;
Expand Down
2 changes: 1 addition & 1 deletion kitsune/src/http/handler/mastodon/api/v1/statuses/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{
error::Result,
http::extractor::{AgnosticForm, AuthExtractor, MastodonAuthExtractor},
state::Zustand,
};
Expand All @@ -9,6 +8,7 @@ use axum::{
routing, Json, Router,
};
use http::StatusCode;
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_service::post::{CreatePost, DeletePost, PostService, UpdatePost};
use kitsune_type::mastodon::{status::Visibility, Status};
Expand Down
6 changes: 2 additions & 4 deletions kitsune/src/http/handler/mastodon/api/v1/statuses/reblog.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use crate::{
error::Result,
http::extractor::{AgnosticForm, AuthExtractor, MastodonAuthExtractor},
};
use crate::http::extractor::{AgnosticForm, AuthExtractor, MastodonAuthExtractor};
use axum::{
debug_handler,
extract::{Path, State},
Json,
};
use kitsune_error::Result;
use kitsune_mastodon::MastodonMapper;
use kitsune_service::post::{PostService, RepostPost};
use kitsune_type::mastodon::{status::Visibility, Status};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{
consts::default_limit,
error::{Error, Result},
http::{
extractor::MastodonAuthExtractor,
pagination::{LinkHeader, PaginatedJsonResponse},
Expand All @@ -13,6 +12,7 @@ use axum::{
};
use axum_extra::extract::Query;
use futures_util::{TryFutureExt, TryStreamExt};
use kitsune_error::{Error, Result};
use kitsune_mastodon::MastodonMapper;
use kitsune_service::post::{GetAccountsInteractingWithPost, PostService};
use kitsune_type::mastodon::Account;
Expand Down
Loading

0 comments on commit a624c50

Please sign in to comment.