Skip to content

Commit

Permalink
RFC0060: Remove the files_container_create_empty method and change th…
Browse files Browse the repository at this point in the history
…e files_container_create method signature to allow an optional location
  • Loading branch information
SAFEShane committed Mar 2, 2020
1 parent f6e194b commit dfac5d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
3 changes: 2 additions & 1 deletion RFCs-by-status.md
Expand Up @@ -22,6 +22,7 @@ A list of all RFCs by their current status.
- [#0032 Forwarding Nodes](./text/0032-forwarding-nodes/0032-forwarding-nodes.md)
- [#0033 Fake Account Packet](./text/0033-fake-account-packet/0033-fake-account-packet.md)
- [#0052 RDF for the Public Name Resolution System](./text/0052-RDF-for-public-name-resolution/0052-RDF-for-public-name-resolution.md)
- [#0060 Enable creating and modifying of FilesContainers within the SAFE Browser environment](./text/0060-enable-creating-and-modifying-of-filescontainers-within-the-safe-browser-environment/0060-enable-creating-and-modifying-of-filescontainers-within-the-safe-browser-environment.md)

## Agreed RFCs

Expand Down Expand Up @@ -75,4 +76,4 @@ A list of all RFCs by their current status.
- [#0051 Safecoin Alternative Implementation](./text/0051-safecoin-alternative-implementation/0051-safecoin-alternative-implementation.md)


(Last updated _Wed 25 Sep 2019 16:16:39 BST_ at REV [5bbb719](https://github.com/maidsafe/rfcs/commit/5bbb719434b92170651549b607e0032c092b13fa))
(Last updated _Mon Mar 2 09:41:48 GMT 2020_ at REV [f6e194b](https://github.com/maidsafe/rfcs/commit/f6e194b231c25a4c27cebeff955006278772f8b7))
Expand Up @@ -29,31 +29,18 @@ At the moment, the following API calls are available (and implemented in the [No
* `files_container_add`
* `files_container_add_from_raw`

Logic would dictate that the browser would call `files_container_create` to create the files container, however first argument to this method `location: &str` requires a path to a directory or file which will be uploaded to the FilesContainer. The same issues also exist for `files_container_sync` and `files_container_add`.
Logic would dictate that the browser would call `files_container_create` to create the files container, however the first argument to this method `location: &str` requires a path to a directory or file which will be uploaded to the FilesContainer. The same issues also exist for `files_container_sync` and `files_container_add`.

`files_container_add_from_raw` is usable, but it always defaults the `type` parameter (which is used as the HTTP `Content-Type` value in the browser to `Raw` regardless of the filetype uploaded..

I propose the addition of 1 new API to be added to the NodeJS library (and thereby allowed for use via the SAFE Browser):

* `files_container_create_empty`

I propose the modifying of 1 existing API in the NodeJS library:
I propose the modifying of 2 existing APIs in the NodeJS library, and the underlying rust SAFE-API:

* `files_container_create`
* `files_container_add_from_raw`

#### files_container_create_empty

This method will create an empty FilesContainer and return the XORURL of the created FilesContainer, or throw an Error.

It would make sense to implement this function [here](https://github.com/maidsafe/safe-api/blob/81687e0a57161f2a7203c62b9897511618862242/safe-api/src/api/files.rs#L55) and expose it to the NodeJS libraries.
#### files_container_create

In NodeJS pseudocode, the interface would be:

```js
function files_container_create_empty(
bool dry_run
) : String;
```
This method will have its first argument (`location: &str`) made optional, with the default being an empty files container.

#### files_container_add_from_raw

Expand Down

0 comments on commit dfac5d5

Please sign in to comment.