This layer will be the interface to calls from the Talk Page View Model to the API fetcher methods created in https://phabricator.wikimedia.org/T311071. It will:
Combine multiple calls to populate initial screen (header, topics & threads, revision ID):
Have an initial data fetching method that call 3 API calls in parallel and combine the results:
- The initial discussion tools API endpoint to get the topics and thread items.
- An article summary call to get the header image and article discussion string
- A call to get the latest revision ID to use in the permanent link overflow menu item url.
Return data while offline:
As a follow on PR, we will need to persist the discussion tools API endpoint response to the file system, and return that persisted response in case of an offline error. Article summaries should already set up to persist / fetch from persistence in the app. Revision ID persistence TBD.
Misc
Other API calls (topic subscription read / write, posting new topic or reply, etc) will just be passthrough methods and not wrap any additional logic until needed.