alphax_web library
AlphaX browser transport adapter.
Classes
- AlphaXApi
- Marks an abstract API declaration for direct AlphaX client generation.
-
AlphaXApiResponse<
T> - A typed response that retains the underlying AlphaX response metadata.
- AlphaXAppClient
- A small application-facing layer over AlphaXClient.
- AlphaXAuthenticationMiddleware
- Adds authentication headers and coordinates one refresh for concurrent 401s.
- AlphaXBody
- Transport-neutral source of request bytes.
- AlphaXBodyParam
- Binds one method parameter to the request body.
- 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.
- AlphaXCancellation
- Marks a parameter carrying an AlphaX cancellation token.
- 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.
- AlphaXDecode
- Supplies a callable Dart expression for typed response decoding.
- AlphaXDelete
- Marks a DELETE API method.
- 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.
- AlphaXFileSourceParam
- Marks a parameter as the source for generated file upload operations.
- AlphaXFileTarget
- Destination for a native or Dart-managed file download.
- AlphaXFileTargetParam
- Marks a parameter as the target for generated file download operations.
- AlphaXGet
- Marks a GET API method.
- AlphaXHead
- Marks a HEAD API method.
- AlphaXHeader
- Binds a method parameter to a request header.
- 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.
- AlphaXOptions
- Marks a parameter carrying request-scoped AlphaX policies.
- AlphaXPatch
- Marks a PATCH API method.
- AlphaXPath
- Binds a method parameter to a URI path placeholder.
- AlphaXPost
- Marks a POST API method.
- 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.
- AlphaXPut
- Marks a PUT API method.
- AlphaXQuery
- Binds a method parameter to a repeated-safe URI query value.
- 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.
- AlphaXSseEvent
- One dispatched Server-Sent Event.
- AlphaXSseParser
- Incrementally parses an AlphaX response body as Server-Sent Events.
- 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.
- AlphaXWebSocketBinaryMessage
- A WebSocket binary message.
- AlphaXWebSocketCapabilities
- Capabilities and honest limitations of a WebSocket connector.
- AlphaXWebSocketCloseInfo
- Information available when an AlphaX WebSocket session terminates.
- AlphaXWebSocketConnector
- A transport-neutral WebSocket connector.
- AlphaXWebSocketMessage
- A complete text or binary message received from or sent to a WebSocket.
- AlphaXWebSocketSession
- One full-duplex WebSocket session.
- AlphaXWebSocketTextMessage
- A WebSocket text message.
- WebFetchTransport
- Browser Fetch transport is available when this package is compiled for Web.
Enums
- AlphaXBodyEncoding
- Selects how a method parameter becomes an AlphaXBody.
- 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.
- AlphaXWebSocketCloseOrigin
- The source of a terminal WebSocket close.
- AlphaXWebSocketState
- The lifecycle state of an AlphaX WebSocket session.
- 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
-
createAlphaXAppClient(
{required String baseUrl, Iterable< AlphaXMiddleware> middleware = const <AlphaXMiddleware>[], bool withCredentials = false, Duration? timeout}) → Future<AlphaXAppClient> - Creates an application-facing client backed by browser Fetch.
-
createAlphaXClient(
{Iterable< AlphaXMiddleware> middleware = const <AlphaXMiddleware>[], bool withCredentials = false}) → AlphaXClient - Creates one AlphaX client backed by browser Fetch.
-
createAlphaXWebSocketConnector(
) → AlphaXWebSocketConnector -
Creates a connector backed by the browser WebSocket API through the
maintained
package:web_socketabstraction. -
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.
- AlphaXWebSocketClosedException
- A send or close operation was attempted after WebSocket termination began.
- AlphaXWebSocketException
- A normalized WebSocket connection or session failure.