Skip to content

Commit

Permalink
feat: Update bsky-sdk, and redesign of object types in API (#189)
Browse files Browse the repository at this point in the history
* Add moderation methods

* Add extra_data...

* Add Object<T> for object types

* Fix README

* Fix tests

* Remove unnecessary clone() and into()

* Fix ModerationPrefs deserializer

* Fix has_muted_word

bluesky-social/atproto#2570

* Add ThreadViewPreference
  • Loading branch information
sugyan authored Jun 19, 2024
1 parent 77c71ec commit b6654b6
Show file tree
Hide file tree
Showing 203 changed files with 1,831 additions and 1,002 deletions.
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

0 comments on commit b6654b6

Please sign in to comment.