Coder plugin: Add arbitraryApiCall
method to CoderClient API factory
#108
Labels
enhancement
New feature or request
Part of umbrella issue #16.
Cannot be started until #107 is done.
This should hopefully be a straightforward (and even quick) update.
Problem
One of the biggest wins we can get for the Coder plugin is making it so that using the plugin doesn't feel so walled-off. We still intend to ship polished UI experiences for our main components, but users will inevitably have use cases that we can't reasonably account for in the UI. So, in that case, why not give them access to the full Coder API, and give them the power to wire things up themselves?
Requirements
CoderClient
class that lets users call any Coder API endpoint that they want, but that still has some restrictions and nicetiesany
type, but beyond that, it should be as type-safe as possiblethis
context when passed around as a value in the React UIuseCoderApiFunction
hookPossible solution
Let's say that we have a general-purpose
ReadonlyJsonValue
type that represents any valid JSON-serializable value:In that case, we can define a method like this:
Code example
The text was updated successfully, but these errors were encountered: