Server-side Filters v2 (#123) - #148
Merged
Merged
Conversation
Add all fifteen v2 filter endpoints to the Hunter facade: - Filter groups: filters/1, filter/2, create_filter/4, update_filter/3, destroy_filter/2 - Keywords: filter_keywords/2, add_keyword_to_filter/4, filter_keyword/2, update_filter_keyword/3, destroy_filter_keyword/2 - Status filters: filter_statuses/2, add_status_to_filter/3, filter_status/2, destroy_filter_status/2 Built on the Filter/FilterKeyword/FilterStatus entities and transformer targets that landed with #119. Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #123
Adds the full v2 Filters API (introduced in Mastodon 4.0) to the
Hunterfacade — all fifteen endpoints from the issue checklist. Hunter never shipped the deprecated v1 client-side filters, so this goes straight to v2.Filter groups
filters/1—GET /api/v2/filtersfilter/2—GET /api/v2/filters/:idcreate_filter/4—POST /api/v2/filters(title + context required; options:filter_actionincludingblur,expires_in,keywords_attributes)update_filter/3—PUT /api/v2/filters/:iddestroy_filter/2—DELETE /api/v2/filters/:idKeywords
filter_keywords/2—GET /api/v2/filters/:filter_id/keywordsadd_keyword_to_filter/4—POST /api/v2/filters/:filter_id/keywordsfilter_keyword/2—GET /api/v2/filters/keywords/:idupdate_filter_keyword/3—PUT /api/v2/filters/keywords/:iddestroy_filter_keyword/2—DELETE /api/v2/filters/keywords/:idStatus filters
filter_statuses/2—GET /api/v2/filters/:filter_id/statusesadd_status_to_filter/3—POST /api/v2/filters/:filter_id/statusesfilter_status/2—GET /api/v2/filters/statuses/:iddestroy_filter_status/2—DELETE /api/v2/filters/statuses/:idBuilt on the
Filter/FilterKeyword/FilterStatusentities and transformer targets that landed with #119 — no entity or transformer changes needed.Tests
15 new tests in
test/hunter/filter_test.exs(one per endpoint, plus an error case) with two new fixtures, following thelist_test.exshouse style. Full suite: 247 tests, 0 failures;--warnings-as-errors, credo--strict, dialyzer, and format checks all clean.🤖 Generated with Claude Code