alphax library

Transport-independent networking contracts for Dart and Flutter.

Classes

AlphaXApiResponse<T>
A typed response that retains the underlying AlphaX response metadata.
AlphaXAuthenticationMiddleware
Adds authentication headers and coordinates one refresh for concurrent 401s.
AlphaXBody
Transport-neutral source of request bytes.
AlphaXBytesBody
An immutable byte request body.
AlphaXCacheEntry
A buffered response stored by an AlphaX cache.
AlphaXCacheKey
Method, URI, request-variant, and optional identity key for a cache entry.
AlphaXCacheMiddleware
Buffered HTTP cache middleware for GET and HEAD operations.
AlphaXCachePolicy
Cache behavior for the private HTTP cache middleware.
AlphaXCacheStore
A transport-neutral cache storage seam.
AlphaXCancellationToken
Idempotent caller-controlled cancellation source.
AlphaXCapabilities
Immutable, transport-neutral capability discovery result.
AlphaXClient
Transport-independent AlphaX client facade.
AlphaXClientIdentity
An opaque reference to a platform-managed client certificate/private key.
AlphaXCookie
A transport-neutral HTTP cookie.
AlphaXCookieJar
In-memory, host/path-scoped cookie storage.
AlphaXCookieMiddleware
Middleware that applies and records cookies for buffered, streamed, and file-transfer operations.
AlphaXCookieStore
Asynchronous transport-neutral cookie storage.
AlphaXEmptyBody
An empty request body.
AlphaXEvent
Event emitted by a streaming AlphaX transport.
AlphaXFileBody
A request body backed by an abstract file source.
AlphaXFileSink
Incremental destination used by AlphaXFileTarget.
AlphaXFileSource
Replayable or single-use source of file bytes.
AlphaXFileTarget
Destination for a native or Dart-managed file download.
AlphaXHeaders
Immutable, case-insensitive HTTP headers with multi-value support.
AlphaXJsonBody
A UTF-8 JSON request body.
AlphaXMemoryCacheStore
Bounded in-memory cache storage.
AlphaXMiddleware
Foundation for asynchronous request/response middleware.
AlphaXMultipartBody
A multipart/form-data request body that streams parts sequentially.
AlphaXMultipartField
A text form-data field.
AlphaXMultipartFile
A file-backed form-data part.
AlphaXMultipartPart
A multipart part with a named content disposition.
AlphaXProgress
Transport-neutral upload or download progress.
AlphaXProtocolFallback
Explicit information about a preferred-protocol fallback.
AlphaXProxyCredentials
Credentials for a configured proxy.
AlphaXProxyPolicy
Immutable proxy routing policy.
AlphaXRedirectInfo
One redirect observed while resolving a request.
AlphaXRedirectPolicy
Redirect policy shared by transports.
AlphaXRequest
Immutable request description passed to every AlphaX transport.
AlphaXRequestMetrics
Transport-neutral timing and transfer metadata for one request.
AlphaXRequestOptions
Immutable request-scoped options accepted by generated AlphaX APIs.
AlphaXResilienceMiddleware
Middleware implementing generic retry and circuit-breaker behavior for buffered operations.
AlphaXResiliencePolicy
Generic resilience configuration with no vendor-specific behavior.
AlphaXResponse
Immutable HTTP response returned by an AlphaX transport.
AlphaXResponseBody
A response body that may be buffered or consumed incrementally.
AlphaXResponseChunk
A bounded response body chunk.
AlphaXResponseCompleted
Terminal metadata for a completed response stream.
AlphaXResponseStarted
Metadata emitted when response headers are available.
AlphaXRetryMiddleware
Middleware that retries replayable buffered operations according to policy.
AlphaXRetryPolicy
Safe, replay-aware retry settings.
AlphaXSpkiPin
A certificate/public-key pin scoped to one DNS host.
AlphaXStreamBody
A request body backed by a caller-owned Dart stream.
AlphaXTextBody
An encoded text request body.
AlphaXTimeouts
Optional timeout configuration shared by all AlphaX transports.
AlphaXTlsPolicy
Immutable TLS policy used by an AlphaX transport instance.
AlphaXTransferResult
Result metadata for a file-backed upload or download.
AlphaXTransport
Transport implementation consumed by AlphaXClient.
AlphaXTrustAnchor
An application-supplied DER-encoded trust anchor.

Enums

