feat(api): complete the smart list filter and source surface - #892
Merged
Conversation
The contract had drifted behind the API: seven filter dimensions and two sources were live and callable, but absent from the schema, so consumers could not send them in a typed request. Adds the two include-arm operators (genres_operator, keywords_operator), the keywords list filter, the Letterboxd and MAL rating ranges, the six missing ignore gates, and the watchlist and library sources. Additive and non-breaking: every new key is optional and no existing field changes type or shape.
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.
The contract had drifted behind the API. Seven filter dimensions and two sources are live and callable today, but were missing from the schema, so consumers could not send them in a typed request. This closes that gap.
Filters
Added to
smartListFiltersSchema:genres_operator'and' | 'or'keywordsstring[]-on an entry excludes it, same as the other list filterskeywords_operator'and' | 'or'letterboxd_ratings[min]or[min, max]mal_ratings[min]or[min, max]ignore_watchingignore_unreleasedignore_releasedignore_endedignore_airingignore_no_release_dateandrequires every included value to be present,or(the default) any of them. Exclusion is always "carries none of", independent of the operator.Sources
smartListWriteSchema.sourcegainswatchlistandlibrary, bringing the enum to the full set of seven. The create-route docs table is updated to match.Compatibility
Additive and non-breaking. Every new key is optional, no existing field changes type or shape, and the operators default to
orserver-side when omitted, so existing payloads behave exactly as before.Verification
deno fmtanddeno lintclean.deno task openapi:validatepasses. Parsed a payload carrying every new key throughsmartListWriteSchema: accepted, while an unknownsourceand an invalid operator value are still rejected.Note that
deno task testreports 5 pre-existing type errors insrc/contracts/sync/HistoryRequest.test.ts, which imports aHistoryRequesttype that has since been renamed toHistoryAddRequest. Identical count onmasterbefore this branch, so it is untouched by this change and left for a separate fix.