Feature summary (what you would like to be able to do and where):
mw.Api() should show warnings returned by the Action API, e.g. by logging them via console.warn().
Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
As a gadget or user script developer, I want to know when I use deprecated API usage patterns. When the API returns warnings, I expect mw.Api() to show them.
Benefits (why should this be implemented?):
Helps to discover user scripts and gadgets that need to be fixed.
Example:
await new mw.Api().get( { action: 'query', prop: 'revisions', rvprop: 'content', pageids: 1 } )
The API returns a warning (about the usage of rvprop=content without rvslots=), but it’s only visible if you look at the response yourself.
By contrast:
await new mw.Api().get( { action: 'edit' } )
The API returns an error, which mw.Api reports as a promise rejection. Users don’t have to check response.errors ?? [ response.error ] themselves.