@functionland/react-native-fula 1.2.1001 → 1.9.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.
- package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
- package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.5.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.5.1/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.6/checksums/checksums.lock +0 -0
- package/android/.gradle/7.6/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.6/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.6/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.6/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.6/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.6/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.6/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.6/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.6/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.6/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.6/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/build.gradle +69 -69
- package/android/src/main/java/land/fx/fula/Cryptography.java +60 -47
- package/android/src/main/java/land/fx/fula/FulaModule.java +1384 -1297
- package/lib/commonjs/index.js +3 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/commonjs/protocols/blockchain.js +12 -12
- package/lib/commonjs/protocols/blockchain.js.map +1 -1
- package/lib/commonjs/protocols/fxblox.js +52 -0
- package/lib/commonjs/protocols/fxblox.js.map +1 -0
- package/lib/commonjs/types/fxblox.js +2 -0
- package/lib/commonjs/types/fxblox.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/module/protocols/blockchain.js +12 -12
- package/lib/module/protocols/blockchain.js.map +1 -1
- package/lib/module/protocols/fxblox.js +43 -0
- package/lib/module/protocols/fxblox.js.map +1 -0
- package/lib/module/types/fxblox.js +2 -0
- package/lib/module/types/fxblox.js.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/interfaces/fulaNativeModule.d.ts +2 -0
- package/lib/typescript/protocols/fxblox.d.ts +7 -0
- package/lib/typescript/types/fxblox.d.ts +8 -0
- package/package.json +1 -1
- package/src/index.tsx +2 -1
- package/src/interfaces/fulaNativeModule.ts +41 -8
- package/src/protocols/blockchain.ts +318 -274
- package/src/protocols/fxblox.ts +49 -0
- package/src/types/fxblox.ts +8 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Fula","wifiRemoveall","console","log","res","then","jsonRes","JSON","parse","e","catch","err","reboot"],"sources":["fxblox.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\r\nimport type * as BType from '../types/fxblox';\r\n\r\n/**\r\n * send a command to Blox hardware to remove all save wifis.\r\n * @returns json{status:true if success, false if fails; msg: error message or success log}\r\n */\r\n\r\nexport const wifiRemoveall = (): Promise<BType.wifiRemoveallResponse> => {\r\n console.log('wifiRemoveall in react-native started');\r\n let res = Fula.wifiRemoveall()\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.wifiRemoveallResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\nexport const reboot = (): Promise<BType.rebootResponse> => {\r\n console.log('reboot in react-native started');\r\n let res = Fula.reboot()\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.rebootResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,gCAAgC;AAGjD;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,aAAa,GAAG,MAA4C;EACvEC,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;EACpD,IAAIC,GAAG,GAAGJ,IAAI,CAACC,aAAa,EAAE,CAC3BI,IAAI,CAAED,GAAG,IAAK;IACb,IAAI;MACF,IAAIE,OAAoC,GAAGC,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MAC1D,OAAOE,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOK,CAAC,EAAE;QACV,OAAOL,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDM,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOP,GAAG;AACZ,CAAC;AAED,OAAO,MAAMQ,MAAM,GAAG,MAAqC;EACzDV,OAAO,CAACC,GAAG,CAAC,gCAAgC,CAAC;EAC7C,IAAIC,GAAG,GAAGJ,IAAI,CAACY,MAAM,EAAE,CACpBP,IAAI,CAAED,GAAG,IAAK;IACb,IAAI;MACF,IAAIE,OAA6B,GAAGC,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACnD,OAAOE,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOK,CAAC,EAAE;QACV,OAAOL,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDM,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOP,GAAG;AACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["fxblox.ts"],"sourcesContent":["export interface wifiRemoveallResponse {\r\n status: boolean;\r\n msg: string;\r\n}\r\nexport interface rebootResponse {\r\n status: boolean;\r\n msg: string;\r\n}\r\n"],"mappings":""}
|
|
@@ -53,6 +53,8 @@ interface FulaNativeModule {
|
|
|
53
53
|
removeStorer: (seed: string, storer: string, poolID: number, cid: string) => Promise<string>;
|
|
54
54
|
removeStoredReplication: (seed: string, uploader: string, poolID: number, cid: string) => Promise<string>;
|
|
55
55
|
bloxFreeSpace: () => Promise<string>;
|
|
56
|
+
wifiRemoveall: () => Promise<string>;
|
|
57
|
+
reboot: () => Promise<string>;
|
|
56
58
|
}
|
|
57
59
|
declare const _default: FulaNativeModule;
|
|
58
60
|
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as BType from '../types/fxblox';
|
|
2
|
+
/**
|
|
3
|
+
* send a command to Blox hardware to remove all save wifis.
|
|
4
|
+
* @returns json{status:true if success, false if fails; msg: error message or success log}
|
|
5
|
+
*/
|
|
6
|
+
export declare const wifiRemoveall: () => Promise<BType.wifiRemoveallResponse>;
|
|
7
|
+
export declare const reboot: () => Promise<BType.rebootResponse>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@functionland/react-native-fula",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "This package is a bridge to use the Fula libp2p protocols in the react-native which is using wnfs",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
package/src/index.tsx
CHANGED
|
@@ -19,7 +19,7 @@ interface FulaNativeModule {
|
|
|
19
19
|
autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
|
|
20
20
|
useRelay: boolean | null, // if true it forces the use of relay
|
|
21
21
|
refresh: boolean // if true it forces to refresh the fula object
|
|
22
|
-
|
|
22
|
+
) => Promise<string>;
|
|
23
23
|
isReady: (filesystemCheck: boolean) => Promise<boolean>;
|
|
24
24
|
logout: (identity: string, storePath: string) => Promise<boolean>;
|
|
25
25
|
checkFailedActions: (retry: boolean, timeout: number) => Promise<boolean>;
|
|
@@ -47,7 +47,7 @@ interface FulaNativeModule {
|
|
|
47
47
|
|
|
48
48
|
shutdown: () => Promise<void>;
|
|
49
49
|
|
|
50
|
-
//Blockchain related functions
|
|
50
|
+
//Blockchain related functions
|
|
51
51
|
createAccount: (seed: string) => Promise<string>;
|
|
52
52
|
checkAccountExists: (account: string) => Promise<string>;
|
|
53
53
|
createPool: (seed: string, poolName: string) => Promise<string>;
|
|
@@ -56,14 +56,47 @@ interface FulaNativeModule {
|
|
|
56
56
|
leavePool: (seed: string, poolID: number) => Promise<string>;
|
|
57
57
|
cancelPoolJoin: (seed: string, poolID: number) => Promise<string>;
|
|
58
58
|
listPoolJoinRequests: (poolID: number) => Promise<string>;
|
|
59
|
-
votePoolJoinRequest: (
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
votePoolJoinRequest: (
|
|
60
|
+
seed: string,
|
|
61
|
+
poolID: number,
|
|
62
|
+
account: string,
|
|
63
|
+
accept: boolean
|
|
64
|
+
) => Promise<string>;
|
|
65
|
+
newReplicationRequest: (
|
|
66
|
+
seed: string,
|
|
67
|
+
poolID: number,
|
|
68
|
+
replicationFactor: number,
|
|
69
|
+
cid: string
|
|
70
|
+
) => Promise<string>;
|
|
71
|
+
newStoreRequest: (
|
|
72
|
+
seed: string,
|
|
73
|
+
poolID: number,
|
|
74
|
+
uploader: string,
|
|
75
|
+
cid: string
|
|
76
|
+
) => Promise<string>;
|
|
62
77
|
listAvailableReplicationRequests: (poolID: number) => Promise<string>;
|
|
63
|
-
removeReplicationRequest: (
|
|
64
|
-
|
|
65
|
-
|
|
78
|
+
removeReplicationRequest: (
|
|
79
|
+
seed: string,
|
|
80
|
+
poolID: number,
|
|
81
|
+
cid: string
|
|
82
|
+
) => Promise<string>;
|
|
83
|
+
removeStorer: (
|
|
84
|
+
seed: string,
|
|
85
|
+
storer: string,
|
|
86
|
+
poolID: number,
|
|
87
|
+
cid: string
|
|
88
|
+
) => Promise<string>;
|
|
89
|
+
removeStoredReplication: (
|
|
90
|
+
seed: string,
|
|
91
|
+
uploader: string,
|
|
92
|
+
poolID: number,
|
|
93
|
+
cid: string
|
|
94
|
+
) => Promise<string>;
|
|
95
|
+
|
|
96
|
+
//Hardware
|
|
66
97
|
bloxFreeSpace: () => Promise<string>;
|
|
98
|
+
wifiRemoveall: () => Promise<string>;
|
|
99
|
+
reboot: () => Promise<string>;
|
|
67
100
|
}
|
|
68
101
|
|
|
69
102
|
const LINKING_ERROR =
|