Something went wrong. Try again.
Laravel AT Protocol Client (alpha & unstable)
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287<?php
namespace SocialDept\AtpClient\Client\Requests\Bsky;
use SocialDept\AtpClient\Attributes\PublicEndpoint;use SocialDept\AtpClient\Attributes\ScopedEndpoint;use SocialDept\AtpClient\Client\Requests\Request;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\DescribeFeedGeneratorResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetActorFeedsResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetActorLikesResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetAuthorFeedResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetFeedGeneratorResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetFeedGeneratorsResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetFeedResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetLikesResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetPostsResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetPostThreadResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetQuotesResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetRepostedByResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetSuggestedFeedsResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetTimelineResponse;use SocialDept\AtpClient\Data\Responses\Bsky\Feed\SearchPostsResponse;use SocialDept\AtpClient\Enums\Nsid\BskyFeed;use SocialDept\AtpClient\Enums\Scope;
class FeedRequestClient extends Request{ /** * Describe feed generator * * @see https://docs.bsky.app/docs/api/app-bsky-feed-describe-feed-generator */ #[PublicEndpoint] public function describeFeedGenerator(): DescribeFeedGeneratorResponse { $response = $this->atp->client->get( endpoint: BskyFeed::DescribeFeedGenerator );
return DescribeFeedGeneratorResponse::fromArray($response->json()); }
/** * Get timeline feed (requires authentication) * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-timeline */ #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:app.bsky.feed.getTimeline')] public function getTimeline(int $limit = 50, ?string $cursor = null): GetTimelineResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetTimeline, params: compact('limit', 'cursor') );
return GetTimelineResponse::fromArray($response->json()); }
/** * Get author feed * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-author-feed */ #[PublicEndpoint] public function getAuthorFeed( string $actor, int $limit = 50, ?string $cursor = null, ?string $filter = null ): GetAuthorFeedResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetAuthorFeed, params: compact('actor', 'limit', 'cursor', 'filter') );
return GetAuthorFeedResponse::fromArray($response->json()); }
/** * Get feeds created by an actor * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-actor-feeds */ #[PublicEndpoint] public function getActorFeeds(string $actor, int $limit = 50, ?string $cursor = null): GetActorFeedsResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetActorFeeds, params: compact('actor', 'limit', 'cursor') );
return GetActorFeedsResponse::fromArray($response->json()); }
/** * Get posts liked by an actor * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-actor-likes */ #[PublicEndpoint] public function getActorLikes(string $actor, int $limit = 50, ?string $cursor = null): GetActorLikesResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetActorLikes, params: compact('actor', 'limit', 'cursor') );
return GetActorLikesResponse::fromArray($response->json()); }
/** * Get a feed * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-feed */ #[PublicEndpoint] public function getFeed(string $feed, int $limit = 50, ?string $cursor = null): GetFeedResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetFeed, params: compact('feed', 'limit', 'cursor') );
return GetFeedResponse::fromArray($response->json()); }
/** * Get a feed generator * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-feed-generator */ #[PublicEndpoint] public function getFeedGenerator(string $feed): GetFeedGeneratorResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetFeedGenerator, params: compact('feed') );
return GetFeedGeneratorResponse::fromArray($response->json()); }
/** * Get multiple feed generators * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-feed-generators */ #[PublicEndpoint] public function getFeedGenerators(array $feeds): GetFeedGeneratorsResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetFeedGenerators, params: compact('feeds') );
return GetFeedGeneratorsResponse::fromArray($response->json()); }
/** * Get post thread * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-post-thread */ #[PublicEndpoint] public function getPostThread(string $uri, int $depth = 6, int $parentHeight = 80): GetPostThreadResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetPostThread, params: compact('uri', 'depth', 'parentHeight') );
return GetPostThreadResponse::fromArray($response->json()); }
/** * Get multiple posts by URI * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-posts */ #[PublicEndpoint] public function getPosts(array $uris): GetPostsResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetPosts, params: compact('uris') );
return GetPostsResponse::fromArray($response->json()); }
/** * Get likes for a post * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-likes */ #[PublicEndpoint] public function getLikes( string $uri, int $limit = 50, ?string $cursor = null, ?string $cid = null ): GetLikesResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetLikes, params: compact('uri', 'limit', 'cursor', 'cid') );
return GetLikesResponse::fromArray($response->json()); }
/** * Get quotes of a post * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-quotes */ #[PublicEndpoint] public function getQuotes( string $uri, int $limit = 50, ?string $cursor = null, ?string $cid = null ): GetQuotesResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetQuotes, params: compact('uri', 'limit', 'cursor', 'cid') );
return GetQuotesResponse::fromArray($response->json()); }
/** * Get reposts for a post * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-reposted-by */ #[PublicEndpoint] public function getRepostedBy( string $uri, int $limit = 50, ?string $cursor = null, ?string $cid = null ): GetRepostedByResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetRepostedBy, params: compact('uri', 'limit', 'cursor', 'cid') );
return GetRepostedByResponse::fromArray($response->json()); }
/** * Get suggested feeds * * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-suggested-feeds */ #[PublicEndpoint] public function getSuggestedFeeds(int $limit = 50, ?string $cursor = null): GetSuggestedFeedsResponse { $response = $this->atp->client->get( endpoint: BskyFeed::GetSuggestedFeeds, params: compact('limit', 'cursor') );
return GetSuggestedFeedsResponse::fromArray($response->json()); }
/** * Search posts * * @see https://docs.bsky.app/docs/api/app-bsky-feed-search-posts */ #[PublicEndpoint] public function searchPosts( string $q, int $limit = 25, ?string $cursor = null, ?string $sort = null ): SearchPostsResponse { $response = $this->atp->client->get( endpoint: BskyFeed::SearchPosts, params: compact('q', 'limit', 'cursor', 'sort') );
return SearchPostsResponse::fromArray($response->json()); }}