-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modularize SDK client #73
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, there was no way for users to create new instances of
SindriClient
because both the logger and the internal generated API client operated on a global level. This updates all of that so that instances are fully independent, and adds aSindriClient.create()
method to initialize new client instances. These can use different credentials, have a different log level, etc.As part of the modularization, I configured openapi-typescript-codegen to use a persistent
request.ts
module that we can customize. This allows our special handling ofFormData
to live outside of the code that gets clobbered with each regeneration. I also hacked in alogger
field in theOpenAPIConfig
class whichrequest.ts
uses to add debug logging around all API requests/responses.I made significant progress on getting the CLI to use the client consistently. All of the commands use it for all logging and requests now, but we still have two parallel implementations of the packaging and polling for circuit deployment so that's a significant last piece that still needs to be addressed. Because the client requests are now logged internally, I was able to remove all of that explicit logging from the CLI commands. This means there's no longer the fancy logic around not logging repeated poll responses if the status hasn't changed, but I think it's worth it to have the request logging be more uniform and universal.
Making these changes required regenerating the internal API client, so this pulls in miscellaneous backend API changes that have taken place. Nothing particularly major, adding
noir_version
to Noir circuit responses is one example, but these are mixed in here.Connects #60
Closes #58
Closes #70