baaba_api_handler 1.1.0
baaba_api_handler: ^1.1.0 copied to clipboard
API handling services
1.1.0 #
- Breaking:
ErrorSourceenum variants renamed fromsnake_casetocamelCase(e.g.no_content→noContent,bad_request→badRequest). Update anyswitchor direct references in your code. - Added
bypassConnectivityCheckparameter toApiServices.configure()for staging/internal environments where connectivity probes fail due to proxies or firewalls. - Added
ApiServices.setConnectivityCheck({bool enabled})— controls the connectivity check independently of token auth configuration. cancelRequest()now cancels all in-flight requests (previously only the most recent). All activeCancelTokens are tracked in aSetand cancelled together.- Extended
ResponseCodeandErrorSourcewith six new HTTP status codes:created(201),requestTimeout(408),conflict(409),unprocessableEntity(422),tooManyRequests(429),badGateway(502). - Fixed
ResponseCode.noContentraw value from 201 to 204. ResponseCoderefactored to use inline integer values (ResponseCode.success(200)style) — no longer requires an extension for.value.ResponseStringsrewritten with cleaner, user-facing error messages.ErrorHandlerno longer implementsException.
1.0.7 #
- Added
TokenRefreshInterceptorfor automatic token refresh on 401 responses. - Added
NetworkRetryInterceptorfor automatic retry on transient network failures. - Added
ApiServices.configure()static method for setting up token-based authentication. - Added
headerBuilderparameter toApiServices.configure()for customising auth headers per request. - Added
onSendProgress,onReceiveProgress, andCancelTokenparameters to all request methods. - Re-exported
ResponseandCancelTokenfrom Dio, andAPICacheDBModelfrom api_cache_manager — no separate imports needed.
1.0.6 #
- Added
SERVICE_NOT_AVAILABLE(503) toResponseCodeand error handling. - Improved error message extraction from API response body (
messageanderrorkeys).
1.0.5 #
- Updated readme documentation and bumped version.
1.0.4 #
- Added license information.
1.0.3 #
- Updated package structure and internal functionality.
1.0.2 #
- Fixed multipart request method naming.
- Fixed incorrect MIME types in multipart requests.
1.0.1 #
- Added multipart request support.
- Updated dependencies.
1.0.0 #
- Initial release.
- HTTP methods: GET, POST, PUT, PATCH, DELETE.
- API response caching via
ApiCacheHelper. - Network connectivity checks before each request.
- Structured error handling with
Failure,ErrorSource, andResponseCode.