hyaenidae/profiles/src/apub/actions/mod.rs

146 lines
2.7 KiB
Rust
Raw Normal View History

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 {
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 {
react_id: Uuid,
2021-01-04 17:34:31 +00:00
}
pub struct CreateComment {
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 {
update_apub_id: Option<Url>,
2021-01-04 17:34:31 +00:00
comment_id: Uuid,
body: Option<String>,
}
pub struct DeleteComment {
note_apub_id: Url,
2021-01-04 17:34:31 +00:00
comment_id: Uuid,
}
pub struct CreateSubmission {
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 {
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 {
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 {
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,
}
pub struct UndoFollowRequest {
2021-01-04 17:34:31 +00:00
follow_request_id: Uuid,
}
pub struct CreateBlock {
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,
}
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,
}