poptart_core library

Classes

AtUri
This is the Dart implementation of AT Uri in AT Protocol.
AtUriConverter
BaseHttpService
Blob
https://atproto.com/specs/data-model#blob-type
BlobConverter
BlobRef
https://atproto.com/specs/data-model#blob-type
Challenge
CID
This is a simple implementation of V1 CID, or a content identifier. CID is a label used to point to material in IPFS.
EmptyData
An object representing a state that is empty instead of null.
Jitter
Jwt
NSID
This is the Dart implementation of NSID in AT Protocol.
NSIDConverter
PoptartClient
A single app-facing client for authenticated and anonymous XRPC calls.
RateLimit
Represents the rate limit applied to an API or a service.
RateLimitPolicy
Represents a policy for rate limiting.
Request
A class that represents a Request sent during HTTP communication.
Response<D>
The class represents the response from the server.
RetryConfig
This class represents an automatic retry configuration.
RetryEvent
This class represents the event during the retry process.
Serializable
ServiceContext
Session
Represents a user session.
Subscription<T>
XRPCClient
A single XRPC client for any lexicon method descriptor.
XRPCError
XRPCMethod<P, I, O>
XRPCMethodDescriptor<P, I, O>
XRPCObjectDescriptor<T>
XRPCRecordDescriptor<T>
XRPCRequest
A class that represents a Request sent during XRPC communication.
XRPCResponse<D>
The class represents the response from ATP server.
XRPCSchemaDescriptor<T>

Enums

HttpMethod
HttpStatus
Multicodec
Represents multicodecs types.
Protocol
XRPCMethodKind

Extensions

BlobPatterns on Blob
Adds pattern-matching-related methods to Blob.
BlobRefPatterns on BlobRef
Adds pattern-matching-related methods to BlobRef.
JwtExtension on Jwt
JwtPatterns on Jwt
Adds pattern-matching-related methods to Jwt.
OauthSessionExtension on OAuthSession
SessionExtension on Session
SessionPatterns on Session
Adds pattern-matching-related methods to Session.

Constants

cbor → const CborSimpleCodec
A constant instance of CborSimpleCodec.
defaultLinkPreviewService → const String
cardyb.bsky.app
defaultProtocol → const Protocol
The default HTTP protocol.
defaultRelayService → const String
bsky.network
defaultService → const String
bsky.social
defaultTimeout → const Duration
The default timeout duration.
objectType → const String
$type

Functions

createSession({required String identifier, required String password, String? authFactorToken, Protocol? protocol, String? service, RetryConfig? retryConfig, PostClient? client}) Future<XRPCResponse<Session>>
Creates an app-password session.
decodeCar(Uint8List bytes) Map<String, Map<String, dynamic>>
decodeJwt(String jwt) Jwt
Returns the decoded Jwt based on jwt.
deleteSession({Protocol? protocol, String? service, required String refreshJwt, RetryConfig? retryConfig, PostClient? client}) Future<XRPCResponse<EmptyData>>
Deletes an app-password session.
isValidAppPassword(String appPassword) bool
Checks if a given application password is valid based on a predefined regular expression pattern.
refreshSession({required String refreshJwt, Protocol? protocol, String? service, RetryConfig? retryConfig, PostClient? client}) Future<XRPCResponse<Session>>
Refreshes an app-password session.
restoreOAuthSession({required String accessToken, required String refreshToken, String? clientId, String? dPoPNonce, required String publicKey, required String privateKey}) OAuthSession
Returns new OAuthSession based on parameters.

Typedefs

GetClient = Future<Response> Function(Uri url, {Map<String, String>? headers})
A function type abstracted from http.get, mainly for mocking at test time.
PostClient = Future<Response> Function(Uri url, {Object? body, Encoding? encoding, Map<String, String>? headers})
A function type abstracted from http.post, mainly for mocking at test time.
ResponseDataAdaptor = Map<String, dynamic> Function(dynamic data)
Function to convert response data to an specific structure.
ResponseDataBuilder<T> = T Function(Map<String, Object?> json)
A function type that expresses the function of converting response body to model objects.

Exceptions / Errors

HttpException
This exception indicates that an unexpected error occurred when communicating with the the server.
InternalServerErrorException
InvalidCidError
Indicates that the passed CID could not be parsed.
InvalidRequestException
RateLimitExceededException
UnauthorizedException
XRPCException
This exception indicates that an unexpected error occurred when communicating with the ATP server.
XRPCNotSupportedException