98 lines
1.9 KiB
Rust
98 lines
1.9 KiB
Rust
pub mod drive;
|
|
pub mod emoji;
|
|
pub mod instance;
|
|
pub mod note;
|
|
pub mod timeline;
|
|
pub mod user;
|
|
|
|
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
use ts_rs::TS;
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
|
|
#[ts(export)]
|
|
pub struct RangeFilter {
|
|
pub time_start: DateTime<Utc>,
|
|
pub time_end: DateTime<Utc>,
|
|
pub id_start: DateTime<Utc>,
|
|
pub id_end: DateTime<Utc>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
|
|
#[ts(export)]
|
|
pub struct StartFilter {
|
|
pub time_start: DateTime<Utc>,
|
|
pub id_start: DateTime<Utc>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
|
|
#[ts(export)]
|
|
pub struct EndFilter {
|
|
pub time_end: DateTime<Utc>,
|
|
pub id_end: DateTime<Utc>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
|
|
#[ts(export)]
|
|
pub struct NoFilter {}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
|
|
#[ts(export)]
|
|
#[serde(untagged)]
|
|
pub enum SpanFilter {
|
|
Range(RangeFilter),
|
|
Start(StartFilter),
|
|
End(EndFilter),
|
|
None(NoFilter),
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
|
|
#[ts(export)]
|
|
#[repr(transparent)]
|
|
pub struct Id {
|
|
pub id: String,
|
|
}
|
|
|
|
impl<T: AsRef<str>> From<T> for Id {
|
|
fn from(id: T) -> Self {
|
|
Self {
|
|
id: id.as_ref().to_string(),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
|
|
#[ts(export)]
|
|
#[repr(transparent)]
|
|
pub struct MmXml(pub String);
|
|
|
|
#[derive(Copy, Clone, Debug, Deserialize, Serialize, TS)]
|
|
#[ts(export)]
|
|
pub enum NotificationType {
|
|
Follow,
|
|
Mention,
|
|
Reply,
|
|
Renote,
|
|
Quote,
|
|
Reaction,
|
|
PollVote,
|
|
PollEnded,
|
|
FollowRequest,
|
|
FollowRequestAccepted,
|
|
App,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
|
|
#[ts(export)]
|
|
pub struct NotificationSettings {
|
|
pub enabled: Vec<NotificationType>,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, Deserialize, Serialize, TS)]
|
|
#[ts(export)]
|
|
pub enum FollowVisibility {
|
|
Public,
|
|
Followers,
|
|
Private,
|
|
}
|