2021-01-04 17:34:31 +00:00
|
|
|
use crate::store::{OwnerSource, Visibility};
|
|
|
|
use chrono::{DateTime, Utc};
|
|
|
|
use url::Url;
|
|
|
|
use uuid::Uuid;
|
|
|
|
|
|
|
|
mod apub;
|
|
|
|
mod block;
|
|
|
|
mod comment;
|
|
|
|
mod follow;
|
|
|
|
mod follow_request;
|
|
|
|
mod profile;
|
|
|
|
mod react;
|
|
|
|
mod submission;
|
|
|
|
|
2021-01-04 17:41:34 +00:00
|
|
|
pub(crate) use apub::ingest;
|
2021-01-04 17:34:31 +00:00
|
|
|
|
|
|
|
pub struct CreateReact {
|
2021-01-05 06:09:59 +00:00
|
|
|
like_apub_id: Option<Url>,
|
2021-01-04 17:34:31 +00:00
|
|
|
submission_id: Uuid,
|
|
|
|
profile_id: Uuid,
|
|
|
|
comment_id: Option<Uuid>,
|
|
|
|
react: String,
|
|
|
|
published: DateTime<Utc>,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct DeleteReact {
|
2021-01-05 03:13:06 +00:00
|
|
|
react_id: Uuid,
|
2021-01-04 17:34:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub struct CreateComment {
|
2021-01-05 06:09:59 +00:00
|
|
|
note_apub_id: Option<Url>,
|
2021-01-04 17:34:31 +00:00
|
|
|
submission_id: Uuid,
|
|
|
|
profile_id: Uuid,
|
|
|
|
comment_id: Option<Uuid>,
|
|
|
|
body: String,
|
|
|
|
published: DateTime<Utc>,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct AnnounceComment;
|
|
|
|
|
|
|
|
pub struct UpdateComment {
|
2021-01-05 06:09:59 +00:00
|
|
|
update_apub_id: Option<Url>,
|
2021-01-04 17:34:31 +00:00
|
|
|
comment_id: Uuid,
|
|
|
|
body: Option<String>,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct DeleteComment {
|
2021-01-05 06:09:59 +00:00
|
|
|
note_apub_id: Url,
|
2021-01-04 17:34:31 +00:00
|
|
|
comment_id: Uuid,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct CreateSubmission {
|
2021-01-05 06:09:59 +00:00
|
|
|
note_apub_id: Option<Url>,
|
2021-01-04 17:34:31 +00:00
|
|
|
profile_id: Uuid,
|
|
|
|
title: String,
|
|
|
|
description: Option<String>,
|
|
|
|
files: Vec<Uuid>,
|
|
|
|
published: DateTime<Utc>,
|
|
|
|
visibility: Visibility,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct AnnounceSubmission;
|
|
|
|
|
|
|
|
pub struct UpdateSubmission {
|
|
|
|
submission_id: Uuid,
|
|
|
|
title: Option<String>,
|
|
|
|
description: Option<String>,
|
|
|
|
files: Vec<Uuid>,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct DeleteSubmission {
|
|
|
|
submission_id: Uuid,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct CreateProfile {
|
2021-01-05 06:09:59 +00:00
|
|
|
person_apub_id: Option<Url>,
|
2021-01-04 17:34:31 +00:00
|
|
|
owner_source: OwnerSource,
|
|
|
|
handle: String,
|
|
|
|
domain: String,
|
|
|
|
display_name: Option<String>,
|
|
|
|
description: Option<String>,
|
|
|
|
login_required: bool,
|
|
|
|
icon: Option<Uuid>,
|
|
|
|
banner: Option<Uuid>,
|
|
|
|
public_key_id: Url,
|
|
|
|
public_key: String,
|
|
|
|
published: DateTime<Utc>,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct UpdateProfile {
|
|
|
|
profile_id: Uuid,
|
|
|
|
display_name: Option<String>,
|
|
|
|
description: Option<String>,
|
|
|
|
login_required: bool,
|
|
|
|
icon: Option<Uuid>,
|
|
|
|
banner: Option<Uuid>,
|
|
|
|
public_key_id: Url,
|
|
|
|
public_key: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct DeleteProfile {
|
|
|
|
profile_id: Uuid,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct CreateFollowRequest {
|
2021-01-05 06:09:59 +00:00
|
|
|
follow_apub_id: Option<Url>,
|
2021-01-04 17:34:31 +00:00
|
|
|
followed_profile: Uuid,
|
|
|
|
followed_by_profile: Uuid,
|
|
|
|
published: DateTime<Utc>,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct AcceptFollowRequest {
|
2021-01-05 06:09:59 +00:00
|
|
|
accept_apub_id: Option<Url>,
|
2021-01-04 17:34:31 +00:00
|
|
|
follow_request_id: Uuid,
|
|
|
|
published: DateTime<Utc>,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct RejectFollowRequest {
|
|
|
|
follow_request_id: Uuid,
|
|
|
|
}
|
|
|
|
|
2021-01-05 06:09:59 +00:00
|
|
|
pub struct UndoFollowRequest {
|
2021-01-04 17:34:31 +00:00
|
|
|
follow_request_id: Uuid,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct CreateBlock {
|
2021-01-05 06:09:59 +00:00
|
|
|
block_apub_id: Option<Url>,
|
2021-01-04 17:34:31 +00:00
|
|
|
blocked_profile: Uuid,
|
|
|
|
blocked_by_profile: Uuid,
|
|
|
|
published: DateTime<Utc>,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct DeleteBlock {
|
|
|
|
block_id: Uuid,
|
|
|
|
}
|
|
|
|
|
2021-01-05 06:09:59 +00:00
|
|
|
pub struct UndoFollow {
|
|
|
|
follow_apub_id: Url,
|
|
|
|
follow_id: Uuid,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct UndoAcceptFollow {
|
|
|
|
follow_apub_id: Url,
|
2021-01-04 17:34:31 +00:00
|
|
|
follow_id: Uuid,
|
|
|
|
}
|