Skip to content

Commit

Permalink
Merge pull request #6 from mnogu/create-pull-request/patch
Browse files Browse the repository at this point in the history
Update atproto
  • Loading branch information
mnogu authored Sep 8, 2024
2 parents 9ee8a5b + 11c6019 commit f8b3da2
Show file tree
Hide file tree
Showing 23 changed files with 512 additions and 501 deletions.
2 changes: 1 addition & 1 deletion atproto
Submodule atproto updated 103 files
44 changes: 22 additions & 22 deletions chitose/app/bsky/actor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ def __init__(self, call: XrpcCall, subscribe: XrpcSubscribe) -> None:
self.call = call
self.subscribe = subscribe

def search_actors_typeahead(self, term: typing.Optional[str]=None, q: typing.Optional[str]=None, limit: typing.Optional[int]=None) -> bytes:
"""Find actor suggestions for a prefix search term. Expected use is for auto-completion during text field entry. Does not require auth.
:param term: DEPRECATED: use 'q' instead.
:param q: Search query prefix; not a full query string.
"""
return _search_actors_typeahead(self.call, term, q, limit)

def put_preferences(self, preferences: chitose.app.bsky.actor.defs.Preferences) -> bytes:
"""Set the private preferences attached to the account."""
return _put_preferences(self.call, preferences)

def get_profile(self, actor: str) -> bytes:
"""Get detailed profile view of an actor. Does not require auth, but contains relevant metadata with auth.
Expand All @@ -41,10 +27,6 @@ def get_profile(self, actor: str) -> bytes:
"""
return _get_profile(self.call, actor)

def get_suggestions(self, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a list of suggested actors. Expected use is discovery of accounts to follow during new account onboarding."""
return _get_suggestions(self.call, limit, cursor)

def search_actors(self, term: typing.Optional[str]=None, q: typing.Optional[str]=None, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Find actors (profiles) matching search criteria. Does not require auth.
Expand All @@ -55,10 +37,28 @@ def search_actors(self, term: typing.Optional[str]=None, q: typing.Optional[str]
"""
return _search_actors(self.call, term, q, limit, cursor)

def get_profiles(self, actors: list[str]) -> bytes:
"""Get detailed profile views of multiple actors."""
return _get_profiles(self.call, actors)
def search_actors_typeahead(self, term: typing.Optional[str]=None, q: typing.Optional[str]=None, limit: typing.Optional[int]=None) -> bytes:
"""Find actor suggestions for a prefix search term. Expected use is for auto-completion during text field entry. Does not require auth.
:param term: DEPRECATED: use 'q' instead.
:param q: Search query prefix; not a full query string.
"""
return _search_actors_typeahead(self.call, term, q, limit)

def get_suggestions(self, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a list of suggested actors. Expected use is discovery of accounts to follow during new account onboarding."""
return _get_suggestions(self.call, limit, cursor)

def get_preferences(self) -> bytes:
"""Get private preferences attached to the current account. Expected use is synchronization between multiple devices, and import/export during account migration. Requires auth."""
return _get_preferences(self.call)
return _get_preferences(self.call)

def put_preferences(self, preferences: chitose.app.bsky.actor.defs.Preferences) -> bytes:
"""Set the private preferences attached to the account."""
return _put_preferences(self.call, preferences)

def get_profiles(self, actors: list[str]) -> bytes:
"""Get detailed profile views of multiple actors."""
return _get_profiles(self.call, actors)
110 changes: 55 additions & 55 deletions chitose/app/bsky/feed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,33 @@ def send_interactions(self, interactions: list[chitose.app.bsky.feed.defs.Intera
"""Send information about interactions with feed items back to the feed generator that served them."""
return _send_interactions(self.call, interactions)

def get_feed_generators(self, feeds: list[str]) -> bytes:
"""Get information about a list of feed generators."""
return _get_feed_generators(self.call, feeds)

def get_timeline(self, algorithm: typing.Optional[str]=None, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed.
def get_author_feed(self, actor: str, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None, filter: typing.Optional[typing.Literal['posts_with_replies', 'posts_no_replies', 'posts_with_media', 'posts_and_author_threads']]=None) -> bytes:
"""Get a view of an actor's 'author feed' (post and reposts by the author). Does not require auth.
:param algorithm: Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism.
:param filter: Combinations of post/repost types to include in response.
"""
return _get_timeline(self.call, algorithm, limit, cursor)

def get_feed_generator(self, feed: str) -> bytes:
"""Get information about a feed generator. Implemented by AppView.
return _get_author_feed(self.call, actor, limit, cursor, filter)

def get_post_thread(self, uri: str, depth: typing.Optional[int]=None, parent_height: typing.Optional[int]=None) -> bytes:
"""Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests.
:param feed: AT-URI of the feed generator record.
"""
return _get_feed_generator(self.call, feed)
def get_author_feed(self, actor: str, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None, filter: typing.Optional[typing.Literal['posts_with_replies', 'posts_no_replies', 'posts_with_media', 'posts_and_author_threads']]=None) -> bytes:
"""Get a view of an actor's 'author feed' (post and reposts by the author). Does not require auth.
:param uri: Reference (AT-URI) to post record.
:param depth: How many levels of reply depth should be included in response.
:param filter: Combinations of post/repost types to include in response.
:param parent_height: How many levels of parent (and grandparent, etc) post to include.
"""
return _get_author_feed(self.call, actor, limit, cursor, filter)
return _get_post_thread(self.call, uri, depth, parent_height)

def get_feed(self, feed: str, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a hydrated feed from an actor's selected feed generator. Implemented by App View."""
return _get_feed(self.call, feed, limit, cursor)

def describe_feed_generator(self) -> bytes:
"""Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View)."""
return _describe_feed_generator(self.call)

def get_likes(self, uri: str, cid: typing.Optional[str]=None, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get like records which reference a subject (by AT-URI and CID).
Expand All @@ -72,21 +72,21 @@ def get_likes(self, uri: str, cid: typing.Optional[str]=None, limit: typing.Opti
"""
return _get_likes(self.call, uri, cid, limit, cursor)

def get_post_thread(self, uri: str, depth: typing.Optional[int]=None, parent_height: typing.Optional[int]=None) -> bytes:
"""Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests.
def get_list_feed(self, list: str, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth.
:param uri: Reference (AT-URI) to post record.
:param list: Reference (AT-URI) to the list record.
"""
return _get_list_feed(self.call, list, limit, cursor)

:param depth: How many levels of reply depth should be included in response.
def get_timeline(self, algorithm: typing.Optional[str]=None, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed.
:param parent_height: How many levels of parent (and grandparent, etc) post to include.
"""
return _get_post_thread(self.call, uri, depth, parent_height)
def get_actor_likes(self, actor: str, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a list of posts liked by an actor. Requires auth, actor must be the requesting account."""
return _get_actor_likes(self.call, actor, limit, cursor)
:param algorithm: Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism.
"""
return _get_timeline(self.call, algorithm, limit, cursor)

def get_reposted_by(self, uri: str, cid: typing.Optional[str]=None, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a list of reposts for a given post.
Expand All @@ -98,10 +98,6 @@ def get_reposted_by(self, uri: str, cid: typing.Optional[str]=None, limit: typin
"""
return _get_reposted_by(self.call, uri, cid, limit, cursor)

def describe_feed_generator(self) -> bytes:
"""Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View)."""
return _describe_feed_generator(self.call)

def search_posts(self, q: str, sort: typing.Optional[typing.Literal['top', 'latest']]=None, since: typing.Optional[str]=None, until: typing.Optional[str]=None, mentions: typing.Optional[str]=None, author: typing.Optional[str]=None, lang: typing.Optional[str]=None, domain: typing.Optional[str]=None, url: typing.Optional[str]=None, tag: typing.Optional[list[str]]=None, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Find posts matching search criteria, returning views of those posts.
Expand Down Expand Up @@ -130,6 +126,14 @@ def search_posts(self, q: str, sort: typing.Optional[typing.Literal['top', 'late
"""
return _search_posts(self.call, q, sort, since, until, mentions, author, lang, domain, url, tag, limit, cursor)

def get_actor_likes(self, actor: str, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a list of posts liked by an actor. Requires auth, actor must be the requesting account."""
return _get_actor_likes(self.call, actor, limit, cursor)

def get_feed_generators(self, feeds: list[str]) -> bytes:
"""Get information about a list of feed generators."""
return _get_feed_generators(self.call, feeds)

def get_posts(self, uris: list[str]) -> bytes:
"""Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.
Expand All @@ -138,20 +142,6 @@ def get_posts(self, uris: list[str]) -> bytes:
"""
return _get_posts(self.call, uris)

def get_feed(self, feed: str, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a hydrated feed from an actor's selected feed generator. Implemented by App View."""
return _get_feed(self.call, feed, limit, cursor)

def get_quotes(self, uri: str, cid: typing.Optional[str]=None, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a list of quotes for a given post.
:param uri: Reference (AT-URI) of post record
:param cid: If supplied, filters to quotes of specific version (by CID) of the post record.
"""
return _get_quotes(self.call, uri, cid, limit, cursor)

def get_feed_skeleton(self, feed: str, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""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.
Expand All @@ -160,18 +150,28 @@ def get_feed_skeleton(self, feed: str, limit: typing.Optional[int]=None, cursor:
"""
return _get_feed_skeleton(self.call, feed, limit, cursor)

def get_list_feed(self, list: str, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth.
:param list: Reference (AT-URI) to the list record.
"""
return _get_list_feed(self.call, list, limit, cursor)

def get_suggested_feeds(self, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a list of suggested feeds (feed generators) for the requesting account."""
return _get_suggested_feeds(self.call, limit, cursor)

def get_actor_feeds(self, actor: str, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a list of feeds (feed generator records) created by the actor (in the actor's repo)."""
return _get_actor_feeds(self.call, actor, limit, cursor)
return _get_actor_feeds(self.call, actor, limit, cursor)

def get_feed_generator(self, feed: str) -> bytes:
"""Get information about a feed generator. Implemented by AppView.
:param feed: AT-URI of the feed generator record.
"""
return _get_feed_generator(self.call, feed)

def get_quotes(self, uri: str, cid: typing.Optional[str]=None, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes:
"""Get a list of quotes for a given post.
:param uri: Reference (AT-URI) of post record
:param cid: If supplied, filters to quotes of specific version (by CID) of the post record.
"""
return _get_quotes(self.call, uri, cid, limit, cursor)
Loading

0 comments on commit f8b3da2

Please sign in to comment.