piefed_api_client 0.13.0
piefed_api_client: ^0.13.0 copied to clipboard
A Future-based http client for the PieFed API.
Changelog #
0.13.0 #
- PieFed v1.7.0 Surface Catch-Up — added 19 endpoints + 58 schemas that landed in the 1.7.0 spec but were not yet implemented. Purely additive; no breaking changes.
- New Endpoints:
- Feeds CRUD:
CreateFeed(POST /feed),EditFeed(PUT /feed),DeleteFeed(POST /feed/delete),FollowFeed(POST /feed/follow). - Moderation reports:
ListPostReports,ResolvePostReport,ListCommentReports,ResolveCommentReport,ListPrivateMessageReports,ResolvePrivateMessageReport,ReportConversation,ListConversationReports,ResolveConversationReport. - Modlog:
GetModLog(GET /modlog) withModLogTypeenum for thetype_filter. - Admin:
ListRegistrationApplications,ApproveRegistrationApplication. - Registration / Captcha:
GetCaptcha,Register(both unauthenticated). - Moderation actions:
MarkCommentAsDistinguished.
- Feeds CRUD:
- New Models:
- 28 modlog types in new
models/modlog.dart: 14 base (ModBan,ModRemovePost,ModFeaturePost,ModLockPost,ModRemoveComment,ModRemoveCommunity,ModBanFromCommunity,ModAddCommunity,ModTransferCommunity,ModAdd,ModHideCommunity,AdminPurgePerson,AdminPurgeCommunity,AdminPurgePost,AdminPurgeComment) + their*Viewwrappers. - Report views:
PostReportView,CommentReportView,PrivateMessageReportView,ConversationReportView,ConversationInfoView. - Report sources:
PostReport,CommentReport,PrivateMessageReport,ConversationReport. - Registration/captcha:
UserRegistration,CaptchaFields,UserRegistrationRequest/UserRegistrationResponse,FetchCaptchaResponse,GetRegistrationListResponse. - Response wrappers:
GetModLogResponse,GetPostReportListResponse,GetCommentReportListResponse,GetPrivateMessageReportListResponse,GetConversationReportListResponse,PrivateMessageReportResponse.
- 28 modlog types in new
- Field Additions:
CommentReplyView.distinguished(bool?).SaveUserSettings.displayNamemapped todisplay_name.
- Tests: 36 new tests covering all new endpoints, modlog/report round-trips, response parsing for
GetModLogResponse(populated + empty),ListCommentReports,FetchCaptchaResponse, andRegister; explicit assertion of thewhen_JSON key.
- New Endpoints:
0.12.0 #
- PieFed v1.7.0 Swagger Support:
- Models:
- Restructured
GetPostResponseandGetCommunityResponseto match API's nested structure (post_view,community_view). - Expanded
PostViewandCommentViewwith missing moderation fields (banned_from_community,creator_is_admin,creator_is_moderator,hidden, etc.). - Added
SuccessResponsefor simple boolean-return actions.
- Restructured
- Voting: Added missing
emojiandprivateparameters toLikePostandLikeComment. - User Settings: Expanded
SaveUserSettingswith visibility controls (GenAI, NSFW, NSFL), thresholds, and management toggles. - Path Corrections: Fixed
SuggestCompletionendpoint path to/suggest_completion. - Cleaning: Simplified response factories and updated
MarkPostAsRead/MarkCommentAsReadto returnSuccessResponse.
- Models:
0.11.0 #
- Comprehensive API Endpoint Alignment:
- Systematically reviewed and corrected nearly every API path and HTTP method to achieve 100% compliance with
endpoints_test.dart. - Post Alignment: Fixed paths for
GetPostReplies,PollVote,GetPostLikes, andListPosts2. UpdatedSubscribePostandSubscribeCommentto usePUT. - User Alignment: Corrected paths for
BanUser,UnbanUser, andSaveUserSettings. UpdatedVerifyCredentialstoPOSTandUpdateNotificationStatetoPUT. FixedMarkAllNotificationsAsReadmethod toPUT. - Community Alignment: Fixed
CommunityUnbanmethod toPUTand corrected moderation-related paths. - Site & Feed Alignment: Fixed paths for
BlockInstance,SearchInstances, andListTopics(/topic/list). - Private Message Alignment: Corrected
LeaveConversationpath to/private_message/conversation/leave.
- Systematically reviewed and corrected nearly every API path and HTTP method to achieve 100% compliance with
- Infrastructure & Tests:
- Ensured all
PieFedApiQueryclasses correctly implement the new mandatory interface fields (path,httpMethod,isMultipart,multipartFiles). - Resolved null-safety compilation errors and property access issues in
response_parsing_test.dart. - Achieved a 100% pass rate in the
endpoints_test.dartsuite (95 tests).
- Ensured all
0.10.0 #
- PieFed v1.7.0 Swagger Sync:
- New Endpoints Added:
BanFromCommunity(POST /community/moderate/ban): Allows moderators to ban users from a community.GetPrivateMessageConversation(GET /private_message/conversation): Fetch full conversation histories between users.
- Endpoints Updated:
MarkAllNotificationsAsRead: Renamed fromMarkAllAsReadand changed from aPOSTmethod (/user/notifs/all_read) to aPUTmethod (/user/mark_all_notifications_read) to match the updated 1.7.0 specification.
- Endpoints Removed:
MarkAllPMsAsRead: Deprecated and removed (POST /private_message/mark_all_read) as it is no longer supported in v1.7.0.
- Models:
- Added
GetPrivateMessageConversationResponseandUserMarkAllNotifsReadResponse.
- Added
- Bug Fixes:
- Fixed missing
pathoverride inReportPrivateMessageendpoint class.
- Fixed missing
- New Endpoints Added:
0.9.0 #
- Complete PieFed API coverage:
- Post APIs:
AssignPostFlair,HidePost,LockPost,SubscribePost,ListPostLikes,ListPosts2. - Comment APIs:
ListCommentLikes,LockComment,MarkCommentAsAnswer,SubscribeComment. - Community APIs:
CreateCommunityFlair,DeleteCommunityFlair,LeaveAllCommunities,ModeratePostNsfw,EditCommunityFlair,CommunityUnban,SubscribeCommunity. - User APIs:
AddUserNote,GetUserMedia,MarkAllAsReadUser,SetUserFlair,VerifyCredentials,UpdateNotificationState,SaveUserSettings,SubscribeUser. - Private Message APIs:
MarkPrivateMessageAsRead,ReportPrivateMessage. - Search & Misc APIs:
SuggestCompletion,DeleteImage,UploadUserImage.
- Post APIs:
0.8.1 #
- Fixes:
GetCommunity: FixedGetCommunityResponsemodel to accurately mirror the API'scommunity_viewstructure, includingflair_list,counts,moderators, anddiscussion_languages.SubscribedType: Replaced booleansubscribedfields inCommunityView,PostView,CommentView, andCommentReplyViewwith a newSubscribedTypeenum ("Subscribed","NotSubscribed","Pending") to match the API and support the "Pending" state.- Simplified response deserialization logic for
GetCommunity,CreateCommunity, andEditCommunity.
- New Fields:
Post: Addedinstance_sticky.
0.8.0 #
- 100% Swagger 1.6.0 Compliance:
- Breaking Changes:
- Refactored
PostPoll: Renamedpoll_idtoid,optionstochoices,expires_attoend_poll. Removedmy_votein favor ofmy_votes(List). - Refactored
PollChoice: Renamedtexttochoice_text,counttonum_votes.
- Refactored
- New Models:
- Added
WidthHeightfor image details. - Moved
LanguageViewtosource.dartfor better internal referencing.
- Added
- New Fields:
Post: Addedsticky,language_id,alt_text,small_thumbnail_url,image_details,locked.Comment: Addedlocked,answer.Person: Addedabout_html.Site: Addedall_languages(List<LanguageView>).PostPoll: Addedmode,local_only,latest_vote,my_votes.PollChoice: Addedsort_order.CommunityAggregates: Addedactive_daily,active_weekly,active_monthly,active_6monthly.PostView: Addedactivity_alert,alt_text,flair_list,can_auth_user_moderate.CommentView: Addedactivity_alert,creator_is_admin,creator_is_moderator,can_auth_user_moderate.PersonView: Addedactivity_alert.
- Improvements:
- Ensured all new model factory constructors are
constfor improved performance. - Updated unit and integration tests to verify new fields and breaking changes.
- Ensured all new model factory constructors are
- Breaking Changes:
0.7.4 #
- PieFed v1.6.0 Alignment:
- Added missing fields to
GetPostResponse(activity_alert) andGetCommunityResponse(activity_alert,subscribed,blocked). - Synchronized all generated models via
build_runner.
- Added missing fields to
- Fixes:
- Fixed formatting in
lib/src/v1/models/api.dart. - Removed unnecessary import in
lib/src/v1/api/post.dart. - Ensured all CI tests pass.
- Fixed formatting in
0.7.3 #
- PieFed v1.6.0 Alignment:
- Added missing
MyUserInfo,LocalUser, and various block/moderator/follower view models. - Updated
TopicViewto match the latest specification (addedtitleandparent_topic_id). - Strongly typed more API responses (e.g.,
ListTopicsResponse,GetSiteResponse.myUser).
- Added missing
- Tests:
- Added serialization tests for all new models.
0.7.2 #
- PieFed v1.6.0 Support:
- Added
GetFeedquery (GET/feed). - Added
BanUser(POST/user/ban) andUnbanUser(POST/user/unban) queries. - Added
FeedViewandTopicViewmodels.
- Added
- Improvements:
ListFeedsResponseis now strongly typed (returnsList<FeedView>instead ofList<dynamic>).
0.7.1 #
- Fixes:
GetPersonDetails: Added missing parameters from the API spec:includeContent- Critical: The PieFed API defaults this tofalse, which causes posts and comments to be returned as empty lists. PassincludeContent: trueto retrieve user posts and comments.sort- Sort order for posts/comments (e.g., "New", "Top", "Hot")page- Page number for pagination (defaults to 1)limit- Items per page (defaults to 20)communityId- Filter posts/comments to a specific communitysavedOnly- Only return saved posts/comments
0.7.0 #
- PieFed v1.4 Support:
- Added support for Polls (
PostPoll,PollChoice,PollVote). - Added support for Events (
PostEvent,PostType.event). - Added support for Emoji Reactions on posts and comments (
Reactions). - Added support for AI Tagging on posts and communities.
- Added support for Answer Comments (
Comment.answer). - Added support for Extra User Fields (
UserExtraField). - Added support for Community Flairs (
CommunityFlair,PostView.flairList).
- Added support for Polls (
- Model Updates:
Post: AddedaiGenerated,poll,event,emojiReactions,tags(as String for hashtags),postType,crossPosts.Person: Addedabout(markdown),extraFields,note,flair.Comment: Addedanswer,emojiReactions.CreatePost: AddedaiGenerated,poll,event.CreateComment: Addedanswer.
0.6.5 #
-
Fixes:
- CommentAggregates:
score,upvotes,downvotes,childCountnow default to0when null in API response. - PostAggregates:
comments,score,upvotes,downvotesnow default to0when null in API response. - PersonAggregates:
postCount,commentCountnow default to0when null in API response. - CommunityAggregates:
postCount,postReplyCount,subscriptionsCountnow default to0when null in API response. - GetUnreadCountResponse:
replies,mentions,privateMessagesnow default to0when null in API response. - CommentView.counts: Now nullable to handle cases where the entire counts object is null.
- CommentAggregates:
-
Tests:
- Added comprehensive null value handling tests (
test/null_values_test.dart).
- Added comprehensive null value handling tests (
0.6.4 #
- Fixes:
PersonView.counts: Now nullable to handle/user/meendpoint returningnullfor counts.
0.6.3 #
- Fixes:
GetPost&GetCommunity(and related): Fixed response parsing schema mismatch. The API returns nestedpost_view/community_viewobjects, but the library expected flattened fields. The client now correctly unwraps these nested objects.
0.6.2 #
- Fixes:
PostView: Now correctly handles missing/nullcreator_blockedandcreator_banned_from_communityfields (defaults to false), resolving deserialization crashes onpiefed.social.PieFedApiV1: AddedapiPrefixconfiguration to constructor (defaulting to/api/alpha) to support instances using different API paths.
0.6.1 #
- Fixes:
Instance.version: Now nullable to handle missing field in API responses.Community.apId: Mapped fromactor_idinstead ofap_idto match live API.CommunityView&PostView: Correctly parsesubscribedfield when returned as a String ("Subscribed"/"NotSubscribed").
- Tests:
- Added comprehensive full-model serialization tests (
test/full_models_test.dart). - Added API response parsing tests with mocks (
test/response_parsing_test.dart). - Added live integration tests against
crust.piefed.social(test/live_api_test.dart).
- Added comprehensive full-model serialization tests (
0.6.0 #
- Implemented Phase 10: Moderation & Advanced Interactions
BlockCommunity,BlockDomainFeaturePost,RemovePost,RemoveCommentGetCommunityBansPollVote,GetSiteMetadata
0.5.0 #
- Implemented Phase 9: Creation & Advanced Messaging
CreateCommunity(POST /community)UploadImage(POST /upload/image)UploadCommunityImage(POST /upload/community_image)EditPrivateMessage(PUT /private_message)DeletePrivateMessage(POST /private_message/delete)MarkAllPMsAsRead(POST /private_message/mark_all_read)LeaveConversation(POST /private_message/conversation/leave)
0.4.0 #
- Implemented Phase 7: Community Discovery & Feeds
ListCommunities(GET /community/list)ListFeeds(GET /feed/list)ListTopics(GET /topic/list)GetPostReplies(GET /post/replies)
- Implemented Phase 8: Content Management (Edit & Delete)
EditPost(PUT /post)DeletePost(POST /post/delete)EditComment(PUT /comment)DeleteComment(POST /comment/delete)EditCommunity(PUT /community)DeleteCommunity(POST /community/delete)
0.3.0 #
- Added Phase 5 Site & Instance APIs:
GetSiteVersionBlockInstanceGetInstanceChooserSearchInstances
- Added Phase 6 Creation & Advanced APIs:
CreatePostCreateCommentCreatePrivateMessageReportPost,ReportCommentMarkPostAsRead,MarkCommentAsReadAddMod
- Expanded unit tests to cover new endpoints (34 tests total).
0.2.0 #
Added #
- GetPersonDetails - Fetch user profile details
- GetMyUser - Fetch current user's profile
- GetUnreadCount - Get counts for replies, mentions, and private messages
- GetReplies - List replies to the user
- BlockUser - Block/unblock a user
- MarkAllAsRead - Mark all notifications as read
- Search - Search for posts, comments, communities, and users
- ResolveObject - Resolve federated URLs (posts, comments, etc.)
- Corresponding response models for all new queries
0.1.0 #
Added #
- ListPosts - List posts with filters
- ListComments - List comments with filters
- LikePost - Upvote/downvote posts
- LikeComment - Upvote/downvote comments
- FollowCommunity - Subscribe/unsubscribe to communities
- SavePost - Save/unsave posts
- SaveComment - Save/unsave comments
- Exported new queries in
v1.dart
0.0.1 #
- Initial version. Just experimental.