Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
404 changes: 392 additions & 12 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ path = "examples/sqlite/src/main.rs"
required-features = ["examples"]

[dependencies]
atrium-api = "=0.24.10"
atrium-api = "=0.25.2"
dotenv = "0.15.0"
env_logger = "0.11.5"
jetstream-oxide = "0.1.1"
jetstream-oxide = "=0.1.2"
log = "0.4.22"
serde = "1.0.215"
serde_json = "1.0.133"
Expand Down
2 changes: 1 addition & 1 deletion src/bin/my_did.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use atrium_api::{
agent::{store::MemorySessionStore, AtpAgent},
agent::atp_agent::{store::MemorySessionStore, AtpAgent},
types::string::Handle,
};
use clap::Parser;
Expand Down
6 changes: 4 additions & 2 deletions src/bin/publish.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use atrium_api::com::atproto::repo::put_record::InputData;
use atrium_api::types::string::RecordKey;
use atrium_api::{
agent::{store::MemorySessionStore, AtpAgent},
agent::atp_agent::{store::MemorySessionStore, AtpAgent},
app::bsky::feed::generator::RecordData,
types::{
string::{Datetime, Did, Handle, Nsid},
Expand Down Expand Up @@ -50,6 +51,7 @@ async fn main() {
let handle = args.handle;
let password = args.app_password;
let feed_host_name = args.hostname;
let record_key = RecordKey::new(args.name.to_owned()).expect("Invalid record key name.");

println!("Logging in...");

Expand Down Expand Up @@ -122,7 +124,7 @@ async fn main() {
repo: atrium_api::types::string::AtIdentifier::Did(
publisher_did.to_owned().did.clone(),
),
rkey: args.name.to_owned(),
rkey: record_key,
swap_commit: None,
swap_record: None,
validate: None,
Expand Down
8 changes: 5 additions & 3 deletions src/bin/unpublish.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::Result;
use atrium_api::{
agent::{store::MemorySessionStore, AtpAgent},
types::string::{Handle, Nsid},
agent::atp_agent::{store::MemorySessionStore, AtpAgent},
types::string::{Handle, Nsid, RecordKey},
};
use clap::Parser;

Expand Down Expand Up @@ -29,6 +29,8 @@ async fn main() -> Result<()> {
let handle = args.handle;
let password = args.app_password;

let record_key = RecordKey::new(args.name.to_owned()).expect("Invalid record key name.");

println!("Logging in");

let agent = AtpAgent::new(
Expand Down Expand Up @@ -62,7 +64,7 @@ async fn main() -> Result<()> {
repo: atrium_api::types::string::AtIdentifier::Did(
publisher_did.to_owned().did.clone(),
),
rkey: args.name.to_owned(),
rkey: record_key,
swap_commit: None,
swap_record: None,
}
Expand Down
2 changes: 1 addition & 1 deletion src/feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ async fn get_feed_skeleton<Handler: FeedHandler>(
.serve_feed(Request {
cursor: query.cursor.clone(),
feed: query.feed.clone(),
limit: query.limit,
limit: query.limit.map(u8::from),
})
.await;
Ok::<warp::reply::Json, warp::Rejection>(warp::reply::json(&FeedSkeleton {
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ mod utility_models;

pub use feed::Feed;
pub use feed_handler::FeedHandler;
pub use models::*;
pub use models::{
Cid, Did, Embed, ExternalEmbed, FeedResult, ImageEmbed, Label, MediaEmbed, Post, QuoteEmbed,
Request, Uri, VideoEmbed,
};
4 changes: 2 additions & 2 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use atrium_api::{
embed::record_with_media::MainMediaRefs,
feed::post::{RecordEmbedRefs, RecordLabelsRefs},
},
types::{BlobRef, LimitedNonZeroU8, Object, TypedBlobRef, Union},
types::{BlobRef, Object, TypedBlobRef, Union},
};
use chrono::{DateTime, Utc};
use log::trace;
Expand All @@ -12,7 +12,7 @@ use log::trace;
pub struct Request {
pub cursor: Option<String>,
pub feed: String,
pub limit: Option<LimitedNonZeroU8<100>>,
pub limit: Option<u8>,
}

#[derive(Debug, Clone)]
Expand Down
149 changes: 148 additions & 1 deletion src/snapshots/skyfeed__public_api_test__public_api.snap

Large diffs are not rendered by default.