Laravel AT Protocol Client (alpha & unstable)

Return type safe PostView DTO from get post endpoint

Changed files
+4 -3
src
Client
+4 -3
src/Client/Records/PostRecordClient.php
··· 10 10 use SocialDept\AtpClient\Enums\Nsid\BskyFeed; 11 11 use SocialDept\AtpClient\Enums\Scope; 12 12 use SocialDept\AtpClient\RichText\TextBuilder; 13 + use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\PostView; 13 14 14 15 class PostRecordClient extends Request 15 16 { ··· 89 90 record: $record 90 91 ); 91 92 92 - return StrongRef::fromResponse($response->json()); 93 + return StrongRef::fromResponse($response->toArray()); 93 94 } 94 95 95 96 /** ··· 114 115 * @requires transition:generic (rpc:com.atproto.repo.getRecord) 115 116 */ 116 117 #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.getRecord')] 117 - public function get(string $rkey, ?string $cid = null): array 118 + public function get(string $rkey, ?string $cid = null): PostView 118 119 { 119 120 $response = $this->atp->atproto->repo->getRecord( 120 121 repo: $this->atp->client->session()->did(), ··· 123 124 cid: $cid 124 125 ); 125 126 126 - return $response->json('value'); 127 + return PostView::fromArray($response->value); 127 128 } 128 129 129 130 /**