Skip to content

Commit 6faa1d2

Browse files
sugyanclaude
andcommitted
feat: Update for the latest lexicon
Catch up the hand-written code with the regenerated API. - New required fields in test fixtures across atrium-api, bsky-sdk and bsky-cli, and in the video example. - `getServiceAuth.aud` is now a plain string rather than a `Did`. - `threadViewPref.prioritizeFollowedUsers` was removed upstream, so `bsky_sdk::preference::ThreadViewPreferenceData` drops the field it could no longer populate. - Register the new `app.bsky.actor.contentVisibilityDeclaration` record with `record_impl!` and handle its `KnownRecord` variant in `create_record`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent cf05875 commit 6faa1d2

12 files changed

Lines changed: 31 additions & 15 deletions

File tree

atrium-api/src/agent.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,7 @@ mod tests {
280280
.server
281281
.get_service_auth(
282282
crate::com::atproto::server::get_service_auth::ParametersData {
283-
aud: Did::new(String::from("did:fake:handle.test"))
284-
.expect("did should be valid"),
283+
aud: String::from("did:fake:handle.test"),
285284
exp: None,
286285
lxm: None,
287286
}

atrium-api/src/agent/atp_agent.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ mod tests {
368368
active: None,
369369
did: "did:web:example.com".parse().expect("valid"),
370370
did_doc: None,
371+
email: None,
372+
email_auth_factor: None,
373+
email_confirmed: None,
371374
handle: "example.com".parse().expect("valid"),
372375
refresh_jwt: String::from("refresh"),
373376
status: None,
@@ -379,6 +382,7 @@ mod tests {
379382
body.extend(serde_json::to_vec(
380383
&crate::com::atproto::server::describe_server::OutputData {
381384
available_user_domains: Vec::new(),
385+
blob_upload_limit: None,
382386
contact: None,
383387
did: "did:web:example.com".parse().expect("valid"),
384388
invite_code_required: None,

atrium-oauth/src/oauth_session.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,7 @@ mod tests {
390390
.server
391391
.get_service_auth(
392392
atrium_api::com::atproto::server::get_service_auth::ParametersData {
393-
aud: Did::new(String::from("did:fake:handle.test"))
394-
.expect("did should be valid"),
393+
aud: String::from("did:fake:handle.test"),
395394
exp: None,
396395
lxm: None,
397396
}
@@ -556,8 +555,7 @@ mod tests {
556555
.server
557556
.get_service_auth(
558557
atrium_api::com::atproto::server::get_service_auth::ParametersData {
559-
aud: Did::new(String::from("did:fake:handle.test"))
560-
.expect("did should be valid"),
558+
aud: String::from("did:fake:handle.test"),
561559
exp: None,
562560
lxm: None,
563561
}
@@ -588,8 +586,7 @@ mod tests {
588586
.server
589587
.get_service_auth(
590588
atrium_api::com::atproto::server::get_service_auth::ParametersData {
591-
aud: Did::new(String::from("did:fake:handle.test"))
592-
.expect("did should be valid"),
589+
aud: String::from("did:fake:handle.test"),
593590
exp: None,
594591
lxm: None,
595592
}
@@ -639,8 +636,7 @@ mod tests {
639636
.server
640637
.get_service_auth(
641638
atrium_api::com::atproto::server::get_service_auth::ParametersData {
642-
aud: Did::new(String::from("did:fake:handle.test"))
643-
.expect("did should be valid"),
639+
aud: String::from("did:fake:handle.test"),
644640
exp: None,
645641
lxm: None,
646642
}

bsky-cli/src/runner.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ impl Runner {
196196
actor: args.actor.unwrap_or(self.handle().await?.into()),
197197
cursor: None,
198198
limit: Some(limit),
199+
sort: None,
199200
}
200201
.into(),
201202
)
@@ -213,6 +214,7 @@ impl Runner {
213214
actor: args.actor.unwrap_or(self.handle().await?.into()),
214215
cursor: None,
215216
limit: Some(limit),
217+
sort: None,
216218
}
217219
.into(),
218220
)
@@ -312,7 +314,9 @@ impl Runner {
312314
.list_convos(
313315
api::chat::bsky::convo::list_convos::ParametersData {
314316
cursor: None,
317+
kind: None,
315318
limit: Some(limit),
319+
lock_status: None,
316320
read_state: None,
317321
status: None,
318322
}
@@ -367,6 +371,7 @@ impl Runner {
367371
message: api::chat::bsky::convo::defs::MessageInputData {
368372
embed: None,
369373
facets: None,
374+
reply_to: None,
370375
text: args.text,
371376
}
372377
.into(),

bsky-sdk/src/agent.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ where
151151
if let Some(v) = &p.sort {
152152
pref.sort = v.clone();
153153
}
154-
if let Some(v) = p.prioritize_followed_users {
155-
pref.prioritize_followed_users = v;
156-
}
157154
prefs.thread_view_prefs = Object {
158155
data: pref,
159156
extra_data: p.extra_data, // pass through extra data

bsky-sdk/src/moderation/tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ fn profile_view_basic(
6060
associated: None,
6161
avatar: None,
6262
created_at: None,
63+
debug: None,
6364
did: format!("did:web:{handle}").parse().expect("invalid did"),
6465
display_name: display_name.map(String::from),
6566
handle: handle.parse().expect("invalid handle"),
@@ -77,6 +78,7 @@ fn post_view(author: &ProfileViewBasic, text: &str, labels: Option<Vec<Label>>)
7778
author: author.clone(),
7879
bookmark_count: None,
7980
cid: FAKE_CID.parse().expect("invalid cid"),
81+
debug: None,
8082
embed: None,
8183
indexed_at: Datetime::now(),
8284
labels,

bsky-sdk/src/moderation/tests/behaviors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ impl TestUser {
105105
} else {
106106
None
107107
},
108+
muted_only_quoteposts: None,
109+
muted_only_reposts: None,
108110
}
109111
.into()
110112
}

bsky-sdk/src/moderation/tests/mutewords.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ fn viewer_state(following: Option<String>) -> ViewerState {
6767
known_followers: None,
6868
muted: None,
6969
muted_by_list: None,
70+
muted_only_quoteposts: None,
71+
muted_only_reposts: None,
7072
}
7173
.into()
7274
}

bsky-sdk/src/preference.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ pub type FeedViewPreference = Object<FeedViewPreferenceData>;
3535
#[serde(rename_all = "camelCase")]
3636
pub struct ThreadViewPreferenceData {
3737
pub sort: String,
38-
pub prioritize_followed_users: bool,
3938
}
4039

4140
impl ThreadViewPreferenceData {
@@ -47,7 +46,7 @@ impl ThreadViewPreferenceData {
4746

4847
impl Default for ThreadViewPreferenceData {
4948
fn default() -> Self {
50-
Self { sort: Self::SORT_OLDEST.to_string(), prioritize_followed_users: true }
49+
Self { sort: Self::SORT_OLDEST.to_string() }
5150
}
5251
}
5352

bsky-sdk/src/record.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ record_impl!(
199199
atrium_api::com::atproto::lexicon::schema::Record,
200200
atrium_api::com::atproto::lexicon::schema::RecordData
201201
);
202+
record_impl!(
203+
atrium_api::app::bsky::actor::ContentVisibilityDeclaration,
204+
atrium_api::app::bsky::actor::content_visibility_declaration::Record,
205+
atrium_api::app::bsky::actor::content_visibility_declaration::RecordData
206+
);
202207
record_impl!(
203208
atrium_api::app::bsky::actor::Profile,
204209
atrium_api::app::bsky::actor::profile::Record,
@@ -416,6 +421,7 @@ mod tests {
416421
let output = atrium_api::app::bsky::graph::follow::RecordData {
417422
created_at: Datetime::now(),
418423
subject: "did:fake:handle.test".parse().expect("invalid did"),
424+
via: None,
419425
}
420426
.create(&agent)
421427
.await?;

0 commit comments

Comments
 (0)