diff --git a/atrium-api/src/app/bsky/actor/defs.rs b/atrium-api/src/app/bsky/actor/defs.rs index b63603d3..49181b25 100644 --- a/atrium-api/src/app/bsky/actor/defs.rs +++ b/atrium-api/src/app/bsky/actor/defs.rs @@ -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 { @@ -110,6 +109,8 @@ pub struct ProfileViewDetailed { pub struct SavedFeedsPref { pub pinned: Vec, pub saved: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub timeline_index: Option, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -121,6 +122,7 @@ pub struct ThreadViewPref { #[serde(skip_serializing_if = "Option::is_none")] pub sort: Option, } +///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 { diff --git a/atrium-api/src/app/bsky/actor/get_profile.rs b/atrium-api/src/app/bsky/actor/get_profile.rs index f33d0333..b1032cb7 100644 --- a/atrium-api/src/app/bsky/actor/get_profile.rs +++ b/atrium-api/src/app/bsky/actor/get_profile.rs @@ -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; diff --git a/atrium-api/src/app/bsky/actor/profile.rs b/atrium-api/src/app/bsky/actor/profile.rs index cf1fab26..c6e1ba88 100644 --- a/atrium-api/src/app/bsky/actor/profile.rs +++ b/atrium-api/src/app/bsky/actor/profile.rs @@ -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, + ///Larger horizontal image to display behind profile view. #[serde(skip_serializing_if = "Option::is_none")] pub banner: Option, + ///Free-form profile description text. #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, #[serde(skip_serializing_if = "Option::is_none")] pub display_name: Option, + ///Self-label values, specific to the Bluesky application, on the overall account. #[serde(skip_serializing_if = "Option::is_none")] pub labels: Option, } diff --git a/atrium-api/src/app/bsky/embed/external.rs b/atrium-api/src/app/bsky/embed/external.rs index 50c1f42c..08699c1e 100644 --- a/atrium-api/src/app/bsky/embed/external.rs +++ b/atrium-api/src/app/bsky/embed/external.rs @@ -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 { diff --git a/atrium-api/src/app/bsky/embed/images.rs b/atrium-api/src/app/bsky/embed/images.rs index d9156b52..0acdba67 100644 --- a/atrium-api/src/app/bsky/embed/images.rs +++ b/atrium-api/src/app/bsky/embed/images.rs @@ -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 { @@ -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, @@ -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, + ///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, } diff --git a/atrium-api/src/app/bsky/embed/record.rs b/atrium-api/src/app/bsky/embed/record.rs index c7bcb483..3bc77af8 100644 --- a/atrium-api/src/app/bsky/embed/record.rs +++ b/atrium-api/src/app/bsky/embed/record.rs @@ -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 { @@ -35,6 +35,7 @@ pub struct ViewRecord { #[serde(skip_serializing_if = "Option::is_none")] pub labels: Option>, pub uri: String, + ///The record data itself. pub value: crate::records::Record, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/app/bsky/embed/record_with_media.rs b/atrium-api/src/app/bsky/embed/record_with_media.rs index 434a87e5..1bb2015a 100644 --- a/atrium-api/src/app/bsky/embed/record_with_media.rs +++ b/atrium-api/src/app/bsky/embed/record_with_media.rs @@ -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 { diff --git a/atrium-api/src/app/bsky/feed/defs.rs b/atrium-api/src/app/bsky/feed/defs.rs index f40e818d..4aef200a 100644 --- a/atrium-api/src/app/bsky/feed/defs.rs +++ b/atrium-api/src/app/bsky/feed/defs.rs @@ -123,6 +123,7 @@ pub struct ThreadgateView { #[serde(skip_serializing_if = "Option::is_none")] pub uri: Option, } +///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 { diff --git a/atrium-api/src/app/bsky/feed/generator.rs b/atrium-api/src/app/bsky/feed/generator.rs index dea6d1fc..3fc18629 100644 --- a/atrium-api/src/app/bsky/feed/generator.rs +++ b/atrium-api/src/app/bsky/feed/generator.rs @@ -12,6 +12,7 @@ pub struct Record { pub description_facets: Option>, pub did: crate::types::string::Did, pub display_name: String, + ///Self-label values #[serde(skip_serializing_if = "Option::is_none")] pub labels: Option, } diff --git a/atrium-api/src/app/bsky/feed/get_author_feed.rs b/atrium-api/src/app/bsky/feed/get_author_feed.rs index 1bd2c3c3..a8f25567 100644 --- a/atrium-api/src/app/bsky/feed/get_author_feed.rs +++ b/atrium-api/src/app/bsky/feed/get_author_feed.rs @@ -6,6 +6,7 @@ pub struct Parameters { pub actor: crate::types::string::AtIdentifier, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, + ///Combinations of post/repost types to include in response. #[serde(skip_serializing_if = "Option::is_none")] pub filter: Option, #[serde(skip_serializing_if = "Option::is_none")] diff --git a/atrium-api/src/app/bsky/feed/get_feed_generator.rs b/atrium-api/src/app/bsky/feed/get_feed_generator.rs index fddcf267..7eba4d70 100644 --- a/atrium-api/src/app/bsky/feed/get_feed_generator.rs +++ b/atrium-api/src/app/bsky/feed/get_feed_generator.rs @@ -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, } diff --git a/atrium-api/src/app/bsky/feed/get_feed_skeleton.rs b/atrium-api/src/app/bsky/feed/get_feed_skeleton.rs index b1430741..75705767 100644 --- a/atrium-api/src/app/bsky/feed/get_feed_skeleton.rs +++ b/atrium-api/src/app/bsky/feed/get_feed_skeleton.rs @@ -5,6 +5,7 @@ pub struct Parameters { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, + ///Reference to feed generator record describing the specific feed being requested. pub feed: String, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, diff --git a/atrium-api/src/app/bsky/feed/get_likes.rs b/atrium-api/src/app/bsky/feed/get_likes.rs index 392415a3..bf413eba 100644 --- a/atrium-api/src/app/bsky/feed/get_likes.rs +++ b/atrium-api/src/app/bsky/feed/get_likes.rs @@ -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, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, + ///AT-URI of the subject (eg, a post record). pub uri: String, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/app/bsky/feed/get_list_feed.rs b/atrium-api/src/app/bsky/feed/get_list_feed.rs index fb0d2b16..33d81d9b 100644 --- a/atrium-api/src/app/bsky/feed/get_list_feed.rs +++ b/atrium-api/src/app/bsky/feed/get_list_feed.rs @@ -7,6 +7,7 @@ pub struct Parameters { pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, + ///Reference (AT-URI) to the list record. pub list: String, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/app/bsky/feed/get_post_thread.rs b/atrium-api/src/app/bsky/feed/get_post_thread.rs index c68b757d..981ac91b 100644 --- a/atrium-api/src/app/bsky/feed/get_post_thread.rs +++ b/atrium-api/src/app/bsky/feed/get_post_thread.rs @@ -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>, + ///How many levels of parent (and grandparent, etc) post to include. #[serde(skip_serializing_if = "Option::is_none")] pub parent_height: Option>, + ///Reference (AT-URI) to post record. pub uri: String, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/app/bsky/feed/get_posts.rs b/atrium-api/src/app/bsky/feed/get_posts.rs index 38e8e64e..9f6c1872 100644 --- a/atrium-api/src/app/bsky/feed/get_posts.rs +++ b/atrium-api/src/app/bsky/feed/get_posts.rs @@ -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, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/app/bsky/feed/get_reposted_by.rs b/atrium-api/src/app/bsky/feed/get_reposted_by.rs index b56d6027..427dda02 100644 --- a/atrium-api/src/app/bsky/feed/get_reposted_by.rs +++ b/atrium-api/src/app/bsky/feed/get_reposted_by.rs @@ -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, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, + ///Reference (AT-URI) of post record pub uri: String, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/app/bsky/feed/get_timeline.rs b/atrium-api/src/app/bsky/feed/get_timeline.rs index 43e94e6a..7e61f184 100644 --- a/atrium-api/src/app/bsky/feed/get_timeline.rs +++ b/atrium-api/src/app/bsky/feed/get_timeline.rs @@ -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, #[serde(skip_serializing_if = "Option::is_none")] diff --git a/atrium-api/src/app/bsky/feed/post.rs b/atrium-api/src/app/bsky/feed/post.rs index 91b76c0e..b31d1cbf 100644 --- a/atrium-api/src/app/bsky/feed/post.rs +++ b/atrium-api/src/app/bsky/feed/post.rs @@ -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, - ///Deprecated: replaced by app.bsky.richtext.facet. + ///DEPRECATED: replaced by app.bsky.richtext.facet. #[serde(skip_serializing_if = "Option::is_none")] pub entities: Option>, + ///Annotations of text (mentions, URLs, hashtags, etc) #[serde(skip_serializing_if = "Option::is_none")] pub facets: Option>, + ///Self-label values for this post. Effectively content warnings. #[serde(skip_serializing_if = "Option::is_none")] pub labels: Option, + ///Indicates human language of post primary text content. #[serde(skip_serializing_if = "Option::is_none")] pub langs: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub reply: Option, - ///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>, + ///The primary post content. May be an empty string, if there are embeds. pub text: String, } ///Deprecated: use facets instead. diff --git a/atrium-api/src/app/bsky/feed/threadgate.rs b/atrium-api/src/app/bsky/feed/threadgate.rs index a20e4fee..77039837 100644 --- a/atrium-api/src/app/bsky/feed/threadgate.rs +++ b/atrium-api/src/app/bsky/feed/threadgate.rs @@ -6,6 +6,7 @@ pub struct Record { #[serde(skip_serializing_if = "Option::is_none")] pub allow: Option>, pub created_at: String, + ///Reference (AT-URI) to the post record. pub post: String, } ///Allow replies from actors you follow. diff --git a/atrium-api/src/app/bsky/graph/block.rs b/atrium-api/src/app/bsky/graph/block.rs index d2a849dd..70c1eb13 100644 --- a/atrium-api/src/app/bsky/graph/block.rs +++ b/atrium-api/src/app/bsky/graph/block.rs @@ -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, } diff --git a/atrium-api/src/app/bsky/graph/get_list.rs b/atrium-api/src/app/bsky/graph/get_list.rs index f32c8704..fb808ccd 100644 --- a/atrium-api/src/app/bsky/graph/get_list.rs +++ b/atrium-api/src/app/bsky/graph/get_list.rs @@ -7,6 +7,7 @@ pub struct Parameters { pub cursor: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option>, + ///Reference (AT-URI) of the list record to hydrate. pub list: String, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/app/bsky/graph/get_lists.rs b/atrium-api/src/app/bsky/graph/get_lists.rs index 97415627..f1921853 100644 --- a/atrium-api/src/app/bsky/graph/get_lists.rs +++ b/atrium-api/src/app/bsky/graph/get_lists.rs @@ -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, diff --git a/atrium-api/src/app/bsky/graph/get_relationships.rs b/atrium-api/src/app/bsky/graph/get_relationships.rs index 7e1e0ad6..be05eda8 100644 --- a/atrium-api/src/app/bsky/graph/get_relationships.rs +++ b/atrium-api/src/app/bsky/graph/get_relationships.rs @@ -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>, } diff --git a/atrium-api/src/app/bsky/graph/list.rs b/atrium-api/src/app/bsky/graph/list.rs index aeba26d6..7d7a32d7 100644 --- a/atrium-api/src/app/bsky/graph/list.rs +++ b/atrium-api/src/app/bsky/graph/list.rs @@ -12,7 +12,9 @@ pub struct Record { pub description_facets: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub labels: Option, + ///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)] diff --git a/atrium-api/src/app/bsky/graph/listblock.rs b/atrium-api/src/app/bsky/graph/listblock.rs index d3240dc8..96874cc6 100644 --- a/atrium-api/src/app/bsky/graph/listblock.rs +++ b/atrium-api/src/app/bsky/graph/listblock.rs @@ -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, } diff --git a/atrium-api/src/app/bsky/graph/listitem.rs b/atrium-api/src/app/bsky/graph/listitem.rs index 74efb4bd..8227561c 100644 --- a/atrium-api/src/app/bsky/graph/listitem.rs +++ b/atrium-api/src/app/bsky/graph/listitem.rs @@ -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, } diff --git a/atrium-api/src/app/bsky/richtext/facet.rs b/atrium-api/src/app/bsky/richtext/facet.rs index c6c1509a..4cef0351 100644 --- a/atrium-api/src/app/bsky/richtext/facet.rs +++ b/atrium-api/src/app/bsky/richtext/facet.rs @@ -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, 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 { diff --git a/atrium-api/src/blob.rs b/atrium-api/src/blob.rs deleted file mode 100644 index 390a4970..00000000 --- a/atrium-api/src/blob.rs +++ /dev/null @@ -1,21 +0,0 @@ -//! Definitions for Blob types. -#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] -#[serde(tag = "$type", rename_all = "lowercase")] -pub enum BlobRef { - Blob(Blob), -} - -#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] -#[serde(rename_all = "camelCase")] -pub struct Blob { - r#ref: CID, - mime_type: String, - size: usize, // TODO -} - -// TODO -#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] -pub struct CID { - #[serde(rename = "$link")] - link: String, -} diff --git a/atrium-api/src/client.rs b/atrium-api/src/client.rs index f9cbeffa..e72ee987 100644 --- a/atrium-api/src/client.rs +++ b/atrium-api/src/client.rs @@ -215,7 +215,7 @@ where pub(crate) fn new(xrpc: std::sync::Arc) -> Self { Self { xrpc } } - ///Get private preferences attached to the account. + ///Get private preferences attached to the current account. Expected use is synchronization between multiple devices, and import/export during account migration. Requires auth. pub async fn get_preferences( &self, params: crate::app::bsky::actor::get_preferences::Parameters, @@ -245,7 +245,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get detailed profile view of an actor. + ///Get detailed profile view of an actor. Does not require auth, but contains relevant metadata with auth. pub async fn get_profile( &self, params: crate::app::bsky::actor::get_profile::Parameters, @@ -305,7 +305,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a list of suggested actors, used for discovery. + ///Get a list of suggested actors. Expected use is discovery of accounts to follow during new account onboarding. pub async fn get_suggestions( &self, params: crate::app::bsky::actor::get_suggestions::Parameters, @@ -365,7 +365,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Find actors (profiles) matching search criteria. + ///Find actors (profiles) matching search criteria. Does not require auth. pub async fn search_actors( &self, params: crate::app::bsky::actor::search_actors::Parameters, @@ -395,7 +395,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Find actor suggestions for a prefix search term. + ///Find actor suggestions for a prefix search term. Expected use is for auto-completion during text field entry. Does not require auth. pub async fn search_actors_typeahead( &self, params: crate::app::bsky::actor::search_actors_typeahead::Parameters, @@ -435,7 +435,7 @@ where pub(crate) fn new(xrpc: std::sync::Arc) -> Self { Self { xrpc } } - ///Get information about a feed generator, including policies and offered feed URIs. + ///Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View). pub async fn describe_feed_generator( &self, ) -> Result< @@ -464,7 +464,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a list of feeds created by the actor. + ///Get a list of feeds (feed generator records) created by the actor (in the actor's repo). pub async fn get_actor_feeds( &self, params: crate::app::bsky::feed::get_actor_feeds::Parameters, @@ -494,7 +494,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a list of posts liked by an actor. + ///Get a list of posts liked by an actor. Does not require auth. pub async fn get_actor_likes( &self, params: crate::app::bsky::feed::get_actor_likes::Parameters, @@ -524,7 +524,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a view of an actor's feed. + ///Get a view of an actor's 'author feed' (post and reposts by the author). Does not require auth. pub async fn get_author_feed( &self, params: crate::app::bsky::feed::get_author_feed::Parameters, @@ -554,7 +554,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a hydrated feed from an actor's selected feed generator. + ///Get a hydrated feed from an actor's selected feed generator. Implemented by App View. pub async fn get_feed( &self, params: crate::app::bsky::feed::get_feed::Parameters, @@ -584,7 +584,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get information about a feed generator. + ///Get information about a feed generator. Implemented by AppView. pub async fn get_feed_generator( &self, params: crate::app::bsky::feed::get_feed_generator::Parameters, @@ -644,7 +644,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a skeleton of a feed provided by a feed generator. + ///Get a skeleton of a feed provided by a feed generator. Auth is optional, depending on provider requirements, and provides the DID of the requester. Implemented by Feed Generator Service. pub async fn get_feed_skeleton( &self, params: crate::app::bsky::feed::get_feed_skeleton::Parameters, @@ -674,7 +674,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get the list of likes. + ///Get like records which reference a subject (by AT-URI and CID). pub async fn get_likes( &self, params: crate::app::bsky::feed::get_likes::Parameters, @@ -704,7 +704,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a view of a recent posts from actors in a list. + ///Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth. pub async fn get_list_feed( &self, params: crate::app::bsky::feed::get_list_feed::Parameters, @@ -734,7 +734,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get posts in a thread. + ///Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests. pub async fn get_post_thread( &self, params: crate::app::bsky::feed::get_post_thread::Parameters, @@ -764,7 +764,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a view of an actor's feed. + ///Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'. pub async fn get_posts( &self, params: crate::app::bsky::feed::get_posts::Parameters, @@ -794,7 +794,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a list of reposts. + ///Get a list of reposts for a given post. pub async fn get_reposted_by( &self, params: crate::app::bsky::feed::get_reposted_by::Parameters, @@ -824,7 +824,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a list of suggested feeds for the viewer. + ///Get a list of suggested feeds (feed generators) for the requesting account. pub async fn get_suggested_feeds( &self, params: crate::app::bsky::feed::get_suggested_feeds::Parameters, @@ -854,7 +854,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a view of the actor's home timeline. + ///Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed. pub async fn get_timeline( &self, params: crate::app::bsky::feed::get_timeline::Parameters, @@ -884,7 +884,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Find posts matching search criteria. + ///Find posts matching search criteria, returning views of those posts. pub async fn search_posts( &self, params: crate::app::bsky::feed::search_posts::Parameters, @@ -922,7 +922,7 @@ where pub(crate) fn new(xrpc: std::sync::Arc) -> Self { Self { xrpc } } - ///Get a list of who the actor is blocking. + ///Enumerates which accounts the requesting account is currently blocking. Requires auth. pub async fn get_blocks( &self, params: crate::app::bsky::graph::get_blocks::Parameters, @@ -952,7 +952,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a list of an actor's followers. + ///Enumerates accounts which follow a specified account (actor). pub async fn get_followers( &self, params: crate::app::bsky::graph::get_followers::Parameters, @@ -982,7 +982,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a list of who the actor follows. + ///Enumerates accounts which a specified account (actor) follows. pub async fn get_follows( &self, params: crate::app::bsky::graph::get_follows::Parameters, @@ -1012,7 +1012,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a list of actors. + ///Gets a 'view' (with additional context) of a specified list. pub async fn get_list( &self, params: crate::app::bsky::graph::get_list::Parameters, @@ -1042,7 +1042,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get lists that the actor is blocking. + ///Get mod lists that the requesting account (actor) is blocking. Requires auth. pub async fn get_list_blocks( &self, params: crate::app::bsky::graph::get_list_blocks::Parameters, @@ -1072,7 +1072,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get lists that the actor is muting. + ///Enumerates mod lists that the requesting account (actor) currently has muted. Requires auth. pub async fn get_list_mutes( &self, params: crate::app::bsky::graph::get_list_mutes::Parameters, @@ -1102,7 +1102,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a list of lists that belong to an actor. + ///Enumerates the lists created by a specified account (actor). pub async fn get_lists( &self, params: crate::app::bsky::graph::get_lists::Parameters, @@ -1132,7 +1132,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a list of who the actor mutes. + ///Enumerates accounts that the requesting account (actor) currently has muted. Requires auth. pub async fn get_mutes( &self, params: crate::app::bsky::graph::get_mutes::Parameters, @@ -1162,7 +1162,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Enumerates public relationships between one account, and a list of other accounts + ///Enumerates public relationships between one account, and a list of other accounts. Does not require auth. pub async fn get_relationships( &self, params: crate::app::bsky::graph::get_relationships::Parameters, @@ -1192,7 +1192,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get suggested follows related to a given actor. + ///Enumerates follows similar to a given account (actor). Expected use is to recommend additional accounts immediately after following one account. pub async fn get_suggested_follows_by_actor( &self, params: crate::app::bsky::graph::get_suggested_follows_by_actor::Parameters, @@ -1224,7 +1224,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Mute an actor by DID or handle. + ///Creates a mute relationship for the specified account. Mutes are private in Bluesky. Requires auth. pub async fn mute_actor( &self, input: crate::app::bsky::graph::mute_actor::Input, @@ -1254,7 +1254,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Mute a list of actors. + ///Creates a mute relationship for the specified list of accounts. Mutes are private in Bluesky. Requires auth. pub async fn mute_actor_list( &self, input: crate::app::bsky::graph::mute_actor_list::Input, @@ -1284,7 +1284,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Unmute an actor by DID or handle. + ///Unmutes the specified account. Requires auth. pub async fn unmute_actor( &self, input: crate::app::bsky::graph::unmute_actor::Input, @@ -1314,7 +1314,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Unmute a list of actors. + ///Unmutes the specified list of accounts. Requires auth. pub async fn unmute_actor_list( &self, input: crate::app::bsky::graph::unmute_actor_list::Input, @@ -1352,7 +1352,7 @@ where pub(crate) fn new(xrpc: std::sync::Arc) -> Self { Self { xrpc } } - ///Get the count of unread notifications. + ///Count the number of unread notifications for the requesting account. Requires auth. pub async fn get_unread_count( &self, params: crate::app::bsky::notification::get_unread_count::Parameters, @@ -1384,7 +1384,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a list of notifications. + ///Enumerate notifications for the requesting account. Requires auth. pub async fn list_notifications( &self, params: crate::app::bsky::notification::list_notifications::Parameters, @@ -1416,7 +1416,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Register for push notifications with a service. + ///Register to receive push notifications, via a specified service, for the requesting account. Requires auth. pub async fn register_push( &self, input: crate::app::bsky::notification::register_push::Input, @@ -1446,7 +1446,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Notify server that the user has seen notifications. + ///Notify server that the requesting account has seen notifications. Requires auth. pub async fn update_seen( &self, input: crate::app::bsky::notification::update_seen::Input, @@ -2374,7 +2374,7 @@ where pub(crate) fn new(xrpc: std::sync::Arc) -> Self { Self { xrpc } } - ///Provides the DID of a repo. + ///Resolves a handle (domain name) to a DID. pub async fn resolve_handle( &self, params: crate::com::atproto::identity::resolve_handle::Parameters, @@ -2404,7 +2404,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Updates the handle of the account. + ///Updates the current account's handle. Verifies handle validity, and updates did:plc document if necessary. Implemented by PDS, and requires auth. pub async fn update_handle( &self, input: crate::com::atproto::identity::update_handle::Input, @@ -2442,7 +2442,7 @@ where pub(crate) fn new(xrpc: std::sync::Arc) -> Self { Self { xrpc } } - ///Find labels relevant to the provided URI patterns. + ///Find labels relevant to the provided AT-URI patterns. Public endpoint for moderation services, though may return different or additional results with auth. pub async fn query_labels( &self, params: crate::com::atproto::label::query_labels::Parameters, @@ -2480,7 +2480,7 @@ where pub(crate) fn new(xrpc: std::sync::Arc) -> Self { Self { xrpc } } - ///Report a repo or a record. + ///Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth. pub async fn create_report( &self, input: crate::com::atproto::moderation::create_report::Input, @@ -2518,7 +2518,7 @@ where pub(crate) fn new(xrpc: std::sync::Arc) -> Self { Self { xrpc } } - ///Apply a batch transaction of creates, updates, and deletes. + ///Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS. pub async fn apply_writes( &self, input: crate::com::atproto::repo::apply_writes::Input, @@ -2548,7 +2548,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Create a new record. + ///Create a single new repository record. Requires auth, implemented by PDS. pub async fn create_record( &self, input: crate::com::atproto::repo::create_record::Input, @@ -2578,7 +2578,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Delete a record, or ensure it doesn't exist. + ///Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS. pub async fn delete_record( &self, input: crate::com::atproto::repo::delete_record::Input, @@ -2608,7 +2608,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get information about the repo, including the list of collections. + ///Get information about an account and repository, including the list of collections. Does not require auth. pub async fn describe_repo( &self, params: crate::com::atproto::repo::describe_repo::Parameters, @@ -2638,7 +2638,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a record. + ///Get a single record from a repository. Does not require auth. pub async fn get_record( &self, params: crate::com::atproto::repo::get_record::Parameters, @@ -2668,7 +2668,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///List a range of records in a collection. + ///List a range of records in a repository, matching a specific collection. Does not require auth. pub async fn list_records( &self, params: crate::com::atproto::repo::list_records::Parameters, @@ -2698,7 +2698,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Write a record, creating or updating it as needed. + ///Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS. pub async fn put_record( &self, input: crate::com::atproto::repo::put_record::Input, @@ -2728,7 +2728,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Upload a new blob to be added to repo in a later request. + ///Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS. pub async fn upload_blob( &self, input: Vec, @@ -2796,7 +2796,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Create an account. + ///Create an account. Implemented by PDS. pub async fn create_account( &self, input: crate::com::atproto::server::create_account::Input, @@ -2950,7 +2950,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Delete an actor's account with a token and password. + ///Delete an actor's account with a token and password. Can only be called after requesting a deletion token. Requires auth. pub async fn delete_account( &self, input: crate::com::atproto::server::delete_account::Input, @@ -2980,7 +2980,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Delete the current session. + ///Delete the current session. Requires auth. pub async fn delete_session( &self, ) -> Result< @@ -3009,7 +3009,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get a document describing the service's accounts configuration. + ///Describes the server's account creation requirements and capabilities. Implemented by PDS. pub async fn describe_server( &self, ) -> Result< @@ -3038,7 +3038,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get all invite codes for a given account. + ///Get all invite codes for the current account. Requires auth. pub async fn get_account_invite_codes( &self, params: crate::com::atproto::server::get_account_invite_codes::Parameters, @@ -3070,7 +3070,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get information about the current session. + ///Get information about the current auth session. Requires auth. pub async fn get_session( &self, ) -> Result< @@ -3128,7 +3128,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Refresh an authentication session. + ///Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt'). pub async fn refresh_session( &self, ) -> Result< @@ -3282,7 +3282,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Reserve a repo signing key for account creation. + ///Reserve a repo signing key, for use with account creation. Necessary so that a DID PLC update operation can be constructed during an account migraiton. Public and does not require auth; implemented by PDS. NOTE: this endpoint may change when full account migration is implemented. pub async fn reserve_signing_key( &self, input: crate::com::atproto::server::reserve_signing_key::Input, @@ -3414,7 +3414,7 @@ where pub(crate) fn new(xrpc: std::sync::Arc) -> Self { Self { xrpc } } - ///Get a blob associated with a given repo. + ///Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS. pub async fn get_blob( &self, params: crate::com::atproto::sync::get_blob::Parameters, @@ -3444,7 +3444,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get blocks from a given repo. + ///Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS. pub async fn get_blocks( &self, params: crate::com::atproto::sync::get_blocks::Parameters, @@ -3534,7 +3534,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get the current commit CID & revision of the repo. + ///Get the current commit CID & revision of the specified repo. Does not require auth. pub async fn get_latest_commit( &self, params: crate::com::atproto::sync::get_latest_commit::Parameters, @@ -3564,7 +3564,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Get blocks needed for existence or non-existence of record. + ///Get data blocks needed to prove the existence or non-existence of record in the current version of repo. Does not require auth. pub async fn get_record( &self, params: crate::com::atproto::sync::get_record::Parameters, @@ -3594,7 +3594,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Gets the DID's repo, optionally catching up from a specific revision. + ///Download a repository export as CAR file. Optionally only a 'diff' since a previous revision. Does not require auth; implemented by PDS. pub async fn get_repo( &self, params: crate::com::atproto::sync::get_repo::Parameters, @@ -3624,7 +3624,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///List blob CIDs since some revision. + ///List blob CIDso for an account, since some repo revision. Does not require auth; implemented by PDS. pub async fn list_blobs( &self, params: crate::com::atproto::sync::list_blobs::Parameters, @@ -3654,7 +3654,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///List DIDs and root CIDs of hosted repos. + ///Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay. pub async fn list_repos( &self, params: crate::com::atproto::sync::list_repos::Parameters, @@ -3684,7 +3684,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Notify a crawling service of a recent update; often when a long break between updates causes the connection with the crawling service to break. + ///Notify a crawling service of a recent update, and that crawling should resume. Intended use is after a gap between repo stream events caused the crawling service to disconnect. Does not require auth; implemented by Relay. pub async fn notify_of_update( &self, input: crate::com::atproto::sync::notify_of_update::Input, @@ -3714,7 +3714,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Request a service to persistently crawl hosted repos. + ///Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth. pub async fn request_crawl( &self, input: crate::com::atproto::sync::request_crawl::Input, @@ -3781,7 +3781,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Fetch all labels from a labeler created after a certain date. + ///Fetch all labels from a labeler created after a certain date. DEPRECATED: use queryLabels or subscribeLabels instead pub async fn fetch_labels( &self, params: crate::com::atproto::temp::fetch_labels::Parameters, @@ -3903,7 +3903,7 @@ where _ => Err(atrium_xrpc::error::Error::UnexpectedResponseType), } } - ///Transfer an account. + ///Transfer an account. NOTE: temporary method, necessarily how account migration will be implemented. pub async fn transfer_account( &self, input: crate::com::atproto::temp::transfer_account::Input, diff --git a/atrium-api/src/com/atproto/identity/update_handle.rs b/atrium-api/src/com/atproto/identity/update_handle.rs index b848edbb..15027f50 100644 --- a/atrium-api/src/com/atproto/identity/update_handle.rs +++ b/atrium-api/src/com/atproto/identity/update_handle.rs @@ -3,6 +3,7 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Input { + ///The new handle. pub handle: crate::types::string::Handle, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/com/atproto/label/subscribe_labels.rs b/atrium-api/src/com/atproto/label/subscribe_labels.rs index 374fa087..a23a1bb6 100644 --- a/atrium-api/src/com/atproto/label/subscribe_labels.rs +++ b/atrium-api/src/com/atproto/label/subscribe_labels.rs @@ -4,7 +4,7 @@ pub const NSID: &str = "com.atproto.label.subscribeLabels"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Parameters { - ///The last known event to backfill from. + ///The last known event seq number to backfill from. #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } diff --git a/atrium-api/src/com/atproto/moderation/create_report.rs b/atrium-api/src/com/atproto/moderation/create_report.rs index 502f01e2..de1a48bd 100644 --- a/atrium-api/src/com/atproto/moderation/create_report.rs +++ b/atrium-api/src/com/atproto/moderation/create_report.rs @@ -3,8 +3,10 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Input { + ///Additional context about the content and violation. #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option, + ///Indicates the broad category of violation the report is for. pub reason_type: crate::com::atproto::moderation::defs::ReasonType, pub subject: InputSubjectEnum, } diff --git a/atrium-api/src/com/atproto/repo/apply_writes.rs b/atrium-api/src/com/atproto/repo/apply_writes.rs index 1b23e260..c61ad47c 100644 --- a/atrium-api/src/com/atproto/repo/apply_writes.rs +++ b/atrium-api/src/com/atproto/repo/apply_writes.rs @@ -3,11 +3,12 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Input { - ///The handle or DID of the repo. + ///The handle or DID of the repo (aka, current account). pub repo: crate::types::string::AtIdentifier, + ///If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations. #[serde(skip_serializing_if = "Option::is_none")] pub swap_commit: Option, - ///Flag for validating the records. + ///Can be set to 'false' to skip Lexicon schema validation of record data, for all operations. #[serde(skip_serializing_if = "Option::is_none")] pub validate: Option, pub writes: Vec, @@ -15,9 +16,10 @@ pub struct Input { #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { + ///Indicates that the 'swapCommit' parameter did not match current commit. InvalidSwap(Option), } -///Create a new record. +///Operation which creates a new record. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Create { @@ -26,14 +28,14 @@ pub struct Create { pub rkey: Option, pub value: crate::records::Record, } -///Delete an existing record. +///Operation which deletes an existing record. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Delete { pub collection: String, pub rkey: String, } -///Update an existing record. +///Operation which updates an existing record. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Update { diff --git a/atrium-api/src/com/atproto/repo/create_record.rs b/atrium-api/src/com/atproto/repo/create_record.rs index d222d191..3e203ca0 100644 --- a/atrium-api/src/com/atproto/repo/create_record.rs +++ b/atrium-api/src/com/atproto/repo/create_record.rs @@ -5,17 +5,17 @@ pub struct Input { ///The NSID of the record collection. pub collection: String, - ///The record to create. + ///The record itself. Must contain a $type field. pub record: crate::records::Record, - ///The handle or DID of the repo. + ///The handle or DID of the repo (aka, current account). pub repo: crate::types::string::AtIdentifier, - ///The key of the record. + ///The Record Key. #[serde(skip_serializing_if = "Option::is_none")] pub rkey: Option, ///Compare and swap with the previous commit by CID. #[serde(skip_serializing_if = "Option::is_none")] pub swap_commit: Option, - ///Flag for validating the record. + ///Can be set to 'false' to skip Lexicon schema validation of record data. #[serde(skip_serializing_if = "Option::is_none")] pub validate: Option, } @@ -28,5 +28,6 @@ pub struct Output { #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "error", content = "message")] pub enum Error { + ///Indicates that 'swapCommit' didn't match current repo commit. InvalidSwap(Option), } diff --git a/atrium-api/src/com/atproto/repo/delete_record.rs b/atrium-api/src/com/atproto/repo/delete_record.rs index 97b2f6dd..3914c852 100644 --- a/atrium-api/src/com/atproto/repo/delete_record.rs +++ b/atrium-api/src/com/atproto/repo/delete_record.rs @@ -5,9 +5,9 @@ pub struct Input { ///The NSID of the record collection. pub collection: String, - ///The handle or DID of the repo. + ///The handle or DID of the repo (aka, current account). pub repo: crate::types::string::AtIdentifier, - ///The key of the record. + ///The Record Key. pub rkey: String, ///Compare and swap with the previous commit by CID. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/atrium-api/src/com/atproto/repo/describe_repo.rs b/atrium-api/src/com/atproto/repo/describe_repo.rs index dac5db70..f7f68bf6 100644 --- a/atrium-api/src/com/atproto/repo/describe_repo.rs +++ b/atrium-api/src/com/atproto/repo/describe_repo.rs @@ -9,10 +9,13 @@ pub struct Parameters { #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Output { + ///List of all the collections (NSIDs) for which this repo contains at least one record. pub collections: Vec, pub did: crate::types::string::Did, + ///The complete DID document for this account. pub did_doc: crate::did_doc::DidDocument, pub handle: crate::types::string::Handle, + ///Indicates if handle is currently valid (resolves bi-directionally) pub handle_is_correct: bool, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/com/atproto/repo/get_record.rs b/atrium-api/src/com/atproto/repo/get_record.rs index c8bc2501..aa110447 100644 --- a/atrium-api/src/com/atproto/repo/get_record.rs +++ b/atrium-api/src/com/atproto/repo/get_record.rs @@ -10,7 +10,7 @@ pub struct Parameters { pub collection: String, ///The handle or DID of the repo. pub repo: crate::types::string::AtIdentifier, - ///The key of the record. + ///The Record Key. pub rkey: String, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/com/atproto/repo/put_record.rs b/atrium-api/src/com/atproto/repo/put_record.rs index b21f5647..cf281002 100644 --- a/atrium-api/src/com/atproto/repo/put_record.rs +++ b/atrium-api/src/com/atproto/repo/put_record.rs @@ -7,17 +7,17 @@ pub struct Input { pub collection: String, ///The record to write. pub record: crate::records::Record, - ///The handle or DID of the repo. + ///The handle or DID of the repo (aka, current account). pub repo: crate::types::string::AtIdentifier, - ///The key of the record. + ///The Record Key. pub rkey: String, ///Compare and swap with the previous commit by CID. #[serde(skip_serializing_if = "Option::is_none")] pub swap_commit: Option, - ///Compare and swap with the previous record by CID. + ///Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation #[serde(skip_serializing_if = "Option::is_none")] pub swap_record: Option, - ///Flag for validating the record. + ///Can be set to 'false' to skip Lexicon schema validation of record data. #[serde(skip_serializing_if = "Option::is_none")] pub validate: Option, } diff --git a/atrium-api/src/com/atproto/server/create_account.rs b/atrium-api/src/com/atproto/server/create_account.rs index 2b761d94..e3cdc052 100644 --- a/atrium-api/src/com/atproto/server/create_account.rs +++ b/atrium-api/src/com/atproto/server/create_account.rs @@ -3,17 +3,22 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Input { + ///Pre-existing atproto DID, being imported to a new account. #[serde(skip_serializing_if = "Option::is_none")] pub did: Option, #[serde(skip_serializing_if = "Option::is_none")] pub email: Option, + ///Requested handle for the account. pub handle: crate::types::string::Handle, #[serde(skip_serializing_if = "Option::is_none")] pub invite_code: Option, + ///Initial account password. May need to meet instance-specific password strength requirements. #[serde(skip_serializing_if = "Option::is_none")] pub password: Option, + ///A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented. #[serde(skip_serializing_if = "Option::is_none")] pub plc_op: Option, + ///DID PLC rotation key (aka, recovery key) to be included in PLC creation operation. #[serde(skip_serializing_if = "Option::is_none")] pub recovery_key: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -21,11 +26,14 @@ pub struct Input { #[serde(skip_serializing_if = "Option::is_none")] pub verification_phone: Option, } +///Account login session returned on successful account creation. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Output { pub access_jwt: String, + ///The DID of the new account. pub did: crate::types::string::Did, + ///Complete DID document. #[serde(skip_serializing_if = "Option::is_none")] pub did_doc: Option, pub handle: crate::types::string::Handle, diff --git a/atrium-api/src/com/atproto/server/create_app_password.rs b/atrium-api/src/com/atproto/server/create_app_password.rs index 02e0e2ab..38a3354d 100644 --- a/atrium-api/src/com/atproto/server/create_app_password.rs +++ b/atrium-api/src/com/atproto/server/create_app_password.rs @@ -3,6 +3,7 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Input { + ///A short name for the App Password, to help distinguish them. pub name: String, } pub type Output = AppPassword; diff --git a/atrium-api/src/com/atproto/server/describe_server.rs b/atrium-api/src/com/atproto/server/describe_server.rs index 781cc788..a01ce38d 100644 --- a/atrium-api/src/com/atproto/server/describe_server.rs +++ b/atrium-api/src/com/atproto/server/describe_server.rs @@ -3,11 +3,15 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Output { + ///List of domain suffixes that can be used in account handles. pub available_user_domains: Vec, + ///If true, an invite code must be supplied to create an account on this instance. #[serde(skip_serializing_if = "Option::is_none")] pub invite_code_required: Option, + ///URLs of service policy documents. #[serde(skip_serializing_if = "Option::is_none")] pub links: Option, + ///If true, a phone verification token must be supplied to create an account on this instance. #[serde(skip_serializing_if = "Option::is_none")] pub phone_verification_required: Option, } diff --git a/atrium-api/src/com/atproto/server/get_account_invite_codes.rs b/atrium-api/src/com/atproto/server/get_account_invite_codes.rs index 5deb8218..05a44513 100644 --- a/atrium-api/src/com/atproto/server/get_account_invite_codes.rs +++ b/atrium-api/src/com/atproto/server/get_account_invite_codes.rs @@ -3,6 +3,7 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Parameters { + ///Controls whether any new 'earned' but not 'created' invites should be created. #[serde(skip_serializing_if = "Option::is_none")] pub create_available: Option, #[serde(skip_serializing_if = "Option::is_none")] diff --git a/atrium-api/src/com/atproto/server/reserve_signing_key.rs b/atrium-api/src/com/atproto/server/reserve_signing_key.rs index 567eb18c..9d50d378 100644 --- a/atrium-api/src/com/atproto/server/reserve_signing_key.rs +++ b/atrium-api/src/com/atproto/server/reserve_signing_key.rs @@ -3,14 +3,14 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Input { - ///The did to reserve a new did:key for + ///The DID to reserve a key for. #[serde(skip_serializing_if = "Option::is_none")] - pub did: Option, + pub did: Option, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Output { - ///Public signing key in the form of a did:key. + ///The public key for the reserved signing key, in did:key serialization. pub signing_key: String, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/com/atproto/sync/get_blob.rs b/atrium-api/src/com/atproto/sync/get_blob.rs index 4dcd3f2c..d1f72bff 100644 --- a/atrium-api/src/com/atproto/sync/get_blob.rs +++ b/atrium-api/src/com/atproto/sync/get_blob.rs @@ -5,7 +5,7 @@ pub struct Parameters { ///The CID of the blob to fetch pub cid: String, - ///The DID of the repo. + ///The DID of the account. pub did: crate::types::string::Did, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/com/atproto/sync/get_record.rs b/atrium-api/src/com/atproto/sync/get_record.rs index 5537951b..d84b66fd 100644 --- a/atrium-api/src/com/atproto/sync/get_record.rs +++ b/atrium-api/src/com/atproto/sync/get_record.rs @@ -9,6 +9,7 @@ pub struct Parameters { pub commit: Option, ///The DID of the repo. pub did: crate::types::string::Did, + ///Record Key pub rkey: String, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/com/atproto/sync/get_repo.rs b/atrium-api/src/com/atproto/sync/get_repo.rs index d3b8c393..c68e8fda 100644 --- a/atrium-api/src/com/atproto/sync/get_repo.rs +++ b/atrium-api/src/com/atproto/sync/get_repo.rs @@ -5,7 +5,7 @@ pub struct Parameters { ///The DID of the repo. pub did: crate::types::string::Did, - ///The revision of the repo to catch up from. + ///The revision ('rev') of the repo to create a diff from. #[serde(skip_serializing_if = "Option::is_none")] pub since: Option, } diff --git a/atrium-api/src/com/atproto/sync/list_repos.rs b/atrium-api/src/com/atproto/sync/list_repos.rs index a650230f..51d788e3 100644 --- a/atrium-api/src/com/atproto/sync/list_repos.rs +++ b/atrium-api/src/com/atproto/sync/list_repos.rs @@ -22,6 +22,7 @@ pub enum Error {} #[serde(rename_all = "camelCase")] pub struct Repo { pub did: crate::types::string::Did, + ///Current repo commit CID pub head: String, pub rev: String, } diff --git a/atrium-api/src/com/atproto/sync/notify_of_update.rs b/atrium-api/src/com/atproto/sync/notify_of_update.rs index a6f00c8c..f199cbde 100644 --- a/atrium-api/src/com/atproto/sync/notify_of_update.rs +++ b/atrium-api/src/com/atproto/sync/notify_of_update.rs @@ -3,7 +3,7 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Input { - ///Hostname of the service that is notifying of update. + ///Hostname of the current service (usually a PDS) that is notifying of update. pub hostname: String, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/com/atproto/sync/request_crawl.rs b/atrium-api/src/com/atproto/sync/request_crawl.rs index d745a05e..42d05917 100644 --- a/atrium-api/src/com/atproto/sync/request_crawl.rs +++ b/atrium-api/src/com/atproto/sync/request_crawl.rs @@ -3,7 +3,7 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Input { - ///Hostname of the service that is requesting to be crawled. + ///Hostname of the current service (eg, PDS) that is requesting to be crawled. pub hostname: String, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/com/atproto/sync/subscribe_repos.rs b/atrium-api/src/com/atproto/sync/subscribe_repos.rs index a59bbce0..dfb489a2 100644 --- a/atrium-api/src/com/atproto/sync/subscribe_repos.rs +++ b/atrium-api/src/com/atproto/sync/subscribe_repos.rs @@ -4,7 +4,7 @@ pub const NSID: &str = "com.atproto.sync.subscribeRepos"; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Parameters { - ///The last known event to backfill from. + ///The last known event seq number to backfill from. #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, } @@ -12,30 +12,40 @@ pub struct Parameters { #[serde(tag = "error", content = "message")] pub enum Error { FutureCursor(Option), + ///If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection. ConsumerTooSlow(Option), } +///Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Commit { pub blobs: Vec, - ///CAR file containing relevant blocks. + ///CAR file containing relevant blocks, as a diff since the previous repo state. #[serde(with = "serde_bytes")] pub blocks: Vec, + ///Repo commit object CID. pub commit: crate::types::CidLink, pub ops: Vec, + ///DEPRECATED -- unused. WARNING -- nullable and optional; stick with optional to ensure golang interoperability. #[serde(skip_serializing_if = "Option::is_none")] pub prev: Option, + ///DEPRECATED -- unused pub rebase: bool, + ///The repo this event comes from. pub repo: crate::types::string::Did, - ///The rev of the emitted commit. + ///The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event. pub rev: String, + ///The stream sequence number of this message. pub seq: i64, - ///The rev of the last emitted commit from this repo. + ///The rev of the last emitted commit from this repo (if any). #[serde(skip_serializing_if = "Option::is_none")] pub since: Option, + ///Timestamp of when this message was originally broadcast. pub time: String, + ///Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data. pub too_big: bool, } +///Represents an update of the account's handle, or transition to/from invalid state. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Handle { @@ -51,6 +61,7 @@ pub struct Info { pub message: Option, pub name: String, } +///Represents an account moving from one PDS instance to another. NOTE: not implemented; full account migration may introduce a new message instead. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Migrate { @@ -60,15 +71,17 @@ pub struct Migrate { pub seq: i64, pub time: String, } -///A repo operation, ie a write of a single record. For creates and updates, CID is the record's CID as of this operation. For deletes, it's null. +///A repo operation, ie a mutation of a single record. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct RepoOp { pub action: String, + ///For creates and updates, the new record CID. For deletions, null. #[serde(skip_serializing_if = "Option::is_none")] pub cid: Option, pub path: String, } +///Indicates that an account has been deleted. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct Tombstone { diff --git a/atrium-xrpc-client/src/surf.rs b/atrium-xrpc-client/src/surf.rs index b7c9511e..6ba8fa72 100644 --- a/atrium-xrpc-client/src/surf.rs +++ b/atrium-xrpc-client/src/surf.rs @@ -20,7 +20,7 @@ impl SurfClient { /// Create a new [`SurfClient`] using the passed [`surf::Client`]. pub fn new(base_uri: impl AsRef, client: Client) -> Self { Self { - base_uri: base_uri.as_ref().to_string(), + base_uri: base_uri.as_ref().into(), client: Arc::new(client), } }