This has been a source of pain for me several times in the past. I don't see a real reason to wrap calls with the Client class within multinetjs itself. The result of having this abstraction is less flexibility (as you can't just pass any axios parameters into the exposed API methods), which results in both more changes/releases to multinetjs, as well as workarounds.
I think we should remove the Client field in the MultinetAPI class altogether, and replace it with an axios instance. Along with this, we should have a parameter in each function that accepts an AxiosRequestConfig object, which we could just pass to the axios call, allowing more flexibility and less multinetjs releases.
The other benefit of replacing these wrapping calls with axios calls directly, is that the client can have access to the details of the request. This can be useful for several reasons, and has already been required in the project. This would result in a breaking change to multinetjs however, so if we were to move forward with this, we'd have to coordinate with that repository as well.
I believe I've already discussed this somewhat with @waxlamp, but I've again run into roadblocks as a result of this, so that's why I'm raising this issue now. I'm willing to do much of the work required for this, but I want to make sure we're in agreement first. Please let me know what you think.
This has been a source of pain for me several times in the past. I don't see a real reason to wrap calls with the
Clientclass withinmultinetjsitself. The result of having this abstraction is less flexibility (as you can't just pass any axios parameters into the exposed API methods), which results in both more changes/releases tomultinetjs, as well as workarounds.I think we should remove the
Clientfield in theMultinetAPIclass altogether, and replace it with anaxiosinstance. Along with this, we should have a parameter in each function that accepts an AxiosRequestConfig object, which we could just pass to the axios call, allowing more flexibility and lessmultinetjsreleases.The other benefit of replacing these wrapping calls with axios calls directly, is that the client can have access to the details of the request. This can be useful for several reasons, and has already been required in the project. This would result in a breaking change to
multinetjshowever, so if we were to move forward with this, we'd have to coordinate with that repository as well.I believe I've already discussed this somewhat with @waxlamp, but I've again run into roadblocks as a result of this, so that's why I'm raising this issue now. I'm willing to do much of the work required for this, but I want to make sure we're in agreement first. Please let me know what you think.