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

Bee class API simplifications #265

Closed
AuHau opened this issue Apr 16, 2021 · 2 comments
Closed

Bee class API simplifications #265

AuHau opened this issue Apr 16, 2021 · 2 comments
Assignees
Labels

Comments

@AuHau
Copy link
Contributor

AuHau commented Apr 16, 2021

I have discovered few possible improvements:

Currently, there are "two ways" how to download a file, even though they are not related that much internally, but from external API point of view they seems similar. There is downloadFile and downloadFileFromCollection. I think these could be merged into downloadFile where its signature would be extended with optional parameter path to downloadFile(reference: Reference | string, path?: string) and if path would be specified than it would use "download file from collection" approach and if not specified than it would use "download file" approach. This would affect both downloadFile and downloadFileReadable.

Another suggestion is actually to drop the uploadFilesFromDirectory method and instead provide this functionality through utility function that would build collection and actually create new method uploadCollection as I have already proposed in #172 that you would pass the collection to.

Also another thing is that I would like to unify usage of the return type of Reference and ReferenceResponse choose one or the other and use it consistently. I would lean to use Reference I guess. Should verify that the responses does not contain some useful data in headers that should be extracted and passed along like with File object.

@AuHau AuHau self-assigned this Apr 19, 2021
@AuHau
Copy link
Contributor Author

AuHau commented Apr 19, 2021

The consensus is to move forward with the first and third improvements.

@AuHau
Copy link
Contributor Author

AuHau commented May 19, 2021

Resolved in #280

@AuHau AuHau closed this as completed May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant