2022-04-13 16:37:54 +00:00
|
|
|
use lemmy_db_schema::{
|
2022-10-06 18:27:58 +00:00
|
|
|
newtypes::{CommunityId, LanguageId, PersonId},
|
2022-04-13 16:37:54 +00:00
|
|
|
source::site::Site,
|
2024-01-25 16:04:25 +00:00
|
|
|
CommunityVisibility,
|
2022-05-06 20:55:07 +00:00
|
|
|
ListingType,
|
2022-04-13 16:37:54 +00:00
|
|
|
};
|
2024-10-15 21:15:43 +00:00
|
|
|
use lemmy_db_views_actor::structs::{
|
|
|
|
CommunityModeratorView,
|
|
|
|
CommunitySortType,
|
|
|
|
CommunityView,
|
2024-11-07 10:49:05 +00:00
|
|
|
PendingFollow,
|
2024-10-15 21:15:43 +00:00
|
|
|
PersonView,
|
|
|
|
};
|
2020-09-01 14:25:34 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2023-04-26 04:26:10 +00:00
|
|
|
use serde_with::skip_serializing_none;
|
|
|
|
#[cfg(feature = "full")]
|
|
|
|
use ts_rs::TS;
|
2020-09-01 14:25:34 +00:00
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2024-11-06 14:50:13 +00:00
|
|
|
// TODO make this into a tagged enum
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Get a community. Must provide either an id, or a name.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct GetCommunity {
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2021-03-18 20:25:21 +00:00
|
|
|
pub id: Option<CommunityId>,
|
2021-07-20 04:29:50 +00:00
|
|
|
/// Example: star_trek , or star_trek@xyz.tld
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub name: Option<String>,
|
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2022-05-06 20:55:07 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// The community response.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct GetCommunityResponse {
|
2020-12-06 14:12:51 +00:00
|
|
|
pub community_view: CommunityView,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2022-04-13 16:37:54 +00:00
|
|
|
pub site: Option<Site>,
|
2020-09-01 14:25:34 +00:00
|
|
|
pub moderators: Vec<CommunityModeratorView>,
|
2022-10-06 18:27:58 +00:00
|
|
|
pub discussion_languages: Vec<LanguageId>,
|
2020-09-01 14:25:34 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Create a community.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct CreateCommunity {
|
2023-05-10 19:20:39 +00:00
|
|
|
/// The unique name.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub name: String,
|
2023-05-10 19:20:39 +00:00
|
|
|
/// A longer title.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub title: String,
|
2024-10-28 15:54:36 +00:00
|
|
|
/// A sidebar for the community in markdown.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2024-10-28 15:54:36 +00:00
|
|
|
pub sidebar: Option<String>,
|
|
|
|
/// A shorter, one line description of your community.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub description: Option<String>,
|
2023-05-10 19:20:39 +00:00
|
|
|
/// An icon URL.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub icon: Option<String>,
|
2023-05-10 19:20:39 +00:00
|
|
|
/// A banner URL.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub banner: Option<String>,
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Whether its an NSFW community.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2021-03-20 20:59:07 +00:00
|
|
|
pub nsfw: Option<bool>,
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Whether to restrict posting only to moderators.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2022-04-29 14:01:10 +00:00
|
|
|
pub posting_restricted_to_mods: Option<bool>,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2022-12-19 11:40:22 +00:00
|
|
|
pub discussion_languages: Option<Vec<LanguageId>>,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2024-01-25 16:04:25 +00:00
|
|
|
pub visibility: Option<CommunityVisibility>,
|
2020-09-01 14:25:34 +00:00
|
|
|
}
|
|
|
|
|
2021-12-06 14:54:47 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// A simple community response.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct CommunityResponse {
|
2020-12-06 14:12:51 +00:00
|
|
|
pub community_view: CommunityView,
|
2022-12-19 11:40:22 +00:00
|
|
|
pub discussion_languages: Vec<LanguageId>,
|
2020-09-01 14:25:34 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Fetches a list of communities.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct ListCommunities {
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2022-05-06 20:55:07 +00:00
|
|
|
pub type_: Option<ListingType>,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2024-10-15 21:15:43 +00:00
|
|
|
pub sort: Option<CommunitySortType>,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2023-06-27 10:45:26 +00:00
|
|
|
pub show_nsfw: Option<bool>,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub page: Option<i64>,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub limit: Option<i64>,
|
|
|
|
}
|
|
|
|
|
2022-05-06 20:55:07 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// The response for listing communities.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct ListCommunitiesResponse {
|
|
|
|
pub communities: Vec<CommunityView>,
|
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Ban a user from a community.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct BanFromCommunity {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub person_id: PersonId,
|
2020-09-01 14:25:34 +00:00
|
|
|
pub ban: bool,
|
2024-09-18 13:11:42 +00:00
|
|
|
/// Optionally remove or restore all their data. Useful for new troll accounts.
|
|
|
|
/// If ban is true, then this means remove. If ban is false, it means restore.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2024-09-18 13:11:42 +00:00
|
|
|
pub remove_or_restore_data: Option<bool>,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub reason: Option<String>,
|
2024-01-25 15:45:42 +00:00
|
|
|
/// A time that the ban will expire, in unix epoch seconds.
|
|
|
|
///
|
|
|
|
/// An i64 unix timestamp is used for a simpler API client implementation.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub expires: Option<i64>,
|
|
|
|
}
|
|
|
|
|
2023-10-20 00:15:55 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
|
|
/// The response for banning a user from a community.
|
|
|
|
pub struct BanFromCommunityResponse {
|
|
|
|
pub person_view: PersonView,
|
|
|
|
pub banned: bool,
|
|
|
|
}
|
|
|
|
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Add a moderator to a community.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct AddModToCommunity {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub person_id: PersonId,
|
2020-09-01 14:25:34 +00:00
|
|
|
pub added: bool,
|
|
|
|
}
|
|
|
|
|
2023-10-20 00:15:55 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
|
|
/// The response of adding a moderator to a community.
|
|
|
|
pub struct AddModToCommunityResponse {
|
|
|
|
pub moderators: Vec<CommunityModeratorView>,
|
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Edit a community.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct EditCommunity {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub community_id: CommunityId,
|
2023-05-10 19:20:39 +00:00
|
|
|
/// A longer title.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2021-04-15 03:37:51 +00:00
|
|
|
pub title: Option<String>,
|
2024-10-28 15:54:36 +00:00
|
|
|
/// A sidebar for the community in markdown.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2024-10-28 15:54:36 +00:00
|
|
|
pub sidebar: Option<String>,
|
|
|
|
/// A shorter, one line description of your community.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub description: Option<String>,
|
2023-05-10 19:20:39 +00:00
|
|
|
/// An icon URL.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub icon: Option<String>,
|
2023-05-10 19:20:39 +00:00
|
|
|
/// A banner URL.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub banner: Option<String>,
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Whether its an NSFW community.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2021-03-20 20:59:07 +00:00
|
|
|
pub nsfw: Option<bool>,
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Whether to restrict posting only to moderators.
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2022-04-29 14:01:10 +00:00
|
|
|
pub posting_restricted_to_mods: Option<bool>,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2022-10-06 18:27:58 +00:00
|
|
|
pub discussion_languages: Option<Vec<LanguageId>>,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2024-01-25 16:04:25 +00:00
|
|
|
pub visibility: Option<CommunityVisibility>,
|
2022-02-18 02:30:47 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Hide a community from the main view.
|
2022-02-18 02:30:47 +00:00
|
|
|
pub struct HideCommunity {
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub hidden: bool,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2022-02-18 02:30:47 +00:00
|
|
|
pub reason: Option<String>,
|
2020-09-01 14:25:34 +00:00
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Delete your own community.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct DeleteCommunity {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub community_id: CommunityId,
|
2020-09-01 14:25:34 +00:00
|
|
|
pub deleted: bool,
|
|
|
|
}
|
|
|
|
|
2023-04-26 04:26:10 +00:00
|
|
|
#[skip_serializing_none]
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Remove a community (only doable by moderators).
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct RemoveCommunity {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub community_id: CommunityId,
|
2020-09-01 14:25:34 +00:00
|
|
|
pub removed: bool,
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2020-09-01 14:25:34 +00:00
|
|
|
pub reason: Option<String>,
|
|
|
|
}
|
|
|
|
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Follow / subscribe to a community.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct FollowCommunity {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub community_id: CommunityId,
|
2020-09-01 14:25:34 +00:00
|
|
|
pub follow: bool,
|
|
|
|
}
|
|
|
|
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Block a community.
|
2021-08-19 20:54:15 +00:00
|
|
|
pub struct BlockCommunity {
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub block: bool,
|
2020-09-01 14:25:34 +00:00
|
|
|
}
|
|
|
|
|
2023-10-20 00:15:55 +00:00
|
|
|
#[skip_serializing_none]
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
|
|
/// The block community response.
|
|
|
|
pub struct BlockCommunityResponse {
|
|
|
|
pub community_view: CommunityView,
|
|
|
|
pub blocked: bool,
|
|
|
|
}
|
|
|
|
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Transfer a community to a new owner.
|
2020-09-01 14:25:34 +00:00
|
|
|
pub struct TransferCommunity {
|
2021-03-18 20:25:21 +00:00
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub person_id: PersonId,
|
2020-09-01 14:25:34 +00:00
|
|
|
}
|
2024-10-02 13:10:41 +00:00
|
|
|
|
|
|
|
#[skip_serializing_none]
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
|
|
/// Fetches a random community
|
|
|
|
pub struct GetRandomCommunity {
|
2024-11-06 14:50:13 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
2024-10-02 13:10:41 +00:00
|
|
|
pub type_: Option<ListingType>,
|
|
|
|
}
|
2024-11-07 10:49:05 +00:00
|
|
|
|
|
|
|
#[skip_serializing_none]
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
|
|
pub struct ListCommunityPendingFollows {
|
|
|
|
/// Only shows the unapproved applications
|
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
|
|
|
pub pending_only: Option<bool>,
|
|
|
|
// Only for admins, show pending follows for communities which you dont moderate
|
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
|
|
|
pub all_communities: Option<bool>,
|
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
|
|
|
pub page: Option<i64>,
|
|
|
|
#[cfg_attr(feature = "full", ts(optional))]
|
|
|
|
pub limit: Option<i64>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
|
|
pub struct GetCommunityPendingFollowsCount {
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
|
|
pub struct GetCommunityPendingFollowsCountResponse {
|
|
|
|
pub count: i64,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
|
|
pub struct ListCommunityPendingFollowsResponse {
|
|
|
|
pub items: Vec<PendingFollow>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
|
|
|
pub struct ApproveCommunityPendingFollower {
|
|
|
|
pub community_id: CommunityId,
|
|
|
|
pub follower_id: PersonId,
|
|
|
|
pub approve: bool,
|
|
|
|
}
|