Laravel AT Protocol Client (alpha & unstable)

Rename RequiresScope to ScopedEndpoint and fix public endpoint attributes

-37
src/Attributes/RequiresScope.php
··· 1 - <?php 2 - 3 - namespace SocialDept\AtpClient\Attributes; 4 - 5 - use Attribute; 6 - use SocialDept\AtpClient\Enums\Scope; 7 - 8 - #[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] 9 - class RequiresScope 10 - { 11 - public array $scopes; 12 - 13 - /** 14 - * @param string|Scope|array<string|Scope> $scopes Required scope(s) for this method 15 - * @param string|null $granular Future granular scope equivalent 16 - * @param string $description Human-readable description of scope requirement 17 - */ 18 - public function __construct( 19 - string|Scope|array $scopes, 20 - public readonly ?string $granular = null, 21 - public readonly string $description = '', 22 - ) { 23 - $this->scopes = $this->normalizeScopes($scopes); 24 - } 25 - 26 - protected function normalizeScopes(string|Scope|array $scopes): array 27 - { 28 - if (! is_array($scopes)) { 29 - $scopes = [$scopes]; 30 - } 31 - 32 - return array_map( 33 - fn ($scope) => $scope instanceof Scope ? $scope->value : $scope, 34 - $scopes 35 - ); 36 - } 37 - }
+6 -6
src/Client/Records/FollowRecordClient.php
··· 3 3 namespace SocialDept\AtpClient\Client\Records; 4 4 5 5 use DateTimeInterface; 6 - use SocialDept\AtpClient\Attributes\RequiresScope; 6 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 7 7 use SocialDept\AtpClient\Client\Requests\Request; 8 8 use SocialDept\AtpClient\Data\StrongRef; 9 9 use SocialDept\AtpClient\Enums\Nsid\BskyGraph; ··· 16 16 * 17 17 * @requires transition:generic OR (rpc:com.atproto.repo.createRecord AND repo:app.bsky.graph.follow?action=create) 18 18 */ 19 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 20 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.graph.follow?action=create')] 19 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 20 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.graph.follow?action=create')] 21 21 public function create( 22 22 string $subject, 23 23 ?DateTimeInterface $createdAt = null ··· 42 42 * 43 43 * @requires transition:generic OR (rpc:com.atproto.repo.deleteRecord AND repo:app.bsky.graph.follow?action=delete) 44 44 */ 45 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.deleteRecord')] 46 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.graph.follow?action=delete')] 45 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.deleteRecord')] 46 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.graph.follow?action=delete')] 47 47 public function delete(string $rkey): void 48 48 { 49 49 $this->atp->atproto->repo->deleteRecord( ··· 58 58 * 59 59 * @requires transition:generic (rpc:com.atproto.repo.getRecord) 60 60 */ 61 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.getRecord')] 61 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.getRecord')] 62 62 public function get(string $rkey, ?string $cid = null): array 63 63 { 64 64 $response = $this->atp->atproto->repo->getRecord(
+6 -6
src/Client/Records/LikeRecordClient.php
··· 3 3 namespace SocialDept\AtpClient\Client\Records; 4 4 5 5 use DateTimeInterface; 6 - use SocialDept\AtpClient\Attributes\RequiresScope; 6 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 7 7 use SocialDept\AtpClient\Client\Requests\Request; 8 8 use SocialDept\AtpClient\Data\StrongRef; 9 9 use SocialDept\AtpClient\Enums\Nsid\BskyFeed; ··· 16 16 * 17 17 * @requires transition:generic OR (rpc:com.atproto.repo.createRecord AND repo:app.bsky.feed.like?action=create) 18 18 */ 19 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 20 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.like?action=create')] 19 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 20 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.like?action=create')] 21 21 public function create( 22 22 StrongRef $subject, 23 23 ?DateTimeInterface $createdAt = null ··· 42 42 * 43 43 * @requires transition:generic OR (rpc:com.atproto.repo.deleteRecord AND repo:app.bsky.feed.like?action=delete) 44 44 */ 45 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.deleteRecord')] 46 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.like?action=delete')] 45 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.deleteRecord')] 46 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.like?action=delete')] 47 47 public function delete(string $rkey): void 48 48 { 49 49 $this->atp->atproto->repo->deleteRecord( ··· 58 58 * 59 59 * @requires transition:generic (rpc:com.atproto.repo.getRecord) 60 60 */ 61 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.getRecord')] 61 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.getRecord')] 62 62 public function get(string $rkey, ?string $cid = null): array 63 63 { 64 64 $response = $this->atp->atproto->repo->getRecord(
+16 -16
src/Client/Records/PostRecordClient.php
··· 3 3 namespace SocialDept\AtpClient\Client\Records; 4 4 5 5 use DateTimeInterface; 6 - use SocialDept\AtpClient\Attributes\RequiresScope; 6 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 7 7 use SocialDept\AtpClient\Client\Requests\Request; 8 8 use SocialDept\AtpClient\Contracts\Recordable; 9 9 use SocialDept\AtpClient\Data\StrongRef; ··· 19 19 * 20 20 * @requires transition:generic OR (rpc:com.atproto.repo.createRecord AND repo:app.bsky.feed.post?action=create) 21 21 */ 22 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 23 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=create')] 22 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 23 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=create')] 24 24 public function create( 25 25 string|array|Recordable $content, 26 26 ?array $facets = null, ··· 74 74 * 75 75 * @requires transition:generic OR (rpc:com.atproto.repo.putRecord AND repo:app.bsky.feed.post?action=update) 76 76 */ 77 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 78 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=update')] 77 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 78 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=update')] 79 79 public function update(string $rkey, array $record): StrongRef 80 80 { 81 81 // Ensure $type is set ··· 98 98 * 99 99 * @requires transition:generic OR (rpc:com.atproto.repo.deleteRecord AND repo:app.bsky.feed.post?action=delete) 100 100 */ 101 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.deleteRecord')] 102 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=delete')] 101 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.deleteRecord')] 102 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=delete')] 103 103 public function delete(string $rkey): void 104 104 { 105 105 $this->atp->atproto->repo->deleteRecord( ··· 114 114 * 115 115 * @requires transition:generic (rpc:com.atproto.repo.getRecord) 116 116 */ 117 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.getRecord')] 117 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.getRecord')] 118 118 public function get(string $rkey, ?string $cid = null): PostView 119 119 { 120 120 $response = $this->atp->atproto->repo->getRecord( ··· 132 132 * 133 133 * @requires transition:generic OR (rpc:com.atproto.repo.createRecord AND repo:app.bsky.feed.post?action=create) 134 134 */ 135 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 136 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=create')] 135 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 136 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=create')] 137 137 public function reply( 138 138 StrongRef $parent, 139 139 StrongRef $root, ··· 163 163 * 164 164 * @requires transition:generic OR (rpc:com.atproto.repo.createRecord AND repo:app.bsky.feed.post?action=create) 165 165 */ 166 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 167 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=create')] 166 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 167 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=create')] 168 168 public function quote( 169 169 StrongRef $quotedPost, 170 170 string|array|Recordable $content, ··· 191 191 * 192 192 * @requires transition:generic OR (rpc:com.atproto.repo.createRecord AND repo:app.bsky.feed.post?action=create) 193 193 */ 194 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 195 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=create')] 194 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 195 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=create')] 196 196 public function withImages( 197 197 string|array|Recordable $content, 198 198 array $images, ··· 219 219 * 220 220 * @requires transition:generic OR (rpc:com.atproto.repo.createRecord AND repo:app.bsky.feed.post?action=create) 221 221 */ 222 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 223 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=create')] 222 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.createRecord')] 223 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.feed.post?action=create')] 224 224 public function withLink( 225 225 string|array|Recordable $content, 226 226 string $uri,
+12 -12
src/Client/Records/ProfileRecordClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Records; 4 4 5 - use SocialDept\AtpClient\Attributes\RequiresScope; 5 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 6 6 use SocialDept\AtpClient\Client\Requests\Request; 7 7 use SocialDept\AtpClient\Data\StrongRef; 8 8 use SocialDept\AtpClient\Enums\Nsid\BskyActor; ··· 15 15 * 16 16 * @requires transition:generic OR (rpc:com.atproto.repo.putRecord AND repo:app.bsky.actor.profile?action=update) 17 17 */ 18 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 19 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.actor.profile?action=update')] 18 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 19 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.actor.profile?action=update')] 20 20 public function update(array $profile): StrongRef 21 21 { 22 22 // Ensure $type is set ··· 39 39 * 40 40 * @requires transition:generic (rpc:com.atproto.repo.getRecord) 41 41 */ 42 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.getRecord')] 42 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.getRecord')] 43 43 public function get(): array 44 44 { 45 45 $response = $this->atp->atproto->repo->getRecord( ··· 56 56 * 57 57 * @requires transition:generic OR (rpc:com.atproto.repo.putRecord AND repo:app.bsky.actor.profile?action=update) 58 58 */ 59 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 60 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.actor.profile?action=update')] 59 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 60 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.actor.profile?action=update')] 61 61 public function updateDisplayName(string $displayName): StrongRef 62 62 { 63 63 $profile = $this->getOrCreateProfile(); ··· 71 71 * 72 72 * @requires transition:generic OR (rpc:com.atproto.repo.putRecord AND repo:app.bsky.actor.profile?action=update) 73 73 */ 74 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 75 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.actor.profile?action=update')] 74 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 75 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.actor.profile?action=update')] 76 76 public function updateDescription(string $description): StrongRef 77 77 { 78 78 $profile = $this->getOrCreateProfile(); ··· 86 86 * 87 87 * @requires transition:generic OR (rpc:com.atproto.repo.putRecord AND repo:app.bsky.actor.profile?action=update) 88 88 */ 89 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 90 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.actor.profile?action=update')] 89 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 90 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.actor.profile?action=update')] 91 91 public function updateAvatar(array $avatarBlob): StrongRef 92 92 { 93 93 $profile = $this->getOrCreateProfile(); ··· 101 101 * 102 102 * @requires transition:generic OR (rpc:com.atproto.repo.putRecord AND repo:app.bsky.actor.profile?action=update) 103 103 */ 104 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 105 - #[RequiresScope(Scope::TransitionGeneric, granular: 'repo:app.bsky.actor.profile?action=update')] 104 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.putRecord')] 105 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'repo:app.bsky.actor.profile?action=update')] 106 106 public function updateBanner(array $bannerBlob): StrongRef 107 107 { 108 108 $profile = $this->getOrCreateProfile();
+4 -5
src/Client/Requests/Atproto/IdentityRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Atproto; 4 4 5 - use SocialDept\AtpClient\Attributes\RequiresScope; 5 + use SocialDept\AtpClient\Attributes\PublicEndpoint; 6 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 6 7 use SocialDept\AtpClient\Client\Requests\Request; 7 8 use SocialDept\AtpClient\Enums\Nsid\AtprotoIdentity; 8 9 use SocialDept\AtpClient\Enums\Scope; ··· 12 13 /** 13 14 * Resolve handle to DID 14 15 * 15 - * @requires transition:generic (rpc:com.atproto.identity.resolveHandle) 16 - * 17 16 * @see https://docs.bsky.app/docs/api/com-atproto-identity-resolve-handle 18 17 */ 19 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.identity.resolveHandle')] 18 + #[PublicEndpoint] 20 19 public function resolveHandle(string $handle): string 21 20 { 22 21 $response = $this->atp->client->get( ··· 34 33 * 35 34 * @see https://docs.bsky.app/docs/api/com-atproto-identity-update-handle 36 35 */ 37 - #[RequiresScope(Scope::Atproto, granular: 'identity:handle')] 36 + #[ScopedEndpoint(Scope::Atproto, granular: 'identity:handle')] 38 37 public function updateHandle(string $handle): void 39 38 { 40 39 $this->atp->client->post(
+9 -14
src/Client/Requests/Atproto/RepoRequestClient.php
··· 5 5 use BackedEnum; 6 6 use Illuminate\Http\UploadedFile; 7 7 use InvalidArgumentException; 8 - use SocialDept\AtpClient\Attributes\RequiresScope; 8 + use SocialDept\AtpClient\Attributes\PublicEndpoint; 9 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 9 10 use SocialDept\AtpClient\Auth\ScopeChecker; 10 11 use SocialDept\AtpClient\Client\Requests\Request; 11 12 use SocialDept\AtpClient\Data\Responses\Atproto\Repo\CreateRecordResponse; ··· 29 30 * 30 31 * @see https://docs.bsky.app/docs/api/com-atproto-repo-create-record 31 32 */ 32 - #[RequiresScope(Scope::TransitionGeneric, description: 'Create records in repository')] 33 + #[ScopedEndpoint(Scope::TransitionGeneric, description: 'Create records in repository')] 33 34 public function createRecord( 34 35 string $repo, 35 36 string|BackedEnum $collection, ··· 59 60 * 60 61 * @see https://docs.bsky.app/docs/api/com-atproto-repo-delete-record 61 62 */ 62 - #[RequiresScope(Scope::TransitionGeneric, description: 'Delete records from repository')] 63 + #[ScopedEndpoint(Scope::TransitionGeneric, description: 'Delete records from repository')] 63 64 public function deleteRecord( 64 65 string $repo, 65 66 string|BackedEnum $collection, ··· 88 89 * 89 90 * @see https://docs.bsky.app/docs/api/com-atproto-repo-put-record 90 91 */ 91 - #[RequiresScope(Scope::TransitionGeneric, description: 'Update records in repository')] 92 + #[ScopedEndpoint(Scope::TransitionGeneric, description: 'Update records in repository')] 92 93 public function putRecord( 93 94 string $repo, 94 95 string|BackedEnum $collection, ··· 115 116 /** 116 117 * Get a record 117 118 * 118 - * @requires transition:generic (rpc:com.atproto.repo.getRecord) 119 - * 120 119 * @see https://docs.bsky.app/docs/api/com-atproto-repo-get-record 121 120 */ 122 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.getRecord')] 121 + #[PublicEndpoint] 123 122 public function getRecord( 124 123 string $repo, 125 124 string|BackedEnum $collection, ··· 138 137 /** 139 138 * List records in a collection 140 139 * 141 - * @requires transition:generic (rpc:com.atproto.repo.listRecords) 142 - * 143 140 * @see https://docs.bsky.app/docs/api/com-atproto-repo-list-records 144 141 */ 145 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.listRecords')] 142 + #[PublicEndpoint] 146 143 public function listRecords( 147 144 string $repo, 148 145 string|BackedEnum $collection, ··· 173 170 * 174 171 * @see https://docs.bsky.app/docs/api/com-atproto-repo-upload-blob 175 172 */ 176 - #[RequiresScope(Scope::TransitionGeneric, granular: 'blob:*/*')] 173 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'blob:*/*')] 177 174 public function uploadBlob(UploadedFile|SplFileInfo|string $file, ?string $mimeType = null): BlobReference 178 175 { 179 176 // Handle different input types ··· 200 197 /** 201 198 * Describe the repository 202 199 * 203 - * @requires transition:generic (rpc:com.atproto.repo.describeRepo) 204 - * 205 200 * @see https://docs.bsky.app/docs/api/com-atproto-repo-describe-repo 206 201 */ 207 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.describeRepo')] 202 + #[PublicEndpoint] 208 203 public function describeRepo(string $repo): DescribeRepoResponse 209 204 { 210 205 $response = $this->atp->client->get(
+4 -5
src/Client/Requests/Atproto/ServerRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Atproto; 4 4 5 - use SocialDept\AtpClient\Attributes\RequiresScope; 5 + use SocialDept\AtpClient\Attributes\PublicEndpoint; 6 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 6 7 use SocialDept\AtpClient\Client\Requests\Request; 7 8 use SocialDept\AtpClient\Data\Responses\Atproto\Server\DescribeServerResponse; 8 9 use SocialDept\AtpClient\Data\Responses\Atproto\Server\GetSessionResponse; ··· 18 19 * 19 20 * @see https://docs.bsky.app/docs/api/com-atproto-server-get-session 20 21 */ 21 - #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.server.getSession')] 22 + #[ScopedEndpoint(Scope::Atproto, granular: 'rpc:com.atproto.server.getSession')] 22 23 public function getSession(): GetSessionResponse 23 24 { 24 25 $response = $this->atp->client->get( ··· 31 32 /** 32 33 * Describe server 33 34 * 34 - * @requires atproto (rpc:com.atproto.server.describeServer) 35 - * 36 35 * @see https://docs.bsky.app/docs/api/com-atproto-server-describe-server 37 36 */ 38 - #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.server.describeServer')] 37 + #[PublicEndpoint] 39 38 public function describeServer(): DescribeServerResponse 40 39 { 41 40 $response = $this->atp->client->get(
+10 -29
src/Client/Requests/Atproto/SyncRequestClient.php
··· 3 3 namespace SocialDept\AtpClient\Client\Requests\Atproto; 4 4 5 5 use BackedEnum; 6 - use SocialDept\AtpClient\Attributes\RequiresScope; 6 + use SocialDept\AtpClient\Attributes\PublicEndpoint; 7 7 use SocialDept\AtpClient\Client\Requests\Request; 8 8 use SocialDept\AtpClient\Data\Responses\Atproto\Sync\GetRepoStatusResponse; 9 9 use SocialDept\AtpClient\Data\Responses\Atproto\Sync\ListBlobsResponse; 10 10 use SocialDept\AtpClient\Data\Responses\Atproto\Sync\ListReposByCollectionResponse; 11 11 use SocialDept\AtpClient\Data\Responses\Atproto\Sync\ListReposResponse; 12 12 use SocialDept\AtpClient\Enums\Nsid\AtprotoSync; 13 - use SocialDept\AtpClient\Enums\Scope; 14 13 use SocialDept\AtpClient\Http\Response; 15 14 use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\Defs\CommitMeta; 16 15 ··· 18 17 { 19 18 /** 20 19 * Get a blob associated with a given account 21 - * 22 - * @requires atproto (rpc:com.atproto.sync.getBlob) 23 20 * 24 21 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-blob 25 22 */ 26 - #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getBlob')] 23 + #[PublicEndpoint] 27 24 public function getBlob(string $did, string $cid): Response 28 25 { 29 26 return $this->atp->client->get( ··· 35 32 /** 36 33 * Download a repository export as CAR file 37 34 * 38 - * @requires atproto (rpc:com.atproto.sync.getRepo) 39 - * 40 35 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-repo 41 36 */ 42 - #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getRepo')] 37 + #[PublicEndpoint] 43 38 public function getRepo(string $did, ?string $since = null): Response 44 39 { 45 40 return $this->atp->client->get( ··· 51 46 /** 52 47 * Enumerates all the DID, rev, and commit CID for all repos hosted by this service 53 48 * 54 - * @requires atproto (rpc:com.atproto.sync.listRepos) 55 - * 56 49 * @see https://docs.bsky.app/docs/api/com-atproto-sync-list-repos 57 50 */ 58 - #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.listRepos')] 51 + #[PublicEndpoint] 59 52 public function listRepos(int $limit = 500, ?string $cursor = null): ListReposResponse 60 53 { 61 54 $response = $this->atp->client->get( ··· 69 62 /** 70 63 * Enumerates all the DIDs with records in a specific collection 71 64 * 72 - * @requires atproto (rpc:com.atproto.sync.listReposByCollection) 73 - * 74 65 * @see https://docs.bsky.app/docs/api/com-atproto-sync-list-repos-by-collection 75 66 */ 76 - #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.listReposByCollection')] 67 + #[PublicEndpoint] 77 68 public function listReposByCollection( 78 69 string|BackedEnum $collection, 79 70 int $limit = 500, ··· 92 83 /** 93 84 * Get the current commit CID & revision of the specified repo 94 85 * 95 - * @requires atproto (rpc:com.atproto.sync.getLatestCommit) 96 - * 97 86 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-latest-commit 98 87 */ 99 - #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getLatestCommit')] 88 + #[PublicEndpoint] 100 89 public function getLatestCommit(string $did): CommitMeta 101 90 { 102 91 $response = $this->atp->client->get( ··· 109 98 110 99 /** 111 100 * Get data blocks needed to prove the existence or non-existence of record 112 - * 113 - * @requires atproto (rpc:com.atproto.sync.getRecord) 114 101 * 115 102 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-record 116 103 */ 117 - #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getRecord')] 104 + #[PublicEndpoint] 118 105 public function getRecord(string $did, string|BackedEnum $collection, string $rkey): Response 119 106 { 120 107 $collection = $collection instanceof BackedEnum ? $collection->value : $collection; ··· 128 115 /** 129 116 * List blob CIDs for an account, since some repo revision 130 117 * 131 - * @requires atproto (rpc:com.atproto.sync.listBlobs) 132 - * 133 118 * @see https://docs.bsky.app/docs/api/com-atproto-sync-list-blobs 134 119 */ 135 - #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.listBlobs')] 120 + #[PublicEndpoint] 136 121 public function listBlobs( 137 122 string $did, 138 123 ?string $since = null, ··· 150 135 /** 151 136 * Get data blocks from a given repo, by CID 152 137 * 153 - * @requires atproto (rpc:com.atproto.sync.getBlocks) 154 - * 155 138 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-blocks 156 139 */ 157 - #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getBlocks')] 140 + #[PublicEndpoint] 158 141 public function getBlocks(string $did, array $cids): Response 159 142 { 160 143 return $this->atp->client->get( ··· 166 149 /** 167 150 * Get the hosting status for a repository, on this server 168 151 * 169 - * @requires atproto (rpc:com.atproto.sync.getRepoStatus) 170 - * 171 152 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-repo-status 172 153 */ 173 - #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getRepoStatus')] 154 + #[PublicEndpoint] 174 155 public function getRepoStatus(string $did): GetRepoStatusResponse 175 156 { 176 157 $response = $this->atp->client->get(
+6
src/Client/Requests/Bsky/ActorRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Bsky; 4 4 5 + use SocialDept\AtpClient\Attributes\PublicEndpoint; 5 6 use SocialDept\AtpClient\Client\Requests\Request; 6 7 use SocialDept\AtpClient\Data\Responses\Bsky\Actor\GetProfilesResponse; 7 8 use SocialDept\AtpClient\Data\Responses\Bsky\Actor\GetSuggestionsResponse; ··· 17 18 * 18 19 * @see https://docs.bsky.app/docs/api/app-bsky-actor-get-profile 19 20 */ 21 + #[PublicEndpoint] 20 22 public function getProfile(string $actor): ProfileViewDetailed 21 23 { 22 24 $response = $this->atp->client->get( ··· 32 34 * 33 35 * @see https://docs.bsky.app/docs/api/app-bsky-actor-get-profiles 34 36 */ 37 + #[PublicEndpoint] 35 38 public function getProfiles(array $actors): GetProfilesResponse 36 39 { 37 40 $response = $this->atp->client->get( ··· 47 50 * 48 51 * @see https://docs.bsky.app/docs/api/app-bsky-actor-get-suggestions 49 52 */ 53 + #[PublicEndpoint] 50 54 public function getSuggestions(int $limit = 50, ?string $cursor = null): GetSuggestionsResponse 51 55 { 52 56 $response = $this->atp->client->get( ··· 62 66 * 63 67 * @see https://docs.bsky.app/docs/api/app-bsky-actor-search-actors 64 68 */ 69 + #[PublicEndpoint] 65 70 public function searchActors(string $q, int $limit = 25, ?string $cursor = null): SearchActorsResponse 66 71 { 67 72 $response = $this->atp->client->get( ··· 77 82 * 78 83 * @see https://docs.bsky.app/docs/api/app-bsky-actor-search-actors-typeahead 79 84 */ 85 + #[PublicEndpoint] 80 86 public function searchActorsTypeahead(string $q, int $limit = 10): SearchActorsTypeaheadResponse 81 87 { 82 88 $response = $this->atp->client->get(
+17 -2
src/Client/Requests/Bsky/FeedRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Bsky; 4 4 5 - use SocialDept\AtpClient\Attributes\RequiresScope; 5 + use SocialDept\AtpClient\Attributes\PublicEndpoint; 6 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 6 7 use SocialDept\AtpClient\Client\Requests\Request; 7 8 use SocialDept\AtpClient\Data\Responses\Bsky\Feed\DescribeFeedGeneratorResponse; 8 9 use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetActorFeedsResponse; ··· 29 30 * 30 31 * @see https://docs.bsky.app/docs/api/app-bsky-feed-describe-feed-generator 31 32 */ 33 + #[PublicEndpoint] 32 34 public function describeFeedGenerator(): DescribeFeedGeneratorResponse 33 35 { 34 36 $response = $this->atp->client->get( ··· 43 45 * 44 46 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-timeline 45 47 */ 46 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:app.bsky.feed.getTimeline')] 48 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:app.bsky.feed.getTimeline')] 47 49 public function getTimeline(int $limit = 50, ?string $cursor = null): GetTimelineResponse 48 50 { 49 51 $response = $this->atp->client->get( ··· 59 61 * 60 62 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-author-feed 61 63 */ 64 + #[PublicEndpoint] 62 65 public function getAuthorFeed( 63 66 string $actor, 64 67 int $limit = 50, ··· 78 81 * 79 82 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-actor-feeds 80 83 */ 84 + #[PublicEndpoint] 81 85 public function getActorFeeds(string $actor, int $limit = 50, ?string $cursor = null): GetActorFeedsResponse 82 86 { 83 87 $response = $this->atp->client->get( ··· 93 97 * 94 98 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-actor-likes 95 99 */ 100 + #[PublicEndpoint] 96 101 public function getActorLikes(string $actor, int $limit = 50, ?string $cursor = null): GetActorLikesResponse 97 102 { 98 103 $response = $this->atp->client->get( ··· 108 113 * 109 114 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-feed 110 115 */ 116 + #[PublicEndpoint] 111 117 public function getFeed(string $feed, int $limit = 50, ?string $cursor = null): GetFeedResponse 112 118 { 113 119 $response = $this->atp->client->get( ··· 123 129 * 124 130 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-feed-generator 125 131 */ 132 + #[PublicEndpoint] 126 133 public function getFeedGenerator(string $feed): GetFeedGeneratorResponse 127 134 { 128 135 $response = $this->atp->client->get( ··· 138 145 * 139 146 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-feed-generators 140 147 */ 148 + #[PublicEndpoint] 141 149 public function getFeedGenerators(array $feeds): GetFeedGeneratorsResponse 142 150 { 143 151 $response = $this->atp->client->get( ··· 153 161 * 154 162 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-post-thread 155 163 */ 164 + #[PublicEndpoint] 156 165 public function getPostThread(string $uri, int $depth = 6, int $parentHeight = 80): GetPostThreadResponse 157 166 { 158 167 $response = $this->atp->client->get( ··· 168 177 * 169 178 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-posts 170 179 */ 180 + #[PublicEndpoint] 171 181 public function getPosts(array $uris): GetPostsResponse 172 182 { 173 183 $response = $this->atp->client->get( ··· 183 193 * 184 194 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-likes 185 195 */ 196 + #[PublicEndpoint] 186 197 public function getLikes( 187 198 string $uri, 188 199 int $limit = 50, ··· 202 213 * 203 214 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-quotes 204 215 */ 216 + #[PublicEndpoint] 205 217 public function getQuotes( 206 218 string $uri, 207 219 int $limit = 50, ··· 221 233 * 222 234 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-reposted-by 223 235 */ 236 + #[PublicEndpoint] 224 237 public function getRepostedBy( 225 238 string $uri, 226 239 int $limit = 50, ··· 240 253 * 241 254 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-suggested-feeds 242 255 */ 256 + #[PublicEndpoint] 243 257 public function getSuggestedFeeds(int $limit = 50, ?string $cursor = null): GetSuggestedFeedsResponse 244 258 { 245 259 $response = $this->atp->client->get( ··· 255 269 * 256 270 * @see https://docs.bsky.app/docs/api/app-bsky-feed-search-posts 257 271 */ 272 + #[PublicEndpoint] 258 273 public function searchPosts( 259 274 string $q, 260 275 int $limit = 25,
+10
src/Client/Requests/Bsky/GraphRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Bsky; 4 4 5 + use SocialDept\AtpClient\Attributes\PublicEndpoint; 5 6 use SocialDept\AtpClient\Client\Requests\Request; 6 7 use SocialDept\AtpClient\Data\Responses\Bsky\Graph\GetFollowersResponse; 7 8 use SocialDept\AtpClient\Data\Responses\Bsky\Graph\GetFollowsResponse; ··· 21 22 * 22 23 * @see https://docs.bsky.app/docs/api/app-bsky-graph-get-followers 23 24 */ 25 + #[PublicEndpoint] 24 26 public function getFollowers(string $actor, int $limit = 50, ?string $cursor = null): GetFollowersResponse 25 27 { 26 28 $response = $this->atp->client->get( ··· 36 38 * 37 39 * @see https://docs.bsky.app/docs/api/app-bsky-graph-get-follows 38 40 */ 41 + #[PublicEndpoint] 39 42 public function getFollows(string $actor, int $limit = 50, ?string $cursor = null): GetFollowsResponse 40 43 { 41 44 $response = $this->atp->client->get( ··· 51 54 * 52 55 * @see https://docs.bsky.app/docs/api/app-bsky-graph-get-known-followers 53 56 */ 57 + #[PublicEndpoint] 54 58 public function getKnownFollowers(string $actor, int $limit = 50, ?string $cursor = null): GetKnownFollowersResponse 55 59 { 56 60 $response = $this->atp->client->get( ··· 66 70 * 67 71 * @see https://docs.bsky.app/docs/api/app-bsky-graph-get-list 68 72 */ 73 + #[PublicEndpoint] 69 74 public function getList(string $list, int $limit = 50, ?string $cursor = null): GetListResponse 70 75 { 71 76 $response = $this->atp->client->get( ··· 81 86 * 82 87 * @see https://docs.bsky.app/docs/api/app-bsky-graph-get-lists 83 88 */ 89 + #[PublicEndpoint] 84 90 public function getLists(string $actor, int $limit = 50, ?string $cursor = null): GetListsResponse 85 91 { 86 92 $response = $this->atp->client->get( ··· 96 102 * 97 103 * @see https://docs.bsky.app/docs/api/app-bsky-graph-get-relationships 98 104 */ 105 + #[PublicEndpoint] 99 106 public function getRelationships(string $actor, array $others = []): GetRelationshipsResponse 100 107 { 101 108 $response = $this->atp->client->get( ··· 111 118 * 112 119 * @see https://docs.bsky.app/docs/api/app-bsky-graph-get-starter-pack 113 120 */ 121 + #[PublicEndpoint] 114 122 public function getStarterPack(string $starterPack): StarterPackView 115 123 { 116 124 $response = $this->atp->client->get( ··· 126 134 * 127 135 * @see https://docs.bsky.app/docs/api/app-bsky-graph-get-starter-packs 128 136 */ 137 + #[PublicEndpoint] 129 138 public function getStarterPacks(array $uris): GetStarterPacksResponse 130 139 { 131 140 $response = $this->atp->client->get( ··· 141 150 * 142 151 * @see https://docs.bsky.app/docs/api/app-bsky-graph-get-suggested-follows-by-actor 143 152 */ 153 + #[PublicEndpoint] 144 154 public function getSuggestedFollowsByActor(string $actor): GetSuggestedFollowsByActorResponse 145 155 { 146 156 $response = $this->atp->client->get(
+2
src/Client/Requests/Bsky/LabelerRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Bsky; 4 4 5 + use SocialDept\AtpClient\Attributes\PublicEndpoint; 5 6 use SocialDept\AtpClient\Client\Requests\Request; 6 7 use SocialDept\AtpClient\Data\Responses\Bsky\Labeler\GetServicesResponse; 7 8 use SocialDept\AtpClient\Enums\Nsid\BskyLabeler; ··· 13 14 * 14 15 * @see https://docs.bsky.app/docs/api/app-bsky-labeler-get-services 15 16 */ 17 + #[PublicEndpoint] 16 18 public function getServices(array $dids, bool $detailed = false): GetServicesResponse 17 19 { 18 20 $response = $this->atp->client->get(
+4 -4
src/Client/Requests/Chat/ActorRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Chat; 4 4 5 - use SocialDept\AtpClient\Attributes\RequiresScope; 5 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 6 6 use SocialDept\AtpClient\Client\Requests\Request; 7 7 use SocialDept\AtpClient\Enums\Nsid\ChatActor; 8 8 use SocialDept\AtpClient\Enums\Scope; ··· 17 17 * 18 18 * @see https://docs.bsky.app/docs/api/chat-bsky-actor-export-account-data 19 19 */ 20 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.actor.getActorMetadata')] 20 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.actor.getActorMetadata')] 21 21 public function getActorMetadata(): Response 22 22 { 23 23 return $this->atp->client->get( ··· 32 32 * 33 33 * @see https://docs.bsky.app/docs/api/chat-bsky-actor-export-account-data 34 34 */ 35 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.actor.exportAccountData')] 35 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.actor.exportAccountData')] 36 36 public function exportAccountData(): Response 37 37 { 38 38 return $this->atp->client->get( ··· 47 47 * 48 48 * @see https://docs.bsky.app/docs/api/chat-bsky-actor-delete-account 49 49 */ 50 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.actor.deleteAccount')] 50 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.actor.deleteAccount')] 51 51 public function deleteAccount(): void 52 52 { 53 53 $this->atp->client->post(
+13 -13
src/Client/Requests/Chat/ConvoRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Chat; 4 4 5 - use SocialDept\AtpClient\Attributes\RequiresScope; 5 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 6 6 use SocialDept\AtpClient\Client\Requests\Request; 7 7 use SocialDept\AtpClient\Data\Responses\Chat\Convo\GetLogResponse; 8 8 use SocialDept\AtpClient\Data\Responses\Chat\Convo\GetMessagesResponse; ··· 24 24 * 25 25 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-get-convo 26 26 */ 27 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getConvo')] 27 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getConvo')] 28 28 public function getConvo(string $convoId): ConvoView 29 29 { 30 30 $response = $this->atp->client->get( ··· 42 42 * 43 43 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-get-convo-for-members 44 44 */ 45 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getConvoForMembers')] 45 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getConvoForMembers')] 46 46 public function getConvoForMembers(array $members): ConvoView 47 47 { 48 48 $response = $this->atp->client->get( ··· 60 60 * 61 61 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-list-convos 62 62 */ 63 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.listConvos')] 63 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.listConvos')] 64 64 public function listConvos(int $limit = 50, ?string $cursor = null): ListConvosResponse 65 65 { 66 66 $response = $this->atp->client->get( ··· 78 78 * 79 79 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-get-messages 80 80 */ 81 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getMessages')] 81 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getMessages')] 82 82 public function getMessages( 83 83 string $convoId, 84 84 int $limit = 50, ··· 99 99 * 100 100 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-send-message 101 101 */ 102 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.sendMessage')] 102 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.sendMessage')] 103 103 public function sendMessage(string $convoId, array $message): MessageView 104 104 { 105 105 $response = $this->atp->client->post( ··· 117 117 * 118 118 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-send-message-batch 119 119 */ 120 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.sendMessageBatch')] 120 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.sendMessageBatch')] 121 121 public function sendMessageBatch(array $items): SendMessageBatchResponse 122 122 { 123 123 $response = $this->atp->client->post( ··· 135 135 * 136 136 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-delete-message-for-self 137 137 */ 138 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.deleteMessageForSelf')] 138 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.deleteMessageForSelf')] 139 139 public function deleteMessageForSelf(string $convoId, string $messageId): DeletedMessageView 140 140 { 141 141 $response = $this->atp->client->post( ··· 153 153 * 154 154 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-update-read 155 155 */ 156 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.updateRead')] 156 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.updateRead')] 157 157 public function updateRead(string $convoId, ?string $messageId = null): ConvoView 158 158 { 159 159 $response = $this->atp->client->post( ··· 171 171 * 172 172 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-mute-convo 173 173 */ 174 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.muteConvo')] 174 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.muteConvo')] 175 175 public function muteConvo(string $convoId): ConvoView 176 176 { 177 177 $response = $this->atp->client->post( ··· 189 189 * 190 190 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-unmute-convo 191 191 */ 192 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.unmuteConvo')] 192 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.unmuteConvo')] 193 193 public function unmuteConvo(string $convoId): ConvoView 194 194 { 195 195 $response = $this->atp->client->post( ··· 207 207 * 208 208 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-leave-convo 209 209 */ 210 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.leaveConvo')] 210 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.leaveConvo')] 211 211 public function leaveConvo(string $convoId): LeaveConvoResponse 212 212 { 213 213 $response = $this->atp->client->post( ··· 225 225 * 226 226 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-get-log 227 227 */ 228 - #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getLog')] 228 + #[ScopedEndpoint(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getLog')] 229 229 public function getLog(?string $cursor = null): GetLogResponse 230 230 { 231 231 $response = $this->atp->client->get(
+9 -9
src/Client/Requests/Ozone/ModerationRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Ozone; 4 4 5 - use SocialDept\AtpClient\Attributes\RequiresScope; 5 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 6 6 use SocialDept\AtpClient\Client\Requests\Request; 7 7 use SocialDept\AtpClient\Data\Responses\Ozone\Moderation\QueryEventsResponse; 8 8 use SocialDept\AtpClient\Data\Responses\Ozone\Moderation\QueryStatusesResponse; ··· 24 24 * 25 25 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-get-event 26 26 */ 27 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getEvent')] 27 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getEvent')] 28 28 public function getModerationEvent(int $id): ModEventViewDetail 29 29 { 30 30 $response = $this->atp->client->get( ··· 42 42 * 43 43 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-query-events 44 44 */ 45 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getEvents')] 45 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getEvents')] 46 46 public function getModerationEvents( 47 47 ?string $subject = null, 48 48 ?array $types = null, ··· 66 66 * 67 67 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-get-record 68 68 */ 69 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getRecord')] 69 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getRecord')] 70 70 public function getRecord(string $uri, ?string $cid = null): RecordViewDetail 71 71 { 72 72 $response = $this->atp->client->get( ··· 84 84 * 85 85 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-get-repo 86 86 */ 87 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getRepo')] 87 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getRepo')] 88 88 public function getRepo(string $did): RepoViewDetail 89 89 { 90 90 $response = $this->atp->client->get( ··· 102 102 * 103 103 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-query-events 104 104 */ 105 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.queryEvents')] 105 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.queryEvents')] 106 106 public function queryEvents( 107 107 ?array $types = null, 108 108 ?string $createdBy = null, ··· 129 129 * 130 130 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-query-statuses 131 131 */ 132 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.queryStatuses')] 132 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.queryStatuses')] 133 133 public function queryStatuses( 134 134 ?string $subject = null, 135 135 ?array $tags = null, ··· 155 155 * 156 156 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-search-repos 157 157 */ 158 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.searchRepos')] 158 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.searchRepos')] 159 159 public function searchRepos( 160 160 ?string $term = null, 161 161 ?string $invitedBy = null, ··· 180 180 * 181 181 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-emit-event 182 182 */ 183 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.emitEvent')] 183 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.emitEvent')] 184 184 public function emitEvent( 185 185 array $event, 186 186 string $subject,
+3 -3
src/Client/Requests/Ozone/ServerRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Ozone; 4 4 5 - use SocialDept\AtpClient\Attributes\RequiresScope; 5 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 6 6 use SocialDept\AtpClient\Client\Requests\Request; 7 7 use SocialDept\AtpClient\Data\Responses\Ozone\Server\GetConfigResponse; 8 8 use SocialDept\AtpClient\Enums\Nsid\OzoneServer; ··· 18 18 * 19 19 * @see https://docs.bsky.app/docs/api/tools-ozone-server-get-config 20 20 */ 21 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.server.getBlob')] 21 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.server.getBlob')] 22 22 public function getBlob(string $did, string $cid): Response 23 23 { 24 24 return $this->atp->client->get( ··· 34 34 * 35 35 * @see https://docs.bsky.app/docs/api/tools-ozone-server-get-config 36 36 */ 37 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.server.getConfig')] 37 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.server.getConfig')] 38 38 public function getConfig(): GetConfigResponse 39 39 { 40 40 $response = $this->atp->client->get(
+6 -6
src/Client/Requests/Ozone/TeamRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Ozone; 4 4 5 - use SocialDept\AtpClient\Attributes\RequiresScope; 5 + use SocialDept\AtpClient\Attributes\ScopedEndpoint; 6 6 use SocialDept\AtpClient\Client\Requests\Request; 7 7 use SocialDept\AtpClient\Data\Responses\Ozone\Team\ListMembersResponse; 8 8 use SocialDept\AtpClient\Enums\Nsid\OzoneTeam; ··· 19 19 * 20 20 * @see https://docs.bsky.app/docs/api/tools-ozone-team-list-members 21 21 */ 22 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.getMember')] 22 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.getMember')] 23 23 public function getTeamMember(string $did): array 24 24 { 25 25 $response = $this->atp->client->get( ··· 37 37 * 38 38 * @see https://docs.bsky.app/docs/api/tools-ozone-team-list-members 39 39 */ 40 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.listMembers')] 40 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.listMembers')] 41 41 public function listTeamMembers(int $limit = 50, ?string $cursor = null): ListMembersResponse 42 42 { 43 43 $response = $this->atp->client->get( ··· 57 57 * 58 58 * @see https://docs.bsky.app/docs/api/tools-ozone-team-add-member 59 59 */ 60 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.addMember')] 60 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.addMember')] 61 61 public function addTeamMember(string $did, string $role): array 62 62 { 63 63 $response = $this->atp->client->post( ··· 77 77 * 78 78 * @see https://docs.bsky.app/docs/api/tools-ozone-team-update-member 79 79 */ 80 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.updateMember')] 80 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.updateMember')] 81 81 public function updateTeamMember( 82 82 string $did, 83 83 ?bool $disabled = null, ··· 101 101 * 102 102 * @see https://docs.bsky.app/docs/api/tools-ozone-team-delete-member 103 103 */ 104 - #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.deleteMember')] 104 + #[ScopedEndpoint(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.deleteMember')] 105 105 public function deleteTeamMember(string $did): void 106 106 { 107 107 $this->atp->client->post(