Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update bsky-sdk, and redesign of object types in API #189

Merged
merged 10 commits into from
Jun 19, 2024
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
14 changes: 8 additions & 6 deletions atrium-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Any HTTP client that implements [`atrium_xrpc::HttpClient`](https://docs.rs/atri

```rust,no_run
use atrium_api::client::AtpServiceClient;
use atrium_api::com::atproto::server::create_session::Input;
use atrium_xrpc_client::reqwest::ReqwestClient;

#[tokio::main]
Expand All @@ -25,11 +24,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.com
.atproto
.server
.create_session(Input {
auth_factor_token: None,
identifier: "[email protected]".into(),
password: "hunter2".into(),
})
.create_session(
atrium_api::com::atproto::server::create_session::InputData {
auth_factor_token: None,
identifier: "[email protected]".into(),
password: "hunter2".into(),
}
.into(),
)
.await;
println!("{:?}", result);
Ok(())
Expand Down
198 changes: 104 additions & 94 deletions atrium-api/src/agent.rs

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions atrium-api/src/agent/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ where
async fn authentication_token(&self, is_refresh: bool) -> Option<String> {
self.store.get_session().await.map(|session| {
if is_refresh {
session.refresh_jwt
session.data.refresh_jwt
} else {
session.access_jwt
session.data.access_jwt
}
})
}
Expand Down Expand Up @@ -178,14 +178,14 @@ where
async fn refresh_session_inner(&self) {
if let Ok(output) = self.call_refresh_session().await {
if let Some(mut session) = self.store.get_session().await {
session.access_jwt = output.access_jwt;
session.did = output.did;
session.did_doc = output.did_doc.clone();
session.handle = output.handle;
session.refresh_jwt = output.refresh_jwt;
session.access_jwt = output.data.access_jwt;
session.did = output.data.did;
session.did_doc = output.data.did_doc.clone();
session.handle = output.data.handle;
session.refresh_jwt = output.data.refresh_jwt;
self.store.set_session(session).await;
}
if let Some(did_doc) = &output.did_doc {
if let Some(did_doc) = &output.data.did_doc {
self.store.update_endpoint(did_doc);
}
} else {
Expand Down
63 changes: 42 additions & 21 deletions atrium-api/src/app/bsky/actor/defs.rs

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

6 changes: 4 additions & 2 deletions atrium-api/src/app/bsky/actor/get_preferences.rs

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

3 changes: 2 additions & 1 deletion atrium-api/src/app/bsky/actor/get_profile.rs

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

6 changes: 4 additions & 2 deletions atrium-api/src/app/bsky/actor/get_profiles.rs

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

6 changes: 4 additions & 2 deletions atrium-api/src/app/bsky/actor/get_suggestions.rs

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

3 changes: 2 additions & 1 deletion atrium-api/src/app/bsky/actor/profile.rs

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

3 changes: 2 additions & 1 deletion atrium-api/src/app/bsky/actor/put_preferences.rs

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

6 changes: 4 additions & 2 deletions atrium-api/src/app/bsky/actor/search_actors.rs

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

Loading
Loading