fix: correct aws request/response wrapper types #37
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.
Context
Noticed the AWS request and response types were coming through as
unknown
on the latest version of the package. This is down to us not including the AWS SDK in our dependencies, they're only in devDependencies. The type we define doesn't have access to it's dependent types in prodA solution would be to include the AWS SDK libs in dependencies, but then consumers would have to download these monster dependencies. @aws-sdk/client-cognito-identity-provider isn't too bad at 2.38 MB, but aws-sdk is 97.2MB ! Users would also have to see the annoying v2 SDK deprecation warning every time they use this library
Another solution is to only include @aws-sdk/client-cognito-identity-provider in dependencies. After investigating the differences between the request and response types in SDK v2 and v3 I found that they're 99% the same. There's only a couple of small difference which I've documented in the code. This way we can move @aws-sdk/client-cognito-identity-provider into dependencies and give consumers proper access to our "wrapper" types
Changes
src/types.ts
Testing
Before

After
