@functionland/react-native-fula 1.55.0 → 1.55.2

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 (98) hide show
  1. package/LICENSE +20 -20
  2. package/android/build.gradle +114 -115
  3. package/android/gradle.properties +8 -8
  4. package/android/src/main/AndroidManifest.xml +3 -3
  5. package/android/src/main/AndroidManifestNew.xml +2 -2
  6. package/android/src/main/java/land/fx/fula/ConfigRef.java +7 -7
  7. package/android/src/main/java/land/fx/fula/Cryptography.java +62 -62
  8. package/android/src/main/java/land/fx/fula/FulaModule.java +1991 -1868
  9. package/android/src/main/java/land/fx/fula/FulaPackage.java +32 -32
  10. package/android/src/main/java/land/fx/fula/SharedPreferenceHelper.java +65 -65
  11. package/android/src/main/java/land/fx/fula/StaticHelper.java +13 -13
  12. package/android/src/main/java/land/fx/fula/ThreadUtils.java +42 -42
  13. package/ios/Cryptography.swift +59 -59
  14. package/ios/Fula-Bridging-Header.h +3 -3
  15. package/ios/UserDataHelper.swift +143 -143
  16. package/lib/commonjs/index.js +3 -1
  17. package/lib/commonjs/index.js.map +1 -1
  18. package/lib/commonjs/interfaces/augment-api-consts.js.map +1 -1
  19. package/lib/commonjs/interfaces/augment-api-errors.js.map +1 -1
  20. package/lib/commonjs/interfaces/augment-api-events.js.map +1 -1
  21. package/lib/commonjs/interfaces/augment-api-query.js.map +1 -1
  22. package/lib/commonjs/interfaces/augment-api-rpc.js.map +1 -1
  23. package/lib/commonjs/interfaces/augment-api-runtime.js.map +1 -1
  24. package/lib/commonjs/interfaces/augment-api-tx.js.map +1 -1
  25. package/lib/commonjs/interfaces/augment-api.js.map +1 -1
  26. package/lib/commonjs/interfaces/augment-types.js.map +1 -1
  27. package/lib/commonjs/interfaces/definitions.js.map +1 -1
  28. package/lib/commonjs/interfaces/defintions.js.map +1 -1
  29. package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
  30. package/lib/commonjs/interfaces/index.js.map +1 -1
  31. package/lib/commonjs/interfaces/lookup.js +300 -300
  32. package/lib/commonjs/interfaces/lookup.js.map +1 -1
  33. package/lib/commonjs/interfaces/registry.js.map +1 -1
  34. package/lib/commonjs/interfaces/types-lookup.js.map +1 -1
  35. package/lib/commonjs/interfaces/types.js.map +1 -1
  36. package/lib/commonjs/protocols/blockchain.js +66 -66
  37. package/lib/commonjs/protocols/blockchain.js.map +1 -1
  38. package/lib/commonjs/protocols/chain-api.js.map +1 -1
  39. package/lib/commonjs/protocols/fula.js.map +1 -1
  40. package/lib/commonjs/protocols/fx-ai.js +161 -0
  41. package/lib/commonjs/protocols/fx-ai.js.map +1 -0
  42. package/lib/commonjs/protocols/fxblox.js +3 -3
  43. package/lib/commonjs/protocols/fxblox.js.map +1 -1
  44. package/lib/commonjs/types/blockchain.js.map +1 -1
  45. package/lib/commonjs/types/fxblox.js.map +1 -1
  46. package/lib/module/index.js +1 -0
  47. package/lib/module/index.js.map +1 -1
  48. package/lib/module/interfaces/augment-api-consts.js.map +1 -1
  49. package/lib/module/interfaces/augment-api-errors.js.map +1 -1
  50. package/lib/module/interfaces/augment-api-events.js.map +1 -1
  51. package/lib/module/interfaces/augment-api-query.js.map +1 -1
  52. package/lib/module/interfaces/augment-api-rpc.js.map +1 -1
  53. package/lib/module/interfaces/augment-api-runtime.js.map +1 -1
  54. package/lib/module/interfaces/augment-api-tx.js.map +1 -1
  55. package/lib/module/interfaces/augment-api.js.map +1 -1
  56. package/lib/module/interfaces/augment-types.js.map +1 -1
  57. package/lib/module/interfaces/definitions.js.map +1 -1
  58. package/lib/module/interfaces/defintions.js.map +1 -1
  59. package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
  60. package/lib/module/interfaces/index.js.map +1 -1
  61. package/lib/module/interfaces/lookup.js +300 -300
  62. package/lib/module/interfaces/lookup.js.map +1 -1
  63. package/lib/module/interfaces/registry.js.map +1 -1
  64. package/lib/module/interfaces/types-lookup.js.map +1 -1
  65. package/lib/module/interfaces/types.js.map +1 -1
  66. package/lib/module/protocols/blockchain.js +66 -66
  67. package/lib/module/protocols/blockchain.js.map +1 -1
  68. package/lib/module/protocols/chain-api.js.map +1 -1
  69. package/lib/module/protocols/fula.js.map +1 -1
  70. package/lib/module/protocols/fx-ai.js +150 -0
  71. package/lib/module/protocols/fx-ai.js.map +1 -0
  72. package/lib/module/protocols/fxblox.js +3 -3
  73. package/lib/module/protocols/fxblox.js.map +1 -1
  74. package/lib/module/types/blockchain.js.map +1 -1
  75. package/lib/module/types/fxblox.js.map +1 -1
  76. package/package.json +176 -176
  77. package/react-native-fula.podspec +47 -47
  78. package/src/index.tsx +5 -4
  79. package/src/interfaces/augment-api-consts.ts +273 -273
  80. package/src/interfaces/augment-api-errors.ts +474 -474
  81. package/src/interfaces/augment-api-events.ts +448 -448
  82. package/src/interfaces/augment-api-query.ts +466 -466
  83. package/src/interfaces/augment-api-rpc.ts +617 -617
  84. package/src/interfaces/augment-api-runtime.ts +223 -223
  85. package/src/interfaces/augment-api-tx.ts +709 -709
  86. package/src/interfaces/augment-api.ts +9 -9
  87. package/src/interfaces/augment-types.ts +1322 -1322
  88. package/src/interfaces/definitions.ts +1 -1
  89. package/src/interfaces/defintions.ts +1 -1
  90. package/src/interfaces/fulaNativeModule.ts +175 -168
  91. package/src/interfaces/index.ts +3 -3
  92. package/src/interfaces/lookup.ts +2011 -2011
  93. package/src/interfaces/registry.ts +163 -163
  94. package/src/interfaces/types-lookup.ts +2165 -2165
  95. package/src/interfaces/types.ts +2 -2
  96. package/src/protocols/blockchain.ts +644 -644
  97. package/src/protocols/fx-ai.ts +182 -0
  98. package/src/protocols/fxblox.ts +443 -443
