@functionland/react-native-fula 0.4.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +133 -100
  3. package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  4. package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
  5. package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
  6. package/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  7. package/android/.gradle/7.5.1/dependencies-accessors/gc.properties +0 -0
  8. package/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
  9. package/android/.gradle/7.5.1/fileChanges/last-build.bin +0 -0
  10. package/android/.gradle/7.5.1/fileHashes/fileHashes.bin +0 -0
  11. package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  12. package/android/.gradle/7.5.1/fileHashes/resourceHashesCache.bin +0 -0
  13. package/android/.gradle/7.5.1/gc.properties +0 -0
  14. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  15. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  16. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  17. package/android/.gradle/vcs-1/gc.properties +0 -0
  18. package/android/.idea/compiler.xml +5 -5
  19. package/android/.idea/gradle.xml +17 -18
  20. package/android/.idea/jarRepositories.xml +44 -49
  21. package/android/.idea/misc.xml +9 -9
  22. package/android/.idea/vcs.xml +5 -5
  23. package/android/build.gradle +69 -67
  24. package/android/gradle/wrapper/gradle-wrapper.properties +1 -0
  25. package/android/gradlew +375 -240
  26. package/android/local.properties +8 -8
  27. package/android/src/main/AndroidManifest.xml +4 -4
  28. package/android/src/main/java/land/fx/fula/ConfigRef.java +7 -7
  29. package/android/src/main/java/land/fx/fula/Cryptography.java +47 -47
  30. package/android/src/main/java/land/fx/fula/FulaModule.java +701 -480
  31. package/android/src/main/java/land/fx/fula/FulaPackage.java +32 -32
  32. package/android/src/main/java/land/fx/fula/SharedPreferenceHelper.java +65 -65
  33. package/android/src/main/java/land/fx/fula/StaticHelper.java +13 -13
  34. package/android/src/main/java/land/fx/fula/ThreadUtils.java +42 -42
  35. package/ios/FulaModule.h +10 -10
  36. package/ios/FulaModule.m +149 -149
  37. package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
  38. package/lib/commonjs/protocols/fula.js +127 -70
  39. package/lib/commonjs/protocols/fula.js.map +1 -1
  40. package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
  41. package/lib/module/protocols/fula.js +122 -68
  42. package/lib/module/protocols/fula.js.map +1 -1
  43. package/lib/typescript/index.d.ts +1 -1
  44. package/lib/typescript/interfaces/fulaNativeModule.d.ts +28 -20
  45. package/lib/typescript/protocols/fula.d.ts +99 -77
  46. package/package.json +149 -152
  47. package/react-native-fula.podspec +19 -19
  48. package/src/interfaces/fulaNativeModule.ts +52 -42
  49. package/src/protocols/fula.ts +212 -138
  50. package/android/.gradle/7.5.1/executionHistory/executionHistory.bin +0 -0
  51. package/android/.gradle/file-system.probe +0 -0
