Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149<?php
declare(strict_types=1);
namespace Wotnak\Atproto;
use Psr\Http\Message\StreamInterface;use Wotnak\Atproto\Client\RawXrpcResponse;use Wotnak\Atproto\Client\XrpcOptions;use Wotnak\Atproto\Client\XrpcResponse;use Wotnak\Atproto\Identity\DidResolver;use Wotnak\Atproto\Identity\HandleResolver;use Wotnak\Atproto\Lexicon\LexiconRepositoryInterface;
/** * Public facade for XRPC execution and identity resolution. * * @api */interface AtprotoClientInterface {
/** * Executes a JSON XRPC query. * * @param array<string, mixed> $query * * @return array<string, mixed> */ public function get(string $method, array $query = [], ?XrpcOptions $options = NULL): array;
/** * Executes a JSON XRPC procedure. * * @param array<string, mixed> $payload * * @return array<string, mixed> */ public function post(string $method, array $payload = [], ?XrpcOptions $options = NULL): array;
/** * Executes an XRPC procedure with a caller-provided body. * * @return array<string, mixed> */ public function postRaw( string $method, string|StreamInterface $body, string $contentType = 'application/octet-stream', ?XrpcOptions $options = NULL, ): array;
/** * Executes a JSON XRPC request with the selected HTTP method. * * @param array<string, mixed> $data */ public function request( string $httpMethod, string $method, array $data = [], ?XrpcOptions $options = NULL, ): XrpcResponse;
/** * Executes a JSON XRPC request without a body. * * @param array<string, mixed> $query */ public function requestWithoutBody( string $httpMethod, string $method, array $query = [], ?XrpcOptions $options = NULL, ): XrpcResponse;
/** * Executes a JSON XRPC request with a caller-provided body. * * @param array<string, mixed> $query */ public function requestWithBody( string $httpMethod, string $method, string|StreamInterface $body, string $contentType = 'application/octet-stream', array $query = [], ?XrpcOptions $options = NULL, ): XrpcResponse;
/** * Executes an XRPC request and returns its raw response body. * * @param array<string, mixed> $data */ public function requestRaw( string $httpMethod, string $method, array $data = [], ?XrpcOptions $options = NULL, ): RawXrpcResponse;
/** * Executes an XRPC request without a body and returns its raw response. * * @param array<string, mixed> $query */ public function requestRawWithoutBody( string $httpMethod, string $method, array $query = [], ?XrpcOptions $options = NULL, ): RawXrpcResponse;
/** * Executes an XRPC request with a caller-provided body and returns its raw response. * * @param array<string, mixed> $query */ public function requestRawWithBody( string $httpMethod, string $method, string|StreamInterface $body, string $contentType = 'application/octet-stream', array $query = [], ?XrpcOptions $options = NULL, ): RawXrpcResponse;
/** * Returns the default service url. */ public function getDefaultServiceUrl(): ?string;
/** * Creates a Lexicon-aware XRPC client for the repository. */ public function lexicons(LexiconRepositoryInterface $repository): LexiconXrpcClient;
/** * Returns the configured handle resolver. */ public function handles(): HandleResolver;
/** * Returns the configured DID resolver. */ public function dids(): DidResolver;
}