Laravel AT Protocol Client (alpha & unstable)
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add RequiresScope attributes to all request clients

+190
+8
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 6 use SocialDept\AtpClient\Client\Requests\Request; 7 + use SocialDept\AtpClient\Enums\Scope; 6 8 use SocialDept\AtpClient\Http\Response; 7 9 8 10 class IdentityRequestClient extends Request 9 11 { 10 12 /** 11 13 * Resolve handle to DID 14 + * 15 + * @requires transition:generic (rpc:com.atproto.identity.resolveHandle) 12 16 * 13 17 * @see https://docs.bsky.app/docs/api/com-atproto-identity-resolve-handle 14 18 */ 19 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.identity.resolveHandle')] 15 20 public function resolveHandle(string $handle): Response 16 21 { 17 22 return $this->atp->client->get( ··· 23 28 /** 24 29 * Update handle 25 30 * 31 + * @requires atproto (identity:handle) 32 + * 26 33 * @see https://docs.bsky.app/docs/api/com-atproto-identity-update-handle 27 34 */ 35 + #[RequiresScope(Scope::Atproto, granular: 'identity:handle')] 28 36 public function updateHandle(string $handle): Response 29 37 { 30 38 return $this->atp->client->post(
+23
src/Client/Requests/Atproto/RepoRequestClient.php
··· 4 4 5 5 use Illuminate\Http\UploadedFile; 6 6 use InvalidArgumentException; 7 + use SocialDept\AtpClient\Attributes\RequiresScope; 7 8 use SocialDept\AtpClient\Client\Requests\Request; 9 + use SocialDept\AtpClient\Enums\Scope; 8 10 use SocialDept\AtpClient\Http\Response; 9 11 use SplFileInfo; 10 12 use Throwable; ··· 14 16 /** 15 17 * Create a record 16 18 * 19 + * @requires transition:generic (repo:[collection]?action=create) 20 + * 17 21 * @see https://docs.bsky.app/docs/api/com-atproto-repo-create-record 18 22 */ 23 + #[RequiresScope(Scope::TransitionGeneric, description: 'Create records in repository')] 19 24 public function createRecord( 20 25 string $repo, 21 26 string $collection, ··· 36 41 /** 37 42 * Delete a record 38 43 * 44 + * @requires transition:generic (repo:[collection]?action=delete) 45 + * 39 46 * @see https://docs.bsky.app/docs/api/com-atproto-repo-delete-record 40 47 */ 48 + #[RequiresScope(Scope::TransitionGeneric, description: 'Delete records from repository')] 41 49 public function deleteRecord( 42 50 string $repo, 43 51 string $collection, ··· 57 65 /** 58 66 * Put (upsert) a record 59 67 * 68 + * @requires transition:generic (repo:[collection]?action=update) 69 + * 60 70 * @see https://docs.bsky.app/docs/api/com-atproto-repo-put-record 61 71 */ 72 + #[RequiresScope(Scope::TransitionGeneric, description: 'Update records in repository')] 62 73 public function putRecord( 63 74 string $repo, 64 75 string $collection, ··· 80 91 /** 81 92 * Get a record 82 93 * 94 + * @requires transition:generic (rpc:com.atproto.repo.getRecord) 95 + * 83 96 * @see https://docs.bsky.app/docs/api/com-atproto-repo-get-record 84 97 */ 98 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.getRecord')] 85 99 public function getRecord( 86 100 string $repo, 87 101 string $collection, ··· 97 111 /** 98 112 * List records in a collection 99 113 * 114 + * @requires transition:generic (rpc:com.atproto.repo.listRecords) 115 + * 100 116 * @see https://docs.bsky.app/docs/api/com-atproto-repo-list-records 101 117 */ 118 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.listRecords')] 102 119 public function listRecords( 103 120 string $repo, 104 121 string $collection, ··· 117 134 * 118 135 * The blob will be deleted if it is not referenced within a time window. 119 136 * 137 + * @requires transition:generic (blob:*\/*\) 138 + * 120 139 * @param UploadedFile|SplFileInfo|string $file The file to upload 121 140 * @param string|null $mimeType MIME type (required for string input, auto-detected for file objects) 122 141 * ··· 124 143 * 125 144 * @see https://docs.bsky.app/docs/api/com-atproto-repo-upload-blob 126 145 */ 146 + #[RequiresScope(Scope::TransitionGeneric, granular: 'blob:*/*')] 127 147 public function uploadBlob(UploadedFile|SplFileInfo|string $file, ?string $mimeType = null): Response 128 148 { 129 149 // Handle different input types ··· 148 168 /** 149 169 * Describe the repository 150 170 * 171 + * @requires transition:generic (rpc:com.atproto.repo.describeRepo) 172 + * 151 173 * @see https://docs.bsky.app/docs/api/com-atproto-repo-describe-repo 152 174 */ 175 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.describeRepo')] 153 176 public function describeRepo(string $repo): Response 154 177 { 155 178 return $this->atp->client->get(
+8
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 6 use SocialDept\AtpClient\Client\Requests\Request; 7 + use SocialDept\AtpClient\Enums\Scope; 6 8 use SocialDept\AtpClient\Http\Response; 7 9 8 10 class ServerRequestClient extends Request 9 11 { 10 12 /** 11 13 * Get current session 14 + * 15 + * @requires atproto (rpc:com.atproto.server.getSession) 12 16 * 13 17 * @see https://docs.bsky.app/docs/api/com-atproto-server-get-session 14 18 */ 19 + #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.server.getSession')] 15 20 public function getSession(): Response 16 21 { 17 22 return $this->atp->client->get( ··· 22 27 /** 23 28 * Describe server 24 29 * 30 + * @requires atproto (rpc:com.atproto.server.describeServer) 31 + * 25 32 * @see https://docs.bsky.app/docs/api/com-atproto-server-describe-server 26 33 */ 34 + #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.server.describeServer')] 27 35 public function describeServer(): Response 28 36 { 29 37 return $this->atp->client->get(
+26
src/Client/Requests/Atproto/SyncRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Atproto; 4 4 5 + use SocialDept\AtpClient\Attributes\RequiresScope; 5 6 use SocialDept\AtpClient\Client\Requests\Request; 7 + use SocialDept\AtpClient\Enums\Scope; 6 8 use SocialDept\AtpClient\Http\Response; 7 9 8 10 class SyncRequestClient extends Request 9 11 { 10 12 /** 11 13 * Get a blob associated with a given account 14 + * 15 + * @requires atproto (rpc:com.atproto.sync.getBlob) 12 16 * 13 17 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-blob 14 18 */ 19 + #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getBlob')] 15 20 public function getBlob(string $did, string $cid): Response 16 21 { 17 22 return $this->atp->client->get( ··· 22 27 23 28 /** 24 29 * Download a repository export as CAR file 30 + * 31 + * @requires atproto (rpc:com.atproto.sync.getRepo) 25 32 * 26 33 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-repo 27 34 */ 35 + #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getRepo')] 28 36 public function getRepo(string $did, ?string $since = null): Response 29 37 { 30 38 return $this->atp->client->get( ··· 35 43 36 44 /** 37 45 * Enumerates all the DID, rev, and commit CID for all repos hosted by this service 46 + * 47 + * @requires atproto (rpc:com.atproto.sync.listRepos) 38 48 * 39 49 * @see https://docs.bsky.app/docs/api/com-atproto-sync-list-repos 40 50 */ 51 + #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.listRepos')] 41 52 public function listRepos(int $limit = 500, ?string $cursor = null): Response 42 53 { 43 54 return $this->atp->client->get( ··· 48 59 49 60 /** 50 61 * Get the current commit CID & revision of the specified repo 62 + * 63 + * @requires atproto (rpc:com.atproto.sync.getLatestCommit) 51 64 * 52 65 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-latest-commit 53 66 */ 67 + #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getLatestCommit')] 54 68 public function getLatestCommit(string $did): Response 55 69 { 56 70 return $this->atp->client->get( ··· 62 76 /** 63 77 * Get data blocks needed to prove the existence or non-existence of record 64 78 * 79 + * @requires atproto (rpc:com.atproto.sync.getRecord) 80 + * 65 81 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-record 66 82 */ 83 + #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getRecord')] 67 84 public function getRecord(string $did, string $collection, string $rkey): Response 68 85 { 69 86 return $this->atp->client->get( ··· 75 92 /** 76 93 * List blob CIDs for an account, since some repo revision 77 94 * 95 + * @requires atproto (rpc:com.atproto.sync.listBlobs) 96 + * 78 97 * @see https://docs.bsky.app/docs/api/com-atproto-sync-list-blobs 79 98 */ 99 + #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.listBlobs')] 80 100 public function listBlobs( 81 101 string $did, 82 102 ?string $since = null, ··· 92 112 /** 93 113 * Get data blocks from a given repo, by CID 94 114 * 115 + * @requires atproto (rpc:com.atproto.sync.getBlocks) 116 + * 95 117 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-blocks 96 118 */ 119 + #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getBlocks')] 97 120 public function getBlocks(string $did, array $cids): Response 98 121 { 99 122 return $this->atp->client->get( ··· 105 128 /** 106 129 * Get the hosting status for a repository, on this server 107 130 * 131 + * @requires atproto (rpc:com.atproto.sync.getRepoStatus) 132 + * 108 133 * @see https://docs.bsky.app/docs/api/com-atproto-sync-get-repo-status 109 134 */ 135 + #[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getRepoStatus')] 110 136 public function getRepoStatus(string $did): Response 111 137 { 112 138 return $this->atp->client->get(
+5
src/Client/Requests/Bsky/ActorRequestClient.php
··· 2 2 3 3 namespace SocialDept\AtpClient\Client\Requests\Bsky; 4 4 5 + use SocialDept\AtpClient\Attributes\RequiresScope; 5 6 use SocialDept\AtpClient\Client\Requests\Request; 7 + use SocialDept\AtpClient\Enums\Scope; 6 8 use SocialDept\AtpClient\Http\Response; 7 9 8 10 class ActorRequestClient extends Request ··· 10 12 /** 11 13 * Get actor profile 12 14 * 15 + * @requires transition:generic (rpc:app.bsky.actor.getProfile) 16 + * 13 17 * @see https://docs.bsky.app/docs/api/app-bsky-actor-get-profile 14 18 */ 19 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:app.bsky.actor.getProfile')] 15 20 public function getProfile(string $actor): Response 16 21 { 17 22 return $this->atp->client->get(
+20
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 6 use SocialDept\AtpClient\Client\Requests\Request; 7 + use SocialDept\AtpClient\Enums\Scope; 6 8 use SocialDept\AtpClient\Http\Response; 7 9 8 10 class FeedRequestClient extends Request ··· 10 12 /** 11 13 * Get timeline feed 12 14 * 15 + * @requires transition:generic (rpc:app.bsky.feed.getTimeline) 16 + * 13 17 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-timeline 14 18 */ 19 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:app.bsky.feed.getTimeline')] 15 20 public function getTimeline(int $limit = 50, ?string $cursor = null): Response 16 21 { 17 22 return $this->atp->client->get( ··· 23 28 /** 24 29 * Get author feed 25 30 * 31 + * @requires transition:generic (rpc:app.bsky.feed.getAuthorFeed) 32 + * 26 33 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-author-feed 27 34 */ 35 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:app.bsky.feed.getAuthorFeed')] 28 36 public function getAuthorFeed( 29 37 string $actor, 30 38 int $limit = 50, ··· 38 46 39 47 /** 40 48 * Get post thread 49 + * 50 + * @requires transition:generic (rpc:app.bsky.feed.getPostThread) 41 51 * 42 52 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-post-thread 43 53 */ 54 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:app.bsky.feed.getPostThread')] 44 55 public function getPostThread(string $uri, int $depth = 6): Response 45 56 { 46 57 return $this->atp->client->get( ··· 51 62 52 63 /** 53 64 * Search posts 65 + * 66 + * @requires transition:generic (rpc:app.bsky.feed.searchPosts) 54 67 * 55 68 * @see https://docs.bsky.app/docs/api/app-bsky-feed-search-posts 56 69 */ 70 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:app.bsky.feed.searchPosts')] 57 71 public function searchPosts( 58 72 string $q, 59 73 int $limit = 25, ··· 68 82 /** 69 83 * Get likes for a post 70 84 * 85 + * @requires transition:generic (rpc:app.bsky.feed.getLikes) 86 + * 71 87 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-likes 72 88 */ 89 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:app.bsky.feed.getLikes')] 73 90 public function getLikes( 74 91 string $uri, 75 92 int $limit = 50, ··· 84 101 /** 85 102 * Get reposts for a post 86 103 * 104 + * @requires transition:generic (rpc:app.bsky.feed.getRepostedBy) 105 + * 87 106 * @see https://docs.bsky.app/docs/api/app-bsky-feed-get-reposted-by 88 107 */ 108 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:app.bsky.feed.getRepostedBy')] 89 109 public function getRepostedBy( 90 110 string $uri, 91 111 int $limit = 50,
+11
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 6 use SocialDept\AtpClient\Client\Requests\Request; 7 + use SocialDept\AtpClient\Enums\Scope; 6 8 use SocialDept\AtpClient\Http\Response; 7 9 8 10 class ActorRequestClient extends Request ··· 10 12 /** 11 13 * Get actor metadata 12 14 * 15 + * @requires transition:chat.bsky (rpc:chat.bsky.actor.getActorMetadata) 16 + * 13 17 * @see https://docs.bsky.app/docs/api/chat-bsky-actor-export-account-data 14 18 */ 19 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.actor.getActorMetadata')] 15 20 public function getActorMetadata(): Response 16 21 { 17 22 return $this->atp->client->get( ··· 22 27 /** 23 28 * Export account data 24 29 * 30 + * @requires transition:chat.bsky (rpc:chat.bsky.actor.exportAccountData) 31 + * 25 32 * @see https://docs.bsky.app/docs/api/chat-bsky-actor-export-account-data 26 33 */ 34 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.actor.exportAccountData')] 27 35 public function exportAccountData(): Response 28 36 { 29 37 return $this->atp->client->get( ··· 34 42 /** 35 43 * Delete account 36 44 * 45 + * @requires transition:chat.bsky (rpc:chat.bsky.actor.deleteAccount) 46 + * 37 47 * @see https://docs.bsky.app/docs/api/chat-bsky-actor-delete-account 38 48 */ 49 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.actor.deleteAccount')] 39 50 public function deleteAccount(): Response 40 51 { 41 52 return $this->atp->client->post(
+38
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 6 use SocialDept\AtpClient\Client\Requests\Request; 7 + use SocialDept\AtpClient\Enums\Scope; 6 8 use SocialDept\AtpClient\Http\Response; 7 9 8 10 class ConvoRequestClient extends Request ··· 10 12 /** 11 13 * Get conversation 12 14 * 15 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.getConvo) 16 + * 13 17 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-get-convo 14 18 */ 19 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getConvo')] 15 20 public function getConvo(string $convoId): Response 16 21 { 17 22 return $this->atp->client->get( ··· 23 28 /** 24 29 * Get conversation for members 25 30 * 31 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.getConvoForMembers) 32 + * 26 33 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-get-convo-for-members 27 34 */ 35 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getConvoForMembers')] 28 36 public function getConvoForMembers(array $members): Response 29 37 { 30 38 return $this->atp->client->get( ··· 35 43 36 44 /** 37 45 * List conversations 46 + * 47 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.listConvos) 38 48 * 39 49 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-list-convos 40 50 */ 51 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.listConvos')] 41 52 public function listConvos(int $limit = 50, ?string $cursor = null): Response 42 53 { 43 54 return $this->atp->client->get( ··· 48 59 49 60 /** 50 61 * Get messages 62 + * 63 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.getMessages) 51 64 * 52 65 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-get-messages 53 66 */ 67 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getMessages')] 54 68 public function getMessages( 55 69 string $convoId, 56 70 int $limit = 50, ··· 65 79 /** 66 80 * Send message 67 81 * 82 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.sendMessage) 83 + * 68 84 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-send-message 69 85 */ 86 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.sendMessage')] 70 87 public function sendMessage(string $convoId, array $message): Response 71 88 { 72 89 return $this->atp->client->post( ··· 77 94 78 95 /** 79 96 * Send message batch 97 + * 98 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.sendMessageBatch) 80 99 * 81 100 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-send-message-batch 82 101 */ 102 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.sendMessageBatch')] 83 103 public function sendMessageBatch(array $items): Response 84 104 { 85 105 return $this->atp->client->post( ··· 90 110 91 111 /** 92 112 * Delete message for self 113 + * 114 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.deleteMessageForSelf) 93 115 * 94 116 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-delete-message-for-self 95 117 */ 118 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.deleteMessageForSelf')] 96 119 public function deleteMessageForSelf(string $convoId, string $messageId): Response 97 120 { 98 121 return $this->atp->client->post( ··· 104 127 /** 105 128 * Update read status 106 129 * 130 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.updateRead) 131 + * 107 132 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-update-read 108 133 */ 134 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.updateRead')] 109 135 public function updateRead(string $convoId, ?string $messageId = null): Response 110 136 { 111 137 return $this->atp->client->post( ··· 117 143 /** 118 144 * Mute conversation 119 145 * 146 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.muteConvo) 147 + * 120 148 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-mute-convo 121 149 */ 150 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.muteConvo')] 122 151 public function muteConvo(string $convoId): Response 123 152 { 124 153 return $this->atp->client->post( ··· 130 159 /** 131 160 * Unmute conversation 132 161 * 162 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.unmuteConvo) 163 + * 133 164 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-unmute-convo 134 165 */ 166 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.unmuteConvo')] 135 167 public function unmuteConvo(string $convoId): Response 136 168 { 137 169 return $this->atp->client->post( ··· 142 174 143 175 /** 144 176 * Leave conversation 177 + * 178 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.leaveConvo) 145 179 * 146 180 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-leave-convo 147 181 */ 182 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.leaveConvo')] 148 183 public function leaveConvo(string $convoId): Response 149 184 { 150 185 return $this->atp->client->post( ··· 156 191 /** 157 192 * Get log 158 193 * 194 + * @requires transition:chat.bsky (rpc:chat.bsky.convo.getLog) 195 + * 159 196 * @see https://docs.bsky.app/docs/api/chat-bsky-convo-get-log 160 197 */ 198 + #[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getLog')] 161 199 public function getLog(?string $cursor = null): Response 162 200 { 163 201 return $this->atp->client->get(
+26
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 6 use SocialDept\AtpClient\Client\Requests\Request; 7 + use SocialDept\AtpClient\Enums\Scope; 6 8 use SocialDept\AtpClient\Http\Response; 7 9 8 10 class ModerationRequestClient extends Request 9 11 { 10 12 /** 11 13 * Get moderation event 14 + * 15 + * @requires transition:generic (rpc:tools.ozone.moderation.getEvent) 12 16 * 13 17 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-get-event 14 18 */ 19 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getEvent')] 15 20 public function getModerationEvent(int $id): Response 16 21 { 17 22 return $this->atp->client->get( ··· 22 27 23 28 /** 24 29 * Get moderation events 30 + * 31 + * @requires transition:generic (rpc:tools.ozone.moderation.getEvents) 25 32 * 26 33 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-query-events 27 34 */ 35 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getEvents')] 28 36 public function getModerationEvents( 29 37 ?string $subject = null, 30 38 ?array $types = null, ··· 44 52 /** 45 53 * Get record 46 54 * 55 + * @requires transition:generic (rpc:tools.ozone.moderation.getRecord) 56 + * 47 57 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-get-record 48 58 */ 59 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getRecord')] 49 60 public function getRecord(string $uri, ?string $cid = null): Response 50 61 { 51 62 return $this->atp->client->get( ··· 56 67 57 68 /** 58 69 * Get repo 70 + * 71 + * @requires transition:generic (rpc:tools.ozone.moderation.getRepo) 59 72 * 60 73 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-get-repo 61 74 */ 75 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getRepo')] 62 76 public function getRepo(string $did): Response 63 77 { 64 78 return $this->atp->client->get( ··· 70 84 /** 71 85 * Query events 72 86 * 87 + * @requires transition:generic (rpc:tools.ozone.moderation.queryEvents) 88 + * 73 89 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-query-events 74 90 */ 91 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.queryEvents')] 75 92 public function queryEvents( 76 93 ?array $types = null, 77 94 ?string $createdBy = null, ··· 92 109 /** 93 110 * Query statuses 94 111 * 112 + * @requires transition:generic (rpc:tools.ozone.moderation.queryStatuses) 113 + * 95 114 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-query-statuses 96 115 */ 116 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.queryStatuses')] 97 117 public function queryStatuses( 98 118 ?string $subject = null, 99 119 ?array $tags = null, ··· 113 133 /** 114 134 * Search repos 115 135 * 136 + * @requires transition:generic (rpc:tools.ozone.moderation.searchRepos) 137 + * 116 138 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-search-repos 117 139 */ 140 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.searchRepos')] 118 141 public function searchRepos( 119 142 ?string $term = null, 120 143 ?string $invitedBy = null, ··· 133 156 /** 134 157 * Emit moderation event 135 158 * 159 + * @requires transition:generic (rpc:tools.ozone.moderation.emitEvent) 160 + * 136 161 * @see https://docs.bsky.app/docs/api/tools-ozone-moderation-emit-event 137 162 */ 163 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.emitEvent')] 138 164 public function emitEvent( 139 165 array $event, 140 166 string $subject,
+8
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 6 use SocialDept\AtpClient\Client\Requests\Request; 7 + use SocialDept\AtpClient\Enums\Scope; 6 8 use SocialDept\AtpClient\Http\Response; 7 9 8 10 class ServerRequestClient extends Request 9 11 { 10 12 /** 11 13 * Get blob 14 + * 15 + * @requires transition:generic (rpc:tools.ozone.server.getBlob) 12 16 * 13 17 * @see https://docs.bsky.app/docs/api/tools-ozone-server-get-config 14 18 */ 19 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.server.getBlob')] 15 20 public function getBlob(string $did, string $cid): Response 16 21 { 17 22 return $this->atp->client->get( ··· 23 28 /** 24 29 * Get config 25 30 * 31 + * @requires transition:generic (rpc:tools.ozone.server.getConfig) 32 + * 26 33 * @see https://docs.bsky.app/docs/api/tools-ozone-server-get-config 27 34 */ 35 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.server.getConfig')] 28 36 public function getConfig(): Response 29 37 { 30 38 return $this->atp->client->get(
+17
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 6 use SocialDept\AtpClient\Client\Requests\Request; 7 + use SocialDept\AtpClient\Enums\Scope; 6 8 use SocialDept\AtpClient\Http\Response; 7 9 8 10 class TeamRequestClient extends Request ··· 10 12 /** 11 13 * Get team member 12 14 * 15 + * @requires transition:generic (rpc:tools.ozone.team.getMember) 16 + * 13 17 * @see https://docs.bsky.app/docs/api/tools-ozone-team-list-members 14 18 */ 19 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.getMember')] 15 20 public function getTeamMember(string $did): Response 16 21 { 17 22 return $this->atp->client->get( ··· 23 28 /** 24 29 * List team members 25 30 * 31 + * @requires transition:generic (rpc:tools.ozone.team.listMembers) 32 + * 26 33 * @see https://docs.bsky.app/docs/api/tools-ozone-team-list-members 27 34 */ 35 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.listMembers')] 28 36 public function listTeamMembers(int $limit = 50, ?string $cursor = null): Response 29 37 { 30 38 return $this->atp->client->get( ··· 36 44 /** 37 45 * Add team member 38 46 * 47 + * @requires transition:generic (rpc:tools.ozone.team.addMember) 48 + * 39 49 * @see https://docs.bsky.app/docs/api/tools-ozone-team-add-member 40 50 */ 51 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.addMember')] 41 52 public function addTeamMember(string $did, string $role): Response 42 53 { 43 54 return $this->atp->client->post( ··· 48 59 49 60 /** 50 61 * Update team member 62 + * 63 + * @requires transition:generic (rpc:tools.ozone.team.updateMember) 51 64 * 52 65 * @see https://docs.bsky.app/docs/api/tools-ozone-team-update-member 53 66 */ 67 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.updateMember')] 54 68 public function updateTeamMember( 55 69 string $did, 56 70 ?bool $disabled = null, ··· 68 82 /** 69 83 * Delete team member 70 84 * 85 + * @requires transition:generic (rpc:tools.ozone.team.deleteMember) 86 + * 71 87 * @see https://docs.bsky.app/docs/api/tools-ozone-team-delete-member 72 88 */ 89 + #[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.deleteMember')] 73 90 public function deleteTeamMember(string $did): Response 74 91 { 75 92 return $this->atp->client->post(