@@ -3,147 +3,204 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.writeFileContent = exports.writeFile = exports.shutdown = exports.rm = exports.readFileContent = exports.readFile = exports.put = exports.push = exports.mkdir = exports.ls = exports.init = exports.has = exports.get = void 0;
6
+ exports.writeFileContent = exports.writeFile = exports.shutdown = exports.rm = exports.readFileContent = exports.readFile = exports.put = exports.push = exports.mv = exports.mkdir = exports.ls = exports.logout = exports.init = exports.has = exports.get = exports.cp = void 0;
7
7
  var _fulaNativeModule = _interopRequireDefault(require("../interfaces/fulaNativeModule"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- /**
10
- * Get gets the value corresponding to the given key from the local datastore.
11
- // The key must be a valid ipld.Link.
12
- * @param config
13
- * @returns boolean
9
+ /**
10
+ * Get gets the value corresponding to the given key from the local datastore.
11
+ // The key must be a valid ipld.Link.
12
+ * @param config
13
+ * @returns boolean
14
14
  */
15
15
 
16
- const init = (identity, storePath, bloxAddr, exchange) => {
16
+ const init = function (identity, storePath, bloxAddr, exchange) {
17
+ let rootCid = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
17
18
  console.log('init in react-native started', identity, storePath, bloxAddr, exchange);
18
- return _fulaNativeModule.default.init(identity, storePath, bloxAddr, exchange);
19
+ return _fulaNativeModule.default.init(identity, storePath, bloxAddr, exchange, rootCid);
19
20
  };
20
21
 
21
- /**
22
- * Get gets the value corresponding to the given key from the local datastore.
23
- // The key must be a valid ipld.Link.
24
- * @param key
25
- * @returns value
22
+ /**
23
+ * rm removes all data
24
+ * @param path
25
+ * @returns string: new cid of the root
26
26
  */
27
27
  exports.init = init;
28
+ const logout = (identity, storePath) => {
29
+ return _fulaNativeModule.default.logout(identity, storePath);
30
+ };
31
+
32
+ /**
33
+ * Get gets the value corresponding to the given key from the local datastore.
34
+ // The key must be a valid ipld.Link.
35
+ * @param key
36
+ * @returns value
37
+ */
38
+ exports.logout = logout;
28
39
  const get = key => {
29
40
  return _fulaNativeModule.default.get(key);
30
41
  };
31
42
 
32
- /**
33
- * Has checks whether the value corresponding to the given key is present in the local datastore.
34
- // The key must be a valid ipld.Link.
35
- * @param key
36
- * @returns boolean
43
+ /**
44
+ * Has checks whether the value corresponding to the given key is present in the local datastore.
45
+ // The key must be a valid ipld.Link.
46
+ * @param key
47
+ * @returns boolean
37
48
  */
38
49
  exports.get = get;
39
50
  const has = key => {
40
51
  return _fulaNativeModule.default.has(key);
41
52
  };
42
53
 
43
- /**
44
- * Push requests the given addr to download the root cid from this node.
45
- // The addr must be a valid multiaddr that includes peer ID.
46
- // this function.
47
- * @param addr
48
- * @returns null or error
54
+ /**
55
+ * Push requests the given addr to download the root cid from this node.
56
+ // The addr must be a valid multiaddr that includes peer ID.
57
+ // this function.
58
+ * @param addr
59
+ * @returns null or error
49
60
  */
50
61
  exports.has = has;
51
62
  const push = () => {
52
63
  return _fulaNativeModule.default.push();
53
64
  };
54
65
 
55
- /**
56
- * Put stores the given key value onto the local datastore.
57
- // The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding
58
- // to the given key.
59
- * @param key, value
60
- * @returns null or string
66
+ /**
67
+ * Put stores the given key value onto the local datastore.
68
+ // The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding
69
+ // to the given key.
70
+ * @param key, value
71
+ * @returns null or string
61
72
  */
62
73
  exports.push = push;
63
74
  const put = (value, codec) => {
64
75
  return _fulaNativeModule.default.put(value, codec);
65
76
  };
66
77
 
67
- /**
68
- * mkdir creates a directory at the given path.
69
- * @param path
70
- * @returns string: new cid of the root
78
+ /**
79
+ * mkdir creates a directory at the given path.
80
+ * @param path
81
+ * @returns string: new cid of the root
71
82
  */
72
83
  exports.put = put;
73
84
  const mkdir = path => {
74
85
  return _fulaNativeModule.default.mkdir(path);
75
86
  };
76
87
 
77
- /**
78
- * writeFileContent writes content at a given path
79
- * @param path
80
- * @returns string: new cid of the root
88
+ /**
89
+ * writeFileContent writes content at a given path
90
+ * @param path
91
+ * @returns string: new cid of the root
81
92
  */
82
93
  exports.mkdir = mkdir;
83
94
  const writeFileContent = (path, content) => {
84
95
  return _fulaNativeModule.default.writeFileContent(path, content);
85
96
  };
86
97
 
87
- /*
88
- // reads content of the file form localFilename (should include full absolute path to local file with read permission
89
- // writes content to the specified location by fulaTargetFilename in Fula filesystem
90
- // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
91
- // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
92
- // Returns: new cid of the root after this file is placed in the tree
98
+ /*
99
+ // reads content of the file form localFilename (should include full absolute path to local file with read permission
100
+ // writes content to the specified location by fulaTargetFilename in Fula filesystem
101
+ // It keeps the original file modiifcation date
102
+ // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
103
+ // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
104
+ // Returns: new cid of the root after this file is placed in the tree
93
105
  */
94
106
  exports.writeFileContent = writeFileContent;
95
107
  const writeFile = (fulaTargetFilename, localFilename) => {
96
108
  return _fulaNativeModule.default.writeFile(fulaTargetFilename, localFilename);
97
109
  };
98
110
 
99
- /**
100
- * ls lists the name of files and folders at a given path
101
- * @param path
102
- * @returns string: list of items
103
- * TODO: Findout how is the string and convert to array
111
+ /**
112
+ * ls lists the name of files and folders at a given path
113
+ * @param path
114
+ * @returns string: list of items
115
+ * TODO: Findout how is the string and convert to array
104
116
  */
105
117
  exports.writeFile = writeFile;
106
118
  const ls = path => {
107
- return _fulaNativeModule.default.ls(path);
119
+ return _fulaNativeModule.default.ls(path).then(res => {
120
+ let lsResult = [];
121
+ let lsRows = res.split('!!!');
122
+ for (const element of lsRows) {
123
+ let rowItems = element.split('???');
124
+ if (rowItems && rowItems[0]) {
125
+ let item = {
126
+ name: '',
127
+ created: '',
128
+ modified: ''
129
+ };
130
+ item.name = rowItems[0];
131
+ if (rowItems[1]) {
132
+ item.created = rowItems[1];
133
+ }
134
+ if (rowItems[2]) {
135
+ item.modified = rowItems[2];
136
+ }
137
+ lsResult.push(item);
138
+ }
139
+ }
140
+ let jsonRes = JSON.parse(JSON.stringify(lsResult));
141
+ return jsonRes;
142
+ }).catch(e => {
143
+ return e;
144
+ });
108
145
  };
109
146
 
110
- /**
111
- * rm removes all files and folders at a given path
112
- * @param path
113
- * @returns string: new cid of the root
147
+ /**
148
+ * rm removes all files and folders at a given path
149
+ * @param path
150
+ * @returns string: new cid of the root
114
151
  */
115
152
  exports.ls = ls;
116
153
  const rm = path => {
117
154
  return _fulaNativeModule.default.rm(path);
118
155
  };
119
156
 
120
- /*
121
- // reads content of the file form localFilename (should include full absolute path to local file with read permission
122
- // writes content to the specified location by fulaTargetFilename in Fula filesystem
123
- // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
124
- // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
125
- // Returns: new cid of the root after this file is placed in the tree
126
- */
157
+ /**
158
+ * cp copies the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
159
+ * @param sourcePath, targetPath
160
+ * @returns string: new cid of the root
161
+ */
127
162
  exports.rm = rm;
163
+ const cp = (sourcePath, targetPath) => {
164
+ return _fulaNativeModule.default.cp(sourcePath, targetPath);
165
+ };
166
+
167
+ /**
168
+ * mv moves the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
169
+ * @param sourcePath, targetPath
170
+ * @returns string: new cid of the root
171
+ */
172
+ exports.cp = cp;
173
+ const mv = (sourcePath, targetPath) => {
174
+ return _fulaNativeModule.default.mv(sourcePath, targetPath);
175
+ };
176
+
177
+ /*
178
+ // reads content of the file form localFilename (should include full absolute path to local file with read permission
179
+ // writes content to the specified location by fulaTargetFilename in Fula filesystem
180
+ // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
181
+ // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
182
+ // Returns: new cid of the root after this file is placed in the tree
183
+ */
184
+ exports.mv = mv;
128
185
  const readFile = (fulaTargetFilename, localFilename) => {
129
186
  return _fulaNativeModule.default.readFile(fulaTargetFilename, localFilename);
130
187
  };
131
188
 
132
- /**
133
- * readFile reads content of a given path
134
- * @param path
135
- * @returns string: cotent
189
+ /**
190
+ * readFile reads content of a given path
191
+ * @param path
192
+ * @returns string: cotent
136
193
  */
137
194
  exports.readFile = readFile;
138
195
  const readFileContent = path => {
139
196
  return _fulaNativeModule.default.readFileContent(path);
140
197
  };
141
198
 
142
- /**
143
- * Shutdown closes all resources used by Client.
144
- // After calling this function Client must be discarded.
145
- * @param
146
- * @returns
199
+ /**
200
+ * Shutdown closes all resources used by Client.
201
+ // After calling this function Client must be discarded.
202
+ * @param
203
+ * @returns
147
204
  */
148
205
  exports.readFileContent = readFileContent;
149
206
  const shutdown = () => {
@@ -1 +1 @@
1
- {"version":3,"names":["init","identity","storePath","bloxAddr","exchange","console","log","Fula","get","key","has","push","put","value","codec","mkdir","path","writeFileContent","content","writeFile","fulaTargetFilename","localFilename","ls","rm","readFile","readFileContent","shutdown"],"sources":["fula.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\r\n\r\n/**\r\n * Get gets the value corresponding to the given key from the local datastore.\r\n// The key must be a valid ipld.Link.\r\n * @param config\r\n * @returns boolean\r\n */\r\n\r\nexport const init = (\r\n identity: string, //privateKey of did identity\r\n storePath: string,\r\n bloxAddr: string,\r\n exchange: string\r\n): Promise<[string, string, string]> => {\r\n console.log('init in react-native started',identity, storePath, bloxAddr, exchange);\r\n return Fula.init(identity, storePath, bloxAddr, exchange);\r\n};\r\n\r\n/**\r\n * Get gets the value corresponding to the given key from the local datastore.\r\n// The key must be a valid ipld.Link.\r\n * @param key\r\n * @returns value\r\n */\r\nexport const get = (key: string): Promise<string> => {\r\n return Fula.get(key);\r\n};\r\n\r\n/**\r\n * Has checks whether the value corresponding to the given key is present in the local datastore.\r\n// The key must be a valid ipld.Link.\r\n * @param key\r\n * @returns boolean\r\n */\r\nexport const has = (key: Uint8Array): Promise<boolean> => {\r\n return Fula.has(key);\r\n};\r\n\r\n/**\r\n * Push requests the given addr to download the root cid from this node.\r\n// The addr must be a valid multiaddr that includes peer ID.\r\n// this function.\r\n * @param addr\r\n * @returns null or error\r\n */\r\nexport const push = (): Promise<string> => {\r\n return Fula.push();\r\n};\r\n\r\n/**\r\n * Put stores the given key value onto the local datastore.\r\n// The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding\r\n// to the given key.\r\n * @param key, value\r\n * @returns null or string\r\n */\r\nexport const put = (value: string, codec: string): Promise<string> => {\r\n return Fula.put(value, codec);\r\n};\r\n\r\n/**\r\n * mkdir creates a directory at the given path.\r\n * @param path\r\n * @returns string: new cid of the root\r\n */\r\nexport const mkdir = (path: string): Promise<string> => {\r\n return Fula.mkdir(path);\r\n};\r\n\r\n/**\r\n * writeFileContent writes content at a given path\r\n * @param path\r\n * @returns string: new cid of the root\r\n */\r\nexport const writeFileContent = (path: string, content: string): Promise<string> => {\r\n return Fula.writeFileContent(path, content);\r\n};\r\n\r\n/*\r\n // reads content of the file form localFilename (should include full absolute path to local file with read permission\r\n // writes content to the specified location by fulaTargetFilename in Fula filesystem\r\n // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)\r\n // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)\r\n // Returns: new cid of the root after this file is placed in the tree\r\n */\r\nexport const writeFile = (fulaTargetFilename: string, localFilename: string): Promise<string> => {\r\n return Fula.writeFile(fulaTargetFilename, localFilename);\r\n};\r\n\r\n/**\r\n * ls lists the name of files and folders at a given path\r\n * @param path\r\n * @returns string: list of items\r\n * TODO: Findout how is the string and convert to array\r\n */\r\n export const ls = (path: string): Promise<string> => {\r\n return Fula.ls(path);\r\n};\r\n\r\n/**\r\n * rm removes all files and folders at a given path\r\n * @param path\r\n * @returns string: new cid of the root\r\n */\r\nexport const rm = (path: string): Promise<string> => {\r\n return Fula.rm(path);\r\n};\r\n\r\n/*\r\n // reads content of the file form localFilename (should include full absolute path to local file with read permission\r\n // writes content to the specified location by fulaTargetFilename in Fula filesystem\r\n // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)\r\n // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)\r\n // Returns: new cid of the root after this file is placed in the tree\r\n */\r\n export const readFile = (fulaTargetFilename: string, localFilename: string): Promise<string> => {\r\n return Fula.readFile(fulaTargetFilename, localFilename);\r\n };\r\n\r\n/**\r\n * readFile reads content of a given path\r\n * @param path\r\n * @returns string: cotent\r\n */\r\n export const readFileContent = (path: string): Promise<string> => {\r\n return Fula.readFileContent(path);\r\n};\r\n\r\n/**\r\n * Shutdown closes all resources used by Client.\r\n// After calling this function Client must be discarded.\r\n * @param\r\n * @returns\r\n */\r\nexport const shutdown = (): Promise<void> => {\r\n return Fula.shutdown();\r\n};\r\n"],"mappings":";;;;;;AAAA;AAAkD;AAElD;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,IAAI,GAAG,CAClBC,QAAgB,EAChBC,SAAiB,EACjBC,QAAgB,EAChBC,QAAgB,KACsB;EACtCC,OAAO,CAACC,GAAG,CAAC,8BAA8B,EAACL,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,CAAC;EACnF,OAAOG,yBAAI,CAACP,IAAI,CAACC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,CAAC;AAC3D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA;AAMO,MAAMI,GAAG,GAAIC,GAAW,IAAsB;EACnD,OAAOF,yBAAI,CAACC,GAAG,CAACC,GAAG,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA;AAMO,MAAMC,GAAG,GAAID,GAAe,IAAuB;EACxD,OAAOF,yBAAI,CAACG,GAAG,CAACD,GAAG,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AAOO,MAAME,IAAI,GAAG,MAAuB;EACzC,OAAOJ,yBAAI,CAACI,IAAI,EAAE;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AAOO,MAAMC,GAAG,GAAG,CAACC,KAAa,EAAEC,KAAa,KAAsB;EACpE,OAAOP,yBAAI,CAACK,GAAG,CAACC,KAAK,EAAEC,KAAK,CAAC;AAC/B,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA;AAKO,MAAMC,KAAK,GAAIC,IAAY,IAAsB;EACtD,OAAOT,yBAAI,CAACQ,KAAK,CAACC,IAAI,CAAC;AACzB,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA;AAKO,MAAMC,gBAAgB,GAAG,CAACD,IAAY,EAAEE,OAAe,KAAsB;EAClF,OAAOX,yBAAI,CAACU,gBAAgB,CAACD,IAAI,EAAEE,OAAO,CAAC;AAC7C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AAOO,MAAMC,SAAS,GAAG,CAACC,kBAA0B,EAAEC,aAAqB,KAAsB;EAC/F,OAAOd,yBAAI,CAACY,SAAS,CAACC,kBAAkB,EAAEC,aAAa,CAAC;AAC1D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA;AAMQ,MAAMC,EAAE,GAAIN,IAAY,IAAsB;EACpD,OAAOT,yBAAI,CAACe,EAAE,CAACN,IAAI,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA;AAKO,MAAMO,EAAE,GAAIP,IAAY,IAAsB;EACnD,OAAOT,yBAAI,CAACgB,EAAE,CAACP,IAAI,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AAOW,MAAMQ,QAAQ,GAAG,CAACJ,kBAA0B,EAAEC,aAAqB,KAAsB;EAC9F,OAAOd,yBAAI,CAACiB,QAAQ,CAACJ,kBAAkB,EAAEC,aAAa,CAAC;AACzD,CAAC;;AAEL;AACA;AACA;AACA;AACA;AAJA;AAKQ,MAAMI,eAAe,GAAIT,IAAY,IAAsB;EACjE,OAAOT,yBAAI,CAACkB,eAAe,CAACT,IAAI,CAAC;AACnC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA;AAMO,MAAMU,QAAQ,GAAG,MAAqB;EAC3C,OAAOnB,yBAAI,CAACmB,QAAQ,EAAE;AACxB,CAAC;AAAC"}
1
+ {"version":3,"names":["init","identity","storePath","bloxAddr","exchange","rootCid","console","log","Fula","logout","get","key","has","push","put","value","codec","mkdir","path","writeFileContent","content","writeFile","fulaTargetFilename","localFilename","ls","then","res","lsResult","lsRows","split","element","rowItems","item","name","created","modified","jsonRes","JSON","parse","stringify","catch","e","rm","cp","sourcePath","targetPath","mv","readFile","readFileContent","shutdown"],"sources":["fula.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\n\n/**\n * Get gets the value corresponding to the given key from the local datastore.\n// The key must be a valid ipld.Link.\n * @param config\n * @returns boolean\n */\n\nexport const init = (\n identity: string, //privateKey of did identity\n storePath: string,\n bloxAddr: string,\n exchange: string,\n rootCid: string | null = null\n): Promise<{ peerId: string; rootCid: string; private_ref: string }> => {\n console.log(\n 'init in react-native started',\n identity,\n storePath,\n bloxAddr,\n exchange\n );\n return Fula.init(identity, storePath, bloxAddr, exchange, rootCid);\n};\n\n/**\n * rm removes all data\n * @param path\n * @returns string: new cid of the root\n */\nexport const logout = (\n identity: string,\n storePath: string\n): Promise<boolean> => {\n return Fula.logout(identity, storePath);\n};\n\n/**\n * Get gets the value corresponding to the given key from the local datastore.\n// The key must be a valid ipld.Link.\n * @param key\n * @returns value\n */\nexport const get = (key: string): Promise<string> => {\n return Fula.get(key);\n};\n\n/**\n * Has checks whether the value corresponding to the given key is present in the local datastore.\n// The key must be a valid ipld.Link.\n * @param key\n * @returns boolean\n */\nexport const has = (key: Uint8Array): Promise<boolean> => {\n return Fula.has(key);\n};\n\n/**\n * Push requests the given addr to download the root cid from this node.\n// The addr must be a valid multiaddr that includes peer ID.\n// this function.\n * @param addr\n * @returns null or error\n */\nexport const push = (): Promise<string> => {\n return Fula.push();\n};\n\n/**\n * Put stores the given key value onto the local datastore.\n// The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding\n// to the given key.\n * @param key, value\n * @returns null or string\n */\nexport const put = (value: string, codec: string): Promise<string> => {\n return Fula.put(value, codec);\n};\n\n/**\n * mkdir creates a directory at the given path.\n * @param path\n * @returns string: new cid of the root\n */\nexport const mkdir = (path: string): Promise<string> => {\n return Fula.mkdir(path);\n};\n\n/**\n * writeFileContent writes content at a given path\n * @param path\n * @returns string: new cid of the root\n */\nexport const writeFileContent = (\n path: string,\n content: string\n): Promise<string> => {\n return Fula.writeFileContent(path, content);\n};\n\n/*\n // reads content of the file form localFilename (should include full absolute path to local file with read permission\n // writes content to the specified location by fulaTargetFilename in Fula filesystem\n // It keeps the original file modiifcation date\n // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)\n // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)\n // Returns: new cid of the root after this file is placed in the tree\n */\nexport const writeFile = (\n fulaTargetFilename: string,\n localFilename: string\n): Promise<string> => {\n return Fula.writeFile(fulaTargetFilename, localFilename);\n};\n\n/**\n * ls lists the name of files and folders at a given path\n * @param path\n * @returns string: list of items\n * TODO: Findout how is the string and convert to array\n */\nexport const ls = (path: string): Promise<void | JSON> => {\n return Fula.ls(path)\n .then((res) => {\n let lsResult = [];\n let lsRows = res.split('!!!');\n for (const element of lsRows) {\n let rowItems = element.split('???');\n if (rowItems && rowItems[0]) {\n let item = {\n name: '',\n created: '',\n modified: '',\n };\n item.name = rowItems[0];\n if (rowItems[1]) {\n item.created = rowItems[1];\n }\n if (rowItems[2]) {\n item.modified = rowItems[2];\n }\n lsResult.push(item);\n }\n }\n let jsonRes = JSON.parse(JSON.stringify(lsResult));\n return jsonRes;\n })\n .catch((e) => {\n return e;\n });\n};\n\n/**\n * rm removes all files and folders at a given path\n * @param path\n * @returns string: new cid of the root\n */\nexport const rm = (path: string): Promise<string> => {\n return Fula.rm(path);\n};\n\n/**\n * cp copies the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already\n * @param sourcePath, targetPath\n * @returns string: new cid of the root\n */\nexport const cp = (sourcePath: string, targetPath: string): Promise<string> => {\n return Fula.cp(sourcePath, targetPath);\n};\n\n/**\n * mv moves the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already\n * @param sourcePath, targetPath\n * @returns string: new cid of the root\n */\nexport const mv = (sourcePath: string, targetPath: string): Promise<string> => {\n return Fula.mv(sourcePath, targetPath);\n};\n\n/*\n // reads content of the file form localFilename (should include full absolute path to local file with read permission\n // writes content to the specified location by fulaTargetFilename in Fula filesystem\n // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)\n // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)\n // Returns: new cid of the root after this file is placed in the tree\n */\nexport const readFile = (\n fulaTargetFilename: string,\n localFilename: string\n): Promise<string> => {\n return Fula.readFile(fulaTargetFilename, localFilename);\n};\n\n/**\n * readFile reads content of a given path\n * @param path\n * @returns string: cotent\n */\nexport const readFileContent = (path: string): Promise<string> => {\n return Fula.readFileContent(path);\n};\n\n/**\n * Shutdown closes all resources used by Client.\n// After calling this function Client must be discarded.\n * @param\n * @returns\n */\nexport const shutdown = (): Promise<void> => {\n return Fula.shutdown();\n};\n"],"mappings":";;;;;;AAAA;AAAkD;AAElD;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,IAAI,GAAG,UAClBC,QAAgB,EAChBC,SAAiB,EACjBC,QAAgB,EAChBC,QAAgB,EAEsD;EAAA,IADtEC,OAAsB,uEAAG,IAAI;EAE7BC,OAAO,CAACC,GAAG,CACT,8BAA8B,EAC9BN,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,QAAQ,CACT;EACD,OAAOI,yBAAI,CAACR,IAAI,CAACC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,OAAO,CAAC;AACpE,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA;AAKO,MAAMI,MAAM,GAAG,CACpBR,QAAgB,EAChBC,SAAiB,KACI;EACrB,OAAOM,yBAAI,CAACC,MAAM,CAACR,QAAQ,EAAEC,SAAS,CAAC;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA;AAMO,MAAMQ,GAAG,GAAIC,GAAW,IAAsB;EACnD,OAAOH,yBAAI,CAACE,GAAG,CAACC,GAAG,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA;AAMO,MAAMC,GAAG,GAAID,GAAe,IAA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,CACtBzB,kBAA0B,EAC1BC,aAAqB,KACD;EACpB,OAAOf,yBAAI,CAACuC,QAAQ,CAACzB,kBAAkB,EAAEC,aAAa,CAAC;AACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA;AAKO,MAAMyB,eAAe,GAAI9B,IAAY,IAAsB;EAChE,OAAOV,yBAAI,CAACwC,eAAe,CAAC9B,IAAI,CAAC;AACnC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA;AAMO,MAAM+B,QAAQ,GAAG,MAAqB;EAC3C,OAAOzC,yBAAI,CAACyC,QAAQ,EAAE;AACxB,CAAC;AAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Fula","FulaModule","Proxy","get","Error"],"sources":["fulaNativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\r\n\r\ninterface FulaNativeModule {\r\n init: (\r\n identity: string | null, //Private key of did identity\r\n storePath: string | null, //You can leave empty\r\n bloxAddr: string, //Blox multiadddr needs to be manually entered now\r\n exchange: string //set to 'noope' for testing\r\n ) => Promise<[string, string, string]>;\r\n get: (key: string) => Promise<string>;\r\n has: (key: Uint8Array) => Promise<boolean>;\r\n push: () => Promise<string>;\r\n put: (content: string, codec: string) => Promise<string>;\r\n mkdir: (path: string) => Promise<string>;\r\n writeFileContent: (path: string, content: string) => Promise<string>;\r\n writeFile: (fulaTargetFilename: string, localFilename: string) => Promise<string>;\r\n ls: (path: string) => Promise<string>;\r\n rm: (path: string) => Promise<string>;\r\n readFile: (fulaTargetFilename: string, localFilename: string) => Promise<string>;\r\n readFileContent: (path: string) => Promise<string>;\r\n\r\n shutdown: () => Promise<void>;\r\n}\r\n\r\nconst LINKING_ERROR =\r\n `The package 'react-native-fula' doesn't seem to be linked. Make sure: \\n\\n` +\r\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\r\n '- You rebuilt the app after installing the package\\n' +\r\n '- You are not using Expo managed workflow\\n';\r\n\r\nconst Fula = NativeModules.FulaModule\r\n ? NativeModules.FulaModule\r\n : new Proxy(\r\n {},\r\n {\r\n get() {\r\n throw new Error(LINKING_ERROR);\r\n },\r\n }\r\n );\r\n\r\nexport default Fula as FulaNativeModule;\r\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAwBtD,MAAMC,aAAa,GAChB,4EAA2E,GAC5ED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,IAAI,GAAGN,aAAa,CAACO,UAAU,GACjCP,aAAa,CAACO,UAAU,GACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,CAAC;EAChC;AACF,CAAC,CACF;AAEL,eAAeI,IAAI"}
1
+ {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Fula","FulaModule","Proxy","get","Error"],"sources":["fulaNativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\ninterface FulaNativeModule {\n init: (\n identity: string, //Private key of did identity\n storePath: string, //You can leave empty\n bloxAddr: string, //Blox multiadddr needs to be manually entered now\n exchange: string, //set to 'noope' for testing\n rootCid: string | null //if you have the latest rootCid you can send it and it generates the private_ref for filesystem\n ) => Promise<{ peerId: string; rootCid: string; private_ref: string }>;\n logout: (identity: string, storePath: string) => Promise<boolean>;\n get: (key: string) => Promise<string>;\n has: (key: Uint8Array) => Promise<boolean>;\n push: () => Promise<string>;\n put: (content: string, codec: string) => Promise<string>;\n mkdir: (path: string) => Promise<string>;\n writeFileContent: (path: string, content: string) => Promise<string>;\n writeFile: (\n fulaTargetFilename: string,\n localFilename: string\n ) => Promise<string>;\n ls: (path: string) => Promise<string>;\n rm: (path: string) => Promise<string>;\n cp: (sourcePath: string, targetPath: string) => Promise<string>;\n mv: (sourcePath: string, targetPath: string) => Promise<string>;\n readFile: (\n fulaTargetFilename: string,\n localFilename: string\n ) => Promise<string>;\n readFileContent: (path: string) => Promise<string>;\n\n shutdown: () => Promise<void>;\n}\n\nconst LINKING_ERROR =\n `The package 'react-native-fula' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst Fula = NativeModules.FulaModule\n ? NativeModules.FulaModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport default Fula as FulaNativeModule;\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAkCtD,MAAMC,aAAa,GAChB,4EAA2E,GAC5ED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,IAAI,GAAGN,aAAa,CAACO,UAAU,GACjCP,aAAa,CAACO,UAAU,GACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,CAAC;EAChC;AACF,CAAC,CACF;AAEL,eAAeI,IAAI"}
@@ -1,132 +1,186 @@
1
1
  import Fula from '../interfaces/fulaNativeModule';
2
2
 
3
- /**
4
- * Get gets the value corresponding to the given key from the local datastore.
5
- // The key must be a valid ipld.Link.
6
- * @param config
7
- * @returns boolean
3
+ /**
4
+ * Get gets the value corresponding to the given key from the local datastore.
5
+ // The key must be a valid ipld.Link.
6
+ * @param config
7
+ * @returns boolean
8
8
  */
9
9
 
10
- export const init = (identity, storePath, bloxAddr, exchange) => {
10
+ export const init = function (identity, storePath, bloxAddr, exchange) {
11
+ let rootCid = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
11
12
  console.log('init in react-native started', identity, storePath, bloxAddr, exchange);
12
- return Fula.init(identity, storePath, bloxAddr, exchange);
13
+ return Fula.init(identity, storePath, bloxAddr, exchange, rootCid);
13
14
  };
14
15
 
15
- /**
16
- * Get gets the value corresponding to the given key from the local datastore.
17
- // The key must be a valid ipld.Link.
18
- * @param key
19
- * @returns value
16
+ /**
17
+ * rm removes all data
18
+ * @param path
19
+ * @returns string: new cid of the root
20
+ */
21
+ export const logout = (identity, storePath) => {
22
+ return Fula.logout(identity, storePath);
23
+ };
24
+
25
+ /**
26
+ * Get gets the value corresponding to the given key from the local datastore.
27
+ // The key must be a valid ipld.Link.
28
+ * @param key
29
+ * @returns value
20
30
  */
21
31
  export const get = key => {
22
32
  return Fula.get(key);
23
33
  };
24
34
 
25
- /**
26
- * Has checks whether the value corresponding to the given key is present in the local datastore.
27
- // The key must be a valid ipld.Link.
28
- * @param key
29
- * @returns boolean
35
+ /**
36
+ * Has checks whether the value corresponding to the given key is present in the local datastore.
37
+ // The key must be a valid ipld.Link.
38
+ * @param key
39
+ * @returns boolean
30
40
  */
31
41
  export const has = key => {
32
42
  return Fula.has(key);
33
43
  };
34
44
 
35
- /**
36
- * Push requests the given addr to download the root cid from this node.
37
- // The addr must be a valid multiaddr that includes peer ID.
38
- // this function.
39
- * @param addr
40
- * @returns null or error
45
+ /**
46
+ * Push requests the given addr to download the root cid from this node.
47
+ // The addr must be a valid multiaddr that includes peer ID.
48
+ // this function.
49
+ * @param addr
50
+ * @returns null or error
41
51
  */
42
52
  export const push = () => {
43
53
  return Fula.push();
44
54
  };
45
55
 
46
- /**
47
- * Put stores the given key value onto the local datastore.
48
- // The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding
49
- // to the given key.
50
- * @param key, value
51
- * @returns null or string
56
+ /**
57
+ * Put stores the given key value onto the local datastore.
58
+ // The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding
59
+ // to the given key.
60
+ * @param key, value
61
+ * @returns null or string
52
62
  */
53
63
  export const put = (value, codec) => {
54
64
  return Fula.put(value, codec);
55
65
  };
56
66
 
57
- /**
58
- * mkdir creates a directory at the given path.
59
- * @param path
60
- * @returns string: new cid of the root
67
+ /**
68
+ * mkdir creates a directory at the given path.
69
+ * @param path
70
+ * @returns string: new cid of the root
61
71
  */
62
72
  export const mkdir = path => {
63
73
  return Fula.mkdir(path);
64
74
  };
65
75
 
66
- /**
67
- * writeFileContent writes content at a given path
68
- * @param path
69
- * @returns string: new cid of the root
76
+ /**
77
+ * writeFileContent writes content at a given path
78
+ * @param path
79
+ * @returns string: new cid of the root
70
80
  */
71
81
  export const writeFileContent = (path, content) => {
72
82
  return Fula.writeFileContent(path, content);
73
83
  };
74
84
 
75
- /*
76
- // reads content of the file form localFilename (should include full absolute path to local file with read permission
77
- // writes content to the specified location by fulaTargetFilename in Fula filesystem
78
- // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
79
- // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
80
- // Returns: new cid of the root after this file is placed in the tree
85
+ /*
86
+ // reads content of the file form localFilename (should include full absolute path to local file with read permission
87
+ // writes content to the specified location by fulaTargetFilename in Fula filesystem
88
+ // It keeps the original file modiifcation date
89
+ // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
90
+ // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
91
+ // Returns: new cid of the root after this file is placed in the tree
81
92
  */
82
93
  export const writeFile = (fulaTargetFilename, localFilename) => {
83
94
  return Fula.writeFile(fulaTargetFilename, localFilename);
84
95
  };
85
96
 
86
- /**
87
- * ls lists the name of files and folders at a given path
88
- * @param path
89
- * @returns string: list of items
90
- * TODO: Findout how is the string and convert to array
97
+ /**
98
+ * ls lists the name of files and folders at a given path
99
+ * @param path
100
+ * @returns string: list of items
101
+ * TODO: Findout how is the string and convert to array
91
102
  */
92
103
  export const ls = path => {
93
- return Fula.ls(path);
104
+ return Fula.ls(path).then(res => {
105
+ let lsResult = [];
106
+ let lsRows = res.split('!!!');
107
+ for (const element of lsRows) {
108
+ let rowItems = element.split('???');
109
+ if (rowItems && rowItems[0]) {
110
+ let item = {
111
+ name: '',
112
+ created: '',
113
+ modified: ''
114
+ };
115
+ item.name = rowItems[0];
116
+ if (rowItems[1]) {
117
+ item.created = rowItems[1];
118
+ }
119
+ if (rowItems[2]) {
120
+ item.modified = rowItems[2];
121
+ }
122
+ lsResult.push(item);
123
+ }
124
+ }
125
+ let jsonRes = JSON.parse(JSON.stringify(lsResult));
126
+ return jsonRes;
127
+ }).catch(e => {
128
+ return e;
129
+ });
94
130
  };
95
131
 
96
- /**
97
- * rm removes all files and folders at a given path
98
- * @param path
99
- * @returns string: new cid of the root
132
+ /**
133
+ * rm removes all files and folders at a given path
134
+ * @param path
135
+ * @returns string: new cid of the root
100
136
  */
101
137
  export const rm = path => {
102
138
  return Fula.rm(path);
103
139
  };
104
140
 
105
- /*
106
- // reads content of the file form localFilename (should include full absolute path to local file with read permission
107
- // writes content to the specified location by fulaTargetFilename in Fula filesystem
108
- // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
109
- // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
110
- // Returns: new cid of the root after this file is placed in the tree
141
+ /**
142
+ * cp copies the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
143
+ * @param sourcePath, targetPath
144
+ * @returns string: new cid of the root
145
+ */
146
+ export const cp = (sourcePath, targetPath) => {
147
+ return Fula.cp(sourcePath, targetPath);
148
+ };
149
+
150
+ /**
151
+ * mv moves the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
152
+ * @param sourcePath, targetPath
153
+ * @returns string: new cid of the root
154
+ */
155
+ export const mv = (sourcePath, targetPath) => {
156
+ return Fula.mv(sourcePath, targetPath);
157
+ };
158
+
159
+ /*
160
+ // reads content of the file form localFilename (should include full absolute path to local file with read permission
161
+ // writes content to the specified location by fulaTargetFilename in Fula filesystem
162
+ // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
163
+ // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
164
+ // Returns: new cid of the root after this file is placed in the tree
111
165
  */
112
166
  export const readFile = (fulaTargetFilename, localFilename) => {
113
167
  return Fula.readFile(fulaTargetFilename, localFilename);
114
168
  };
115
169
 
116
- /**
117
- * readFile reads content of a given path
118
- * @param path
119
- * @returns string: cotent
170
+ /**
171
+ * readFile reads content of a given path
172
+ * @param path
173
+ * @returns string: cotent
120
174
  */
121
175
  export const readFileContent = path => {
122
176
  return Fula.readFileContent(path);
123
177
  };
124
178
 
125
- /**
126
- * Shutdown closes all resources used by Client.
127
- // After calling this function Client must be discarded.
128
- * @param
129
- * @returns
179
+ /**
180
+ * Shutdown closes all resources used by Client.
181
+ // After calling this function Client must be discarded.
182
+ * @param
183
+ * @returns
130
184
  */
131
185
  export const shutdown = () => {
132
186
  return Fula.shutdown();
@@ -1 +1 @@
1
- {"version":3,"names":["Fula","init","identity","storePath","bloxAddr","exchange","console","log","get","key","has","push","put","value","codec","mkdir","path","writeFileContent","content","writeFile","fulaTargetFilename","localFilename","ls","rm","readFile","readFileContent","shutdown"],"sources":["fula.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\r\n\r\n/**\r\n * Get gets the value corresponding to the given key from the local datastore.\r\n// The key must be a valid ipld.Link.\r\n * @param config\r\n * @returns boolean\r\n */\r\n\r\nexport const init = (\r\n identity: string, //privateKey of did identity\r\n storePath: string,\r\n bloxAddr: string,\r\n exchange: string\r\n): Promise<[string, string, string]> => {\r\n console.log('init in react-native started',identity, storePath, bloxAddr, exchange);\r\n return Fula.init(identity, storePath, bloxAddr, exchange);\r\n};\r\n\r\n/**\r\n * Get gets the value corresponding to the given key from the local datastore.\r\n// The key must be a valid ipld.Link.\r\n * @param key\r\n * @returns value\r\n */\r\nexport const get = (key: string): Promise<string> => {\r\n return Fula.get(key);\r\n};\r\n\r\n/**\r\n * Has checks whether the value corresponding to the given key is present in the local datastore.\r\n// The key must be a valid ipld.Link.\r\n * @param key\r\n * @returns boolean\r\n */\r\nexport const has = (key: Uint8Array): Promise<boolean> => {\r\n return Fula.has(key);\r\n};\r\n\r\n/**\r\n * Push requests the given addr to download the root cid from this node.\r\n// The addr must be a valid multiaddr that includes peer ID.\r\n// this function.\r\n * @param addr\r\n * @returns null or error\r\n */\r\nexport const push = (): Promise<string> => {\r\n return Fula.push();\r\n};\r\n\r\n/**\r\n * Put stores the given key value onto the local datastore.\r\n// The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding\r\n// to the given key.\r\n * @param key, value\r\n * @returns null or string\r\n */\r\nexport const put = (value: string, codec: string): Promise<string> => {\r\n return Fula.put(value, codec);\r\n};\r\n\r\n/**\r\n * mkdir creates a directory at the given path.\r\n * @param path\r\n * @returns string: new cid of the root\r\n */\r\nexport const mkdir = (path: string): Promise<string> => {\r\n return Fula.mkdir(path);\r\n};\r\n\r\n/**\r\n * writeFileContent writes content at a given path\r\n * @param path\r\n * @returns string: new cid of the root\r\n */\r\nexport const writeFileContent = (path: string, content: string): Promise<string> => {\r\n return Fula.writeFileContent(path, content);\r\n};\r\n\r\n/*\r\n // reads content of the file form localFilename (should include full absolute path to local file with read permission\r\n // writes content to the specified location by fulaTargetFilename in Fula filesystem\r\n // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)\r\n // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)\r\n // Returns: new cid of the root after this file is placed in the tree\r\n */\r\nexport const writeFile = (fulaTargetFilename: string, localFilename: string): Promise<string> => {\r\n return Fula.writeFile(fulaTargetFilename, localFilename);\r\n};\r\n\r\n/**\r\n * ls lists the name of files and folders at a given path\r\n * @param path\r\n * @returns string: list of items\r\n * TODO: Findout how is the string and convert to array\r\n */\r\n export const ls = (path: string): Promise<string> => {\r\n return Fula.ls(path);\r\n};\r\n\r\n/**\r\n * rm removes all files and folders at a given path\r\n * @param path\r\n * @returns string: new cid of the root\r\n */\r\nexport const rm = (path: string): Promise<string> => {\r\n return Fula.rm(path);\r\n};\r\n\r\n/*\r\n // reads content of the file form localFilename (should include full absolute path to local file with read permission\r\n // writes content to the specified location by fulaTargetFilename in Fula filesystem\r\n // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)\r\n // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)\r\n // Returns: new cid of the root after this file is placed in the tree\r\n */\r\n export const readFile = (fulaTargetFilename: string, localFilename: string): Promise<string> => {\r\n return Fula.readFile(fulaTargetFilename, localFilename);\r\n };\r\n\r\n/**\r\n * readFile reads content of a given path\r\n * @param path\r\n * @returns string: cotent\r\n */\r\n export const readFileContent = (path: string): Promise<string> => {\r\n return Fula.readFileContent(path);\r\n};\r\n\r\n/**\r\n * Shutdown closes all resources used by Client.\r\n// After calling this function Client must be discarded.\r\n * @param\r\n * @returns\r\n */\r\nexport const shutdown = (): Promise<void> => {\r\n return Fula.shutdown();\r\n};\r\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,gCAAgC;;AAEjD;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,IAAI,GAAG,CAClBC,QAAgB,EAChBC,SAAiB,EACjBC,QAAgB,EAChBC,QAAgB,KACsB;EACtCC,OAAO,CAACC,GAAG,CAAC,8BAA8B,EAACL,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,CAAC;EACnF,OAAOL,IAAI,CAACC,IAAI,CAACC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,CAAC;AAC3D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,GAAG,GAAIC,GAAW,IAAsB;EACnD,OAAOT,IAAI,CAACQ,GAAG,CAACC,GAAG,CAAC;AACtB,CAAC;;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AAMQ,QAAQ,GAAG,CAACJ,kBAA0B,EAAEC,aAAqB,KAAsB;EAC9F,OAAOrB,IAAI,CAACwB,QAAQ,CAACJ,kBAAkB,EAAEC,aAAa,CAAC;AACzD,CAAC;;AAEL;AACA;AACA;AACA;AACA;AACC,OAAO,MAAMI,eAAe,GAAIT,IAAY,IAAsB;EACjE,OAAOhB,IAAI,CAACyB,eAAe,CAACT,IAAI,CAAC;AACnC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,QAAQ,GAAG,MAAqB;EAC3C,OAAO1B,IAAI,CAAC0B,QAAQ,EAAE;AACxB,CAAC"}
1
+ {"version":3,"names":["Fula","init","identity","storePath","bloxAddr","exchange","rootCid","console","log","logout","get","key","has","push","put","value","codec","mkdir","path","writeFileContent","content","writeFile","fulaTargetFilename","localFilename","ls","then","res","lsResult","lsRows","split","element","rowItems","item","name","created","modified","jsonRes","JSON","parse","stringify","catch","e","rm","cp","sourcePath","targetPath","mv","readFile","readFileContent","shutdown"],"sources":["fula.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\n\n/**\n * Get gets the value corresponding to the given key from the local datastore.\n// The key must be a valid ipld.Link.\n * @param config\n * @returns boolean\n */\n\nexport const init = (\n identity: string, //privateKey of did identity\n storePath: string,\n bloxAddr: string,\n exchange: string,\n rootCid: string | null = null\n): Promise<{ peerId: string; rootCid: string; private_ref: string }> => {\n console.log(\n 'init in react-native started',\n identity,\n storePath,\n bloxAddr,\n exchange\n );\n return Fula.init(identity, storePath, bloxAddr, exchange, rootCid);\n};\n\n/**\n * rm removes all data\n * @param path\n * @returns string: new cid of the root\n */\nexport const logout = (\n identity: string,\n storePath: string\n): Promise<boolean> => {\n return Fula.logout(identity, storePath);\n};\n\n/**\n * Get gets the value corresponding to the given key from the local datastore.\n// The key must be a valid ipld.Link.\n * @param key\n * @returns value\n */\nexport const get = (key: string): Promise<string> => {\n return Fula.get(key);\n};\n\n/**\n * Has checks whether the value corresponding to the given key is present in the local datastore.\n// The key must be a valid ipld.Link.\n * @param key\n * @returns boolean\n */\nexport const has = (key: Uint8Array): Promise<boolean> => {\n return Fula.has(key);\n};\n\n/**\n * Push requests the given addr to download the root cid from this node.\n// The addr must be a valid multiaddr that includes peer ID.\n// this function.\n * @param addr\n * @returns null or error\n */\nexport const push = (): Promise<string> => {\n return Fula.push();\n};\n\n/**\n * Put stores the given key value onto the local datastore.\n// The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding\n// to the given key.\n * @param key, value\n * @returns null or string\n */\nexport const put = (value: string, codec: string): Promise<string> => {\n return Fula.put(value, codec);\n};\n\n/**\n * mkdir creates a directory at the given path.\n * @param path\n * @returns string: new cid of the root\n */\nexport const mkdir = (path: string): Promise<string> => {\n return Fula.mkdir(path);\n};\n\n/**\n * writeFileContent writes content at a given path\n * @param path\n * @returns string: new cid of the root\n */\nexport const writeFileContent = (\n path: string,\n content: string\n): Promise<string> => {\n return Fula.writeFileContent(path, content);\n};\n\n/*\n // reads content of the file form localFilename (should include full absolute path to local file with read permission\n // writes content to the specified location by fulaTargetFilename in Fula filesystem\n // It keeps the original file modiifcation date\n // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)\n // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)\n // Returns: new cid of the root after this file is placed in the tree\n */\nexport const writeFile = (\n fulaTargetFilename: string,\n localFilename: string\n): Promise<string> => {\n return Fula.writeFile(fulaTargetFilename, localFilename);\n};\n\n/**\n * ls lists the name of files and folders at a given path\n * @param path\n * @returns string: list of items\n * TODO: Findout how is the string and convert to array\n */\nexport const ls = (path: string): Promise<void | JSON> => {\n return Fula.ls(path)\n .then((res) => {\n let lsResult = [];\n let lsRows = res.split('!!!');\n for (const element of lsRows) {\n let rowItems = element.split('???');\n if (rowItems && rowItems[0]) {\n let item = {\n name: '',\n created: '',\n modified: '',\n };\n item.name = rowItems[0];\n if (rowItems[1]) {\n item.created = rowItems[1];\n }\n if (rowItems[2]) {\n item.modified = rowItems[2];\n }\n lsResult.push(item);\n }\n }\n let jsonRes = JSON.parse(JSON.stringify(lsResult));\n return jsonRes;\n })\n .catch((e) => {\n return e;\n });\n};\n\n/**\n * rm removes all files and folders at a given path\n * @param path\n * @returns string: new cid of the root\n */\nexport const rm = (path: string): Promise<string> => {\n return Fula.rm(path);\n};\n\n/**\n * cp copies the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already\n * @param sourcePath, targetPath\n * @returns string: new cid of the root\n */\nexport const cp = (sourcePath: string, targetPath: string): Promise<string> => {\n return Fula.cp(sourcePath, targetPath);\n};\n\n/**\n * mv moves the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already\n * @param sourcePath, targetPath\n * @returns string: new cid of the root\n */\nexport const mv = (sourcePath: string, targetPath: string): Promise<string> => {\n return Fula.mv(sourcePath, targetPath);\n};\n\n/*\n // reads content of the file form localFilename (should include full absolute path to local file with read permission\n // writes content to the specified location by fulaTargetFilename in Fula filesystem\n // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)\n // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)\n // Returns: new cid of the root after this file is placed in the tree\n */\nexport const readFile = (\n fulaTargetFilename: string,\n localFilename: string\n): Promise<string> => {\n return Fula.readFile(fulaTargetFilename, localFilename);\n};\n\n/**\n * readFile reads content of a given path\n * @param path\n * @returns string: cotent\n */\nexport const readFileContent = (path: string): Promise<string> => {\n return Fula.readFileContent(path);\n};\n\n/**\n * Shutdown closes all resources used by Client.\n// After calling this function Client must be discarded.\n * @param\n * @returns\n */\nexport const shutdown = (): Promise<void> => {\n return Fula.shutdown();\n};\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,gCAAgC;;AAEjD;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,IAAI,GAAG,UAClBC,QAAgB,EAChBC,SAAiB,EACjBC,QAAgB,EAChBC,QAAgB,EAE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DI,KAAK,CAAEC,CAAC,IAAK;IACZ,OAAOA,CAAC;EACV,CAAC,CAAC;AACN,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,EAAE,GAAIxB,IAAY,IAAsB;EACnD,OAAOlB,IAAI,CAAC0C,EAAE,CAACxB,IAAI,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMyB,EAAE,GAAG,CAACC,UAAkB,EAAEC,UAAkB,KAAsB;EAC7E,OAAO7C,IAAI,CAAC2C,EAAE,CAACC,UAAU,EAAEC,UAAU,CAAC;AACxC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,EAAE,GAAG,CAACF,UAAkB,EAAEC,UAAkB,KAAsB;EAC7E,OAAO7C,IAAI,CAAC8C,EAAE,CAACF,UAAU,EAAEC,UAAU,CAAC;AACxC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,QAAQ,GAAG,CACtBzB,kBAA0B,EAC1BC,aAAqB,KACD;EACpB,OAAOvB,IAAI,CAAC+C,QAAQ,CAACzB,kBAAkB,EAAEC,aAAa,CAAC;AACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMyB,eAAe,GAAI9B,IAAY,IAAsB;EAChE,OAAOlB,IAAI,CAACgD,eAAe,CAAC9B,IAAI,CAAC;AACnC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM+B,QAAQ,GAAG,MAAqB;EAC3C,OAAOjD,IAAI,CAACiD,QAAQ,EAAE;AACxB,CAAC"}
@@ -1 +1 @@
1
- export * as fula from './protocols/fula';
1
+ export * as fula from './protocols/fula';