Open razor-x opened 3 months ago
This issue is a draft. The approach is being refined and should not be implemented until after https://github.com/seamapi/javascript-http/issues/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:
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.
class
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:
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.