diff --git a/README.md b/README.md index 29adcd4..5d5176e 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,17 @@ await fula.rm( ``` +```js +//removes all Fula related data and information (Except the encrypted filesystem) at the specified storage local path +const result //returns true if succesful and false if fails += +await fula.logout( + identity: string, //bytes of the privateKey of did identity in string format + storePath: string, // leave empty to use the default temp one +); + +``` + ## Roadmap Please note the following might not be done in order: diff --git a/android/build.gradle b/android/build.gradle index c11e1ef..5026738 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -63,7 +63,7 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation 'com.github.functionland:fula-build-aar:v0.7.4' // From jitpack.io - implementation 'com.github.functionland:wnfs-build-aar:v1.3.9' // From jitpack.io + implementation 'com.github.functionland:wnfs-build-aar:v1.4.0' // From jitpack.io implementation 'commons-io:commons-io:20030203.000550' // implementation files('mobile.aar') } diff --git a/android/src/main/java/land/fx/fula/FulaModule.java b/android/src/main/java/land/fx/fula/FulaModule.java index 4c56dff..11f287e 100755 --- a/android/src/main/java/land/fx/fula/FulaModule.java +++ b/android/src/main/java/land/fx/fula/FulaModule.java @@ -459,9 +459,10 @@ public void ls(String path, Promise promise) { Log.d("ReactNative", "ls: path = " + path); try { byte[] res = Fs.ls(this.client, this.rootConfig.getCid(), this.rootConfig.getPrivate_ref(), path); - Log.d("ReactNative", "ls: res = " + res); + //JSONArray jsonArray = new JSONArray(res); String s = new String(res, StandardCharsets.UTF_8); + Log.d("ReactNative", "ls: res = " + s); promise.resolve(s); } catch (Exception e) { Log.d("get", e.getMessage()); @@ -498,7 +499,7 @@ public void readFile(String fulaTargetFilename, String localFilename, Promise pr ThreadUtils.runOnExecutor(() -> { Log.d("ReactNative", "readFile: fulaTargetFilename = " + fulaTargetFilename); try { - String path = Fs.readFileToPath(this.client, this.rootConfig.getCid(), this.rootConfig.getPrivate_ref(), fulaTargetFilename, localFilename); + String path = Fs.readFilestreamToPath(this.client, this.rootConfig.getCid(), this.rootConfig.getPrivate_ref(), fulaTargetFilename, localFilename); promise.resolve(path); } catch (Exception e) { Log.d("get", e.getMessage()); diff --git a/package.json b/package.json index 91ece4b..2a72a35 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@functionland/react-native-fula", - "version": "0.4.7", + "version": "0.4.8", "description": "This package is a bridge to use the Fula libp2p protocols in the react-native which is using wnfs", "main": "lib/commonjs/index", "module": "lib/module/index",