add: user requests in js app sdk
This commit is contained in:
parent
884a89904e
commit
0138bf4cd4
52 changed files with 282 additions and 53 deletions
|
@ -7,7 +7,7 @@ use crate::{
|
|||
State,
|
||||
};
|
||||
use axum::{Extension, Json, extract::Path, response::IntoResponse};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{
|
||||
apps::{AppQuota, ThirdPartyApp},
|
||||
oauth::{AuthGrant, PkceChallengeMethod},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::collections::HashMap;
|
||||
use axum::{extract::Path, response::IntoResponse, Extension, Json};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::{
|
||||
database::connections::last_fm::LastFmConnection,
|
||||
model::{
|
||||
|
|
|
@ -5,7 +5,7 @@ pub mod stripe;
|
|||
use std::collections::HashMap;
|
||||
|
||||
use axum::{extract::Path, response::IntoResponse, Extension, Json};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use serde::Deserialize;
|
||||
use tetratto_core::model::{
|
||||
auth::{ConnectionService, ExternalConnectionData},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use axum::{response::IntoResponse, Extension, Json};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::{
|
||||
database::connections::spotify::SpotifyConnection,
|
||||
model::{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::{str::FromStr, time::Duration};
|
||||
|
||||
use axum::{http::HeaderMap, response::IntoResponse, Extension, Json};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{
|
||||
auth::{Notification, User},
|
||||
moderation::AuditLogEntry,
|
||||
|
|
|
@ -4,7 +4,7 @@ use axum::{
|
|||
extract::{Path, Query},
|
||||
response::IntoResponse,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use pathbufd::{PathBufD, pathd};
|
||||
use serde::Deserialize;
|
||||
use std::{
|
||||
|
|
|
@ -4,7 +4,7 @@ use crate::{
|
|||
routes::api::v1::CreateIpBan,
|
||||
};
|
||||
use axum::{Extension, Json, extract::Path, response::IntoResponse};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{addr::RemoteAddr, auth::IpBan, permissions::FinePermission};
|
||||
|
||||
/// Create a new IP ban.
|
||||
|
|
|
@ -16,7 +16,7 @@ use axum::{
|
|||
response::{IntoResponse, Redirect},
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use serde::Deserialize;
|
||||
use tetratto_core::model::addr::RemoteAddr;
|
||||
use tetratto_shared::hash::hash;
|
||||
|
|
|
@ -18,7 +18,7 @@ use axum::{
|
|||
response::{IntoResponse, Redirect},
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use futures_util::{sink::SinkExt, stream::StreamExt};
|
||||
use tetratto_core::{
|
||||
cache::Cache,
|
||||
|
|
|
@ -9,7 +9,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{
|
||||
addr::RemoteAddr,
|
||||
auth::{AchievementName, FollowResult, IpBlock, Notification, UserBlock, UserFollow},
|
||||
|
|
|
@ -9,7 +9,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{auth::UserWarning, oauth, permissions::FinePermission};
|
||||
|
||||
/// Create a new user warning.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use axum::{Extension, Json, extract::Path, response::IntoResponse};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{oauth, channels::Channel, ApiReturn, Error};
|
||||
use crate::{
|
||||
get_user_from_token,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::{get_user_from_token, routes::api::v1::CreateMessageReaction, State};
|
||||
use axum::{Extension, Json, extract::Path, response::IntoResponse};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{channels::MessageReaction, oauth, ApiReturn, Error};
|
||||
|
||||
pub async fn get_request(
|
||||
|
|
|
@ -7,7 +7,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::{
|
||||
cache::{Cache, redis::Commands},
|
||||
model::{
|
||||
|
|
|
@ -3,7 +3,7 @@ use axum::{
|
|||
extract::Path,
|
||||
response::{IntoResponse, Redirect},
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{
|
||||
auth::Notification,
|
||||
communities::{Community, CommunityMembership},
|
||||
|
|
|
@ -3,7 +3,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{auth::AchievementName, communities::PostDraft, oauth, ApiReturn, Error};
|
||||
use crate::{
|
||||
get_user_from_token,
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::{
|
|||
State,
|
||||
};
|
||||
use axum::{body::Body, extract::Path, response::IntoResponse, Extension, Json};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{
|
||||
oauth,
|
||||
uploads::{CustomEmoji, MediaType, MediaUpload},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use axum::{Extension, Json, body::Body, extract::Path, response::IntoResponse};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use pathbufd::{PathBufD, pathd};
|
||||
use std::fs::exists;
|
||||
use tetratto_core::model::{ApiReturn, Error, permissions::FinePermission, oauth};
|
||||
|
|
|
@ -4,7 +4,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{
|
||||
addr::RemoteAddr,
|
||||
auth::AchievementName,
|
||||
|
|
|
@ -4,7 +4,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{
|
||||
addr::RemoteAddr,
|
||||
auth::{AchievementName, IpBlock},
|
||||
|
|
|
@ -9,7 +9,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{
|
||||
auth::AchievementName,
|
||||
littleweb::{Domain, ServiceFsMime},
|
||||
|
|
|
@ -3,7 +3,7 @@ use axum::{
|
|||
extract::{Json, Path},
|
||||
Extension,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_shared::snow::Snowflake;
|
||||
use crate::{
|
||||
get_user_from_token,
|
||||
|
|
|
@ -3,7 +3,7 @@ use axum::{
|
|||
extract::{Json, Path},
|
||||
Extension,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_shared::unix_epoch_timestamp;
|
||||
use crate::{
|
||||
get_user_from_token,
|
||||
|
|
|
@ -5,7 +5,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{oauth, ApiReturn, Error};
|
||||
|
||||
pub async fn delete_request(
|
||||
|
|
|
@ -15,7 +15,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{
|
||||
oauth,
|
||||
products::Product,
|
||||
|
|
|
@ -5,7 +5,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{addr::RemoteAddr, oauth, reactions::Reaction, ApiReturn, Error};
|
||||
|
||||
pub async fn get_request(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use super::CreateReport;
|
||||
use crate::{State, get_user_from_token};
|
||||
use axum::{Extension, Json, extract::Path, response::IntoResponse};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{ApiReturn, Error, moderation::Report};
|
||||
|
||||
pub async fn create_request(
|
||||
|
|
|
@ -4,7 +4,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{oauth, ApiReturn, Error};
|
||||
|
||||
pub async fn delete_request(
|
||||
|
|
|
@ -6,7 +6,7 @@ use crate::{
|
|||
State,
|
||||
};
|
||||
use axum::{extract::Path, response::IntoResponse, Extension, Json};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::model::{auth::AchievementName, littleweb::Service, oauth, ApiReturn, Error};
|
||||
use tetratto_shared::unix_epoch_timestamp;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension, Json,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use tetratto_core::{
|
||||
model::{
|
||||
oauth,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::fs::exists;
|
||||
use axum::{body::Body, extract::Path, response::IntoResponse, Extension, Json};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use pathbufd::PathBufD;
|
||||
use crate::{get_user_from_token, routes::api::v1::UpdateUploadAlt, State};
|
||||
use super::auth::images::read_image;
|
||||
|
|
|
@ -7,7 +7,7 @@ use axum::{
|
|||
response::IntoResponse,
|
||||
Extension,
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use crate::cookie::CookieJar;
|
||||
use pathbufd::PathBufD;
|
||||
use serde::Deserialize;
|
||||
use tetratto_core::model::permissions::FinePermission;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue