Skip to content

Commit

Permalink
Merge pull request #8 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 21, 2024
2 parents d781b03 + a540194 commit 2349235
Show file tree
Hide file tree
Showing 19 changed files with 471 additions and 471 deletions.
2 changes: 1 addition & 1 deletion atproto
Submodule atproto updated 63 files
+5 −0 .changeset/calm-shoes-own.md
+5 −0 .changeset/cold-zebras-peel.md
+5 −0 .changeset/dry-laws-jam.md
+5 −0 .changeset/flat-news-collect.md
+5 −0 .changeset/healthy-cats-unite.md
+5 −0 .changeset/honest-coats-add.md
+5 −0 .changeset/khaki-lemons-joke.md
+5 −0 .changeset/ninety-bees-beg.md
+5 −0 .changeset/quick-eyes-destroy.md
+6 −0 .changeset/rude-bees-design.md
+5 −0 .changeset/shy-sloths-doubt.md
+5 −0 .changeset/silly-carrots-build.md
+5 −0 .changeset/silver-boxes-teach.md
+5 −0 .changeset/slimy-bananas-promise.md
+5 −0 .changeset/stale-bears-talk.md
+5 −0 .changeset/sweet-dolls-chew.md
+6 −0 .changeset/tidy-frogs-peel.md
+5 −0 .changeset/tough-rabbits-wait.md
+5 −0 .changeset/warm-cougars-cheat.md
+5 −0 .changeset/weak-pants-beg.md
+5 −0 .changeset/wet-flowers-kneel.md
+1 −1 .github/workflows/build-and-push-pds-ghcr.yaml
+1 −1 package.json
+5 −0 packages/common-web/src/check.ts
+71 −39 packages/common-web/src/did-doc.ts
+15 −0 packages/common-web/src/util.ts
+89 −9 packages/common/src/streams.ts
+29 −2 packages/common/tests/streams.test.ts
+1 −1 packages/dev-env/src/pds.ts
+2 −1 packages/internal/fetch-node/src/index.ts
+26 −12 packages/internal/fetch-node/src/safe.ts
+0 −214 packages/internal/fetch-node/src/ssrf.ts
+202 −0 packages/internal/fetch-node/src/unicast.ts
+22 −0 packages/internal/fetch-node/src/util.ts
+41 −16 packages/internal/fetch/src/fetch-request.ts
+40 −12 packages/internal/fetch/src/fetch-wrap.ts
+7 −0 packages/internal/fetch/src/util.ts
+1 −0 packages/oauth/oauth-provider/package.json
+15 −6 packages/oauth/oauth-provider/src/lib/http/parser.ts
+16 −7 packages/oauth/oauth-provider/src/lib/http/request.ts
+10 −36 packages/oauth/oauth-provider/src/lib/http/stream.ts
+1 −0 packages/pds/package.json
+3 −17 packages/pds/src/api/app/bsky/actor/getProfile.ts
+3 −15 packages/pds/src/api/app/bsky/actor/getProfiles.ts
+3 −19 packages/pds/src/api/app/bsky/feed/getActorLikes.ts
+3 −17 packages/pds/src/api/app/bsky/feed/getAuthorFeed.ts
+3 −1 packages/pds/src/api/app/bsky/feed/getFeed.ts
+16 −23 packages/pds/src/api/app/bsky/feed/getPostThread.ts
+3 −14 packages/pds/src/api/app/bsky/feed/getTimeline.ts
+1 −1 packages/pds/src/api/com/atproto/repo/getRecord.ts
+21 −1 packages/pds/src/config/config.ts
+20 −2 packages/pds/src/config/env.ts
+62 −17 packages/pds/src/context.ts
+447 −223 packages/pds/src/pipethrough.ts
+50 −32 packages/pds/src/read-after-write/util.ts
+31 −1 packages/pds/tests/proxied/proxy-header.test.ts
+1 −7 packages/xrpc-server/src/index.ts
+78 −99 packages/xrpc-server/src/server.ts
+209 −41 packages/xrpc-server/src/types.ts
+80 −62 packages/xrpc-server/src/util.ts
+89 −0 packages/xrpc-server/tests/parsing.test.ts
+1 −0 packages/xrpc/src/types.ts
+72 −69 pnpm-lock.yaml
14 changes: 7 additions & 7 deletions chitose/app/bsky/actor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def search_actors(self, term: typing.Optional[str]=None, q: typing.Optional[str]
"""
return _search_actors(self.call, term, q, limit, cursor)

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_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.
Expand All @@ -47,18 +51,14 @@ def search_actors_typeahead(self, term: typing.Optional[str]=None, q: typing.Opt
"""
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 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_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)

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)
138 changes: 69 additions & 69 deletions chitose/app/bsky/feed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,43 +34,19 @@ 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_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 filter: Combinations of post/repost types to include in response.
"""
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 uri: Reference (AT-URI) to post record.
:param depth: How many levels of reply depth should be included in response.
: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_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_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_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).
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: AT-URI of the subject (eg, a post record).
:param uri: Reference (AT-URI) of post record
:param cid: CID of the subject record (aka, specific version of record), to filter likes.
:param cid: If supplied, filters to quotes of specific version (by CID) of the post record.
"""
return _get_likes(self.call, uri, cid, limit, cursor)
return _get_quotes(self.call, uri, cid, 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.
Expand All @@ -80,23 +56,9 @@ def get_list_feed(self, list: str, limit: typing.Optional[int]=None, cursor: typ
"""
return _get_list_feed(self.call, list, limit, cursor)

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 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.
:param uri: Reference (AT-URI) of post record
:param cid: If supplied, filters to reposts of specific version (by CID) of the post record.
"""
return _get_reposted_by(self.call, uri, cid, 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 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 @@ -126,21 +88,31 @@ 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_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_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'.
:param uri: Reference (AT-URI) to post record.
:param depth: How many levels of reply depth should be included in response.
:param uris: List of post AT-URIs to return hydrated views for.
:param parent_height: How many levels of parent (and grandparent, etc) post to include.
"""
return _get_posts(self.call, uris)
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 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).
:param uri: AT-URI of the subject (eg, a post record).
:param cid: CID of the subject record (aka, specific version of record), to filter likes.
"""
return _get_likes(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 @@ -150,13 +122,21 @@ def get_feed_skeleton(self, feed: str, limit: typing.Optional[int]=None, cursor:
"""
return _get_feed_skeleton(self.call, feed, 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_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_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)
: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_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 filter: Combinations of post/repost types to include in response.
"""
return _get_author_feed(self.call, actor, limit, cursor, filter)

def get_feed_generator(self, feed: str) -> bytes:
"""Get information about a feed generator. Implemented by AppView.
Expand All @@ -166,12 +146,32 @@ def get_feed_generator(self, feed: str) -> bytes:
"""
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.
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)

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_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'.
:param uris: List of post AT-URIs to return hydrated views for.
"""
return _get_posts(self.call, uris)

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_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.
:param uri: Reference (AT-URI) of post record
:param cid: If supplied, filters to quotes of specific version (by CID) of the post record.
:param cid: If supplied, filters to reposts of specific version (by CID) of the post record.
"""
return _get_quotes(self.call, uri, cid, limit, cursor)
return _get_reposted_by(self.call, uri, cid, limit, cursor)
Loading

0 comments on commit 2349235

Please sign in to comment.