-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4b3750
commit 4df9e38
Showing
9 changed files
with
87 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// Represents raw homeserver bookmark with id | ||
/// URI: /pub/pubky.app/bookmarks/:URI_BOOKMARKED_OBJECT | ||
/// | ||
/// Example URI: | ||
/// | ||
/// `/pub/pubky.app/bookmarks/pxnu33x7jtpx9ar1ytsi4yxbp6a5o36gwhffs8zoxmbuptici1jy/pub/pubky.app/posts/2ZKGWXZ44J300/cool` | ||
/// | ||
#[derive(Serialize, Deserialize, Default)] | ||
pub struct HomeserverBookmark { | ||
pub created_at: i64, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// Represents raw homeserver follow object with timestamp | ||
/// URI: /pub/pubky.app/follows/:user_id | ||
/// | ||
/// Example URI: | ||
/// | ||
/// `/pub/pubky.app/follows/pxnu33x7jtpx9ar1ytsi4yxbp6a5o36gwhffs8zoxmbuptici1jy`` | ||
/// | ||
#[derive(Serialize, Deserialize, Default)] | ||
pub struct HomeserverFollow { | ||
pub created_at: i64, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
/// Raw schemas stored on homeserver. | ||
pub mod user; | ||
/// Raw schemas as stored on homeserver. | ||
mod bookmark; | ||
mod follow; | ||
mod post; | ||
mod tag; | ||
mod user; | ||
|
||
pub use bookmark::HomeserverBookmark; | ||
pub use follow::HomeserverFollow; | ||
pub use post::{HomeserverPost, PostKind}; | ||
pub use tag::HomeserverTag; | ||
pub use user::{HomeserverUser, UserLink}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use utoipa::ToSchema; | ||
|
||
/// Represents the type of pubky-app posted data | ||
/// Used primarily to best display the content in UI | ||
#[derive(Serialize, Deserialize, ToSchema, Default)] | ||
pub enum PostKind { | ||
#[default] | ||
Short, | ||
Long, | ||
Image, | ||
Video, | ||
Link, | ||
File, | ||
} | ||
|
||
/// Used primarily to best display the content in UI | ||
#[derive(Serialize, Deserialize, Default)] | ||
pub struct PostEmbed { | ||
pub r#type: String, //e.g., "post", we have to define a type for this. | ||
pub uri: String, | ||
} | ||
|
||
/// Represents raw post in homeserver with content and kind | ||
/// URI: /pub/pubky.app/posts/:post_id | ||
/// Where post_id is CrockfordBase32 encoding of timestamp | ||
#[derive(Serialize, Deserialize, Default)] | ||
pub struct HomeserverPost { | ||
pub content: String, | ||
pub kind: PostKind, | ||
pub embed: PostEmbed, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// Represents raw homeserver tag with id | ||
/// URI: /pub/pubky.app/tags/:URI_TAGGED_OBJECT/:label | ||
/// | ||
/// Example URI: | ||
/// | ||
/// `/pub/pubky.app/tags/pxnu33x7jtpx9ar1ytsi4yxbp6a5o36gwhffs8zoxmbuptici1jy/pub/pubky.app/posts/2ZKGWXZ44J300/cool` | ||
/// | ||
#[derive(Serialize, Deserialize, Default)] | ||
pub struct HomeserverTag { | ||
pub created_at: i64, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters