+4
-3
src/Client/Public/Requests/Atproto/IdentityPublicRequestClient.php
+4
-3
src/Client/Public/Requests/Atproto/IdentityPublicRequestClient.php
···
3
3
namespace SocialDept\AtpClient\Client\Public\Requests\Atproto;
4
4
5
5
use SocialDept\AtpClient\Client\Public\Requests\PublicRequest;
6
-
use SocialDept\AtpClient\Http\Response;
7
6
8
7
class IdentityPublicRequestClient extends PublicRequest
9
8
{
10
-
public function resolveHandle(string $handle): Response
9
+
public function resolveHandle(string $handle): string
11
10
{
12
-
return $this->atp->client->get('com.atproto.identity.resolveHandle', compact('handle'));
11
+
$response = $this->atp->client->get('com.atproto.identity.resolveHandle', compact('handle'));
12
+
13
+
return $response->json()['did'];
13
14
}
14
15
}
+25
-11
src/Client/Public/Requests/Bsky/ActorPublicRequestClient.php
+25
-11
src/Client/Public/Requests/Bsky/ActorPublicRequestClient.php
···
3
3
namespace SocialDept\AtpClient\Client\Public\Requests\Bsky;
4
4
5
5
use SocialDept\AtpClient\Client\Public\Requests\PublicRequest;
6
-
use SocialDept\AtpClient\Http\Response;
6
+
use SocialDept\AtpClient\Data\Responses\Bsky\Actor\GetProfilesResponse;
7
+
use SocialDept\AtpClient\Data\Responses\Bsky\Actor\GetSuggestionsResponse;
8
+
use SocialDept\AtpClient\Data\Responses\Bsky\Actor\SearchActorsResponse;
9
+
use SocialDept\AtpClient\Data\Responses\Bsky\Actor\SearchActorsTypeaheadResponse;
10
+
use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewDetailed;
7
11
8
12
class ActorPublicRequestClient extends PublicRequest
9
13
{
10
-
public function getProfile(string $actor): Response
14
+
public function getProfile(string $actor): ProfileViewDetailed
11
15
{
12
-
return $this->atp->client->get('app.bsky.actor.getProfile', compact('actor'));
16
+
$response = $this->atp->client->get('app.bsky.actor.getProfile', compact('actor'));
17
+
18
+
return ProfileViewDetailed::fromArray($response->json());
13
19
}
14
20
15
-
public function getProfiles(array $actors): Response
21
+
public function getProfiles(array $actors): GetProfilesResponse
16
22
{
17
-
return $this->atp->client->get('app.bsky.actor.getProfiles', compact('actors'));
23
+
$response = $this->atp->client->get('app.bsky.actor.getProfiles', compact('actors'));
24
+
25
+
return GetProfilesResponse::fromArray($response->json());
18
26
}
19
27
20
-
public function getSuggestions(int $limit = 50, ?string $cursor = null): Response
28
+
public function getSuggestions(int $limit = 50, ?string $cursor = null): GetSuggestionsResponse
21
29
{
22
-
return $this->atp->client->get('app.bsky.actor.getSuggestions', compact('limit', 'cursor'));
30
+
$response = $this->atp->client->get('app.bsky.actor.getSuggestions', compact('limit', 'cursor'));
31
+
32
+
return GetSuggestionsResponse::fromArray($response->json());
23
33
}
24
34
25
-
public function searchActors(string $q, int $limit = 25, ?string $cursor = null): Response
35
+
public function searchActors(string $q, int $limit = 25, ?string $cursor = null): SearchActorsResponse
26
36
{
27
-
return $this->atp->client->get('app.bsky.actor.searchActors', compact('q', 'limit', 'cursor'));
37
+
$response = $this->atp->client->get('app.bsky.actor.searchActors', compact('q', 'limit', 'cursor'));
38
+
39
+
return SearchActorsResponse::fromArray($response->json());
28
40
}
29
41
30
-
public function searchActorsTypeahead(string $q, int $limit = 10): Response
42
+
public function searchActorsTypeahead(string $q, int $limit = 10): SearchActorsTypeaheadResponse
31
43
{
32
-
return $this->atp->client->get('app.bsky.actor.searchActorsTypeahead', compact('q', 'limit'));
44
+
$response = $this->atp->client->get('app.bsky.actor.searchActorsTypeahead', compact('q', 'limit'));
45
+
46
+
return SearchActorsTypeaheadResponse::fromArray($response->json());
33
47
}
34
48
}
+70
-29
src/Client/Public/Requests/Bsky/FeedPublicRequestClient.php
+70
-29
src/Client/Public/Requests/Bsky/FeedPublicRequestClient.php
···
3
3
namespace SocialDept\AtpClient\Client\Public\Requests\Bsky;
4
4
5
5
use SocialDept\AtpClient\Client\Public\Requests\PublicRequest;
6
-
use SocialDept\AtpClient\Http\Response;
6
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\DescribeFeedGeneratorResponse;
7
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetActorFeedsResponse;
8
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetActorLikesResponse;
9
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetAuthorFeedResponse;
10
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetFeedGeneratorResponse;
11
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetFeedGeneratorsResponse;
12
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetFeedResponse;
13
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetLikesResponse;
14
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetPostsResponse;
15
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetPostThreadResponse;
16
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetQuotesResponse;
17
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetRepostedByResponse;
18
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetSuggestedFeedsResponse;
19
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\SearchPostsResponse;
7
20
8
21
class FeedPublicRequestClient extends PublicRequest
9
22
{
10
-
public function describeFeedGenerator(): Response
23
+
public function describeFeedGenerator(): DescribeFeedGeneratorResponse
11
24
{
12
-
return $this->atp->client->get('app.bsky.feed.describeFeedGenerator');
25
+
$response = $this->atp->client->get('app.bsky.feed.describeFeedGenerator');
26
+
27
+
return DescribeFeedGeneratorResponse::fromArray($response->json());
13
28
}
14
29
15
-
public function getAuthorFeed(string $actor, int $limit = 50, ?string $cursor = null, ?string $filter = null): Response
30
+
public function getAuthorFeed(string $actor, int $limit = 50, ?string $cursor = null, ?string $filter = null): GetAuthorFeedResponse
16
31
{
17
-
return $this->atp->client->get('app.bsky.feed.getAuthorFeed', compact('actor', 'limit', 'cursor', 'filter'));
32
+
$response = $this->atp->client->get('app.bsky.feed.getAuthorFeed', compact('actor', 'limit', 'cursor', 'filter'));
33
+
34
+
return GetAuthorFeedResponse::fromArray($response->json());
18
35
}
19
36
20
-
public function getActorFeeds(string $actor, int $limit = 50, ?string $cursor = null): Response
37
+
public function getActorFeeds(string $actor, int $limit = 50, ?string $cursor = null): GetActorFeedsResponse
21
38
{
22
-
return $this->atp->client->get('app.bsky.feed.getActorFeeds', compact('actor', 'limit', 'cursor'));
39
+
$response = $this->atp->client->get('app.bsky.feed.getActorFeeds', compact('actor', 'limit', 'cursor'));
40
+
41
+
return GetActorFeedsResponse::fromArray($response->json());
23
42
}
24
43
25
-
public function getActorLikes(string $actor, int $limit = 50, ?string $cursor = null): Response
44
+
public function getActorLikes(string $actor, int $limit = 50, ?string $cursor = null): GetActorLikesResponse
26
45
{
27
-
return $this->atp->client->get('app.bsky.feed.getActorLikes', compact('actor', 'limit', 'cursor'));
46
+
$response = $this->atp->client->get('app.bsky.feed.getActorLikes', compact('actor', 'limit', 'cursor'));
47
+
48
+
return GetActorLikesResponse::fromArray($response->json());
28
49
}
29
50
30
-
public function getFeed(string $feed, int $limit = 50, ?string $cursor = null): Response
51
+
public function getFeed(string $feed, int $limit = 50, ?string $cursor = null): GetFeedResponse
31
52
{
32
-
return $this->atp->client->get('app.bsky.feed.getFeed', compact('feed', 'limit', 'cursor'));
53
+
$response = $this->atp->client->get('app.bsky.feed.getFeed', compact('feed', 'limit', 'cursor'));
54
+
55
+
return GetFeedResponse::fromArray($response->json());
33
56
}
34
57
35
-
public function getFeedGenerator(string $feed): Response
58
+
public function getFeedGenerator(string $feed): GetFeedGeneratorResponse
36
59
{
37
-
return $this->atp->client->get('app.bsky.feed.getFeedGenerator', compact('feed'));
60
+
$response = $this->atp->client->get('app.bsky.feed.getFeedGenerator', compact('feed'));
61
+
62
+
return GetFeedGeneratorResponse::fromArray($response->json());
38
63
}
39
64
40
-
public function getFeedGenerators(array $feeds): Response
65
+
public function getFeedGenerators(array $feeds): GetFeedGeneratorsResponse
41
66
{
42
-
return $this->atp->client->get('app.bsky.feed.getFeedGenerators', compact('feeds'));
67
+
$response = $this->atp->client->get('app.bsky.feed.getFeedGenerators', compact('feeds'));
68
+
69
+
return GetFeedGeneratorsResponse::fromArray($response->json());
43
70
}
44
71
45
-
public function getLikes(string $uri, int $limit = 50, ?string $cursor = null, ?string $cid = null): Response
72
+
public function getLikes(string $uri, int $limit = 50, ?string $cursor = null, ?string $cid = null): GetLikesResponse
46
73
{
47
-
return $this->atp->client->get('app.bsky.feed.getLikes', compact('uri', 'limit', 'cursor', 'cid'));
74
+
$response = $this->atp->client->get('app.bsky.feed.getLikes', compact('uri', 'limit', 'cursor', 'cid'));
75
+
76
+
return GetLikesResponse::fromArray($response->json());
48
77
}
49
78
50
-
public function getPostThread(string $uri, int $depth = 6, int $parentHeight = 80): Response
79
+
public function getPostThread(string $uri, int $depth = 6, int $parentHeight = 80): GetPostThreadResponse
51
80
{
52
-
return $this->atp->client->get('app.bsky.feed.getPostThread', compact('uri', 'depth', 'parentHeight'));
81
+
$response = $this->atp->client->get('app.bsky.feed.getPostThread', compact('uri', 'depth', 'parentHeight'));
82
+
83
+
return GetPostThreadResponse::fromArray($response->json());
53
84
}
54
85
55
-
public function getPosts(array $uris): Response
86
+
public function getPosts(array $uris): GetPostsResponse
56
87
{
57
-
return $this->atp->client->get('app.bsky.feed.getPosts', compact('uris'));
88
+
$response = $this->atp->client->get('app.bsky.feed.getPosts', compact('uris'));
89
+
90
+
return GetPostsResponse::fromArray($response->json());
58
91
}
59
92
60
-
public function getQuotes(string $uri, int $limit = 50, ?string $cursor = null, ?string $cid = null): Response
93
+
public function getQuotes(string $uri, int $limit = 50, ?string $cursor = null, ?string $cid = null): GetQuotesResponse
61
94
{
62
-
return $this->atp->client->get('app.bsky.feed.getQuotes', compact('uri', 'limit', 'cursor', 'cid'));
95
+
$response = $this->atp->client->get('app.bsky.feed.getQuotes', compact('uri', 'limit', 'cursor', 'cid'));
96
+
97
+
return GetQuotesResponse::fromArray($response->json());
63
98
}
64
99
65
-
public function getRepostedBy(string $uri, int $limit = 50, ?string $cursor = null, ?string $cid = null): Response
100
+
public function getRepostedBy(string $uri, int $limit = 50, ?string $cursor = null, ?string $cid = null): GetRepostedByResponse
66
101
{
67
-
return $this->atp->client->get('app.bsky.feed.getRepostedBy', compact('uri', 'limit', 'cursor', 'cid'));
102
+
$response = $this->atp->client->get('app.bsky.feed.getRepostedBy', compact('uri', 'limit', 'cursor', 'cid'));
103
+
104
+
return GetRepostedByResponse::fromArray($response->json());
68
105
}
69
106
70
-
public function getSuggestedFeeds(int $limit = 50, ?string $cursor = null): Response
107
+
public function getSuggestedFeeds(int $limit = 50, ?string $cursor = null): GetSuggestedFeedsResponse
71
108
{
72
-
return $this->atp->client->get('app.bsky.feed.getSuggestedFeeds', compact('limit', 'cursor'));
109
+
$response = $this->atp->client->get('app.bsky.feed.getSuggestedFeeds', compact('limit', 'cursor'));
110
+
111
+
return GetSuggestedFeedsResponse::fromArray($response->json());
73
112
}
74
113
75
-
public function searchPosts(string $q, int $limit = 25, ?string $cursor = null, ?string $sort = null): Response
114
+
public function searchPosts(string $q, int $limit = 25, ?string $cursor = null, ?string $sort = null): SearchPostsResponse
76
115
{
77
-
return $this->atp->client->get('app.bsky.feed.searchPosts', compact('q', 'limit', 'cursor', 'sort'));
116
+
$response = $this->atp->client->get('app.bsky.feed.searchPosts', compact('q', 'limit', 'cursor', 'sort'));
117
+
118
+
return SearchPostsResponse::fromArray($response->json());
78
119
}
79
120
}
+45
-19
src/Client/Public/Requests/Bsky/GraphPublicRequestClient.php
+45
-19
src/Client/Public/Requests/Bsky/GraphPublicRequestClient.php
···
3
3
namespace SocialDept\AtpClient\Client\Public\Requests\Bsky;
4
4
5
5
use SocialDept\AtpClient\Client\Public\Requests\PublicRequest;
6
-
use SocialDept\AtpClient\Http\Response;
6
+
use SocialDept\AtpClient\Data\Responses\Bsky\Graph\GetFollowersResponse;
7
+
use SocialDept\AtpClient\Data\Responses\Bsky\Graph\GetFollowsResponse;
8
+
use SocialDept\AtpClient\Data\Responses\Bsky\Graph\GetKnownFollowersResponse;
9
+
use SocialDept\AtpClient\Data\Responses\Bsky\Graph\GetListResponse;
10
+
use SocialDept\AtpClient\Data\Responses\Bsky\Graph\GetListsResponse;
11
+
use SocialDept\AtpClient\Data\Responses\Bsky\Graph\GetRelationshipsResponse;
12
+
use SocialDept\AtpClient\Data\Responses\Bsky\Graph\GetStarterPacksResponse;
13
+
use SocialDept\AtpClient\Data\Responses\Bsky\Graph\GetSuggestedFollowsByActorResponse;
14
+
use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\StarterPackView;
7
15
8
16
class GraphPublicRequestClient extends PublicRequest
9
17
{
10
-
public function getFollowers(string $actor, int $limit = 50, ?string $cursor = null): Response
18
+
public function getFollowers(string $actor, int $limit = 50, ?string $cursor = null): GetFollowersResponse
11
19
{
12
-
return $this->atp->client->get('app.bsky.graph.getFollowers', compact('actor', 'limit', 'cursor'));
20
+
$response = $this->atp->client->get('app.bsky.graph.getFollowers', compact('actor', 'limit', 'cursor'));
21
+
22
+
return GetFollowersResponse::fromArray($response->json());
13
23
}
14
24
15
-
public function getFollows(string $actor, int $limit = 50, ?string $cursor = null): Response
25
+
public function getFollows(string $actor, int $limit = 50, ?string $cursor = null): GetFollowsResponse
16
26
{
17
-
return $this->atp->client->get('app.bsky.graph.getFollows', compact('actor', 'limit', 'cursor'));
27
+
$response = $this->atp->client->get('app.bsky.graph.getFollows', compact('actor', 'limit', 'cursor'));
28
+
29
+
return GetFollowsResponse::fromArray($response->json());
18
30
}
19
31
20
-
public function getKnownFollowers(string $actor, int $limit = 50, ?string $cursor = null): Response
32
+
public function getKnownFollowers(string $actor, int $limit = 50, ?string $cursor = null): GetKnownFollowersResponse
21
33
{
22
-
return $this->atp->client->get('app.bsky.graph.getKnownFollowers', compact('actor', 'limit', 'cursor'));
34
+
$response = $this->atp->client->get('app.bsky.graph.getKnownFollowers', compact('actor', 'limit', 'cursor'));
35
+
36
+
return GetKnownFollowersResponse::fromArray($response->json());
23
37
}
24
38
25
-
public function getList(string $list, int $limit = 50, ?string $cursor = null): Response
39
+
public function getList(string $list, int $limit = 50, ?string $cursor = null): GetListResponse
26
40
{
27
-
return $this->atp->client->get('app.bsky.graph.getList', compact('list', 'limit', 'cursor'));
41
+
$response = $this->atp->client->get('app.bsky.graph.getList', compact('list', 'limit', 'cursor'));
42
+
43
+
return GetListResponse::fromArray($response->json());
28
44
}
29
45
30
-
public function getLists(string $actor, int $limit = 50, ?string $cursor = null): Response
46
+
public function getLists(string $actor, int $limit = 50, ?string $cursor = null): GetListsResponse
31
47
{
32
-
return $this->atp->client->get('app.bsky.graph.getLists', compact('actor', 'limit', 'cursor'));
48
+
$response = $this->atp->client->get('app.bsky.graph.getLists', compact('actor', 'limit', 'cursor'));
49
+
50
+
return GetListsResponse::fromArray($response->json());
33
51
}
34
52
35
-
public function getRelationships(string $actor, array $others = []): Response
53
+
public function getRelationships(string $actor, array $others = []): GetRelationshipsResponse
36
54
{
37
-
return $this->atp->client->get('app.bsky.graph.getRelationships', compact('actor', 'others'));
55
+
$response = $this->atp->client->get('app.bsky.graph.getRelationships', compact('actor', 'others'));
56
+
57
+
return GetRelationshipsResponse::fromArray($response->json());
38
58
}
39
59
40
-
public function getStarterPack(string $starterPack): Response
60
+
public function getStarterPack(string $starterPack): StarterPackView
41
61
{
42
-
return $this->atp->client->get('app.bsky.graph.getStarterPack', compact('starterPack'));
62
+
$response = $this->atp->client->get('app.bsky.graph.getStarterPack', compact('starterPack'));
63
+
64
+
return StarterPackView::fromArray($response->json()['starterPack']);
43
65
}
44
66
45
-
public function getStarterPacks(array $uris): Response
67
+
public function getStarterPacks(array $uris): GetStarterPacksResponse
46
68
{
47
-
return $this->atp->client->get('app.bsky.graph.getStarterPacks', compact('uris'));
69
+
$response = $this->atp->client->get('app.bsky.graph.getStarterPacks', compact('uris'));
70
+
71
+
return GetStarterPacksResponse::fromArray($response->json());
48
72
}
49
73
50
-
public function getSuggestedFollowsByActor(string $actor): Response
74
+
public function getSuggestedFollowsByActor(string $actor): GetSuggestedFollowsByActorResponse
51
75
{
52
-
return $this->atp->client->get('app.bsky.graph.getSuggestedFollowsByActor', compact('actor'));
76
+
$response = $this->atp->client->get('app.bsky.graph.getSuggestedFollowsByActor', compact('actor'));
77
+
78
+
return GetSuggestedFollowsByActorResponse::fromArray($response->json());
53
79
}
54
80
}
+5
-3
src/Client/Public/Requests/Bsky/LabelerPublicRequestClient.php
+5
-3
src/Client/Public/Requests/Bsky/LabelerPublicRequestClient.php
···
3
3
namespace SocialDept\AtpClient\Client\Public\Requests\Bsky;
4
4
5
5
use SocialDept\AtpClient\Client\Public\Requests\PublicRequest;
6
-
use SocialDept\AtpClient\Http\Response;
6
+
use SocialDept\AtpClient\Data\Responses\Bsky\Labeler\GetServicesResponse;
7
7
8
8
class LabelerPublicRequestClient extends PublicRequest
9
9
{
10
-
public function getServices(array $dids, bool $detailed = false): Response
10
+
public function getServices(array $dids, bool $detailed = false): GetServicesResponse
11
11
{
12
-
return $this->atp->client->get('app.bsky.labeler.getServices', compact('dids', 'detailed'));
12
+
$response = $this->atp->client->get('app.bsky.labeler.getServices', compact('dids', 'detailed'));
13
+
14
+
return GetServicesResponse::fromArray($response->json(), $detailed);
13
15
}
14
16
}
+6
-5
src/Client/Requests/Atproto/IdentityRequestClient.php
+6
-5
src/Client/Requests/Atproto/IdentityRequestClient.php
···
5
5
use SocialDept\AtpClient\Attributes\RequiresScope;
6
6
use SocialDept\AtpClient\Client\Requests\Request;
7
7
use SocialDept\AtpClient\Enums\Scope;
8
-
use SocialDept\AtpClient\Http\Response;
9
8
10
9
class IdentityRequestClient extends Request
11
10
{
···
17
16
* @see https://docs.bsky.app/docs/api/com-atproto-identity-resolve-handle
18
17
*/
19
18
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.identity.resolveHandle')]
20
-
public function resolveHandle(string $handle): Response
19
+
public function resolveHandle(string $handle): string
21
20
{
22
-
return $this->atp->client->get(
21
+
$response = $this->atp->client->get(
23
22
endpoint: 'com.atproto.identity.resolveHandle',
24
23
params: compact('handle')
25
24
);
25
+
26
+
return $response->json()['did'];
26
27
}
27
28
28
29
/**
···
33
34
* @see https://docs.bsky.app/docs/api/com-atproto-identity-update-handle
34
35
*/
35
36
#[RequiresScope(Scope::Atproto, granular: 'identity:handle')]
36
-
public function updateHandle(string $handle): Response
37
+
public function updateHandle(string $handle): void
37
38
{
38
-
return $this->atp->client->post(
39
+
$this->atp->client->post(
39
40
endpoint: 'com.atproto.identity.updateHandle',
40
41
body: compact('handle')
41
42
);
+35
-15
src/Client/Requests/Atproto/RepoRequestClient.php
+35
-15
src/Client/Requests/Atproto/RepoRequestClient.php
···
7
7
use SocialDept\AtpClient\Attributes\RequiresScope;
8
8
use SocialDept\AtpClient\Auth\ScopeChecker;
9
9
use SocialDept\AtpClient\Client\Requests\Request;
10
+
use SocialDept\AtpClient\Data\Responses\Atproto\Repo\CreateRecordResponse;
11
+
use SocialDept\AtpClient\Data\Responses\Atproto\Repo\DeleteRecordResponse;
12
+
use SocialDept\AtpClient\Data\Responses\Atproto\Repo\DescribeRepoResponse;
13
+
use SocialDept\AtpClient\Data\Responses\Atproto\Repo\GetRecordResponse;
14
+
use SocialDept\AtpClient\Data\Responses\Atproto\Repo\ListRecordsResponse;
15
+
use SocialDept\AtpClient\Data\Responses\Atproto\Repo\PutRecordResponse;
10
16
use SocialDept\AtpClient\Enums\Scope;
11
-
use SocialDept\AtpClient\Http\Response;
17
+
use SocialDept\AtpSchema\Data\BlobReference;
12
18
use SplFileInfo;
13
19
use Throwable;
14
20
···
29
35
?string $rkey = null,
30
36
bool $validate = true,
31
37
?string $swapCommit = null
32
-
): Response {
38
+
): CreateRecordResponse {
33
39
$this->checkCollectionScope($collection, 'create');
34
40
35
-
return $this->atp->client->post(
41
+
$response = $this->atp->client->post(
36
42
endpoint: 'com.atproto.repo.createRecord',
37
43
body: array_filter(
38
44
compact('repo', 'collection', 'record', 'rkey', 'validate', 'swapCommit'),
39
45
fn ($v) => ! is_null($v)
40
46
)
41
47
);
48
+
49
+
return CreateRecordResponse::fromArray($response->json());
42
50
}
43
51
44
52
/**
···
55
63
string $rkey,
56
64
?string $swapRecord = null,
57
65
?string $swapCommit = null
58
-
): Response {
66
+
): DeleteRecordResponse {
59
67
$this->checkCollectionScope($collection, 'delete');
60
68
61
-
return $this->atp->client->post(
69
+
$response = $this->atp->client->post(
62
70
endpoint: 'com.atproto.repo.deleteRecord',
63
71
body: array_filter(
64
72
compact('repo', 'collection', 'rkey', 'swapRecord', 'swapCommit'),
65
73
fn ($v) => ! is_null($v)
66
74
)
67
75
);
76
+
77
+
return DeleteRecordResponse::fromArray($response->json());
68
78
}
69
79
70
80
/**
···
83
93
bool $validate = true,
84
94
?string $swapRecord = null,
85
95
?string $swapCommit = null
86
-
): Response {
96
+
): PutRecordResponse {
87
97
$this->checkCollectionScope($collection, 'update');
88
98
89
-
return $this->atp->client->post(
99
+
$response = $this->atp->client->post(
90
100
endpoint: 'com.atproto.repo.putRecord',
91
101
body: array_filter(
92
102
compact('repo', 'collection', 'rkey', 'record', 'validate', 'swapRecord', 'swapCommit'),
93
103
fn ($v) => ! is_null($v)
94
104
)
95
105
);
106
+
107
+
return PutRecordResponse::fromArray($response->json());
96
108
}
97
109
98
110
/**
···
108
120
string $collection,
109
121
string $rkey,
110
122
?string $cid = null
111
-
): Response {
112
-
return $this->atp->client->get(
123
+
): GetRecordResponse {
124
+
$response = $this->atp->client->get(
113
125
endpoint: 'com.atproto.repo.getRecord',
114
126
params: compact('repo', 'collection', 'rkey', 'cid')
115
127
);
128
+
129
+
return GetRecordResponse::fromArray($response->json());
116
130
}
117
131
118
132
/**
···
129
143
int $limit = 50,
130
144
?string $cursor = null,
131
145
bool $reverse = false
132
-
): Response {
133
-
return $this->atp->client->get(
146
+
): ListRecordsResponse {
147
+
$response = $this->atp->client->get(
134
148
endpoint: 'com.atproto.repo.listRecords',
135
149
params: compact('repo', 'collection', 'limit', 'cursor', 'reverse')
136
150
);
151
+
152
+
return ListRecordsResponse::fromArray($response->json());
137
153
}
138
154
139
155
/**
···
151
167
* @see https://docs.bsky.app/docs/api/com-atproto-repo-upload-blob
152
168
*/
153
169
#[RequiresScope(Scope::TransitionGeneric, granular: 'blob:*/*')]
154
-
public function uploadBlob(UploadedFile|SplFileInfo|string $file, ?string $mimeType = null): Response
170
+
public function uploadBlob(UploadedFile|SplFileInfo|string $file, ?string $mimeType = null): BlobReference
155
171
{
156
172
// Handle different input types
157
173
if ($file instanceof UploadedFile) {
···
165
181
$data = $file;
166
182
}
167
183
168
-
return $this->atp->client->postBlob(
184
+
$response = $this->atp->client->postBlob(
169
185
endpoint: 'com.atproto.repo.uploadBlob',
170
186
data: $data,
171
187
mimeType: $mimeType
172
188
);
189
+
190
+
return BlobReference::fromArray($response->json()['blob']);
173
191
}
174
192
175
193
/**
···
180
198
* @see https://docs.bsky.app/docs/api/com-atproto-repo-describe-repo
181
199
*/
182
200
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:com.atproto.repo.describeRepo')]
183
-
public function describeRepo(string $repo): Response
201
+
public function describeRepo(string $repo): DescribeRepoResponse
184
202
{
185
-
return $this->atp->client->get(
203
+
$response = $this->atp->client->get(
186
204
endpoint: 'com.atproto.repo.describeRepo',
187
205
params: compact('repo')
188
206
);
207
+
208
+
return DescribeRepoResponse::fromArray($response->json());
189
209
}
190
210
191
211
/**
+10
-5
src/Client/Requests/Atproto/ServerRequestClient.php
+10
-5
src/Client/Requests/Atproto/ServerRequestClient.php
···
4
4
5
5
use SocialDept\AtpClient\Attributes\RequiresScope;
6
6
use SocialDept\AtpClient\Client\Requests\Request;
7
+
use SocialDept\AtpClient\Data\Responses\Atproto\Server\DescribeServerResponse;
8
+
use SocialDept\AtpClient\Data\Responses\Atproto\Server\GetSessionResponse;
7
9
use SocialDept\AtpClient\Enums\Scope;
8
-
use SocialDept\AtpClient\Http\Response;
9
10
10
11
class ServerRequestClient extends Request
11
12
{
···
17
18
* @see https://docs.bsky.app/docs/api/com-atproto-server-get-session
18
19
*/
19
20
#[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.server.getSession')]
20
-
public function getSession(): Response
21
+
public function getSession(): GetSessionResponse
21
22
{
22
-
return $this->atp->client->get(
23
+
$response = $this->atp->client->get(
23
24
endpoint: 'com.atproto.server.getSession'
24
25
);
26
+
27
+
return GetSessionResponse::fromArray($response->json());
25
28
}
26
29
27
30
/**
···
32
35
* @see https://docs.bsky.app/docs/api/com-atproto-server-describe-server
33
36
*/
34
37
#[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.server.describeServer')]
35
-
public function describeServer(): Response
38
+
public function describeServer(): DescribeServerResponse
36
39
{
37
-
return $this->atp->client->get(
40
+
$response = $this->atp->client->get(
38
41
endpoint: 'com.atproto.server.describeServer'
39
42
);
43
+
44
+
return DescribeServerResponse::fromArray($response->json());
40
45
}
41
46
}
+20
-8
src/Client/Requests/Atproto/SyncRequestClient.php
+20
-8
src/Client/Requests/Atproto/SyncRequestClient.php
···
4
4
5
5
use SocialDept\AtpClient\Attributes\RequiresScope;
6
6
use SocialDept\AtpClient\Client\Requests\Request;
7
+
use SocialDept\AtpClient\Data\Responses\Atproto\Sync\GetRepoStatusResponse;
8
+
use SocialDept\AtpClient\Data\Responses\Atproto\Sync\ListBlobsResponse;
9
+
use SocialDept\AtpClient\Data\Responses\Atproto\Sync\ListReposResponse;
7
10
use SocialDept\AtpClient\Enums\Scope;
8
11
use SocialDept\AtpClient\Http\Response;
12
+
use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\Defs\CommitMeta;
9
13
10
14
class SyncRequestClient extends Request
11
15
{
···
49
53
* @see https://docs.bsky.app/docs/api/com-atproto-sync-list-repos
50
54
*/
51
55
#[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.listRepos')]
52
-
public function listRepos(int $limit = 500, ?string $cursor = null): Response
56
+
public function listRepos(int $limit = 500, ?string $cursor = null): ListReposResponse
53
57
{
54
-
return $this->atp->client->get(
58
+
$response = $this->atp->client->get(
55
59
endpoint: 'com.atproto.sync.listRepos',
56
60
params: compact('limit', 'cursor')
57
61
);
62
+
63
+
return ListReposResponse::fromArray($response->json());
58
64
}
59
65
60
66
/**
···
65
71
* @see https://docs.bsky.app/docs/api/com-atproto-sync-get-latest-commit
66
72
*/
67
73
#[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getLatestCommit')]
68
-
public function getLatestCommit(string $did): Response
74
+
public function getLatestCommit(string $did): CommitMeta
69
75
{
70
-
return $this->atp->client->get(
76
+
$response = $this->atp->client->get(
71
77
endpoint: 'com.atproto.sync.getLatestCommit',
72
78
params: compact('did')
73
79
);
80
+
81
+
return CommitMeta::fromArray($response->json());
74
82
}
75
83
76
84
/**
···
102
110
?string $since = null,
103
111
int $limit = 500,
104
112
?string $cursor = null
105
-
): Response {
106
-
return $this->atp->client->get(
113
+
): ListBlobsResponse {
114
+
$response = $this->atp->client->get(
107
115
endpoint: 'com.atproto.sync.listBlobs',
108
116
params: compact('did', 'since', 'limit', 'cursor')
109
117
);
118
+
119
+
return ListBlobsResponse::fromArray($response->json());
110
120
}
111
121
112
122
/**
···
133
143
* @see https://docs.bsky.app/docs/api/com-atproto-sync-get-repo-status
134
144
*/
135
145
#[RequiresScope(Scope::Atproto, granular: 'rpc:com.atproto.sync.getRepoStatus')]
136
-
public function getRepoStatus(string $did): Response
146
+
public function getRepoStatus(string $did): GetRepoStatusResponse
137
147
{
138
-
return $this->atp->client->get(
148
+
$response = $this->atp->client->get(
139
149
endpoint: 'com.atproto.sync.getRepoStatus',
140
150
params: compact('did')
141
151
);
152
+
153
+
return GetRepoStatusResponse::fromArray($response->json());
142
154
}
143
155
}
+5
-3
src/Client/Requests/Bsky/ActorRequestClient.php
+5
-3
src/Client/Requests/Bsky/ActorRequestClient.php
···
5
5
use SocialDept\AtpClient\Attributes\RequiresScope;
6
6
use SocialDept\AtpClient\Client\Requests\Request;
7
7
use SocialDept\AtpClient\Enums\Scope;
8
-
use SocialDept\AtpClient\Http\Response;
8
+
use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewDetailed;
9
9
10
10
class ActorRequestClient extends Request
11
11
{
···
17
17
* @see https://docs.bsky.app/docs/api/app-bsky-actor-get-profile
18
18
*/
19
19
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:app.bsky.actor.getProfile')]
20
-
public function getProfile(string $actor): Response
20
+
public function getProfile(string $actor): ProfileViewDetailed
21
21
{
22
-
return $this->atp->client->get(
22
+
$response = $this->atp->client->get(
23
23
endpoint: 'app.bsky.actor.getProfile',
24
24
params: compact('actor')
25
25
);
26
+
27
+
return ProfileViewDetailed::fromArray($response->json());
26
28
}
27
29
}
+30
-13
src/Client/Requests/Bsky/FeedRequestClient.php
+30
-13
src/Client/Requests/Bsky/FeedRequestClient.php
···
4
4
5
5
use SocialDept\AtpClient\Attributes\RequiresScope;
6
6
use SocialDept\AtpClient\Client\Requests\Request;
7
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetAuthorFeedResponse;
8
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetLikesResponse;
9
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetPostThreadResponse;
10
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetRepostedByResponse;
11
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\GetTimelineResponse;
12
+
use SocialDept\AtpClient\Data\Responses\Bsky\Feed\SearchPostsResponse;
7
13
use SocialDept\AtpClient\Enums\Scope;
8
-
use SocialDept\AtpClient\Http\Response;
9
14
10
15
class FeedRequestClient extends Request
11
16
{
···
17
22
* @see https://docs.bsky.app/docs/api/app-bsky-feed-get-timeline
18
23
*/
19
24
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:app.bsky.feed.getTimeline')]
20
-
public function getTimeline(int $limit = 50, ?string $cursor = null): Response
25
+
public function getTimeline(int $limit = 50, ?string $cursor = null): GetTimelineResponse
21
26
{
22
-
return $this->atp->client->get(
27
+
$response = $this->atp->client->get(
23
28
endpoint: 'app.bsky.feed.getTimeline',
24
29
params: compact('limit', 'cursor')
25
30
);
31
+
32
+
return GetTimelineResponse::fromArray($response->json());
26
33
}
27
34
28
35
/**
···
37
44
string $actor,
38
45
int $limit = 50,
39
46
?string $cursor = null
40
-
): Response {
41
-
return $this->atp->client->get(
47
+
): GetAuthorFeedResponse {
48
+
$response = $this->atp->client->get(
42
49
endpoint: 'app.bsky.feed.getAuthorFeed',
43
50
params: compact('actor', 'limit', 'cursor')
44
51
);
52
+
53
+
return GetAuthorFeedResponse::fromArray($response->json());
45
54
}
46
55
47
56
/**
···
52
61
* @see https://docs.bsky.app/docs/api/app-bsky-feed-get-post-thread
53
62
*/
54
63
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:app.bsky.feed.getPostThread')]
55
-
public function getPostThread(string $uri, int $depth = 6): Response
64
+
public function getPostThread(string $uri, int $depth = 6): GetPostThreadResponse
56
65
{
57
-
return $this->atp->client->get(
66
+
$response = $this->atp->client->get(
58
67
endpoint: 'app.bsky.feed.getPostThread',
59
68
params: compact('uri', 'depth')
60
69
);
70
+
71
+
return GetPostThreadResponse::fromArray($response->json());
61
72
}
62
73
63
74
/**
···
72
83
string $q,
73
84
int $limit = 25,
74
85
?string $cursor = null
75
-
): Response {
76
-
return $this->atp->client->get(
86
+
): SearchPostsResponse {
87
+
$response = $this->atp->client->get(
77
88
endpoint: 'app.bsky.feed.searchPosts',
78
89
params: compact('q', 'limit', 'cursor')
79
90
);
91
+
92
+
return SearchPostsResponse::fromArray($response->json());
80
93
}
81
94
82
95
/**
···
91
104
string $uri,
92
105
int $limit = 50,
93
106
?string $cursor = null
94
-
): Response {
95
-
return $this->atp->client->get(
107
+
): GetLikesResponse {
108
+
$response = $this->atp->client->get(
96
109
endpoint: 'app.bsky.feed.getLikes',
97
110
params: compact('uri', 'limit', 'cursor')
98
111
);
112
+
113
+
return GetLikesResponse::fromArray($response->json());
99
114
}
100
115
101
116
/**
···
110
125
string $uri,
111
126
int $limit = 50,
112
127
?string $cursor = null
113
-
): Response {
114
-
return $this->atp->client->get(
128
+
): GetRepostedByResponse {
129
+
$response = $this->atp->client->get(
115
130
endpoint: 'app.bsky.feed.getRepostedBy',
116
131
params: compact('uri', 'limit', 'cursor')
117
132
);
133
+
134
+
return GetRepostedByResponse::fromArray($response->json());
118
135
}
119
136
}
+3
-3
src/Client/Requests/Chat/ActorRequestClient.php
+3
-3
src/Client/Requests/Chat/ActorRequestClient.php
···
25
25
}
26
26
27
27
/**
28
-
* Export account data
28
+
* Export account data (returns JSONL stream)
29
29
*
30
30
* @requires transition:chat.bsky (rpc:chat.bsky.actor.exportAccountData)
31
31
*
···
47
47
* @see https://docs.bsky.app/docs/api/chat-bsky-actor-delete-account
48
48
*/
49
49
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.actor.deleteAccount')]
50
-
public function deleteAccount(): Response
50
+
public function deleteAccount(): void
51
51
{
52
-
return $this->atp->client->post(
52
+
$this->atp->client->post(
53
53
endpoint: 'chat.bsky.actor.deleteAccount'
54
54
);
55
55
}
+56
-25
src/Client/Requests/Chat/ConvoRequestClient.php
+56
-25
src/Client/Requests/Chat/ConvoRequestClient.php
···
4
4
5
5
use SocialDept\AtpClient\Attributes\RequiresScope;
6
6
use SocialDept\AtpClient\Client\Requests\Request;
7
+
use SocialDept\AtpClient\Data\Responses\Chat\Convo\GetLogResponse;
8
+
use SocialDept\AtpClient\Data\Responses\Chat\Convo\GetMessagesResponse;
9
+
use SocialDept\AtpClient\Data\Responses\Chat\Convo\LeaveConvoResponse;
10
+
use SocialDept\AtpClient\Data\Responses\Chat\Convo\ListConvosResponse;
11
+
use SocialDept\AtpClient\Data\Responses\Chat\Convo\SendMessageBatchResponse;
7
12
use SocialDept\AtpClient\Enums\Scope;
8
-
use SocialDept\AtpClient\Http\Response;
13
+
use SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs\ConvoView;
14
+
use SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs\DeletedMessageView;
15
+
use SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs\MessageView;
9
16
10
17
class ConvoRequestClient extends Request
11
18
{
···
17
24
* @see https://docs.bsky.app/docs/api/chat-bsky-convo-get-convo
18
25
*/
19
26
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getConvo')]
20
-
public function getConvo(string $convoId): Response
27
+
public function getConvo(string $convoId): ConvoView
21
28
{
22
-
return $this->atp->client->get(
29
+
$response = $this->atp->client->get(
23
30
endpoint: 'chat.bsky.convo.getConvo',
24
31
params: compact('convoId')
25
32
);
33
+
34
+
return ConvoView::fromArray($response->json()['convo']);
26
35
}
27
36
28
37
/**
···
33
42
* @see https://docs.bsky.app/docs/api/chat-bsky-convo-get-convo-for-members
34
43
*/
35
44
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getConvoForMembers')]
36
-
public function getConvoForMembers(array $members): Response
45
+
public function getConvoForMembers(array $members): ConvoView
37
46
{
38
-
return $this->atp->client->get(
47
+
$response = $this->atp->client->get(
39
48
endpoint: 'chat.bsky.convo.getConvoForMembers',
40
49
params: compact('members')
41
50
);
51
+
52
+
return ConvoView::fromArray($response->json()['convo']);
42
53
}
43
54
44
55
/**
···
49
60
* @see https://docs.bsky.app/docs/api/chat-bsky-convo-list-convos
50
61
*/
51
62
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.listConvos')]
52
-
public function listConvos(int $limit = 50, ?string $cursor = null): Response
63
+
public function listConvos(int $limit = 50, ?string $cursor = null): ListConvosResponse
53
64
{
54
-
return $this->atp->client->get(
65
+
$response = $this->atp->client->get(
55
66
endpoint: 'chat.bsky.convo.listConvos',
56
67
params: compact('limit', 'cursor')
57
68
);
69
+
70
+
return ListConvosResponse::fromArray($response->json());
58
71
}
59
72
60
73
/**
···
69
82
string $convoId,
70
83
int $limit = 50,
71
84
?string $cursor = null
72
-
): Response {
73
-
return $this->atp->client->get(
85
+
): GetMessagesResponse {
86
+
$response = $this->atp->client->get(
74
87
endpoint: 'chat.bsky.convo.getMessages',
75
88
params: compact('convoId', 'limit', 'cursor')
76
89
);
90
+
91
+
return GetMessagesResponse::fromArray($response->json());
77
92
}
78
93
79
94
/**
···
84
99
* @see https://docs.bsky.app/docs/api/chat-bsky-convo-send-message
85
100
*/
86
101
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.sendMessage')]
87
-
public function sendMessage(string $convoId, array $message): Response
102
+
public function sendMessage(string $convoId, array $message): MessageView
88
103
{
89
-
return $this->atp->client->post(
104
+
$response = $this->atp->client->post(
90
105
endpoint: 'chat.bsky.convo.sendMessage',
91
106
body: compact('convoId', 'message')
92
107
);
108
+
109
+
return MessageView::fromArray($response->json());
93
110
}
94
111
95
112
/**
···
100
117
* @see https://docs.bsky.app/docs/api/chat-bsky-convo-send-message-batch
101
118
*/
102
119
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.sendMessageBatch')]
103
-
public function sendMessageBatch(array $items): Response
120
+
public function sendMessageBatch(array $items): SendMessageBatchResponse
104
121
{
105
-
return $this->atp->client->post(
122
+
$response = $this->atp->client->post(
106
123
endpoint: 'chat.bsky.convo.sendMessageBatch',
107
124
body: compact('items')
108
125
);
126
+
127
+
return SendMessageBatchResponse::fromArray($response->json());
109
128
}
110
129
111
130
/**
···
116
135
* @see https://docs.bsky.app/docs/api/chat-bsky-convo-delete-message-for-self
117
136
*/
118
137
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.deleteMessageForSelf')]
119
-
public function deleteMessageForSelf(string $convoId, string $messageId): Response
138
+
public function deleteMessageForSelf(string $convoId, string $messageId): DeletedMessageView
120
139
{
121
-
return $this->atp->client->post(
140
+
$response = $this->atp->client->post(
122
141
endpoint: 'chat.bsky.convo.deleteMessageForSelf',
123
142
body: compact('convoId', 'messageId')
124
143
);
144
+
145
+
return DeletedMessageView::fromArray($response->json());
125
146
}
126
147
127
148
/**
···
132
153
* @see https://docs.bsky.app/docs/api/chat-bsky-convo-update-read
133
154
*/
134
155
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.updateRead')]
135
-
public function updateRead(string $convoId, ?string $messageId = null): Response
156
+
public function updateRead(string $convoId, ?string $messageId = null): ConvoView
136
157
{
137
-
return $this->atp->client->post(
158
+
$response = $this->atp->client->post(
138
159
endpoint: 'chat.bsky.convo.updateRead',
139
160
body: compact('convoId', 'messageId')
140
161
);
162
+
163
+
return ConvoView::fromArray($response->json()['convo']);
141
164
}
142
165
143
166
/**
···
148
171
* @see https://docs.bsky.app/docs/api/chat-bsky-convo-mute-convo
149
172
*/
150
173
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.muteConvo')]
151
-
public function muteConvo(string $convoId): Response
174
+
public function muteConvo(string $convoId): ConvoView
152
175
{
153
-
return $this->atp->client->post(
176
+
$response = $this->atp->client->post(
154
177
endpoint: 'chat.bsky.convo.muteConvo',
155
178
body: compact('convoId')
156
179
);
180
+
181
+
return ConvoView::fromArray($response->json()['convo']);
157
182
}
158
183
159
184
/**
···
164
189
* @see https://docs.bsky.app/docs/api/chat-bsky-convo-unmute-convo
165
190
*/
166
191
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.unmuteConvo')]
167
-
public function unmuteConvo(string $convoId): Response
192
+
public function unmuteConvo(string $convoId): ConvoView
168
193
{
169
-
return $this->atp->client->post(
194
+
$response = $this->atp->client->post(
170
195
endpoint: 'chat.bsky.convo.unmuteConvo',
171
196
body: compact('convoId')
172
197
);
198
+
199
+
return ConvoView::fromArray($response->json()['convo']);
173
200
}
174
201
175
202
/**
···
180
207
* @see https://docs.bsky.app/docs/api/chat-bsky-convo-leave-convo
181
208
*/
182
209
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.leaveConvo')]
183
-
public function leaveConvo(string $convoId): Response
210
+
public function leaveConvo(string $convoId): LeaveConvoResponse
184
211
{
185
-
return $this->atp->client->post(
212
+
$response = $this->atp->client->post(
186
213
endpoint: 'chat.bsky.convo.leaveConvo',
187
214
body: compact('convoId')
188
215
);
216
+
217
+
return LeaveConvoResponse::fromArray($response->json());
189
218
}
190
219
191
220
/**
···
196
225
* @see https://docs.bsky.app/docs/api/chat-bsky-convo-get-log
197
226
*/
198
227
#[RequiresScope(Scope::TransitionChat, granular: 'rpc:chat.bsky.convo.getLog')]
199
-
public function getLog(?string $cursor = null): Response
228
+
public function getLog(?string $cursor = null): GetLogResponse
200
229
{
201
-
return $this->atp->client->get(
230
+
$response = $this->atp->client->get(
202
231
endpoint: 'chat.bsky.convo.getLog',
203
232
params: compact('cursor')
204
233
);
234
+
235
+
return GetLogResponse::fromArray($response->json());
205
236
}
206
237
}
+35
-14
src/Client/Requests/Ozone/ModerationRequestClient.php
+35
-14
src/Client/Requests/Ozone/ModerationRequestClient.php
···
4
4
5
5
use SocialDept\AtpClient\Attributes\RequiresScope;
6
6
use SocialDept\AtpClient\Client\Requests\Request;
7
+
use SocialDept\AtpClient\Data\Responses\Ozone\Moderation\QueryEventsResponse;
8
+
use SocialDept\AtpClient\Data\Responses\Ozone\Moderation\QueryStatusesResponse;
9
+
use SocialDept\AtpClient\Data\Responses\Ozone\Moderation\SearchReposResponse;
7
10
use SocialDept\AtpClient\Enums\Scope;
8
11
use SocialDept\AtpClient\Http\Response;
12
+
use SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs\ModEventView;
13
+
use SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs\ModEventViewDetail;
14
+
use SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs\RecordViewDetail;
15
+
use SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs\RepoViewDetail;
9
16
10
17
class ModerationRequestClient extends Request
11
18
{
···
17
24
* @see https://docs.bsky.app/docs/api/tools-ozone-moderation-get-event
18
25
*/
19
26
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getEvent')]
20
-
public function getModerationEvent(int $id): Response
27
+
public function getModerationEvent(int $id): ModEventViewDetail
21
28
{
22
-
return $this->atp->client->get(
29
+
$response = $this->atp->client->get(
23
30
endpoint: 'tools.ozone.moderation.getEvent',
24
31
params: compact('id')
25
32
);
33
+
34
+
return ModEventViewDetail::fromArray($response->json());
26
35
}
27
36
28
37
/**
···
57
66
* @see https://docs.bsky.app/docs/api/tools-ozone-moderation-get-record
58
67
*/
59
68
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getRecord')]
60
-
public function getRecord(string $uri, ?string $cid = null): Response
69
+
public function getRecord(string $uri, ?string $cid = null): RecordViewDetail
61
70
{
62
-
return $this->atp->client->get(
71
+
$response = $this->atp->client->get(
63
72
endpoint: 'tools.ozone.moderation.getRecord',
64
73
params: compact('uri', 'cid')
65
74
);
75
+
76
+
return RecordViewDetail::fromArray($response->json());
66
77
}
67
78
68
79
/**
···
73
84
* @see https://docs.bsky.app/docs/api/tools-ozone-moderation-get-repo
74
85
*/
75
86
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.moderation.getRepo')]
76
-
public function getRepo(string $did): Response
87
+
public function getRepo(string $did): RepoViewDetail
77
88
{
78
-
return $this->atp->client->get(
89
+
$response = $this->atp->client->get(
79
90
endpoint: 'tools.ozone.moderation.getRepo',
80
91
params: compact('did')
81
92
);
93
+
94
+
return RepoViewDetail::fromArray($response->json());
82
95
}
83
96
84
97
/**
···
96
109
int $limit = 50,
97
110
?string $cursor = null,
98
111
bool $sortDirection = false
99
-
): Response {
100
-
return $this->atp->client->get(
112
+
): QueryEventsResponse {
113
+
$response = $this->atp->client->get(
101
114
endpoint: 'tools.ozone.moderation.queryEvents',
102
115
params: array_filter(
103
116
compact('types', 'createdBy', 'subject', 'limit', 'cursor', 'sortDirection'),
104
117
fn ($v) => ! is_null($v)
105
118
)
106
119
);
120
+
121
+
return QueryEventsResponse::fromArray($response->json());
107
122
}
108
123
109
124
/**
···
120
135
?string $excludeTags = null,
121
136
int $limit = 50,
122
137
?string $cursor = null
123
-
): Response {
124
-
return $this->atp->client->get(
138
+
): QueryStatusesResponse {
139
+
$response = $this->atp->client->get(
125
140
endpoint: 'tools.ozone.moderation.queryStatuses',
126
141
params: array_filter(
127
142
compact('subject', 'tags', 'excludeTags', 'limit', 'cursor'),
128
143
fn ($v) => ! is_null($v)
129
144
)
130
145
);
146
+
147
+
return QueryStatusesResponse::fromArray($response->json());
131
148
}
132
149
133
150
/**
···
143
160
?string $invitedBy = null,
144
161
int $limit = 50,
145
162
?string $cursor = null
146
-
): Response {
147
-
return $this->atp->client->get(
163
+
): SearchReposResponse {
164
+
$response = $this->atp->client->get(
148
165
endpoint: 'tools.ozone.moderation.searchRepos',
149
166
params: array_filter(
150
167
compact('term', 'invitedBy', 'limit', 'cursor'),
151
168
fn ($v) => ! is_null($v)
152
169
)
153
170
);
171
+
172
+
return SearchReposResponse::fromArray($response->json());
154
173
}
155
174
156
175
/**
···
166
185
string $subject,
167
186
array $subjectBlobCids = [],
168
187
?string $createdBy = null
169
-
): Response {
170
-
return $this->atp->client->post(
188
+
): ModEventView {
189
+
$response = $this->atp->client->post(
171
190
endpoint: 'tools.ozone.moderation.emitEvent',
172
191
body: compact('event', 'subject', 'subjectBlobCids', 'createdBy')
173
192
);
193
+
194
+
return ModEventView::fromArray($response->json());
174
195
}
175
196
}
+6
-3
src/Client/Requests/Ozone/ServerRequestClient.php
+6
-3
src/Client/Requests/Ozone/ServerRequestClient.php
···
4
4
5
5
use SocialDept\AtpClient\Attributes\RequiresScope;
6
6
use SocialDept\AtpClient\Client\Requests\Request;
7
+
use SocialDept\AtpClient\Data\Responses\Ozone\Server\GetConfigResponse;
7
8
use SocialDept\AtpClient\Enums\Scope;
8
9
use SocialDept\AtpClient\Http\Response;
9
10
10
11
class ServerRequestClient extends Request
11
12
{
12
13
/**
13
-
* Get blob
14
+
* Get blob (returns binary data)
14
15
*
15
16
* @requires transition:generic (rpc:tools.ozone.server.getBlob)
16
17
*
···
33
34
* @see https://docs.bsky.app/docs/api/tools-ozone-server-get-config
34
35
*/
35
36
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.server.getConfig')]
36
-
public function getConfig(): Response
37
+
public function getConfig(): GetConfigResponse
37
38
{
38
-
return $this->atp->client->get(
39
+
$response = $this->atp->client->get(
39
40
endpoint: 'tools.ozone.server.getConfig'
40
41
);
42
+
43
+
return GetConfigResponse::fromArray($response->json());
41
44
}
42
45
}
+25
-11
src/Client/Requests/Ozone/TeamRequestClient.php
+25
-11
src/Client/Requests/Ozone/TeamRequestClient.php
···
4
4
5
5
use SocialDept\AtpClient\Attributes\RequiresScope;
6
6
use SocialDept\AtpClient\Client\Requests\Request;
7
+
use SocialDept\AtpClient\Data\Responses\Ozone\Team\ListMembersResponse;
7
8
use SocialDept\AtpClient\Enums\Scope;
8
-
use SocialDept\AtpClient\Http\Response;
9
9
10
10
class TeamRequestClient extends Request
11
11
{
···
14
14
*
15
15
* @requires transition:generic (rpc:tools.ozone.team.getMember)
16
16
*
17
+
* @return array<string, mixed> Team member object
18
+
*
17
19
* @see https://docs.bsky.app/docs/api/tools-ozone-team-list-members
18
20
*/
19
21
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.getMember')]
20
-
public function getTeamMember(string $did): Response
22
+
public function getTeamMember(string $did): array
21
23
{
22
-
return $this->atp->client->get(
24
+
$response = $this->atp->client->get(
23
25
endpoint: 'tools.ozone.team.getMember',
24
26
params: compact('did')
25
27
);
28
+
29
+
return $response->json();
26
30
}
27
31
28
32
/**
···
33
37
* @see https://docs.bsky.app/docs/api/tools-ozone-team-list-members
34
38
*/
35
39
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.listMembers')]
36
-
public function listTeamMembers(int $limit = 50, ?string $cursor = null): Response
40
+
public function listTeamMembers(int $limit = 50, ?string $cursor = null): ListMembersResponse
37
41
{
38
-
return $this->atp->client->get(
42
+
$response = $this->atp->client->get(
39
43
endpoint: 'tools.ozone.team.listMembers',
40
44
params: compact('limit', 'cursor')
41
45
);
46
+
47
+
return ListMembersResponse::fromArray($response->json());
42
48
}
43
49
44
50
/**
45
51
* Add team member
46
52
*
47
53
* @requires transition:generic (rpc:tools.ozone.team.addMember)
54
+
*
55
+
* @return array<string, mixed> Team member object
48
56
*
49
57
* @see https://docs.bsky.app/docs/api/tools-ozone-team-add-member
50
58
*/
51
59
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.addMember')]
52
-
public function addTeamMember(string $did, string $role): Response
60
+
public function addTeamMember(string $did, string $role): array
53
61
{
54
-
return $this->atp->client->post(
62
+
$response = $this->atp->client->post(
55
63
endpoint: 'tools.ozone.team.addMember',
56
64
body: compact('did', 'role')
57
65
);
66
+
67
+
return $response->json();
58
68
}
59
69
60
70
/**
···
62
72
*
63
73
* @requires transition:generic (rpc:tools.ozone.team.updateMember)
64
74
*
75
+
* @return array<string, mixed> Team member object
76
+
*
65
77
* @see https://docs.bsky.app/docs/api/tools-ozone-team-update-member
66
78
*/
67
79
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.updateMember')]
···
69
81
string $did,
70
82
?bool $disabled = null,
71
83
?string $role = null
72
-
): Response {
73
-
return $this->atp->client->post(
84
+
): array {
85
+
$response = $this->atp->client->post(
74
86
endpoint: 'tools.ozone.team.updateMember',
75
87
body: array_filter(
76
88
compact('did', 'disabled', 'role'),
77
89
fn ($v) => ! is_null($v)
78
90
)
79
91
);
92
+
93
+
return $response->json();
80
94
}
81
95
82
96
/**
···
87
101
* @see https://docs.bsky.app/docs/api/tools-ozone-team-delete-member
88
102
*/
89
103
#[RequiresScope(Scope::TransitionGeneric, granular: 'rpc:tools.ozone.team.deleteMember')]
90
-
public function deleteTeamMember(string $did): Response
104
+
public function deleteTeamMember(string $did): void
91
105
{
92
-
return $this->atp->client->post(
106
+
$this->atp->client->post(
93
107
endpoint: 'tools.ozone.team.deleteMember',
94
108
body: compact('did')
95
109
);
+25
src/Data/Responses/Atproto/Repo/CreateRecordResponse.php
+25
src/Data/Responses/Atproto/Repo/CreateRecordResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Atproto\Repo;
4
+
5
+
use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\Defs\CommitMeta;
6
+
7
+
class CreateRecordResponse
8
+
{
9
+
public function __construct(
10
+
public readonly string $uri,
11
+
public readonly string $cid,
12
+
public readonly ?CommitMeta $commit = null,
13
+
public readonly ?string $validationStatus = null,
14
+
) {}
15
+
16
+
public static function fromArray(array $data): self
17
+
{
18
+
return new self(
19
+
uri: $data['uri'],
20
+
cid: $data['cid'],
21
+
commit: isset($data['commit']) ? CommitMeta::fromArray($data['commit']) : null,
22
+
validationStatus: $data['validationStatus'] ?? null,
23
+
);
24
+
}
25
+
}
+19
src/Data/Responses/Atproto/Repo/DeleteRecordResponse.php
+19
src/Data/Responses/Atproto/Repo/DeleteRecordResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Atproto\Repo;
4
+
5
+
use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\Defs\CommitMeta;
6
+
7
+
class DeleteRecordResponse
8
+
{
9
+
public function __construct(
10
+
public readonly ?CommitMeta $commit = null,
11
+
) {}
12
+
13
+
public static function fromArray(array $data): self
14
+
{
15
+
return new self(
16
+
commit: isset($data['commit']) ? CommitMeta::fromArray($data['commit']) : null,
17
+
);
18
+
}
19
+
}
+28
src/Data/Responses/Atproto/Repo/DescribeRepoResponse.php
+28
src/Data/Responses/Atproto/Repo/DescribeRepoResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Atproto\Repo;
4
+
5
+
class DescribeRepoResponse
6
+
{
7
+
/**
8
+
* @param array<string> $collections
9
+
*/
10
+
public function __construct(
11
+
public readonly string $handle,
12
+
public readonly string $did,
13
+
public readonly mixed $didDoc,
14
+
public readonly array $collections,
15
+
public readonly bool $handleIsCorrect,
16
+
) {}
17
+
18
+
public static function fromArray(array $data): self
19
+
{
20
+
return new self(
21
+
handle: $data['handle'],
22
+
did: $data['did'],
23
+
didDoc: $data['didDoc'],
24
+
collections: $data['collections'] ?? [],
25
+
handleIsCorrect: $data['handleIsCorrect'],
26
+
);
27
+
}
28
+
}
+21
src/Data/Responses/Atproto/Repo/GetRecordResponse.php
+21
src/Data/Responses/Atproto/Repo/GetRecordResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Atproto\Repo;
4
+
5
+
class GetRecordResponse
6
+
{
7
+
public function __construct(
8
+
public readonly string $uri,
9
+
public readonly mixed $value,
10
+
public readonly ?string $cid = null,
11
+
) {}
12
+
13
+
public static function fromArray(array $data): self
14
+
{
15
+
return new self(
16
+
uri: $data['uri'],
17
+
value: $data['value'],
18
+
cid: $data['cid'] ?? null,
19
+
);
20
+
}
21
+
}
+22
src/Data/Responses/Atproto/Repo/ListRecordsResponse.php
+22
src/Data/Responses/Atproto/Repo/ListRecordsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Atproto\Repo;
4
+
5
+
class ListRecordsResponse
6
+
{
7
+
/**
8
+
* @param array<array{uri: string, cid: string, value: mixed}> $records
9
+
*/
10
+
public function __construct(
11
+
public readonly array $records,
12
+
public readonly ?string $cursor = null,
13
+
) {}
14
+
15
+
public static function fromArray(array $data): self
16
+
{
17
+
return new self(
18
+
records: $data['records'] ?? [],
19
+
cursor: $data['cursor'] ?? null,
20
+
);
21
+
}
22
+
}
+25
src/Data/Responses/Atproto/Repo/PutRecordResponse.php
+25
src/Data/Responses/Atproto/Repo/PutRecordResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Atproto\Repo;
4
+
5
+
use SocialDept\AtpSchema\Generated\Com\Atproto\Repo\Defs\CommitMeta;
6
+
7
+
class PutRecordResponse
8
+
{
9
+
public function __construct(
10
+
public readonly string $uri,
11
+
public readonly string $cid,
12
+
public readonly ?CommitMeta $commit = null,
13
+
public readonly ?string $validationStatus = null,
14
+
) {}
15
+
16
+
public static function fromArray(array $data): self
17
+
{
18
+
return new self(
19
+
uri: $data['uri'],
20
+
cid: $data['cid'],
21
+
commit: isset($data['commit']) ? CommitMeta::fromArray($data['commit']) : null,
22
+
validationStatus: $data['validationStatus'] ?? null,
23
+
);
24
+
}
25
+
}
+30
src/Data/Responses/Atproto/Server/DescribeServerResponse.php
+30
src/Data/Responses/Atproto/Server/DescribeServerResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Atproto\Server;
4
+
5
+
class DescribeServerResponse
6
+
{
7
+
/**
8
+
* @param array<string> $availableUserDomains
9
+
*/
10
+
public function __construct(
11
+
public readonly string $did,
12
+
public readonly array $availableUserDomains,
13
+
public readonly ?bool $inviteCodeRequired = null,
14
+
public readonly ?bool $phoneVerificationRequired = null,
15
+
public readonly ?array $links = null,
16
+
public readonly ?array $contact = null,
17
+
) {}
18
+
19
+
public static function fromArray(array $data): self
20
+
{
21
+
return new self(
22
+
did: $data['did'],
23
+
availableUserDomains: $data['availableUserDomains'] ?? [],
24
+
inviteCodeRequired: $data['inviteCodeRequired'] ?? null,
25
+
phoneVerificationRequired: $data['phoneVerificationRequired'] ?? null,
26
+
links: $data['links'] ?? null,
27
+
contact: $data['contact'] ?? null,
28
+
);
29
+
}
30
+
}
+31
src/Data/Responses/Atproto/Server/GetSessionResponse.php
+31
src/Data/Responses/Atproto/Server/GetSessionResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Atproto\Server;
4
+
5
+
class GetSessionResponse
6
+
{
7
+
public function __construct(
8
+
public readonly string $handle,
9
+
public readonly string $did,
10
+
public readonly ?string $email = null,
11
+
public readonly ?bool $emailConfirmed = null,
12
+
public readonly ?bool $emailAuthFactor = null,
13
+
public readonly mixed $didDoc = null,
14
+
public readonly ?bool $active = null,
15
+
public readonly ?string $status = null,
16
+
) {}
17
+
18
+
public static function fromArray(array $data): self
19
+
{
20
+
return new self(
21
+
handle: $data['handle'],
22
+
did: $data['did'],
23
+
email: $data['email'] ?? null,
24
+
emailConfirmed: $data['emailConfirmed'] ?? null,
25
+
emailAuthFactor: $data['emailAuthFactor'] ?? null,
26
+
didDoc: $data['didDoc'] ?? null,
27
+
active: $data['active'] ?? null,
28
+
status: $data['status'] ?? null,
29
+
);
30
+
}
31
+
}
+23
src/Data/Responses/Atproto/Sync/GetRepoStatusResponse.php
+23
src/Data/Responses/Atproto/Sync/GetRepoStatusResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Atproto\Sync;
4
+
5
+
class GetRepoStatusResponse
6
+
{
7
+
public function __construct(
8
+
public readonly string $did,
9
+
public readonly bool $active,
10
+
public readonly ?string $status = null,
11
+
public readonly ?string $rev = null,
12
+
) {}
13
+
14
+
public static function fromArray(array $data): self
15
+
{
16
+
return new self(
17
+
did: $data['did'],
18
+
active: $data['active'],
19
+
status: $data['status'] ?? null,
20
+
rev: $data['rev'] ?? null,
21
+
);
22
+
}
23
+
}
+22
src/Data/Responses/Atproto/Sync/ListBlobsResponse.php
+22
src/Data/Responses/Atproto/Sync/ListBlobsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Atproto\Sync;
4
+
5
+
class ListBlobsResponse
6
+
{
7
+
/**
8
+
* @param array<string> $cids
9
+
*/
10
+
public function __construct(
11
+
public readonly array $cids,
12
+
public readonly ?string $cursor = null,
13
+
) {}
14
+
15
+
public static function fromArray(array $data): self
16
+
{
17
+
return new self(
18
+
cids: $data['cids'] ?? [],
19
+
cursor: $data['cursor'] ?? null,
20
+
);
21
+
}
22
+
}
+22
src/Data/Responses/Atproto/Sync/ListReposResponse.php
+22
src/Data/Responses/Atproto/Sync/ListReposResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Atproto\Sync;
4
+
5
+
class ListReposResponse
6
+
{
7
+
/**
8
+
* @param array<array{did: string, head: string, rev: string, active?: bool, status?: string}> $repos
9
+
*/
10
+
public function __construct(
11
+
public readonly array $repos,
12
+
public readonly ?string $cursor = null,
13
+
) {}
14
+
15
+
public static function fromArray(array $data): self
16
+
{
17
+
return new self(
18
+
repos: $data['repos'] ?? [],
19
+
cursor: $data['cursor'] ?? null,
20
+
);
21
+
}
22
+
}
+25
src/Data/Responses/Bsky/Actor/GetProfilesResponse.php
+25
src/Data/Responses/Bsky/Actor/GetProfilesResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Actor;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewDetailed;
6
+
7
+
class GetProfilesResponse
8
+
{
9
+
/**
10
+
* @param array<ProfileViewDetailed> $profiles
11
+
*/
12
+
public function __construct(
13
+
public readonly array $profiles,
14
+
) {}
15
+
16
+
public static function fromArray(array $data): self
17
+
{
18
+
return new self(
19
+
profiles: array_map(
20
+
fn (array $profile) => ProfileViewDetailed::fromArray($profile),
21
+
$data['profiles'] ?? []
22
+
),
23
+
);
24
+
}
25
+
}
+27
src/Data/Responses/Bsky/Actor/GetSuggestionsResponse.php
+27
src/Data/Responses/Bsky/Actor/GetSuggestionsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Actor;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView;
6
+
7
+
class GetSuggestionsResponse
8
+
{
9
+
/**
10
+
* @param array<ProfileView> $actors
11
+
*/
12
+
public function __construct(
13
+
public readonly array $actors,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
actors: array_map(
21
+
fn (array $actor) => ProfileView::fromArray($actor),
22
+
$data['actors'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+27
src/Data/Responses/Bsky/Actor/SearchActorsResponse.php
+27
src/Data/Responses/Bsky/Actor/SearchActorsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Actor;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView;
6
+
7
+
class SearchActorsResponse
8
+
{
9
+
/**
10
+
* @param array<ProfileView> $actors
11
+
*/
12
+
public function __construct(
13
+
public readonly array $actors,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
actors: array_map(
21
+
fn (array $actor) => ProfileView::fromArray($actor),
22
+
$data['actors'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+25
src/Data/Responses/Bsky/Actor/SearchActorsTypeaheadResponse.php
+25
src/Data/Responses/Bsky/Actor/SearchActorsTypeaheadResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Actor;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileViewBasic;
6
+
7
+
class SearchActorsTypeaheadResponse
8
+
{
9
+
/**
10
+
* @param array<ProfileViewBasic> $actors
11
+
*/
12
+
public function __construct(
13
+
public readonly array $actors,
14
+
) {}
15
+
16
+
public static function fromArray(array $data): self
17
+
{
18
+
return new self(
19
+
actors: array_map(
20
+
fn (array $actor) => ProfileViewBasic::fromArray($actor),
21
+
$data['actors'] ?? []
22
+
),
23
+
);
24
+
}
25
+
}
+24
src/Data/Responses/Bsky/Feed/DescribeFeedGeneratorResponse.php
+24
src/Data/Responses/Bsky/Feed/DescribeFeedGeneratorResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
class DescribeFeedGeneratorResponse
6
+
{
7
+
/**
8
+
* @param array<array{uri: string}> $feeds
9
+
*/
10
+
public function __construct(
11
+
public readonly string $did,
12
+
public readonly array $feeds,
13
+
public readonly ?array $links = null,
14
+
) {}
15
+
16
+
public static function fromArray(array $data): self
17
+
{
18
+
return new self(
19
+
did: $data['did'],
20
+
feeds: $data['feeds'] ?? [],
21
+
links: $data['links'] ?? null,
22
+
);
23
+
}
24
+
}
+27
src/Data/Responses/Bsky/Feed/GetActorFeedsResponse.php
+27
src/Data/Responses/Bsky/Feed/GetActorFeedsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\GeneratorView;
6
+
7
+
class GetActorFeedsResponse
8
+
{
9
+
/**
10
+
* @param array<GeneratorView> $feeds
11
+
*/
12
+
public function __construct(
13
+
public readonly array $feeds,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
feeds: array_map(
21
+
fn (array $feed) => GeneratorView::fromArray($feed),
22
+
$data['feeds'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+27
src/Data/Responses/Bsky/Feed/GetActorLikesResponse.php
+27
src/Data/Responses/Bsky/Feed/GetActorLikesResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\FeedViewPost;
6
+
7
+
class GetActorLikesResponse
8
+
{
9
+
/**
10
+
* @param array<FeedViewPost> $feed
11
+
*/
12
+
public function __construct(
13
+
public readonly array $feed,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
feed: array_map(
21
+
fn (array $post) => FeedViewPost::fromArray($post),
22
+
$data['feed'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+27
src/Data/Responses/Bsky/Feed/GetAuthorFeedResponse.php
+27
src/Data/Responses/Bsky/Feed/GetAuthorFeedResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\FeedViewPost;
6
+
7
+
class GetAuthorFeedResponse
8
+
{
9
+
/**
10
+
* @param array<FeedViewPost> $feed
11
+
*/
12
+
public function __construct(
13
+
public readonly array $feed,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
feed: array_map(
21
+
fn (array $post) => FeedViewPost::fromArray($post),
22
+
$data['feed'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+23
src/Data/Responses/Bsky/Feed/GetFeedGeneratorResponse.php
+23
src/Data/Responses/Bsky/Feed/GetFeedGeneratorResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\GeneratorView;
6
+
7
+
class GetFeedGeneratorResponse
8
+
{
9
+
public function __construct(
10
+
public readonly GeneratorView $view,
11
+
public readonly bool $isOnline,
12
+
public readonly bool $isValid,
13
+
) {}
14
+
15
+
public static function fromArray(array $data): self
16
+
{
17
+
return new self(
18
+
view: GeneratorView::fromArray($data['view']),
19
+
isOnline: $data['isOnline'],
20
+
isValid: $data['isValid'],
21
+
);
22
+
}
23
+
}
+25
src/Data/Responses/Bsky/Feed/GetFeedGeneratorsResponse.php
+25
src/Data/Responses/Bsky/Feed/GetFeedGeneratorsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\GeneratorView;
6
+
7
+
class GetFeedGeneratorsResponse
8
+
{
9
+
/**
10
+
* @param array<GeneratorView> $feeds
11
+
*/
12
+
public function __construct(
13
+
public readonly array $feeds,
14
+
) {}
15
+
16
+
public static function fromArray(array $data): self
17
+
{
18
+
return new self(
19
+
feeds: array_map(
20
+
fn (array $feed) => GeneratorView::fromArray($feed),
21
+
$data['feeds'] ?? []
22
+
),
23
+
);
24
+
}
25
+
}
+27
src/Data/Responses/Bsky/Feed/GetFeedResponse.php
+27
src/Data/Responses/Bsky/Feed/GetFeedResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\FeedViewPost;
6
+
7
+
class GetFeedResponse
8
+
{
9
+
/**
10
+
* @param array<FeedViewPost> $feed
11
+
*/
12
+
public function __construct(
13
+
public readonly array $feed,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
feed: array_map(
21
+
fn (array $post) => FeedViewPost::fromArray($post),
22
+
$data['feed'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+31
src/Data/Responses/Bsky/Feed/GetLikesResponse.php
+31
src/Data/Responses/Bsky/Feed/GetLikesResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\GetLikes\Like;
6
+
7
+
class GetLikesResponse
8
+
{
9
+
/**
10
+
* @param array<Like> $likes
11
+
*/
12
+
public function __construct(
13
+
public readonly string $uri,
14
+
public readonly array $likes,
15
+
public readonly ?string $cid = null,
16
+
public readonly ?string $cursor = null,
17
+
) {}
18
+
19
+
public static function fromArray(array $data): self
20
+
{
21
+
return new self(
22
+
uri: $data['uri'],
23
+
likes: array_map(
24
+
fn (array $like) => Like::fromArray($like),
25
+
$data['likes'] ?? []
26
+
),
27
+
cid: $data['cid'] ?? null,
28
+
cursor: $data['cursor'] ?? null,
29
+
);
30
+
}
31
+
}
+21
src/Data/Responses/Bsky/Feed/GetPostThreadResponse.php
+21
src/Data/Responses/Bsky/Feed/GetPostThreadResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\ThreadViewPost;
6
+
7
+
class GetPostThreadResponse
8
+
{
9
+
public function __construct(
10
+
public readonly ThreadViewPost $thread,
11
+
public readonly mixed $threadgate = null,
12
+
) {}
13
+
14
+
public static function fromArray(array $data): self
15
+
{
16
+
return new self(
17
+
thread: ThreadViewPost::fromArray($data['thread']),
18
+
threadgate: $data['threadgate'] ?? null,
19
+
);
20
+
}
21
+
}
+25
src/Data/Responses/Bsky/Feed/GetPostsResponse.php
+25
src/Data/Responses/Bsky/Feed/GetPostsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\PostView;
6
+
7
+
class GetPostsResponse
8
+
{
9
+
/**
10
+
* @param array<PostView> $posts
11
+
*/
12
+
public function __construct(
13
+
public readonly array $posts,
14
+
) {}
15
+
16
+
public static function fromArray(array $data): self
17
+
{
18
+
return new self(
19
+
posts: array_map(
20
+
fn (array $post) => PostView::fromArray($post),
21
+
$data['posts'] ?? []
22
+
),
23
+
);
24
+
}
25
+
}
+31
src/Data/Responses/Bsky/Feed/GetQuotesResponse.php
+31
src/Data/Responses/Bsky/Feed/GetQuotesResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\PostView;
6
+
7
+
class GetQuotesResponse
8
+
{
9
+
/**
10
+
* @param array<PostView> $posts
11
+
*/
12
+
public function __construct(
13
+
public readonly string $uri,
14
+
public readonly array $posts,
15
+
public readonly ?string $cid = null,
16
+
public readonly ?string $cursor = null,
17
+
) {}
18
+
19
+
public static function fromArray(array $data): self
20
+
{
21
+
return new self(
22
+
uri: $data['uri'],
23
+
posts: array_map(
24
+
fn (array $post) => PostView::fromArray($post),
25
+
$data['posts'] ?? []
26
+
),
27
+
cid: $data['cid'] ?? null,
28
+
cursor: $data['cursor'] ?? null,
29
+
);
30
+
}
31
+
}
+31
src/Data/Responses/Bsky/Feed/GetRepostedByResponse.php
+31
src/Data/Responses/Bsky/Feed/GetRepostedByResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView;
6
+
7
+
class GetRepostedByResponse
8
+
{
9
+
/**
10
+
* @param array<ProfileView> $repostedBy
11
+
*/
12
+
public function __construct(
13
+
public readonly string $uri,
14
+
public readonly array $repostedBy,
15
+
public readonly ?string $cid = null,
16
+
public readonly ?string $cursor = null,
17
+
) {}
18
+
19
+
public static function fromArray(array $data): self
20
+
{
21
+
return new self(
22
+
uri: $data['uri'],
23
+
repostedBy: array_map(
24
+
fn (array $profile) => ProfileView::fromArray($profile),
25
+
$data['repostedBy'] ?? []
26
+
),
27
+
cid: $data['cid'] ?? null,
28
+
cursor: $data['cursor'] ?? null,
29
+
);
30
+
}
31
+
}
+27
src/Data/Responses/Bsky/Feed/GetSuggestedFeedsResponse.php
+27
src/Data/Responses/Bsky/Feed/GetSuggestedFeedsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\GeneratorView;
6
+
7
+
class GetSuggestedFeedsResponse
8
+
{
9
+
/**
10
+
* @param array<GeneratorView> $feeds
11
+
*/
12
+
public function __construct(
13
+
public readonly array $feeds,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
feeds: array_map(
21
+
fn (array $feed) => GeneratorView::fromArray($feed),
22
+
$data['feeds'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+27
src/Data/Responses/Bsky/Feed/GetTimelineResponse.php
+27
src/Data/Responses/Bsky/Feed/GetTimelineResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\FeedViewPost;
6
+
7
+
class GetTimelineResponse
8
+
{
9
+
/**
10
+
* @param array<FeedViewPost> $feed
11
+
*/
12
+
public function __construct(
13
+
public readonly array $feed,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
feed: array_map(
21
+
fn (array $post) => FeedViewPost::fromArray($post),
22
+
$data['feed'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+29
src/Data/Responses/Bsky/Feed/SearchPostsResponse.php
+29
src/Data/Responses/Bsky/Feed/SearchPostsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Feed;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Feed\Defs\PostView;
6
+
7
+
class SearchPostsResponse
8
+
{
9
+
/**
10
+
* @param array<PostView> $posts
11
+
*/
12
+
public function __construct(
13
+
public readonly array $posts,
14
+
public readonly ?string $cursor = null,
15
+
public readonly ?int $hitsTotal = null,
16
+
) {}
17
+
18
+
public static function fromArray(array $data): self
19
+
{
20
+
return new self(
21
+
posts: array_map(
22
+
fn (array $post) => PostView::fromArray($post),
23
+
$data['posts'] ?? []
24
+
),
25
+
cursor: $data['cursor'] ?? null,
26
+
hitsTotal: $data['hitsTotal'] ?? null,
27
+
);
28
+
}
29
+
}
+29
src/Data/Responses/Bsky/Graph/GetFollowersResponse.php
+29
src/Data/Responses/Bsky/Graph/GetFollowersResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView;
6
+
7
+
class GetFollowersResponse
8
+
{
9
+
/**
10
+
* @param array<ProfileView> $followers
11
+
*/
12
+
public function __construct(
13
+
public readonly ProfileView $subject,
14
+
public readonly array $followers,
15
+
public readonly ?string $cursor = null,
16
+
) {}
17
+
18
+
public static function fromArray(array $data): self
19
+
{
20
+
return new self(
21
+
subject: ProfileView::fromArray($data['subject']),
22
+
followers: array_map(
23
+
fn (array $profile) => ProfileView::fromArray($profile),
24
+
$data['followers'] ?? []
25
+
),
26
+
cursor: $data['cursor'] ?? null,
27
+
);
28
+
}
29
+
}
+29
src/Data/Responses/Bsky/Graph/GetFollowsResponse.php
+29
src/Data/Responses/Bsky/Graph/GetFollowsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView;
6
+
7
+
class GetFollowsResponse
8
+
{
9
+
/**
10
+
* @param array<ProfileView> $follows
11
+
*/
12
+
public function __construct(
13
+
public readonly ProfileView $subject,
14
+
public readonly array $follows,
15
+
public readonly ?string $cursor = null,
16
+
) {}
17
+
18
+
public static function fromArray(array $data): self
19
+
{
20
+
return new self(
21
+
subject: ProfileView::fromArray($data['subject']),
22
+
follows: array_map(
23
+
fn (array $profile) => ProfileView::fromArray($profile),
24
+
$data['follows'] ?? []
25
+
),
26
+
cursor: $data['cursor'] ?? null,
27
+
);
28
+
}
29
+
}
+29
src/Data/Responses/Bsky/Graph/GetKnownFollowersResponse.php
+29
src/Data/Responses/Bsky/Graph/GetKnownFollowersResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView;
6
+
7
+
class GetKnownFollowersResponse
8
+
{
9
+
/**
10
+
* @param array<ProfileView> $followers
11
+
*/
12
+
public function __construct(
13
+
public readonly ProfileView $subject,
14
+
public readonly array $followers,
15
+
public readonly ?string $cursor = null,
16
+
) {}
17
+
18
+
public static function fromArray(array $data): self
19
+
{
20
+
return new self(
21
+
subject: ProfileView::fromArray($data['subject']),
22
+
followers: array_map(
23
+
fn (array $profile) => ProfileView::fromArray($profile),
24
+
$data['followers'] ?? []
25
+
),
26
+
cursor: $data['cursor'] ?? null,
27
+
);
28
+
}
29
+
}
+30
src/Data/Responses/Bsky/Graph/GetListResponse.php
+30
src/Data/Responses/Bsky/Graph/GetListResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\ListItemView;
6
+
use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\ListView;
7
+
8
+
class GetListResponse
9
+
{
10
+
/**
11
+
* @param array<ListItemView> $items
12
+
*/
13
+
public function __construct(
14
+
public readonly ListView $list,
15
+
public readonly array $items,
16
+
public readonly ?string $cursor = null,
17
+
) {}
18
+
19
+
public static function fromArray(array $data): self
20
+
{
21
+
return new self(
22
+
list: ListView::fromArray($data['list']),
23
+
items: array_map(
24
+
fn (array $item) => ListItemView::fromArray($item),
25
+
$data['items'] ?? []
26
+
),
27
+
cursor: $data['cursor'] ?? null,
28
+
);
29
+
}
30
+
}
+27
src/Data/Responses/Bsky/Graph/GetListsResponse.php
+27
src/Data/Responses/Bsky/Graph/GetListsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\ListView;
6
+
7
+
class GetListsResponse
8
+
{
9
+
/**
10
+
* @param array<ListView> $lists
11
+
*/
12
+
public function __construct(
13
+
public readonly array $lists,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
lists: array_map(
21
+
fn (array $list) => ListView::fromArray($list),
22
+
$data['lists'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+22
src/Data/Responses/Bsky/Graph/GetRelationshipsResponse.php
+22
src/Data/Responses/Bsky/Graph/GetRelationshipsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph;
4
+
5
+
class GetRelationshipsResponse
6
+
{
7
+
/**
8
+
* @param array<mixed> $relationships Array of Relationship or NotFoundActor objects
9
+
*/
10
+
public function __construct(
11
+
public readonly array $relationships,
12
+
public readonly ?string $actor = null,
13
+
) {}
14
+
15
+
public static function fromArray(array $data): self
16
+
{
17
+
return new self(
18
+
relationships: $data['relationships'] ?? [],
19
+
actor: $data['actor'] ?? null,
20
+
);
21
+
}
22
+
}
+25
src/Data/Responses/Bsky/Graph/GetStarterPacksResponse.php
+25
src/Data/Responses/Bsky/Graph/GetStarterPacksResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Graph\Defs\StarterPackViewBasic;
6
+
7
+
class GetStarterPacksResponse
8
+
{
9
+
/**
10
+
* @param array<StarterPackViewBasic> $starterPacks
11
+
*/
12
+
public function __construct(
13
+
public readonly array $starterPacks,
14
+
) {}
15
+
16
+
public static function fromArray(array $data): self
17
+
{
18
+
return new self(
19
+
starterPacks: array_map(
20
+
fn (array $pack) => StarterPackViewBasic::fromArray($pack),
21
+
$data['starterPacks'] ?? []
22
+
),
23
+
);
24
+
}
25
+
}
+27
src/Data/Responses/Bsky/Graph/GetSuggestedFollowsByActorResponse.php
+27
src/Data/Responses/Bsky/Graph/GetSuggestedFollowsByActorResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Graph;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Actor\Defs\ProfileView;
6
+
7
+
class GetSuggestedFollowsByActorResponse
8
+
{
9
+
/**
10
+
* @param array<ProfileView> $suggestions
11
+
*/
12
+
public function __construct(
13
+
public readonly array $suggestions,
14
+
public readonly ?bool $isFallback = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
suggestions: array_map(
21
+
fn (array $profile) => ProfileView::fromArray($profile),
22
+
$data['suggestions'] ?? []
23
+
),
24
+
isFallback: $data['isFallback'] ?? null,
25
+
);
26
+
}
27
+
}
+28
src/Data/Responses/Bsky/Labeler/GetServicesResponse.php
+28
src/Data/Responses/Bsky/Labeler/GetServicesResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Bsky\Labeler;
4
+
5
+
use SocialDept\AtpSchema\Generated\App\Bsky\Labeler\Defs\LabelerView;
6
+
use SocialDept\AtpSchema\Generated\App\Bsky\Labeler\Defs\LabelerViewDetailed;
7
+
8
+
class GetServicesResponse
9
+
{
10
+
/**
11
+
* @param array<LabelerView|LabelerViewDetailed> $views
12
+
*/
13
+
public function __construct(
14
+
public readonly array $views,
15
+
) {}
16
+
17
+
public static function fromArray(array $data, bool $detailed = false): self
18
+
{
19
+
return new self(
20
+
views: array_map(
21
+
fn (array $view) => $detailed
22
+
? LabelerViewDetailed::fromArray($view)
23
+
: LabelerView::fromArray($view),
24
+
$data['views'] ?? []
25
+
),
26
+
);
27
+
}
28
+
}
+22
src/Data/Responses/Chat/Convo/GetLogResponse.php
+22
src/Data/Responses/Chat/Convo/GetLogResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Chat\Convo;
4
+
5
+
class GetLogResponse
6
+
{
7
+
/**
8
+
* @param array<mixed> $logs Array of log event objects (LogBeginConvo, LogCreateMessage, etc.)
9
+
*/
10
+
public function __construct(
11
+
public readonly array $logs,
12
+
public readonly ?string $cursor = null,
13
+
) {}
14
+
15
+
public static function fromArray(array $data): self
16
+
{
17
+
return new self(
18
+
logs: $data['logs'] ?? [],
19
+
cursor: $data['cursor'] ?? null,
20
+
);
21
+
}
22
+
}
+34
src/Data/Responses/Chat/Convo/GetMessagesResponse.php
+34
src/Data/Responses/Chat/Convo/GetMessagesResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Chat\Convo;
4
+
5
+
use SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs\DeletedMessageView;
6
+
use SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs\MessageView;
7
+
8
+
class GetMessagesResponse
9
+
{
10
+
/**
11
+
* @param array<MessageView|DeletedMessageView> $messages
12
+
*/
13
+
public function __construct(
14
+
public readonly array $messages,
15
+
public readonly ?string $cursor = null,
16
+
) {}
17
+
18
+
public static function fromArray(array $data): self
19
+
{
20
+
return new self(
21
+
messages: array_map(
22
+
function (array $message) {
23
+
if (isset($message['$type']) && $message['$type'] === 'chat.bsky.convo.defs#deletedMessageView') {
24
+
return DeletedMessageView::fromArray($message);
25
+
}
26
+
27
+
return MessageView::fromArray($message);
28
+
},
29
+
$data['messages'] ?? []
30
+
),
31
+
cursor: $data['cursor'] ?? null,
32
+
);
33
+
}
34
+
}
+19
src/Data/Responses/Chat/Convo/LeaveConvoResponse.php
+19
src/Data/Responses/Chat/Convo/LeaveConvoResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Chat\Convo;
4
+
5
+
class LeaveConvoResponse
6
+
{
7
+
public function __construct(
8
+
public readonly string $convoId,
9
+
public readonly string $rev,
10
+
) {}
11
+
12
+
public static function fromArray(array $data): self
13
+
{
14
+
return new self(
15
+
convoId: $data['convoId'],
16
+
rev: $data['rev'],
17
+
);
18
+
}
19
+
}
+27
src/Data/Responses/Chat/Convo/ListConvosResponse.php
+27
src/Data/Responses/Chat/Convo/ListConvosResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Chat\Convo;
4
+
5
+
use SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs\ConvoView;
6
+
7
+
class ListConvosResponse
8
+
{
9
+
/**
10
+
* @param array<ConvoView> $convos
11
+
*/
12
+
public function __construct(
13
+
public readonly array $convos,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
convos: array_map(
21
+
fn (array $convo) => ConvoView::fromArray($convo),
22
+
$data['convos'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+25
src/Data/Responses/Chat/Convo/SendMessageBatchResponse.php
+25
src/Data/Responses/Chat/Convo/SendMessageBatchResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Chat\Convo;
4
+
5
+
use SocialDept\AtpSchema\Generated\Chat\Bsky\Convo\Defs\MessageView;
6
+
7
+
class SendMessageBatchResponse
8
+
{
9
+
/**
10
+
* @param array<MessageView> $items
11
+
*/
12
+
public function __construct(
13
+
public readonly array $items,
14
+
) {}
15
+
16
+
public static function fromArray(array $data): self
17
+
{
18
+
return new self(
19
+
items: array_map(
20
+
fn (array $item) => MessageView::fromArray($item),
21
+
$data['items'] ?? []
22
+
),
23
+
);
24
+
}
25
+
}
+27
src/Data/Responses/Ozone/Moderation/QueryEventsResponse.php
+27
src/Data/Responses/Ozone/Moderation/QueryEventsResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Ozone\Moderation;
4
+
5
+
use SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs\ModEventView;
6
+
7
+
class QueryEventsResponse
8
+
{
9
+
/**
10
+
* @param array<ModEventView> $events
11
+
*/
12
+
public function __construct(
13
+
public readonly array $events,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
events: array_map(
21
+
fn (array $event) => ModEventView::fromArray($event),
22
+
$data['events'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+27
src/Data/Responses/Ozone/Moderation/QueryStatusesResponse.php
+27
src/Data/Responses/Ozone/Moderation/QueryStatusesResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Ozone\Moderation;
4
+
5
+
use SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs\SubjectStatusView;
6
+
7
+
class QueryStatusesResponse
8
+
{
9
+
/**
10
+
* @param array<SubjectStatusView> $subjectStatuses
11
+
*/
12
+
public function __construct(
13
+
public readonly array $subjectStatuses,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
subjectStatuses: array_map(
21
+
fn (array $status) => SubjectStatusView::fromArray($status),
22
+
$data['subjectStatuses'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+27
src/Data/Responses/Ozone/Moderation/SearchReposResponse.php
+27
src/Data/Responses/Ozone/Moderation/SearchReposResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Ozone\Moderation;
4
+
5
+
use SocialDept\AtpSchema\Generated\Tools\Ozone\Moderation\Defs\RepoView;
6
+
7
+
class SearchReposResponse
8
+
{
9
+
/**
10
+
* @param array<RepoView> $repos
11
+
*/
12
+
public function __construct(
13
+
public readonly array $repos,
14
+
public readonly ?string $cursor = null,
15
+
) {}
16
+
17
+
public static function fromArray(array $data): self
18
+
{
19
+
return new self(
20
+
repos: array_map(
21
+
fn (array $repo) => RepoView::fromArray($repo),
22
+
$data['repos'] ?? []
23
+
),
24
+
cursor: $data['cursor'] ?? null,
25
+
);
26
+
}
27
+
}
+30
src/Data/Responses/Ozone/Server/GetConfigResponse.php
+30
src/Data/Responses/Ozone/Server/GetConfigResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Ozone\Server;
4
+
5
+
use SocialDept\AtpSchema\Generated\Tools\Ozone\Server\GetConfig\ServiceConfig;
6
+
use SocialDept\AtpSchema\Generated\Tools\Ozone\Server\GetConfig\ViewerConfig;
7
+
8
+
class GetConfigResponse
9
+
{
10
+
public function __construct(
11
+
public readonly ?ServiceConfig $appview = null,
12
+
public readonly ?ServiceConfig $pds = null,
13
+
public readonly ?ServiceConfig $blobDivert = null,
14
+
public readonly ?ServiceConfig $chat = null,
15
+
public readonly ?ViewerConfig $viewer = null,
16
+
public readonly ?string $verifierDid = null,
17
+
) {}
18
+
19
+
public static function fromArray(array $data): self
20
+
{
21
+
return new self(
22
+
appview: isset($data['appview']) ? ServiceConfig::fromArray($data['appview']) : null,
23
+
pds: isset($data['pds']) ? ServiceConfig::fromArray($data['pds']) : null,
24
+
blobDivert: isset($data['blobDivert']) ? ServiceConfig::fromArray($data['blobDivert']) : null,
25
+
chat: isset($data['chat']) ? ServiceConfig::fromArray($data['chat']) : null,
26
+
viewer: isset($data['viewer']) ? ViewerConfig::fromArray($data['viewer']) : null,
27
+
verifierDid: $data['verifierDid'] ?? null,
28
+
);
29
+
}
30
+
}
+22
src/Data/Responses/Ozone/Team/ListMembersResponse.php
+22
src/Data/Responses/Ozone/Team/ListMembersResponse.php
···
1
+
<?php
2
+
3
+
namespace SocialDept\AtpClient\Data\Responses\Ozone\Team;
4
+
5
+
class ListMembersResponse
6
+
{
7
+
/**
8
+
* @param array<array<string, mixed>> $members Array of team member objects
9
+
*/
10
+
public function __construct(
11
+
public readonly array $members,
12
+
public readonly ?string $cursor = null,
13
+
) {}
14
+
15
+
public static function fromArray(array $data): self
16
+
{
17
+
return new self(
18
+
members: $data['members'] ?? [],
19
+
cursor: $data['cursor'] ?? null,
20
+
);
21
+
}
22
+
}