mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-06-28 10:10:33 +00:00
88a0d2feec
* Adding typescript generation for API. Fixes #2824 * Try to fix Ltree issue 1. * Forgot a few types. * Fixing api tests. * Removing url_serde line. * Manually deriving TS for some types.
69 lines
1.7 KiB
Rust
69 lines
1.7 KiB
Rust
use crate::sensitive::Sensitive;
|
|
use lemmy_db_schema::newtypes::{CommunityId, PostId};
|
|
use serde::{Deserialize, Serialize};
|
|
#[cfg(feature = "full")]
|
|
use ts_rs::TS;
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
pub struct UserJoin {
|
|
pub auth: Sensitive<String>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
pub struct UserJoinResponse {
|
|
pub joined: bool,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
pub struct CommunityJoin {
|
|
pub community_id: CommunityId,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
pub struct CommunityJoinResponse {
|
|
pub joined: bool,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
pub struct ModJoin {
|
|
pub community_id: CommunityId,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
pub struct ModJoinResponse {
|
|
pub joined: bool,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
pub struct PostJoin {
|
|
pub post_id: PostId,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
pub struct PostJoinResponse {
|
|
pub joined: bool,
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct CaptchaItem {
|
|
pub uuid: String,
|
|
pub answer: String,
|
|
pub expires: chrono::NaiveDateTime,
|
|
}
|