@@ -1 +1 @@
1
- // no custom definitions
1
+ // no custom definitions
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,168 +1,175 @@
1
- import { NativeModules, Platform } from 'react-native';
2
-
3
- interface FulaNativeModule {
4
- registerLifecycleListener: () => Promise<void>;
5
- initFula: (
6
- identity: string, //Private key of did identity
7
- storePath: string, //You can leave empty
8
- bloxAddr: string, //Blox multiadddr needs to be manually entered now
9
- exchange: string, //set to 'noope' for testing
10
- autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
11
- rootCid: string | null, //if you have the latest rootCid you can send it and it generates the private_ref for filesystem
12
- useRelay: boolean | null, // if true it forces the use of relay
13
- refresh: boolean // if true it forces to refresh the fula object
14
- ) => Promise<{ peerId: string; rootCid: string }>;
15
- newClient: (
16
- identity: string, //Private key of did identity
17
- storePath: string, //You can leave empty
18
- bloxAddr: string, //Blox multiadddr needs to be manually entered now
19
- exchange: string, //set to 'noope' for testing
20
- autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
21
- useRelay: boolean | null, // if true it forces the use of relay
22
- refresh: boolean // if true it forces to refresh the fula object
23
- ) => Promise<string>;
24
- isReady: (filesystemCheck: boolean) => Promise<boolean>;
25
- logout: (identity: string, storePath: string) => Promise<boolean>;
26
- checkFailedActions: (retry: boolean, timeout: number) => Promise<boolean>;
27
- listFailedActions: (cids: string[]) => Promise<string[]>;
28
- listRecentCidsAsString: () => Promise<string[]>;
29
- listRecentCidsAsStringWithChildren: () => Promise<string[]>;
30
- clearCidsFromRecent: (cids: string[]) => Promise<boolean>;
31
- checkConnection: (timeout: number) => Promise<boolean>;
32
- get: (key: string) => Promise<string>;
33
- has: (key: Uint8Array) => Promise<boolean>;
34
- push: () => Promise<string>;
35
- put: (content: string, codec: string) => Promise<string>;
36
- mkdir: (path: string) => Promise<string>;
37
- writeFileContent: (path: string, content: string) => Promise<string>;
38
- writeFile: (
39
- fulaTargetFilename: string,
40
- localFilename: string
41
- ) => Promise<string>;
42
- ls: (path: string) => Promise<string>;
43
- rm: (path: string) => Promise<string>;
44
- cp: (sourcePath: string, targetPath: string) => Promise<string>;
45
- mv: (sourcePath: string, targetPath: string) => Promise<string>;
46
- readFile: (
47
- fulaTargetFilename: string,
48
- localFilename: string
49
- ) => Promise<string>;
50
- readFileContent: (path: string) => Promise<string>;
51
- setAuth: (peerId: string, allow: boolean) => Promise<boolean>;
52
-
53
- shutdown: () => Promise<void>;
54
-
55
- testData: (identity: string, bloxAddr: string) => Promise<string>;
56
-
57
- //Blockchain related functions
58
- createAccount: (seed: string) => Promise<string>;
59
- checkAccountExists: (account: string) => Promise<string>;
60
- accountFund: (account: string) => Promise<string>;
61
- createPool: (seed: string, poolName: string) => Promise<string>;
62
- listPools: () => Promise<string>;
63
- joinPool: (poolID: string) => Promise<string>;
64
- leavePool: (poolID: string) => Promise<string>;
65
- cancelPoolJoin: (poolID: string) => Promise<string>;
66
- listPoolJoinRequests: (poolID: string) => Promise<string>;
67
- votePoolJoinRequest: (
68
- seed: string,
69
- poolID: number,
70
- account: string,
71
- accept: boolean
72
- ) => Promise<string>;
73
- batchUploadManifest: (
74
- cid: string[],
75
- poolID: string,
76
- replicationFactor: string
77
- ) => Promise<string>;
78
- replicateInPool: (
79
- cid: string[],
80
- account: string,
81
- poolID: string
82
- ) => Promise<string>;
83
- newStoreRequest: (
84
- seed: string,
85
- poolID: number,
86
- uploader: string,
87
- cid: string
88
- ) => Promise<string>;
89
- listAvailableReplicationRequests: (poolID: string) => Promise<string>;
90
- removeReplicationRequest: (
91
- seed: string,
92
- poolID: number,
93
- cid: string
94
- ) => Promise<string>;
95
- removeStorer: (
96
- seed: string,
97
- storer: string,
98
- poolID: number,
99
- cid: string
100
- ) => Promise<string>;
101
- removeStoredReplication: (
102
- seed: string,
103
- uploader: string,
104
- poolID: number,
105
- cid: string
106
- ) => Promise<string>;
107
-
108
- //On Blox calls for chain
109
- //Hardware
110
- assetsBalance: (
111
- account: string,
112
- assetId: string,
113
- classId: string
114
- ) => Promise<string>;
115
- transferToFula: (
116
- amount: string,
117
- wallet: string,
118
- chain: string
119
- ) => Promise<string>;
120
- getAccount: () => Promise<string>;
121
-
122
- //Hardware
123
- eraseBlData: () => Promise<string>;
124
- fetchContainerLogs: (
125
- containerName: string,
126
- tailCount: string
127
- ) => Promise<string>;
128
- findBestAndTargetInLogs: (
129
- containerName: string,
130
- tailCount: string
131
- ) => Promise<string>;
132
- getFolderSize: (folderPath: string) => Promise<string>;
133
- getDatastoreSize: () => Promise<string>;
134
- bloxFreeSpace: () => Promise<string>;
135
- wifiRemoveall: () => Promise<string>;
136
- reboot: () => Promise<string>;
137
- partition: () => Promise<string>;
138
-
139
- // Plugin related functions
140
- listPlugins: () => Promise<string>;
141
- listActivePlugins: () => Promise<string>;
142
- installPlugin: (pluginName: string, params: string) => Promise<string>;
143
- uninstallPlugin: (pluginName: string) => Promise<string>;
144
- showPluginStatus: (pluginName: string, lines: number) => Promise<string>;
145
- getInstallOutput: (pluginName: string, params: string) => Promise<string>;
146
- getInstallStatus: (pluginName: string) => Promise<string>;
147
- updatePlugin: (pluginName: string) => Promise<string>;
148
- deleteDsLock: () => Promise<void>;
149
- }
150
-
151
- const LINKING_ERROR =
152
- `The package 'react-native-fula/Fula' doesn't seem to be linked. Make sure: \n\n` +
153
- Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
154
- '- You rebuilt the app after installing the package\n' +
155
- '- You are not using Expo managed workflow\n';
156
-
157
- const Fula = NativeModules.FulaModule
158
- ? NativeModules.FulaModule
159
- : new Proxy(
160
- {},
161
- {
162
- get() {
163
- throw new Error(LINKING_ERROR);
164
- },
165
- }
166
- );
167
-
168
- export default Fula as FulaNativeModule;
1
+ import { NativeModules, Platform } from 'react-native';
2
+
3
+ interface FulaNativeModule {
4
+ registerLifecycleListener: () => Promise<void>;
5
+ initFula: (
6
+ identity: string, //Private key of did identity
7
+ storePath: string, //You can leave empty
8
+ bloxAddr: string, //Blox multiadddr needs to be manually entered now
9
+ exchange: string, //set to 'noope' for testing
10
+ autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
11
+ rootCid: string | null, //if you have the latest rootCid you can send it and it generates the private_ref for filesystem
12
+ useRelay: boolean | null, // if true it forces the use of relay
13
+ refresh: boolean // if true it forces to refresh the fula object
14
+ ) => Promise<{ peerId: string; rootCid: string }>;
15
+ newClient: (
16
+ identity: string, //Private key of did identity
17
+ storePath: string, //You can leave empty
18
+ bloxAddr: string, //Blox multiadddr needs to be manually entered now
19
+ exchange: string, //set to 'noope' for testing
20
+ autoFlush: boolean, //set to false always unless you know what you are doing. This is to write actions to disk explicitly after each write
21
+ useRelay: boolean | null, // if true it forces the use of relay
22
+ refresh: boolean // if true it forces to refresh the fula object
23
+ ) => Promise<string>;
24
+ isReady: (filesystemCheck: boolean) => Promise<boolean>;
25
+ logout: (identity: string, storePath: string) => Promise<boolean>;
26
+ checkFailedActions: (retry: boolean, timeout: number) => Promise<boolean>;
27
+ listFailedActions: (cids: string[]) => Promise<string[]>;
28
+ listRecentCidsAsString: () => Promise<string[]>;
29
+ listRecentCidsAsStringWithChildren: () => Promise<string[]>;
30
+ clearCidsFromRecent: (cids: string[]) => Promise<boolean>;
31
+ checkConnection: (timeout: number) => Promise<boolean>;
32
+ get: (key: string) => Promise<string>;
33
+ has: (key: Uint8Array) => Promise<boolean>;
34
+ push: () => Promise<string>;
35
+ put: (content: string, codec: string) => Promise<string>;
36
+ mkdir: (path: string) => Promise<string>;
37
+ writeFileContent: (path: string, content: string) => Promise<string>;
38
+ writeFile: (
39
+ fulaTargetFilename: string,
40
+ localFilename: string
41
+ ) => Promise<string>;
42
+ ls: (path: string) => Promise<string>;
43
+ rm: (path: string) => Promise<string>;
44
+ cp: (sourcePath: string, targetPath: string) => Promise<string>;
45
+ mv: (sourcePath: string, targetPath: string) => Promise<string>;
46
+ readFile: (
47
+ fulaTargetFilename: string,
48
+ localFilename: string
49
+ ) => Promise<string>;
50
+ readFileContent: (path: string) => Promise<string>;
51
+ setAuth: (peerId: string, allow: boolean) => Promise<boolean>;
52
+
53
+ shutdown: () => Promise<void>;
54
+
55
+ testData: (identity: string, bloxAddr: string) => Promise<string>;
56
+
57
+ //Blockchain related functions
58
+ createAccount: (seed: string) => Promise<string>;
59
+ checkAccountExists: (account: string) => Promise<string>;
60
+ accountFund: (account: string) => Promise<string>;
61
+ createPool: (seed: string, poolName: string) => Promise<string>;
62
+ listPools: () => Promise<string>;
63
+ joinPool: (poolID: string) => Promise<string>;
64
+ leavePool: (poolID: string) => Promise<string>;
65
+ cancelPoolJoin: (poolID: string) => Promise<string>;
66
+ listPoolJoinRequests: (poolID: string) => Promise<string>;
67
+ votePoolJoinRequest: (
68
+ seed: string,
69
+ poolID: number,
70
+ account: string,
71
+ accept: boolean
72
+ ) => Promise<string>;
73
+ batchUploadManifest: (
74
+ cid: string[],
75
+ poolID: string,
76
+ replicationFactor: string
77
+ ) => Promise<string>;
78
+ replicateInPool: (
79
+ cid: string[],
80
+ account: string,
81
+ poolID: string
82
+ ) => Promise<string>;
83
+ newStoreRequest: (
84
+ seed: string,
85
+ poolID: number,
86
+ uploader: string,
87
+ cid: string
88
+ ) => Promise<string>;
89
+ listAvailableReplicationRequests: (poolID: string) => Promise<string>;
90
+ removeReplicationRequest: (
91
+ seed: string,
92
+ poolID: number,
93
+ cid: string
94
+ ) => Promise<string>;
95
+ removeStorer: (
96
+ seed: string,
97
+ storer: string,
98
+ poolID: number,
99
+ cid: string
100
+ ) => Promise<string>;
101
+ removeStoredReplication: (
102
+ seed: string,
103
+ uploader: string,
104
+ poolID: number,
105
+ cid: string
106
+ ) => Promise<string>;
107
+
108
+ //On Blox calls for chain
109
+ //Hardware
110
+ assetsBalance: (
111
+ account: string,
112
+ assetId: string,
113
+ classId: string
114
+ ) => Promise<string>;
115
+ transferToFula: (
116
+ amount: string,
117
+ wallet: string,
118
+ chain: string
119
+ ) => Promise<string>;
120
+ getAccount: () => Promise<string>;
121
+
122
+ //Hardware
123
+ eraseBlData: () => Promise<string>;
124
+ fetchContainerLogs: (
125
+ containerName: string,
126
+ tailCount: string
127
+ ) => Promise<string>;
128
+ findBestAndTargetInLogs: (
129
+ containerName: string,
130
+ tailCount: string
131
+ ) => Promise<string>;
132
+ getFolderSize: (folderPath: string) => Promise<string>;
133
+ getDatastoreSize: () => Promise<string>;
134
+ bloxFreeSpace: () => Promise<string>;
135
+ wifiRemoveall: () => Promise<string>;
136
+ reboot: () => Promise<string>;
137
+ partition: () => Promise<string>;
138
+
139
+ // Plugin related functions
140
+ listPlugins: () => Promise<string>;
141
+ listActivePlugins: () => Promise<string>;
142
+ installPlugin: (pluginName: string, params: string) => Promise<string>;
143
+ uninstallPlugin: (pluginName: string) => Promise<string>;
144
+ showPluginStatus: (pluginName: string, lines: number) => Promise<string>;
145
+ getInstallOutput: (pluginName: string, params: string) => Promise<string>;
146
+ getInstallStatus: (pluginName: string) => Promise<string>;
147
+ updatePlugin: (pluginName: string) => Promise<string>;
148
+ deleteDsLock: () => Promise<void>;
149
+
150
+ //AI
151
+ chatWithAI: (aiModel: string, userMessage: string) => Promise<string>;
152
+ getChatChunk: (streamID: string) => Promise<string>;
153
+ streamChunks: (streamID: string) => Promise<void>;
154
+
155
+
156
+ }
157
+
158
+ const LINKING_ERROR =
159
+ `The package 'react-native-fula/Fula' doesn't seem to be linked. Make sure: \n\n` +
160
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
161
+ '- You rebuilt the app after installing the package\n' +
162
+ '- You are not using Expo managed workflow\n';
163
+
164
+ const Fula = NativeModules.FulaModule
165
+ ? NativeModules.FulaModule
166
+ : new Proxy(
167
+ {},
168
+ {
169
+ get() {
170
+ throw new Error(LINKING_ERROR);
171
+ },
172
+ }
173
+ );
174
+
175
+ export default Fula as FulaNativeModule;
@@ -1,3 +1,3 @@
1
- // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
2
- /* eslint-disable */
3
-
1
+ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
2
+ /* eslint-disable */
3
+