AlphaXCacheScope
Scope used when interpreting private/public cache directives.
AlphaXCapability
Capabilities that a transport may expose without leaking its implementation.
AlphaXCircuitState
State of a generic circuit breaker.
AlphaXErrorKind
Normalized categories exposed by AlphaX transports.
AlphaXPriority
Optional scheduling hint retained as a transport-neutral policy value.
AlphaXProtocol
Protocol actually negotiated for an AlphaX response.
AlphaXProtocolFallbackReason
Why the negotiated protocol differed from the request preference.
AlphaXProtocolPreference
Protocol preference supplied to a request.
AlphaXProtocolRequirement
A protocol that a request requires rather than merely prefers.
AlphaXProxyMode
Proxy routing mode.
AlphaXProxyScheme
Supported proxy route families.
AlphaXRedirectMode
Redirect behavior requested for a request.
AlphaXSupport
A capability can be supported, unavailable, or not known by a transport.
AlphaXTimeoutKind
Timeout phase understood by the AlphaX public contract.
AlphaXTransferDirection
Direction of a reported body transfer.
HttpMethod
HTTP methods supported by the AlphaX 1.0 request contract.

Extensions

AlphaXProtocolRequirementValues on AlphaXProtocolRequirement
Converts a protocol requirement to its actual-protocol representation.

Functions

defaultAlphaXRetryDelay({required int retryNumber, required AlphaXResponse? response, required Object? error}) Duration
Exponential backoff helper with stable defaults, suitable for deterministic tests.

Typedefs

AlphaXAccessTokenProvider = FutureOr<String?> Function()
Supplies the current access token, when one is available.
AlphaXAccessTokenRefresher = FutureOr<String?> Function()
Refreshes an access token after an authentication challenge.
AlphaXDownloadNext = Future<AlphaXTransferResult> Function(AlphaXRequest request, AlphaXFileTarget target)
Next handler for a file download operation.
AlphaXNext = Future<AlphaXResponse> Function(AlphaXRequest request)
Next handler for a buffered response operation.
AlphaXProgressCallback = void Function(AlphaXProgress progress)
Callback invoked when a transport reports body progress.
AlphaXRequestBody = AlphaXBody
Name used by the Phase 1A request API.
AlphaXRetryDecider = bool Function({required int attempt, required Object? error, required AlphaXRequest request, required AlphaXResponse? response})
Decides whether a failed operation may be retried.
AlphaXRetryDelay = Duration Function({required Object? error, required AlphaXResponse? response, required int retryNumber})
Calculates the delay before a retry attempt.
AlphaXStreamNext = Stream<AlphaXEvent> Function(AlphaXRequest request)
Next handler for a streamed response operation.
AlphaXTimeout = AlphaXTimeouts
Compatibility alias for the Phase 0 timeout name.
AlphaXUploadNext = Future<AlphaXTransferResult> Function(AlphaXRequest request, AlphaXFileSource source)
Next handler for a file upload operation.

Exceptions / Errors

AlphaXBodyException
Compatibility base for body-related failures.
AlphaXCancellationException
A caller or client lifecycle requested cancellation.
AlphaXCancelledException
Compatibility spelling for the Phase 0 cancellation exception.
AlphaXCertificateException
Certificate verification or pinning failed.
AlphaXCertificatePinMismatchException
A valid certificate chain did not contain a configured SPKI pin.
AlphaXCircuitOpenException
Resilience policy rejected a request before transport dispatch.
AlphaXClientCertificateException
A configured client identity could not be used for mutual TLS.
AlphaXClientClosedException
The client was closed before the operation could start.
AlphaXConnectException
Compatibility spelling for the Phase 0 connection exception.
AlphaXConnectionException
Connection establishment or persistence failed.
AlphaXDnsException
DNS resolution failed.
AlphaXException
Base exception for the AlphaX public API.
AlphaXProtocolException
The peer returned data that violated the expected protocol.
AlphaXProtocolRequirementException
The final negotiated protocol did not satisfy the request requirement.
AlphaXProxyAuthenticationException
Proxy authentication failed or was rejected.
AlphaXProxyException
A proxy operation failed.
AlphaXRedirectException
Redirect handling failed or violated the request policy.
AlphaXRequestBodyException
A request body could not be opened, encoded, or sent.
AlphaXResilienceException
A generic resilience policy rejected a request before transport dispatch.
AlphaXResponseBodyException
A response body could not be read or decoded.
AlphaXTimeoutException
A configured timeout elapsed.
AlphaXTlsException
TLS negotiation, validation, or pinning failed.
AlphaXTransportException
The transport failed without a more specific normalized category.
AlphaXUnsupportedCapabilityException
A requested capability is unavailable for the selected transport.
AlphaXUnsupportedProxyPolicyException
A proxy requested by policy cannot be configured by the transport.
AlphaXUnsupportedTlsPolicyException
The requested TLS policy cannot be honored by the selected transport.