This task is for building out an API that returns tasks to display in the suggested edits module. For v1.0, it needs to return tasks based on a grouping of maintenance templates.
The source of the tasks will be `hastemplate:{pipe-delimited-template-names}` sent to Special:Search.
While the tasks (without topics) could be done purely client-side, creating an API that proxies these requests to Special:Search has some benefits:
- we can do EventLogging on the server-side
- post-processing of results, including (not in v1.0) ensuring a threshold for uniqueness of tasks that users see, or supporting task claiming, etc
- If topic matching ends up involving something other than ElasticSearch for storage, then our backend code switches to using that, without us needing to update the client-side code
- because we'd probably only return 20 results per task type ("copyediting", "links" etc) then we could probably return the full set of 120 records in a single request, instead of requiring up to 6 requests on the client-side.
That said, this approach isn't strictly necessary to to populate the suggested edits module with tasks grouped by maintenance template types, so if we want to do a client-side approach that's fine too. (Example of the client-side approach can be seen [in the prototype](https://github.com/kostajh/newcomertasks-prototype/blob/master/assets/init.js)).
One difference between the prototype and what we'd use for populating suggested edits is that we will want to set the limit to 20, and `srsort` to `random`. We will also want to use `-hastemplate` keyword to filter out deletion templates, pass in the relevant property to get the protection status and obtain the properties needed to construct the suggested edit card (image, description, page view count, etc).