Closed jan-tennert closed 2 months ago
Note that there are some commits from #694 because I backported and improved some of the changes, but file metadata and exists
/info
support is not being added in this PR.
Yes, I originally wanted to only refactor some internal stuff, but now the changes are getting very breaking alongside the WASM support. I can probably include #622 too. I plan to release 3.0.0.
What kind of change does this PR introduce?
Internal refactor and public API improvements
What is the current behavior?
The current implementation is very complex/messy and the flow variants are even worse (calling
BucketApiImpl
methods, that shouldn't be in a public extension function).What is the new behavior?
Public API
Every upload and download method now has a
options
DSL. This makes it possible to add configuration options in the future without filling up the parameter list (e.g. file metadata) For downloads, there are currently only two things to configure:Example of the new syntax:
For uploads, you can configure:
Example of the new syntax:
Every upload/update/download variant has this new builder including the flow variants.
BucketItem
has been renamed toFileObject
to match the JS lib.Internal implementation
For non-flow-variants I cleaned up the code to minimize duplications & improve readability. The same approach was used for the flow variants, which no longer call internal methods from
BucketApiImpl
and instead use the newhttpOverride
option.Additional context
Add any other context or screenshots.