Skip to content

Commit

Permalink
feat: Update API, based on the latest lexicon schemas (#104)
Browse files Browse the repository at this point in the history
* Update API, based on the latest lexicon schemas

bluesky-social/atproto@8c94979

* Remove unused code

* Tweak
  • Loading branch information
sugyan authored Feb 19, 2024
1 parent 3d9e1f5 commit 02042e3
Show file tree
Hide file tree
Showing 52 changed files with 194 additions and 131 deletions.
4 changes: 3 additions & 1 deletion atrium-api/src/app/bsky/actor/defs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.actor.defs` namespace.
//!A reference to an actor in the network.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct AdultContentPref {
Expand Down Expand Up @@ -110,6 +109,8 @@ pub struct ProfileViewDetailed {
pub struct SavedFeedsPref {
pub pinned: Vec<String>,
pub saved: Vec<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub timeline_index: Option<i64>,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
Expand All @@ -121,6 +122,7 @@ pub struct ThreadViewPref {
#[serde(skip_serializing_if = "Option::is_none")]
pub sort: Option<String>,
}
///Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ViewerState {
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/actor/get_profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Parameters {
///Handle or DID of account to fetch profile of.
pub actor: crate::types::string::AtIdentifier,
}
pub type Output = crate::app::bsky::actor::defs::ProfileViewDetailed;
Expand Down
4 changes: 4 additions & 0 deletions atrium-api/src/app/bsky/actor/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Record {
///Small image to be displayed next to posts from account. AKA, 'profile picture'
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<crate::types::BlobRef>,
///Larger horizontal image to display behind profile view.
#[serde(skip_serializing_if = "Option::is_none")]
pub banner: Option<crate::types::BlobRef>,
///Free-form profile description text.
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
///Self-label values, specific to the Bluesky application, on the overall account.
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<RecordLabelsEnum>,
}
Expand Down
2 changes: 1 addition & 1 deletion atrium-api/src/app/bsky/embed/external.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.embed.external` namespace.
//!A representation of some externally linked content, embedded in another form of content.
///A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Main {
Expand Down
6 changes: 5 additions & 1 deletion atrium-api/src/app/bsky/embed/images.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.embed.images` namespace.
//!A set of images embedded in some other form of content.
//!A set of images embedded in a Bluesky record (eg, a post).
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Main {
Expand All @@ -16,6 +16,7 @@ pub struct AspectRatio {
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Image {
///Alt text description of the image, for accessibility.
pub alt: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub aspect_ratio: Option<AspectRatio>,
Expand All @@ -29,9 +30,12 @@ pub struct View {
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ViewImage {
///Alt text description of the image, for accessibility.
pub alt: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub aspect_ratio: Option<AspectRatio>,
///Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.
pub fullsize: String,
///Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.
pub thumb: String,
}
3 changes: 2 additions & 1 deletion atrium-api/src/app/bsky/embed/record.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.embed.record` namespace.
//!A representation of a record embedded in another form of content.
//!A representation of a record embedded in a Bluesky record (eg, a post). For example, a quote-post, or sharing a feed generator record.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Main {
Expand Down Expand Up @@ -35,6 +35,7 @@ pub struct ViewRecord {
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<crate::com::atproto::label::defs::Label>>,
pub uri: String,
///The record data itself.
pub value: crate::records::Record,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
Expand Down
2 changes: 1 addition & 1 deletion atrium-api/src/app/bsky/embed/record_with_media.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.embed.recordWithMedia` namespace.
//!A representation of a record embedded in another form of content, alongside other compatible embeds.
//!A representation of a record embedded in a Bluesky record (eg, a post), alongside other compatible embeds. For example, a quote post and image, or a quote post and external URL card.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Main {
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/feed/defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ pub struct ThreadgateView {
#[serde(skip_serializing_if = "Option::is_none")]
pub uri: Option<String>,
}
///Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ViewerState {
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/feed/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub struct Record {
pub description_facets: Option<Vec<crate::app::bsky::richtext::facet::Main>>,
pub did: crate::types::string::Did,
pub display_name: String,
///Self-label values
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<RecordLabelsEnum>,
}
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/feed/get_author_feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub struct Parameters {
pub actor: crate::types::string::AtIdentifier,
#[serde(skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
///Combinations of post/repost types to include in response.
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
3 changes: 3 additions & 0 deletions atrium-api/src/app/bsky/feed/get_feed_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Parameters {
///AT-URI of the feed generator record.
pub feed: String,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Output {
///Indicates whether the feed generator service has been online recently, or else seems to be inactive.
pub is_online: bool,
///Indicates whether the feed generator service is compatible with the record declaration.
pub is_valid: bool,
pub view: crate::app::bsky::feed::defs::GeneratorView,
}
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/feed/get_feed_skeleton.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
pub struct Parameters {
#[serde(skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
///Reference to feed generator record describing the specific feed being requested.
pub feed: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<crate::types::LimitedNonZeroU8<100u8>>,
Expand Down
2 changes: 2 additions & 0 deletions atrium-api/src/app/bsky/feed/get_likes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Parameters {
///CID of the subject record (aka, specific version of record), to filter likes.
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<crate::types::LimitedNonZeroU8<100u8>>,
///AT-URI of the subject (eg, a post record).
pub uri: String,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/feed/get_list_feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub struct Parameters {
pub cursor: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<crate::types::LimitedNonZeroU8<100u8>>,
///Reference (AT-URI) to the list record.
pub list: String,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
Expand Down
3 changes: 3 additions & 0 deletions atrium-api/src/app/bsky/feed/get_post_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Parameters {
///How many levels of reply depth should be included in response.
#[serde(skip_serializing_if = "Option::is_none")]
pub depth: Option<crate::types::LimitedU16<1000u16>>,
///How many levels of parent (and grandparent, etc) post to include.
#[serde(skip_serializing_if = "Option::is_none")]
pub parent_height: Option<crate::types::LimitedU16<1000u16>>,
///Reference (AT-URI) to post record.
pub uri: String,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/feed/get_posts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Parameters {
///List of post AT-URIs to return hydrated views for.
pub uris: Vec<String>,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
Expand Down
2 changes: 2 additions & 0 deletions atrium-api/src/app/bsky/feed/get_reposted_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Parameters {
///If supplied, filters to reposts of specific version (by CID) of the post record.
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<crate::types::LimitedNonZeroU8<100u8>>,
///Reference (AT-URI) of post record
pub uri: String,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/feed/get_timeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Parameters {
///Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism.
#[serde(skip_serializing_if = "Option::is_none")]
pub algorithm: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
9 changes: 7 additions & 2 deletions atrium-api/src/app/bsky/feed/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,28 @@
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Record {
///Client-declared timestamp when this post was originally created.
pub created_at: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub embed: Option<RecordEmbedEnum>,
///Deprecated: replaced by app.bsky.richtext.facet.
///DEPRECATED: replaced by app.bsky.richtext.facet.
#[serde(skip_serializing_if = "Option::is_none")]
pub entities: Option<Vec<Entity>>,
///Annotations of text (mentions, URLs, hashtags, etc)
#[serde(skip_serializing_if = "Option::is_none")]
pub facets: Option<Vec<crate::app::bsky::richtext::facet::Main>>,
///Self-label values for this post. Effectively content warnings.
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<RecordLabelsEnum>,
///Indicates human language of post primary text content.
#[serde(skip_serializing_if = "Option::is_none")]
pub langs: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub reply: Option<ReplyRef>,
///Additional non-inline tags describing this post.
///Additional hashtags, in addition to any included in post text and facets.
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
///The primary post content. May be an empty string, if there are embeds.
pub text: String,
}
///Deprecated: use facets instead.
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/feed/threadgate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub struct Record {
#[serde(skip_serializing_if = "Option::is_none")]
pub allow: Option<Vec<RecordAllowItem>>,
pub created_at: String,
///Reference (AT-URI) to the post record.
pub post: String,
}
///Allow replies from actors you follow.
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/graph/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
#[serde(rename_all = "camelCase")]
pub struct Record {
pub created_at: String,
///DID of the account to be blocked.
pub subject: crate::types::string::Did,
}
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/graph/get_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub struct Parameters {
pub cursor: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<crate::types::LimitedNonZeroU8<100u8>>,
///Reference (AT-URI) of the list record to hydrate.
pub list: String,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/graph/get_lists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Parameters {
///The account (actor) to enumerate lists from.
pub actor: crate::types::string::AtIdentifier,
#[serde(skip_serializing_if = "Option::is_none")]
pub cursor: Option<String>,
Expand Down
2 changes: 2 additions & 0 deletions atrium-api/src/app/bsky/graph/get_relationships.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Parameters {
///Primary account requesting relationships for.
pub actor: crate::types::string::AtIdentifier,
///List of 'other' accounts to be related back to the primary.
#[serde(skip_serializing_if = "Option::is_none")]
pub others: Option<Vec<crate::types::string::AtIdentifier>>,
}
Expand Down
2 changes: 2 additions & 0 deletions atrium-api/src/app/bsky/graph/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ pub struct Record {
pub description_facets: Option<Vec<crate::app::bsky::richtext::facet::Main>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<RecordLabelsEnum>,
///Display name for list; can not be empty.
pub name: String,
///Defines the purpose of the list (aka, moderation-oriented or curration-oriented)
pub purpose: crate::app::bsky::graph::defs::ListPurpose,
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
Expand Down
1 change: 1 addition & 0 deletions atrium-api/src/app/bsky/graph/listblock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
#[serde(rename_all = "camelCase")]
pub struct Record {
pub created_at: String,
///Reference (AT-URI) to the mod list record.
pub subject: String,
}
2 changes: 2 additions & 0 deletions atrium-api/src/app/bsky/graph/listitem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#[serde(rename_all = "camelCase")]
pub struct Record {
pub created_at: String,
///Reference (AT-URI) to the list record (app.bsky.graph.list).
pub list: String,
///The account which is included on the list.
pub subject: crate::types::string::Did,
}
9 changes: 5 additions & 4 deletions atrium-api/src/app/bsky/richtext/facet.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
// This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.richtext.facet` namespace.
///Annotation of a sub-string within rich text.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Main {
pub features: Vec<MainFeaturesItem>,
pub index: ByteSlice,
}
///A text segment. Start is inclusive, end is exclusive. Indices are for utf8-encoded strings.
///Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ByteSlice {
pub byte_end: usize,
pub byte_start: usize,
}
///A facet feature for links.
///Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Link {
pub uri: String,
}
///A facet feature for actor mentions.
///Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Mention {
pub did: crate::types::string::Did,
}
///A hashtag.
///Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Tag {
Expand Down
21 changes: 0 additions & 21 deletions atrium-api/src/blob.rs

This file was deleted.

Loading

0 comments on commit 02042e3

Please sign in to comment.