Skip to content

Commit

Permalink
Create external api
Browse files Browse the repository at this point in the history
  • Loading branch information
SHAcollision committed Nov 27, 2024
1 parent 0506f38 commit 4524f8b
Show file tree
Hide file tree
Showing 11 changed files with 395 additions and 56 deletions.
168 changes: 168 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ url = "2.5.4"
base32 = "0.5.1"
blake3 = "1.5.4"
chrono = "0.4.38"

[dev-dependencies]
tokio = { version = "1.41.1", features = ["full"] }
4 changes: 2 additions & 2 deletions src/bookmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use serde::{Deserialize, Serialize};
/// Where bookmark_id is Crockford-base32(Blake3("{uri_bookmarked}"")[:half])
#[derive(Serialize, Deserialize, Default)]
pub struct PubkyAppBookmark {
pub uri: String,
pub created_at: i64,
uri: String,
created_at: i64,
}

#[async_trait]
Expand Down
10 changes: 5 additions & 5 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ use serde::{Deserialize, Serialize};
/// Profile schema
#[derive(Deserialize, Serialize, Debug)]
pub struct PubkyAppFile {
pub name: String,
pub created_at: i64,
pub src: String,
pub content_type: String,
pub size: i64,
name: String,
created_at: i64,
src: String,
content_type: String,
size: i64,
}

impl TimestampId for PubkyAppFile {}
Expand Down
2 changes: 1 addition & 1 deletion src/follow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
///
#[derive(Serialize, Deserialize, Default)]
pub struct PubkyAppFollow {
pub created_at: i64,
created_at: i64,
}

#[async_trait]
Expand Down
20 changes: 10 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
pub mod bookmark;
pub mod file;
pub mod follow;
pub mod mute;
pub mod post;
pub mod tag;
mod bookmark;
mod file;
mod follow;
mod mute;
mod post;
mod tag;
pub mod traits;
pub mod types;
pub mod user;
mod types;
mod user;

pub use bookmark::PubkyAppBookmark;
pub use file::PubkyAppFile;
pub use follow::PubkyAppFollow;
pub use mute::PubkyAppMute;
pub use post::{PostEmbed, PostKind, PubkyAppPost};
pub use post::{PubkyAppPost, PubkyAppPostEmbed, PubkyAppPostKind};
pub use tag::PubkyAppTag;
pub use user::{PubkyAppUser, UserLink};
pub use user::{PubkyAppUser, PubkyAppUserLink};
2 changes: 1 addition & 1 deletion src/mute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
///
#[derive(Serialize, Deserialize, Default)]
pub struct PubkyAppMute {
pub created_at: i64,
created_at: i64,
}

#[async_trait]
Expand Down
Loading

0 comments on commit 4524f8b

Please sign in to comment.