misskey_client 1.0.0-beta.7
misskey_client: ^1.0.0-beta.7 copied to clipboard
A pure Dart client library for the Misskey API. Covers 25 API domains with token-based auth, automatic retry, and structured error handling.
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.
[Unreleased] #
1.0.0-beta.7 - 2026-08-16 #
Added #
- Integrated Misskey Streaming API access through the lazily created
MisskeyClient.streamingproperty, sharing the client's base URL, token provider, logger, and log setting (issue #30) - Added reusable Streaming connection lifecycle and observability through
connect(),disconnect(),reconnect(),dispose(),state,stateChanges, and typederrors, with configurable acknowledgement timeouts and automatic reconnection - Added typed definitions for all 18 official Streaming channels, acknowledgement-backed subscription handles, automatic resubscription, a 32-subscription limit, and
subscribeRaw()for fork-specific channels - Added raw
MisskeyStreamingMessagedelivery, typed note and notification streams, typed captured-note update events, and losslessMisskeyUnknownEventfallback - Added subscription-scoped note capture with reference-counted
captureNote()/uncaptureNote()handling across reconnections - Added a migration guide from the standalone
misskey_streamingpackage and Streaming documentation in all six README and Docusaurus languages - Added an opt-in Streaming E2E test suite covering connection, typed timeline delivery, captured-note updates, and cleanup against a configured Misskey server
Changed #
MisskeyClient.dispose()now idempotently disposes an initialized Streaming connection before closing the HTTP transport
1.0.0-beta.6 - 2026-08-14 #
Added #
- Added
MisskeyClient.baseUrl, exposing the configured server URL so that packages built on top of a client can identify which server it targets
1.0.0-beta.5 - 2026-08-14 #
Removed #
- Removed
MisskeyCustomEmoji.roleIdsThatCanNotBeUsedThisEmojiAsReaction, a breaking API change, because the field does not exist in upstream Misskey and is specific to the misskey.io fork
1.0.0-beta.4 - 2026-08-13 #
Added #
- Added
MisskeyCustomEmoji.roleIdsThatCanNotBeUsedThisEmojiAsReactionfor roles denied from using a custom emoji as a reaction - Added migration guides from
misskey_api_coreto all six README languages - Added CI checks for formatting, static analysis, generated code, unit tests, and package validation on the minimum and stable Dart SDKs (issue #29)
- Added OIDC-based pub.dev publishing and release version update/verification tooling (issue #29)
- Added automatic GitHub Release creation from the matching CHANGELOG section after a successful pub.dev publication (issue #29)
Changed #
- Raised the minimum Dart SDK from 3.5 to 3.9 to match the supported range of the JSON serialization dependencies
- Updated the HTTP, logging, JSON serialization, code generation, lint, and test dependencies
- Replaced the Flutter-dependent
pedantic_monolint set with the official Dartlintsrecommended set, and removed the unused Flutter-dependent pubspec sorter to keep the package tooling pure Dart - Migrated conditional collection entries to Dart 3.9 null-aware elements and reformatted the package with the current Dart formatter
Fixed #
- Reduced the published package size by excluding test sources and local agent configuration (issue #16)
1.0.0-beta.3 - 2026-08-05 #
Added #
MisskeyClip.notesCount: the number of notes in a clip. The server already returned this field, but the model did not declare it, so it was silently discarded on deserialization. It now surfaces on every clip-returning endpoint:ClipsApi.create()/update()/show()/list()/myFavorites(),NotesApi.clips(), andUsersApi.clips(). Misskey packs this field only for the clip's owner, so it staysnullwhen reading another user's clip or when unauthenticated. It is deliberately left without a default value so that "not disclosed" remains distinguishable from an empty clip
1.0.0-beta.2 - 2026-08-05 #
Added #
- Admin API: complete coverage of all 99
/api/admin/*endpoints- Core admin (
AdminApi): meta, update-meta, server-info, show-user, show-users, suspend-user, unsuspend-user, reset-password, update-user-note, delete-account, delete-all-files-of-a-user, unset-user-avatar, unset-user-banner, get-user-ips, show-moderation-logs, send-email, update-proxy-account, promo/create, get-index-stats, get-table-stats - Account management (
AdminAccountsApi): create, delete, find-by-email - Role management (
AdminRolesApi): list, show, create, update, delete, assign, unassign, update-default-policies, users - Invite management (
AdminInviteApi): create, list - Custom emoji management (
AdminEmojiApi): add, update, delete, delete-bulk, list, list-remote, copy, import-zip, add/remove/set-aliases-bulk, set-category-bulk, set-license-bulk - Federation management (
AdminFederationApi): delete-all-files, refresh-remote-instance-metadata, remove-all-following, update-instance - Relay management (
AdminRelaysApi): add, list, remove - Abuse report management (
AdminAbuseReportsApi): list, resolve, forward, update, notification-recipient list/show/create/update/delete - Announcement management (
AdminAnnouncementsApi): create, list, update, delete - Job queue management (
AdminQueueApi): stats, queues, queue-stats, jobs, show-job, show-job-logs, retry-job, remove-job, promote-jobs, clear, deliver-delayed, inbox-delayed - Drive management (
AdminDriveApi): files, show-file, clean-remote-files, cleanup - Advertisement (
AdminAdApi), avatar decoration (AdminAvatarDecorationsApi), system webhook (AdminSystemWebhookApi), and CAPTCHA configuration (AdminCaptchaApi)
- Core admin (
- Admin models:
MisskeyAdminMeta(typed subset + raw),MisskeyAdminServerInfo,MisskeyAdminUserDetail(withMisskeySignin/MisskeyRoleAssign),MisskeyAdminCreatedAccount,MisskeyAbuseUserReport,MisskeyAbuseReportNotificationRecipient,MisskeyRelay,MisskeyAdminAnnouncement,MisskeyQueueStats,MisskeyQueueCount,MisskeyQueueInfo,MisskeyQueueMetrics,MisskeyQueueJob,MisskeyDelayedQueueEntry,MisskeyAd,MisskeyAdminAvatarDecoration,MisskeySystemWebhook,MisskeyCaptchaSettings,MisskeyModerationLog,MisskeyUserIp,MisskeyIndexStat,MisskeyTableStat httpClientAdapterparameter onMisskeyClientto customize the HTTP transport (private CA trust, proxying)- E2E test layer (
test/e2e/) targeting the local closed-federation environment (fediverse_e2e); enabled viaRUN_E2E=1, auto-skipped otherwise. Run it with-j 1— parallel suites hit the server's rate limit - E2E tests covering
null-clearing on everyupdate-style method fixed under issue #12, asserting all three states per field (omitted,Optional(value),Optional.null_()) and re-reading the resource so the result is confirmed to be persisted rather than merely echoed back - Tests covering the
unknownEnumValuefallback forMisskeyNoteVisibility,MisskeyOnlineStatus, andMisskeyNotificationTypewhen the server returns a value not yet known to this client - Tests pinning
MisskeyUser.isAdmin/isModeratorin theirtruestate, from an admin-scopedusers/showfixture. Both fields default tofalse, so the previous general-user fixture could not distinguish a parsedfalsefrom an omitted field
Changed #
- Breaking:
MisskeyNoteDraft.pollchanged type fromMisskeyPoll?toMisskeyNoteDraftPoll?. Code readingpoll.choicesnow getsList<String>instead ofList<MisskeyPollChoice> - Breaking: parameters changed to
Optional<T>by the null-clearing fix below no longer accept a bare value. Wrap it:description: 'text'becomesdescription: Optional('text'). Affected:ClipsApi.update(),ChannelsApi.update(),PagesApi.update(),AdminAnnouncementsApi.update(),AdminApi.updateProxyAccount(),AntennasApi.update(),DriveFilesApi.update(),GalleryApi.postsUpdate(),AdminAvatarDecorationsApi.update(),NotesApi.draftsUpdate() - Breaking:
MisskeyReactionAcceptancegained anunknownmember. Exhaustiveswitchstatements over this enum in downstream code will no longer compile until the new member is handled - Refreshed fixtures against a live, federated world (multi-account, cross-server posts/reactions/follows) via the fixture collection tool in
fediverse_e2e, replacing the single-server March snapshot. Corresponding model tests were updated to assert on structural properties rather than hardcoded IDs/counts where the underlying data is inherently dynamic (timestamps, counters, federated content)
Fixed #
- Nullable fields could not be cleared by passing
nulltoupdate-style methods (issue #12). Dart cannot distinguish an omitted optional parameter from an explicitnull, so the naiveif (x != null)guards these methods used dropped the field from the request body and the server treated the call as "no change". The affected parameters are now typed asOptional<T>, matching the methods that already used it. Affected methods:ClipsApi.update()(description),ChannelsApi.update()(description,bannerId),PagesApi.update()(summary,eyeCatchingImageId),AdminAnnouncementsApi.update()(imageUrl),AdminApi.updateProxyAccount()(description),AntennasApi.update()(userListId),DriveFilesApi.update()(comment),GalleryApi.postsUpdate()(description),AdminAvatarDecorationsApi.update()(category),NotesApi.draftsUpdate()(cw,hashtag,reactionAcceptance,replyId,renoteId,channelId,text,scheduledAt) MisskeyNoteDraft.pollwas typed asMisskeyPoll, the shape used by published notes, so deserializing any draft that carried a poll threwtype 'String' is not a subtype of type 'Map<String, dynamic>'— which took downdraftsCreate/draftsUpdate/draftsListfor that draft. A draft stores what was typed into the composer, so its choices are plain strings with no vote counts and its deadline may still be relative. AddedMisskeyNoteDraftPoll(choices,multiple,expiresAt,expiredAfter) and retyped the field. The existing fixture only coveredpoll: null, so a poll-carrying draft was added to itMisskeyNote.reactionAcceptancethrew when the server returned a value not yet known to this client (nounknownEnumValuewas configured), which would fail the deserialization of the entire note. Added aMisskeyReactionAcceptance.unknownfallback- Model fields that the API documentation omits or mistypes, verified against a live Misskey 2026.5.1 server: queue counts include
paused/prioritized/waiting-children;QueueJob.failedReasonis absent for successful jobs;QueueJob.progressandreturnValueare not objects; index stats includeschemaname/tablespace/indexdef
Notes #
/notes/drafts/updatehas three behaviours the client cannot work around, all documented onNotesApi.draftsUpdate()and pinned by E2E tests:scheduledAtis always overwritten (the server sendsscheduledAt ? new Date(scheduledAt) : nullon every call, so omitting it unschedules the draft); an update that does not mention the poll keeps the choices but drops their deadline, for the same reason; and a poll cannot be removed, because the server reads it throughpoll?.choicesand so cannot tellpoll: nullfrom an omitted poll — passing an emptypollChoiceslist empties the choices instead/gallery/posts/updatedeclaresisSensitivewithdefault: falsein its server-side schema, so omitting the parameter resets the post to not sensitive instead of keeping the current value. This is not a nullable-field problem andOptionaldoes not apply; always pass the intended value. Documented onGalleryApi.postsUpdate()and pinned by an E2E test/channels/updatecannot clearbannerIdon Misskey 2026.5.1. The server assembles its update object withbanner ? { bannerId: banner.id } : {}, dropping an explicitnull; sent alone the update object ends up empty and the server returns a 500 (UpdateValuesMissingError), sent alongside another parameter the call succeeds but the banner remains.descriptionclears correctly. Documented onChannelsApi.update()and pinned by E2E tests/clips/update(description) and/admin/announcements/update(imageUrl) always overwrite those fields: the server evaluates them asvalue || null, so omitting the parameter clears the existing value and an empty string is stored asnull. This is server-side behaviour that the client cannot work around; pass the current value explicitly to preserve it. Documented onClipsApi.update()/AdminAnnouncementsApi.update()and pinned by E2E testsMeta.policies/MisskeyUser.policies/MisskeyRole.policiesalready surfacecanCreateChannel(and any other server-added policy) through their dynamicMap<String, dynamic>representation, without needing a typed field — verified against Misskey 2026.5.1 and now covered by a fixture-based test
1.0.0-beta.1 - 2026-03-18 #
Added #
- Core HTTP client with Dio, automatic retry, and logging interceptor
MisskeyClientConfigfor base URL, timeout, User-Agent, headers, retry, and log configurationTokenProvidersupporting synchronous and asynchronous token retrievalAuthModeenum (required, optional, none) for per-request authentication controlOptional<T>sealed type distinguishing "not specified" from "explicitly send null"- Sealed exception hierarchy (
MisskeyClientException) mapping HTTP status codes (401, 403, 404, 422, 429, 5xx) and network errors - Customizable logging via
Loggerinterface withStdoutLoggerandFunctionLoggerimplementations - Account API: profile fetch/update, pin/unpin, favorites, password/email/token management, sign-in history, account move/delete, export/import (notes, following, blocking, muting, antennas, clips, user lists), gallery posts/likes, authorized apps
- Account sub-APIs: registry (key-value storage), two-factor authentication (TOTP/security key), webhooks CRUD
- Notes API: list, show, create (with text, CW, files, polls, visibility, scheduled posts), delete, timelines (home, local, hybrid, global, user list, channel), reactions, renotes, replies, children, conversation, featured, mentions, search (full-text and hashtag), favorites, drafts (CRUD and count), translation, partial bulk fetch
- Users API: fetch by ID/username/multiple, directory listing, followers/following, user notes, search, user list CRUD with membership management
- Notifications API: list, grouped list, mark all as read, flush, create custom notifications, test notification
- Following API: follow, unfollow, update per-follow settings, bulk update, invalidate follower
- Follow requests API: list received/sent, accept, reject, cancel
- Blocking API: block, unblock, list
- Mute API: mute (with optional expiration), unmute, list
- Renote mute API: mute/unmute renotes only, list
- Channels API: CRUD, timeline, follow/unfollow, favorite/unfavorite, search, featured/followed/owned listing, channel mute CRUD
- Antennas API: CRUD, notes listing with keyword/user/list source filtering
- Chat API: history, read all, direct messages (create/delete/show/react/search/timeline), rooms (CRUD/join/leave/mute/members/invitations)
- Clips API: CRUD, add/remove notes, notes listing, favorite/unfavorite
- Drive API: file CRUD (upload with progress, URL upload, show by ID/URL, update, delete), folder CRUD, stats (capacity info), stream, find by hash, bulk move, attached notes
- Flash (Play) API: CRUD, featured, like/unlike, search
- Gallery API: featured, popular, posts listing, post CRUD, like/unlike
- Pages API: show by ID/name, featured, CRUD, like/unlike
- Federation API: instances listing with status filters, show instance, followers/following/users per host, stats, remote user refresh
- Meta API: server metadata with in-memory caching,
supports()feature detection, server info, stats, ping, endpoints listing, custom emoji, pinned users, online users count, avatar decorations, retention - Roles API: list public roles, show, notes, users
- Charts API: active users, AP requests, federation, instance, notes, users, per-user following/notes/page views/reactions
- Hashtags API: list, search, show, trends, users by hashtag
- Announcements API: list, show, mark as read
- Invite API: create, delete, remaining quota, list
- SW (Push) API: register, unregister, show registration, update registration
- ActivityPub API: resolve URI to user/note, fetch raw AP object
toJson()method on all response models- Docusaurus documentation site with 15 pages in 6 languages (English, Japanese, Chinese, German, French, Korean)
- GitHub Actions workflow for documentation deployment
- README in 6 languages
Fixed #
i/2fa/update-keyname parameter changed to optional