diff options
author | bryan newbold <bnewbold@robocracy.org> | 2023-03-04 19:03:17 -0800 |
---|---|---|
committer | bryan newbold <bnewbold@robocracy.org> | 2023-03-04 19:03:17 -0800 |
commit | 97f030b15321bb22274fa2807da445aa5dfc5512 (patch) | |
tree | febdb322f5f9f5b7a11764a1d50b83c596d6a911 /adenosine | |
parent | 33548eb9169c048456795e2cc999ada22465df4a (diff) | |
download | adenosine-97f030b15321bb22274fa2807da445aa5dfc5512.tar.gz adenosine-97f030b15321bb22274fa2807da445aa5dfc5512.zip |
cli: improve 'pretty' output styling
Diffstat (limited to 'adenosine')
-rw-r--r-- | adenosine/src/app_bsky/mod.rs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/adenosine/src/app_bsky/mod.rs b/adenosine/src/app_bsky/mod.rs index d828bcb..76352f5 100644 --- a/adenosine/src/app_bsky/mod.rs +++ b/adenosine/src/app_bsky/mod.rs @@ -108,7 +108,6 @@ pub struct PostView { pub uri: String, pub cid: String, pub author: UserView, - pub repostedBy: Option<UserView>, pub record: Post, pub embed: Option<PostEmbedView>, pub replyCount: u64, @@ -122,9 +121,13 @@ pub struct PostView { #[allow(non_snake_case)] #[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] pub struct ThreadPostView { - pub post: PostView, - // TODO: 'parent' and 'replies' should allow "NotFoundPost" for references that point to an - // unknown URI + // TODO: doing this as the intersetion of #threadViewPost and #notFoundPost. actually it is + // supposed to be a union type + // #notFoundPost fields (uri and notFound actually required) + pub uri: Option<String>, + pub notFound: Option<bool>, + // #threadViewPost fields (post actually required) + pub post: Option<PostView>, pub parent: Option<Box<ThreadPostView>>, pub replies: Option<Vec<ThreadPostView>>, } @@ -134,7 +137,15 @@ pub struct ThreadPostView { pub struct FeedPostView { pub post: PostView, pub reply: Option<PostReply>, - pub reason: Option<Value>, + // TODO: this could extend to other "reasons" in the future + pub reason: Option<RepostReason>, +} + +#[allow(non_snake_case)] +#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] +pub struct RepostReason { + pub by: UserView, + pub indexedAt: String, } #[allow(non_snake_case)] |