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

Generate and use classes for each seam resource #157

Open
razor-x opened this issue Aug 13, 2024 · 0 comments
Open

Generate and use classes for each seam resource #157

razor-x opened this issue Aug 13, 2024 · 0 comments

Comments

@razor-x
Copy link
Contributor

razor-x commented Aug 13, 2024

This issue is a draft. The approach is being refined and should not be implemented until after #73

Currently each method returns an Promise for a SeamHttpRequest which resolves to an object types using the route spec.

This is nice because the types provide the interface without additional codegen. This mostly helps TypeScript consumers.

However, other SDKs wrap all responses in a typed class by generating models. This SDK should follow the same pattern:

  1. This provides a strict interface for JS consumers.
  2. This enables Seam to enforce LTS changes at the SDK level before properties are removed from the API response.

Instead of using a class, we may be able to get a similar result by passing the method args and return though the zod.parse methods.

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

No branches or pull requests

1 participant