Skip to content

Commit b6654b6

Browse files
authored
feat: Update bsky-sdk, and redesign of object types in API (#189)
* 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
1 parent 77c71ec commit b6654b6

File tree

203 files changed

+1831
-1002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+1831
-1002
lines changed

atrium-api/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Any HTTP client that implements [`atrium_xrpc::HttpClient`](https://docs.rs/atri
1414

1515
```rust,no_run
1616
use atrium_api::client::AtpServiceClient;
17-
use atrium_api::com::atproto::server::create_session::Input;
1817
use atrium_xrpc_client::reqwest::ReqwestClient;
1918
2019
#[tokio::main]
@@ -25,11 +24,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
2524
.com
2625
.atproto
2726
.server
28-
.create_session(Input {
29-
auth_factor_token: None,
30-
identifier: "[email protected]".into(),
31-
password: "hunter2".into(),
32-
})
27+
.create_session(
28+
atrium_api::com::atproto::server::create_session::InputData {
29+
auth_factor_token: None,
30+
identifier: "[email protected]".into(),
31+
password: "hunter2".into(),
32+
}
33+
.into(),
34+
)
3335
.await;
3436
println!("{:?}", result);
3537
Ok(())

atrium-api/src/agent.rs

Lines changed: 104 additions & 94 deletions
Large diffs are not rendered by default.

atrium-api/src/agent/inner.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ where
8686
async fn authentication_token(&self, is_refresh: bool) -> Option<String> {
8787
self.store.get_session().await.map(|session| {
8888
if is_refresh {
89-
session.refresh_jwt
89+
session.data.refresh_jwt
9090
} else {
91-
session.access_jwt
91+
session.data.access_jwt
9292
}
9393
})
9494
}
@@ -178,14 +178,14 @@ where
178178
async fn refresh_session_inner(&self) {
179179
if let Ok(output) = self.call_refresh_session().await {
180180
if let Some(mut session) = self.store.get_session().await {
181-
session.access_jwt = output.access_jwt;
182-
session.did = output.did;
183-
session.did_doc = output.did_doc.clone();
184-
session.handle = output.handle;
185-
session.refresh_jwt = output.refresh_jwt;
181+
session.access_jwt = output.data.access_jwt;
182+
session.did = output.data.did;
183+
session.did_doc = output.data.did_doc.clone();
184+
session.handle = output.data.handle;
185+
session.refresh_jwt = output.data.refresh_jwt;
186186
self.store.set_session(session).await;
187187
}
188-
if let Some(did_doc) = &output.did_doc {
188+
if let Some(did_doc) = &output.data.did_doc {
189189
self.store.update_endpoint(did_doc);
190190
}
191191
} else {

atrium-api/src/app/bsky/actor/defs.rs

Lines changed: 42 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

atrium-api/src/app/bsky/actor/get_preferences.rs

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

atrium-api/src/app/bsky/actor/get_profile.rs

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

atrium-api/src/app/bsky/actor/get_profiles.rs

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

atrium-api/src/app/bsky/actor/get_suggestions.rs

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

atrium-api/src/app/bsky/actor/profile.rs

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

atrium-api/src/app/bsky/actor/put_preferences.rs

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

atrium-api/src/app/bsky/actor/search_actors.rs

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)