misskey_api_core 0.0.4-beta
misskey_api_core: ^0.0.4-beta copied to clipboard
A library to make it easy to use the Misskey API in your Flutter and Dart apps.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.0.4-beta - 2025-10-03 #
0.0.3-beta - 2025-09-13 #
Added #
- Added support for multipart/form-data uploads (
FormData
). When using POST andauthRequired=true
, the tokeni
is automatically injected intoFormData
as well. MisskeyHttpClient.send
now accepts adynamic body
(Map
/FormData
/null
) and supports upload progress callbacks viaonSendProgress
.- Added
contentType
,headers
, andextra
toRequestOptions
, allowing per-request overrides. - The
Retry-After
value on HTTP 429 is now captured inMisskeyApiException.retryAfter
.
Changed #
- Removed the global
Content-Type: application/json
. Content-Type is now automatically inferred per request (or can be explicitly set viaRequestOptions.contentType
).Accept: application/json
is still set globally. - Improved token injection in the interceptor: the token
i
is now injected for allMap
,FormData
, andnull
bodies (when POST andauthRequired=true
). - Existing error mapping is retained, but now includes the retry wait hint for 429 responses.
Migration Notes #
- Sending JSON works as before by passing
body: Map
(Dio will infer the Content-Type). - If you previously relied on a global fixed
Content-Type
, please specify it viaRequestOptions.contentType
as needed. - The signature of
send<T>
has been extended, but existing calls passing aMap
will continue to work as before.
0.0.2-beta - 2025-08-19 #
Added #
- Expose
MisskeyHttpClient.baseUrl
(original base, before/api
normalization). - Add
exceptionMapper
hook toMisskeyHttpClient
to customize thrown exceptions. - Add
loggerFn
(function-style logger) accepted byMisskeyHttpClient
and adapt to existingLogger
interface. MetaClient.getMeta({bool refresh = false})
to force-refresh cache when needed.
Changed #
- Generalize
TokenProvider
toFutureOr<String?> Function()
to support both sync/async token sources.
0.0.1-beta - 2025-08-18 #
Added #
- HTTP foundation using Dio: base URL handling (appends
/api
), timeouts, and idempotent retries (429/5xx/network) with jitter viaretry
. - Request/response logging (debug-only).
- Unified error handling: map Misskey error responses to
MisskeyApiException(statusCode/code/message)
. - Auth token auto-injection: inject
i
into POST JSON bodies whenauthRequired
is true; per-request options viaRequestOptions(authRequired/idempotent)
. - Minimal common model and client for
/api/meta
(Meta + MetaClient), including a tiny cache andsupports(keyPath)
capability detection. - JSON serialization setup (
json_serializable
/json_annotation
) and generated code. - Example app (
example/
): sign-in usingmisskey_auth
, note posting, timeline, following/followers tabs; Riverpod for state;loader_overlay
for loading UI. - OAuth helper site under
pages/
(index.html
,redirect.html
) and GitHub Pages deploy workflow (.github/workflows/deploy-pages.yml
). - Android/ iOS URL-scheme setup for OAuth callback; Android
INTERNET
permission. - Unit tests: token injection, error mapping, retry behavior, and Meta serialization/capability; example smoke test.