fix(docs): update Attachments.upload
method JSDoc to reflect supported file types
#449
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.
Pull Request Description
Problem
The JSDoc for method handling attachments upload incorrectly uses Buffer as a valid type for the file parameter. However, the underlying code does not support the Buffer type, and attempting to use it results in a runtime failure.
The incorrect JSDoc type (file: Buffer) creates a confusing experience for developers. It leads them to pass file data as a Buffer, which is not supported by the code and causes hard-to-diagnose errors.
Solution
The JSDoc type for the attachment upload file parameter was updated to reflect the actual implementation.
The type has been changed from Buffer to FormData | Stream | PathLike, as using a Buffer causes a runtime error. This change ensures the types are correct and prevents improper usage.
Related Issue(s)
Documentation
Checklist