Skip to content
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 17 commits into from
Feb 22, 2024
Merged

Modularize SDK client #73

merged 17 commits into from
Feb 22, 2024

Conversation

sangaline
Copy link
Contributor

@sangaline sangaline commented Feb 21, 2024

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 a SindriClient.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 of FormData to live outside of the code that gets clobbered with each regeneration. I also hacked in a logger field in the OpenAPIConfig class which request.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

@sangaline sangaline merged commit 52216e9 into main Feb 22, 2024
5 checks passed
@sangaline sangaline deleted the ews-make-client-modular branch February 22, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update openapi spec from production to obtain updates Modularize SDK Client
1 participant