Laravel AT Protocol Client (alpha & unstable)
3
fork

Configure Feed

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

Format Request classes with named parameters and break long lines

+349 -100
+8 -2
src/Client/Requests/Atproto/Identity.php
··· 12 12 */ 13 13 public function resolveHandle(string $handle): Response 14 14 { 15 - return $this->atp->client->get('com.atproto.identity.resolveHandle', compact('handle')); 15 + return $this->atp->client->get( 16 + endpoint: 'com.atproto.identity.resolveHandle', 17 + params: compact('handle') 18 + ); 16 19 } 17 20 18 21 /** ··· 20 23 */ 21 24 public function updateHandle(string $handle): Response 22 25 { 23 - return $this->atp->client->post('com.atproto.identity.updateHandle', compact('handle')); 26 + return $this->atp->client->post( 27 + endpoint: 'com.atproto.identity.updateHandle', 28 + body: compact('handle') 29 + ); 24 30 } 25 31 }
+74 -17
src/Client/Requests/Atproto/Repo.php
··· 10 10 /** 11 11 * Create a record 12 12 */ 13 - public function createRecord(string $repo, string $collection, array $record, ?string $rkey = null, bool $validate = true, ?string $swapCommit = null): Response 14 - { 15 - return $this->atp->client->post('com.atproto.repo.createRecord', array_filter(compact('repo', 'collection', 'record', 'rkey', 'validate', 'swapCommit'), fn ($v) => ! is_null($v))); 13 + public function createRecord( 14 + string $repo, 15 + string $collection, 16 + array $record, 17 + ?string $rkey = null, 18 + bool $validate = true, 19 + ?string $swapCommit = null 20 + ): Response { 21 + return $this->atp->client->post( 22 + endpoint: 'com.atproto.repo.createRecord', 23 + body: array_filter( 24 + compact('repo', 'collection', 'record', 'rkey', 'validate', 'swapCommit'), 25 + fn ($v) => ! is_null($v) 26 + ) 27 + ); 16 28 } 17 29 18 30 /** 19 31 * Delete a record 20 32 */ 21 - public function deleteRecord(string $repo, string $collection, string $rkey, ?string $swapRecord = null, ?string $swapCommit = null): Response 22 - { 23 - return $this->atp->client->post('com.atproto.repo.deleteRecord', array_filter(compact('repo', 'collection', 'rkey', 'swapRecord', 'swapCommit'), fn ($v) => ! is_null($v))); 33 + public function deleteRecord( 34 + string $repo, 35 + string $collection, 36 + string $rkey, 37 + ?string $swapRecord = null, 38 + ?string $swapCommit = null 39 + ): Response { 40 + return $this->atp->client->post( 41 + endpoint: 'com.atproto.repo.deleteRecord', 42 + body: array_filter( 43 + compact('repo', 'collection', 'rkey', 'swapRecord', 'swapCommit'), 44 + fn ($v) => ! is_null($v) 45 + ) 46 + ); 24 47 } 25 48 26 49 /** 27 50 * Put (upsert) a record 28 51 */ 29 - public function putRecord(string $repo, string $collection, string $rkey, array $record, bool $validate = true, ?string $swapRecord = null, ?string $swapCommit = null): Response 30 - { 31 - return $this->atp->client->post('com.atproto.repo.putRecord', array_filter(compact('repo', 'collection', 'rkey', 'record', 'validate', 'swapRecord', 'swapCommit'), fn ($v) => ! is_null($v))); 52 + public function putRecord( 53 + string $repo, 54 + string $collection, 55 + string $rkey, 56 + array $record, 57 + bool $validate = true, 58 + ?string $swapRecord = null, 59 + ?string $swapCommit = null 60 + ): Response { 61 + return $this->atp->client->post( 62 + endpoint: 'com.atproto.repo.putRecord', 63 + body: array_filter( 64 + compact('repo', 'collection', 'rkey', 'record', 'validate', 'swapRecord', 'swapCommit'), 65 + fn ($v) => ! is_null($v) 66 + ) 67 + ); 32 68 } 33 69 34 70 /** 35 71 * Get a record 36 72 */ 37 - public function getRecord(string $repo, string $collection, string $rkey, ?string $cid = null): Response 38 - { 39 - return $this->atp->client->get('com.atproto.repo.getRecord', compact('repo', 'collection', 'rkey', 'cid')); 73 + public function getRecord( 74 + string $repo, 75 + string $collection, 76 + string $rkey, 77 + ?string $cid = null 78 + ): Response { 79 + return $this->atp->client->get( 80 + endpoint: 'com.atproto.repo.getRecord', 81 + params: compact('repo', 'collection', 'rkey', 'cid') 82 + ); 40 83 } 41 84 42 85 /** 43 86 * List records in a collection 44 87 */ 45 - public function listRecords(string $repo, string $collection, int $limit = 50, ?string $cursor = null, bool $reverse = false): Response 46 - { 47 - return $this->atp->client->get('com.atproto.repo.listRecords', compact('repo', 'collection', 'limit', 'cursor', 'reverse')); 88 + public function listRecords( 89 + string $repo, 90 + string $collection, 91 + int $limit = 50, 92 + ?string $cursor = null, 93 + bool $reverse = false 94 + ): Response { 95 + return $this->atp->client->get( 96 + endpoint: 'com.atproto.repo.listRecords', 97 + params: compact('repo', 'collection', 'limit', 'cursor', 'reverse') 98 + ); 48 99 } 49 100 50 101 /** ··· 52 103 */ 53 104 public function uploadBlob(string $data, string $mimeType): Response 54 105 { 55 - return $this->atp->client->post('com.atproto.repo.uploadBlob', ['blob' => $data, 'mimeType' => $mimeType]); 106 + return $this->atp->client->post( 107 + endpoint: 'com.atproto.repo.uploadBlob', 108 + body: ['blob' => $data, 'mimeType' => $mimeType] 109 + ); 56 110 } 57 111 58 112 /** ··· 60 114 */ 61 115 public function describeRepo(string $repo): Response 62 116 { 63 - return $this->atp->client->get('com.atproto.repo.describeRepo', compact('repo')); 117 + return $this->atp->client->get( 118 + endpoint: 'com.atproto.repo.describeRepo', 119 + params: compact('repo') 120 + ); 64 121 } 65 122 }
+6 -2
src/Client/Requests/Atproto/Server.php
··· 12 12 */ 13 13 public function getSession(): Response 14 14 { 15 - return $this->atp->client->get('com.atproto.server.getSession'); 15 + return $this->atp->client->get( 16 + endpoint: 'com.atproto.server.getSession' 17 + ); 16 18 } 17 19 18 20 /** ··· 20 22 */ 21 23 public function describeServer(): Response 22 24 { 23 - return $this->atp->client->get('com.atproto.server.describeServer'); 25 + return $this->atp->client->get( 26 + endpoint: 'com.atproto.server.describeServer' 27 + ); 24 28 } 25 29 }
+25 -7
src/Client/Requests/Atproto/Sync.php
··· 12 12 */ 13 13 public function getBlob(string $did, string $cid): Response 14 14 { 15 - return $this->atp->client->get('com.atproto.sync.getBlob', compact('did', 'cid')); 15 + return $this->atp->client->get( 16 + endpoint: 'com.atproto.sync.getBlob', 17 + params: compact('did', 'cid') 18 + ); 16 19 } 17 20 18 21 /** ··· 20 23 */ 21 24 public function getCheckout(string $did): Response 22 25 { 23 - return $this->atp->client->get('com.atproto.sync.getCheckout', compact('did')); 26 + return $this->atp->client->get( 27 + endpoint: 'com.atproto.sync.getCheckout', 28 + params: compact('did') 29 + ); 24 30 } 25 31 26 32 /** 27 33 * Get commit path from sync 28 34 */ 29 - public function getCommitPath(string $did, ?string $latest = null, ?string $earliest = null): Response 30 - { 31 - return $this->atp->client->get('com.atproto.sync.getCommitPath', compact('did', 'latest', 'earliest')); 35 + public function getCommitPath( 36 + string $did, 37 + ?string $latest = null, 38 + ?string $earliest = null 39 + ): Response { 40 + return $this->atp->client->get( 41 + endpoint: 'com.atproto.sync.getCommitPath', 42 + params: compact('did', 'latest', 'earliest') 43 + ); 32 44 } 33 45 34 46 /** ··· 36 48 */ 37 49 public function getRepo(string $did, ?string $since = null): Response 38 50 { 39 - return $this->atp->client->get('com.atproto.sync.getRepo', compact('did', 'since')); 51 + return $this->atp->client->get( 52 + endpoint: 'com.atproto.sync.getRepo', 53 + params: compact('did', 'since') 54 + ); 40 55 } 41 56 42 57 /** ··· 44 59 */ 45 60 public function listRepos(int $limit = 500, ?string $cursor = null): Response 46 61 { 47 - return $this->atp->client->get('com.atproto.sync.listRepos', compact('limit', 'cursor')); 62 + return $this->atp->client->get( 63 + endpoint: 'com.atproto.sync.listRepos', 64 + params: compact('limit', 'cursor') 65 + ); 48 66 } 49 67 }
+4 -1
src/Client/Requests/Bsky/Actor.php
··· 12 12 */ 13 13 public function getProfile(string $actor): Response 14 14 { 15 - return $this->atp->client->get('app.bsky.actor.getProfile', compact('actor')); 15 + return $this->atp->client->get( 16 + endpoint: 'app.bsky.actor.getProfile', 17 + params: compact('actor') 18 + ); 16 19 } 17 20 }
+44 -14
src/Client/Requests/Bsky/Feed.php
··· 12 12 */ 13 13 public function getTimeline(int $limit = 50, ?string $cursor = null): Response 14 14 { 15 - return $this->atp->client->get('app.bsky.feed.getTimeline', compact('limit', 'cursor')); 15 + return $this->atp->client->get( 16 + endpoint: 'app.bsky.feed.getTimeline', 17 + params: compact('limit', 'cursor') 18 + ); 16 19 } 17 20 18 21 /** 19 22 * Get author feed 20 23 */ 21 - public function getAuthorFeed(string $actor, int $limit = 50, ?string $cursor = null): Response 22 - { 23 - return $this->atp->client->get('app.bsky.feed.getAuthorFeed', compact('actor', 'limit', 'cursor')); 24 + public function getAuthorFeed( 25 + string $actor, 26 + int $limit = 50, 27 + ?string $cursor = null 28 + ): Response { 29 + return $this->atp->client->get( 30 + endpoint: 'app.bsky.feed.getAuthorFeed', 31 + params: compact('actor', 'limit', 'cursor') 32 + ); 24 33 } 25 34 26 35 /** ··· 28 37 */ 29 38 public function getPostThread(string $uri, int $depth = 6): Response 30 39 { 31 - return $this->atp->client->get('app.bsky.feed.getPostThread', compact('uri', 'depth')); 40 + return $this->atp->client->get( 41 + endpoint: 'app.bsky.feed.getPostThread', 42 + params: compact('uri', 'depth') 43 + ); 32 44 } 33 45 34 46 /** 35 47 * Search posts 36 48 */ 37 - public function searchPosts(string $q, int $limit = 25, ?string $cursor = null): Response 38 - { 39 - return $this->atp->client->get('app.bsky.feed.searchPosts', compact('q', 'limit', 'cursor')); 49 + public function searchPosts( 50 + string $q, 51 + int $limit = 25, 52 + ?string $cursor = null 53 + ): Response { 54 + return $this->atp->client->get( 55 + endpoint: 'app.bsky.feed.searchPosts', 56 + params: compact('q', 'limit', 'cursor') 57 + ); 40 58 } 41 59 42 60 /** 43 61 * Get likes for a post 44 62 */ 45 - public function getLikes(string $uri, int $limit = 50, ?string $cursor = null): Response 46 - { 47 - return $this->atp->client->get('app.bsky.feed.getLikes', compact('uri', 'limit', 'cursor')); 63 + public function getLikes( 64 + string $uri, 65 + int $limit = 50, 66 + ?string $cursor = null 67 + ): Response { 68 + return $this->atp->client->get( 69 + endpoint: 'app.bsky.feed.getLikes', 70 + params: compact('uri', 'limit', 'cursor') 71 + ); 48 72 } 49 73 50 74 /** 51 75 * Get reposts for a post 52 76 */ 53 - public function getRepostedBy(string $uri, int $limit = 50, ?string $cursor = null): Response 54 - { 55 - return $this->atp->client->get('app.bsky.feed.getRepostedBy', compact('uri', 'limit', 'cursor')); 77 + public function getRepostedBy( 78 + string $uri, 79 + int $limit = 50, 80 + ?string $cursor = null 81 + ): Response { 82 + return $this->atp->client->get( 83 + endpoint: 'app.bsky.feed.getRepostedBy', 84 + params: compact('uri', 'limit', 'cursor') 85 + ); 56 86 } 57 87 }
+9 -3
src/Client/Requests/Chat/Actor.php
··· 12 12 */ 13 13 public function getActorMetadata(): Response 14 14 { 15 - return $this->atp->client->get('chat.bsky.actor.getActorMetadata'); 15 + return $this->atp->client->get( 16 + endpoint: 'chat.bsky.actor.getActorMetadata' 17 + ); 16 18 } 17 19 18 20 /** ··· 20 22 */ 21 23 public function exportAccountData(): Response 22 24 { 23 - return $this->atp->client->get('chat.bsky.actor.exportAccountData'); 25 + return $this->atp->client->get( 26 + endpoint: 'chat.bsky.actor.exportAccountData' 27 + ); 24 28 } 25 29 26 30 /** ··· 28 32 */ 29 33 public function deleteAccount(): Response 30 34 { 31 - return $this->atp->client->post('chat.bsky.actor.deleteAccount'); 35 + return $this->atp->client->post( 36 + endpoint: 'chat.bsky.actor.deleteAccount' 37 + ); 32 38 } 33 39 }
+53 -14
src/Client/Requests/Chat/Convo.php
··· 12 12 */ 13 13 public function getConvo(string $convoId): Response 14 14 { 15 - return $this->atp->client->get('chat.bsky.convo.getConvo', compact('convoId')); 15 + return $this->atp->client->get( 16 + endpoint: 'chat.bsky.convo.getConvo', 17 + params: compact('convoId') 18 + ); 16 19 } 17 20 18 21 /** ··· 20 23 */ 21 24 public function getConvoForMembers(array $members): Response 22 25 { 23 - return $this->atp->client->get('chat.bsky.convo.getConvoForMembers', compact('members')); 26 + return $this->atp->client->get( 27 + endpoint: 'chat.bsky.convo.getConvoForMembers', 28 + params: compact('members') 29 + ); 24 30 } 25 31 26 32 /** ··· 28 34 */ 29 35 public function listConvos(int $limit = 50, ?string $cursor = null): Response 30 36 { 31 - return $this->atp->client->get('chat.bsky.convo.listConvos', compact('limit', 'cursor')); 37 + return $this->atp->client->get( 38 + endpoint: 'chat.bsky.convo.listConvos', 39 + params: compact('limit', 'cursor') 40 + ); 32 41 } 33 42 34 43 /** 35 44 * Get messages 36 45 */ 37 - public function getMessages(string $convoId, int $limit = 50, ?string $cursor = null): Response 38 - { 39 - return $this->atp->client->get('chat.bsky.convo.getMessages', compact('convoId', 'limit', 'cursor')); 46 + public function getMessages( 47 + string $convoId, 48 + int $limit = 50, 49 + ?string $cursor = null 50 + ): Response { 51 + return $this->atp->client->get( 52 + endpoint: 'chat.bsky.convo.getMessages', 53 + params: compact('convoId', 'limit', 'cursor') 54 + ); 40 55 } 41 56 42 57 /** ··· 44 59 */ 45 60 public function sendMessage(string $convoId, array $message): Response 46 61 { 47 - return $this->atp->client->post('chat.bsky.convo.sendMessage', compact('convoId', 'message')); 62 + return $this->atp->client->post( 63 + endpoint: 'chat.bsky.convo.sendMessage', 64 + body: compact('convoId', 'message') 65 + ); 48 66 } 49 67 50 68 /** ··· 52 70 */ 53 71 public function sendMessageBatch(array $items): Response 54 72 { 55 - return $this->atp->client->post('chat.bsky.convo.sendMessageBatch', compact('items')); 73 + return $this->atp->client->post( 74 + endpoint: 'chat.bsky.convo.sendMessageBatch', 75 + body: compact('items') 76 + ); 56 77 } 57 78 58 79 /** ··· 60 81 */ 61 82 public function deleteMessageForSelf(string $convoId, string $messageId): Response 62 83 { 63 - return $this->atp->client->post('chat.bsky.convo.deleteMessageForSelf', compact('convoId', 'messageId')); 84 + return $this->atp->client->post( 85 + endpoint: 'chat.bsky.convo.deleteMessageForSelf', 86 + body: compact('convoId', 'messageId') 87 + ); 64 88 } 65 89 66 90 /** ··· 68 92 */ 69 93 public function updateRead(string $convoId, ?string $messageId = null): Response 70 94 { 71 - return $this->atp->client->post('chat.bsky.convo.updateRead', compact('convoId', 'messageId')); 95 + return $this->atp->client->post( 96 + endpoint: 'chat.bsky.convo.updateRead', 97 + body: compact('convoId', 'messageId') 98 + ); 72 99 } 73 100 74 101 /** ··· 76 103 */ 77 104 public function muteConvo(string $convoId): Response 78 105 { 79 - return $this->atp->client->post('chat.bsky.convo.muteConvo', compact('convoId')); 106 + return $this->atp->client->post( 107 + endpoint: 'chat.bsky.convo.muteConvo', 108 + body: compact('convoId') 109 + ); 80 110 } 81 111 82 112 /** ··· 84 114 */ 85 115 public function unmuteConvo(string $convoId): Response 86 116 { 87 - return $this->atp->client->post('chat.bsky.convo.unmuteConvo', compact('convoId')); 117 + return $this->atp->client->post( 118 + endpoint: 'chat.bsky.convo.unmuteConvo', 119 + body: compact('convoId') 120 + ); 88 121 } 89 122 90 123 /** ··· 92 125 */ 93 126 public function leaveConvo(string $convoId): Response 94 127 { 95 - return $this->atp->client->post('chat.bsky.convo.leaveConvo', compact('convoId')); 128 + return $this->atp->client->post( 129 + endpoint: 'chat.bsky.convo.leaveConvo', 130 + body: compact('convoId') 131 + ); 96 132 } 97 133 98 134 /** ··· 100 136 */ 101 137 public function getLog(?string $cursor = null): Response 102 138 { 103 - return $this->atp->client->get('chat.bsky.convo.getLog', compact('cursor')); 139 + return $this->atp->client->get( 140 + endpoint: 'chat.bsky.convo.getLog', 141 + params: compact('cursor') 142 + ); 104 143 } 105 144 }
+78 -18
src/Client/Requests/Ozone/Moderation.php
··· 12 12 */ 13 13 public function getModerationEvent(int $id): Response 14 14 { 15 - return $this->atp->client->get('tools.ozone.moderation.getEvent', compact('id')); 15 + return $this->atp->client->get( 16 + endpoint: 'tools.ozone.moderation.getEvent', 17 + params: compact('id') 18 + ); 16 19 } 17 20 18 21 /** 19 22 * Get moderation events 20 23 */ 21 - public function getModerationEvents(?string $subject = null, ?array $types = null, ?string $createdBy = null, int $limit = 50, ?string $cursor = null): Response 22 - { 23 - return $this->atp->client->get('tools.ozone.moderation.getEvents', array_filter(compact('subject', 'types', 'createdBy', 'limit', 'cursor'), fn ($v) => ! is_null($v))); 24 + public function getModerationEvents( 25 + ?string $subject = null, 26 + ?array $types = null, 27 + ?string $createdBy = null, 28 + int $limit = 50, 29 + ?string $cursor = null 30 + ): Response { 31 + return $this->atp->client->get( 32 + endpoint: 'tools.ozone.moderation.getEvents', 33 + params: array_filter( 34 + compact('subject', 'types', 'createdBy', 'limit', 'cursor'), 35 + fn ($v) => ! is_null($v) 36 + ) 37 + ); 24 38 } 25 39 26 40 /** ··· 28 42 */ 29 43 public function getRecord(string $uri, ?string $cid = null): Response 30 44 { 31 - return $this->atp->client->get('tools.ozone.moderation.getRecord', compact('uri', 'cid')); 45 + return $this->atp->client->get( 46 + endpoint: 'tools.ozone.moderation.getRecord', 47 + params: compact('uri', 'cid') 48 + ); 32 49 } 33 50 34 51 /** ··· 36 53 */ 37 54 public function getRepo(string $did): Response 38 55 { 39 - return $this->atp->client->get('tools.ozone.moderation.getRepo', compact('did')); 56 + return $this->atp->client->get( 57 + endpoint: 'tools.ozone.moderation.getRepo', 58 + params: compact('did') 59 + ); 40 60 } 41 61 42 62 /** 43 63 * Query events 44 64 */ 45 - public function queryEvents(?array $types = null, ?string $createdBy = null, ?string $subject = null, int $limit = 50, ?string $cursor = null, bool $sortDirection = false): Response 46 - { 47 - return $this->atp->client->get('tools.ozone.moderation.queryEvents', array_filter(compact('types', 'createdBy', 'subject', 'limit', 'cursor', 'sortDirection'), fn ($v) => ! is_null($v))); 65 + public function queryEvents( 66 + ?array $types = null, 67 + ?string $createdBy = null, 68 + ?string $subject = null, 69 + int $limit = 50, 70 + ?string $cursor = null, 71 + bool $sortDirection = false 72 + ): Response { 73 + return $this->atp->client->get( 74 + endpoint: 'tools.ozone.moderation.queryEvents', 75 + params: array_filter( 76 + compact('types', 'createdBy', 'subject', 'limit', 'cursor', 'sortDirection'), 77 + fn ($v) => ! is_null($v) 78 + ) 79 + ); 48 80 } 49 81 50 82 /** 51 83 * Query statuses 52 84 */ 53 - public function queryStatuses(?string $subject = null, ?array $tags = null, ?string $excludeTags = null, int $limit = 50, ?string $cursor = null): Response 54 - { 55 - return $this->atp->client->get('tools.ozone.moderation.queryStatuses', array_filter(compact('subject', 'tags', 'excludeTags', 'limit', 'cursor'), fn ($v) => ! is_null($v))); 85 + public function queryStatuses( 86 + ?string $subject = null, 87 + ?array $tags = null, 88 + ?string $excludeTags = null, 89 + int $limit = 50, 90 + ?string $cursor = null 91 + ): Response { 92 + return $this->atp->client->get( 93 + endpoint: 'tools.ozone.moderation.queryStatuses', 94 + params: array_filter( 95 + compact('subject', 'tags', 'excludeTags', 'limit', 'cursor'), 96 + fn ($v) => ! is_null($v) 97 + ) 98 + ); 56 99 } 57 100 58 101 /** 59 102 * Search repos 60 103 */ 61 - public function searchRepos(?string $term = null, ?string $invitedBy = null, int $limit = 50, ?string $cursor = null): Response 62 - { 63 - return $this->atp->client->get('tools.ozone.moderation.searchRepos', array_filter(compact('term', 'invitedBy', 'limit', 'cursor'), fn ($v) => ! is_null($v))); 104 + public function searchRepos( 105 + ?string $term = null, 106 + ?string $invitedBy = null, 107 + int $limit = 50, 108 + ?string $cursor = null 109 + ): Response { 110 + return $this->atp->client->get( 111 + endpoint: 'tools.ozone.moderation.searchRepos', 112 + params: array_filter( 113 + compact('term', 'invitedBy', 'limit', 'cursor'), 114 + fn ($v) => ! is_null($v) 115 + ) 116 + ); 64 117 } 65 118 66 119 /** 67 120 * Emit moderation event 68 121 */ 69 - public function emitEvent(array $event, string $subject, array $subjectBlobCids = [], ?string $createdBy = null): Response 70 - { 71 - return $this->atp->client->post('tools.ozone.moderation.emitEvent', compact('event', 'subject', 'subjectBlobCids', 'createdBy')); 122 + public function emitEvent( 123 + array $event, 124 + string $subject, 125 + array $subjectBlobCids = [], 126 + ?string $createdBy = null 127 + ): Response { 128 + return $this->atp->client->post( 129 + endpoint: 'tools.ozone.moderation.emitEvent', 130 + body: compact('event', 'subject', 'subjectBlobCids', 'createdBy') 131 + ); 72 132 } 73 133 }
+7 -2
src/Client/Requests/Ozone/Server.php
··· 12 12 */ 13 13 public function getBlob(string $did, string $cid): Response 14 14 { 15 - return $this->atp->client->get('tools.ozone.server.getBlob', compact('did', 'cid')); 15 + return $this->atp->client->get( 16 + endpoint: 'tools.ozone.server.getBlob', 17 + params: compact('did', 'cid') 18 + ); 16 19 } 17 20 18 21 /** ··· 20 23 */ 21 24 public function getConfig(): Response 22 25 { 23 - return $this->atp->client->get('tools.ozone.server.getConfig'); 26 + return $this->atp->client->get( 27 + endpoint: 'tools.ozone.server.getConfig' 28 + ); 24 29 } 25 30 }
+28 -7
src/Client/Requests/Ozone/Team.php
··· 12 12 */ 13 13 public function getTeamMember(string $did): Response 14 14 { 15 - return $this->atp->client->get('tools.ozone.team.getMember', compact('did')); 15 + return $this->atp->client->get( 16 + endpoint: 'tools.ozone.team.getMember', 17 + params: compact('did') 18 + ); 16 19 } 17 20 18 21 /** ··· 20 23 */ 21 24 public function listTeamMembers(int $limit = 50, ?string $cursor = null): Response 22 25 { 23 - return $this->atp->client->get('tools.ozone.team.listMembers', compact('limit', 'cursor')); 26 + return $this->atp->client->get( 27 + endpoint: 'tools.ozone.team.listMembers', 28 + params: compact('limit', 'cursor') 29 + ); 24 30 } 25 31 26 32 /** ··· 28 34 */ 29 35 public function addTeamMember(string $did, string $role): Response 30 36 { 31 - return $this->atp->client->post('tools.ozone.team.addMember', compact('did', 'role')); 37 + return $this->atp->client->post( 38 + endpoint: 'tools.ozone.team.addMember', 39 + body: compact('did', 'role') 40 + ); 32 41 } 33 42 34 43 /** 35 44 * Update team member 36 45 */ 37 - public function updateTeamMember(string $did, ?bool $disabled = null, ?string $role = null): Response 38 - { 39 - return $this->atp->client->post('tools.ozone.team.updateMember', array_filter(compact('did', 'disabled', 'role'), fn ($v) => ! is_null($v))); 46 + public function updateTeamMember( 47 + string $did, 48 + ?bool $disabled = null, 49 + ?string $role = null 50 + ): Response { 51 + return $this->atp->client->post( 52 + endpoint: 'tools.ozone.team.updateMember', 53 + body: array_filter( 54 + compact('did', 'disabled', 'role'), 55 + fn ($v) => ! is_null($v) 56 + ) 57 + ); 40 58 } 41 59 42 60 /** ··· 44 62 */ 45 63 public function deleteTeamMember(string $did): Response 46 64 { 47 - return $this->atp->client->post('tools.ozone.team.deleteMember', compact('did')); 65 + return $this->atp->client->post( 66 + endpoint: 'tools.ozone.team.deleteMember', 67 + body: compact('did') 68 + ); 48 69 } 49 70 }
+13 -13
src/Http/HasHttp.php
··· 23 23 * Make XRPC call 24 24 */ 25 25 protected function call( 26 - string $nsid, 26 + string $endpoint, 27 27 string $method, 28 28 ?array $params = null, 29 29 ?array $body = null ··· 32 32 $session = $this->sessions->ensureValid($this->identifier); 33 33 34 34 // Build URL 35 - $url = rtrim($session->pdsEndpoint(), '/').'/xrpc/'.$nsid; 35 + $url = rtrim($session->pdsEndpoint(), '/').'/xrpc/'.$endpoint; 36 36 37 37 // Get DPoP nonce 38 38 $nonce = $this->nonceManager->getNonce($session->pdsEndpoint()); ··· 70 70 } 71 71 72 72 // Validate response if schema exists 73 - if (Schema::exists($nsid)) { 74 - $this->validateResponse($nsid, $response); 73 + if (Schema::exists($endpoint)) { 74 + $this->validateResponse($endpoint, $response); 75 75 } 76 76 77 77 return new Response($response); ··· 80 80 /** 81 81 * Validate response against schema 82 82 */ 83 - protected function validateResponse(string $nsid, LaravelResponse $response): void 83 + protected function validateResponse(string $endpoint, LaravelResponse $response): void 84 84 { 85 85 if (! $response->successful()) { 86 86 return; // Don't validate error responses ··· 88 88 89 89 $data = $response->json(); 90 90 91 - if (! Schema::validate($nsid, $data)) { 92 - $errors = Schema::getErrors($nsid, $data); 91 + if (! Schema::validate($endpoint, $data)) { 92 + $errors = Schema::getErrors($endpoint, $data); 93 93 throw new ValidationException($errors); 94 94 } 95 95 } ··· 97 97 /** 98 98 * Make GET request 99 99 */ 100 - protected function get(string $nsid, array $params = []): Response 100 + protected function get(string $endpoint, array $params = []): Response 101 101 { 102 - return $this->call($nsid, 'GET', $params); 102 + return $this->call($endpoint, 'GET', $params); 103 103 } 104 104 105 105 /** 106 106 * Make POST request 107 107 */ 108 - protected function post(string $nsid, array $body = []): Response 108 + protected function post(string $endpoint, array $body = []): Response 109 109 { 110 - return $this->call($nsid, 'POST', null, $body); 110 + return $this->call($endpoint, 'POST', null, $body); 111 111 } 112 112 113 113 /** 114 114 * Make DELETE request 115 115 */ 116 - protected function delete(string $nsid, array $params = []): Response 116 + protected function delete(string $endpoint, array $params = []): Response 117 117 { 118 - return $this->call($nsid, 'DELETE', $params); 118 + return $this->call($endpoint, 'DELETE', $params); 119 119 } 120 120 }