@functionland/react-native-fula 1.54.21 → 1.54.24
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/build.gradle +2 -2
- package/android/gradle.properties +3 -0
- package/android/src/main/java/land/fx/fula/FulaModule.java +138 -17
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-errors.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-rpc.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-runtime.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api.js.map +1 -1
- package/lib/commonjs/interfaces/augment-types.js.map +1 -1
- package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/commonjs/interfaces/index.js.map +1 -1
- package/lib/commonjs/interfaces/lookup.js.map +1 -1
- package/lib/commonjs/interfaces/registry.js.map +1 -1
- package/lib/commonjs/interfaces/types-lookup.js.map +1 -1
- package/lib/commonjs/interfaces/types.js.map +1 -1
- package/lib/commonjs/protocols/blockchain.js +0 -4
- package/lib/commonjs/protocols/blockchain.js.map +1 -1
- package/lib/commonjs/protocols/chain-api.js +7 -15
- package/lib/commonjs/protocols/chain-api.js.map +1 -1
- package/lib/commonjs/protocols/fula.js +9 -24
- package/lib/commonjs/protocols/fula.js.map +1 -1
- package/lib/commonjs/protocols/fxblox.js +213 -5
- package/lib/commonjs/protocols/fxblox.js.map +1 -1
- package/lib/commonjs/types/blockchain.js.map +1 -1
- package/lib/commonjs/types/fxblox.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/augment-api-errors.js.map +1 -1
- package/lib/module/interfaces/augment-api-rpc.js.map +1 -1
- package/lib/module/interfaces/augment-api-runtime.js.map +1 -1
- package/lib/module/interfaces/augment-api.js.map +1 -1
- package/lib/module/interfaces/augment-types.js.map +1 -1
- package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/module/interfaces/index.js.map +1 -1
- package/lib/module/interfaces/lookup.js.map +1 -1
- package/lib/module/interfaces/registry.js.map +1 -1
- package/lib/module/interfaces/types-lookup.js.map +1 -1
- package/lib/module/interfaces/types.js.map +1 -1
- package/lib/module/protocols/blockchain.js +0 -4
- package/lib/module/protocols/blockchain.js.map +1 -1
- package/lib/module/protocols/chain-api.js +7 -15
- package/lib/module/protocols/chain-api.js.map +1 -1
- package/lib/module/protocols/fula.js +9 -24
- package/lib/module/protocols/fula.js.map +1 -1
- package/lib/module/protocols/fxblox.js +204 -4
- package/lib/module/protocols/fxblox.js.map +1 -1
- package/lib/module/types/blockchain.js.map +1 -1
- package/lib/module/types/fxblox.js.map +1 -1
- package/lib/typescript/interfaces/fulaNativeModule.d.ts +8 -0
- package/lib/typescript/interfaces/fulaNativeModule.d.ts.map +1 -1
- package/lib/typescript/protocols/fxblox.d.ts +8 -0
- package/lib/typescript/protocols/fxblox.d.ts.map +1 -1
- package/lib/typescript/types/fxblox.d.ts +68 -0
- package/lib/typescript/types/fxblox.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/interfaces/fulaNativeModule.ts +10 -0
- package/src/protocols/fxblox.ts +244 -0
- package/src/types/fxblox.ts +80 -0
package/src/protocols/fxblox.ts
CHANGED
|
@@ -197,3 +197,247 @@ export const getDatastoreSize = (): Promise<BType.GetDatastoreSizeResponse> => {
|
|
|
197
197
|
});
|
|
198
198
|
return res;
|
|
199
199
|
};
|
|
200
|
+
|
|
201
|
+
export const listPlugins = (): Promise<BType.ListPluginsResponse> => {
|
|
202
|
+
console.log('listPlugins in react-native started');
|
|
203
|
+
let res = Fula.listPlugins()
|
|
204
|
+
.then((res1) => {
|
|
205
|
+
try {
|
|
206
|
+
console.log('res1 received');
|
|
207
|
+
console.log(res1);
|
|
208
|
+
let jsonRes: BType.ListPluginsResponse = JSON.parse(res1);
|
|
209
|
+
return jsonRes;
|
|
210
|
+
} catch (e) {
|
|
211
|
+
try {
|
|
212
|
+
return JSON.parse(res1);
|
|
213
|
+
} catch (e1) {
|
|
214
|
+
console.error('Error parsing res in listPlugins:', e1);
|
|
215
|
+
throw e1;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
})
|
|
219
|
+
.catch((err) => {
|
|
220
|
+
console.error('Error listPlugins:', err);
|
|
221
|
+
throw err;
|
|
222
|
+
});
|
|
223
|
+
return res;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export const listActivePlugins =
|
|
227
|
+
(): Promise<BType.ListActivePluginsResponse> => {
|
|
228
|
+
console.log('listActivePlugins in react-native started');
|
|
229
|
+
let res = Fula.listActivePlugins()
|
|
230
|
+
.then((res1) => {
|
|
231
|
+
try {
|
|
232
|
+
console.log('res1 received');
|
|
233
|
+
console.log(res1);
|
|
234
|
+
let jsonRes: BType.ListActivePluginsResponse = JSON.parse(res1);
|
|
235
|
+
if (jsonRes.status) {
|
|
236
|
+
return jsonRes;
|
|
237
|
+
} else {
|
|
238
|
+
console.error('Error getting listActivePlugins:', jsonRes.msg);
|
|
239
|
+
throw jsonRes;
|
|
240
|
+
}
|
|
241
|
+
} catch (e) {
|
|
242
|
+
try {
|
|
243
|
+
return JSON.parse(res1);
|
|
244
|
+
} catch (e1) {
|
|
245
|
+
console.error('Error parsing res in listActivePlugins:', e1);
|
|
246
|
+
throw e1;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
})
|
|
250
|
+
.catch((err) => {
|
|
251
|
+
console.error('Error listActivePlugins:', err);
|
|
252
|
+
throw err;
|
|
253
|
+
});
|
|
254
|
+
return res;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export const installPlugin = (
|
|
258
|
+
pluginName: string,
|
|
259
|
+
params: string
|
|
260
|
+
): Promise<BType.InstallPluginResponse> => {
|
|
261
|
+
console.log('installPlugin in react-native started');
|
|
262
|
+
let res = Fula.installPlugin(pluginName, params)
|
|
263
|
+
.then((res1) => {
|
|
264
|
+
try {
|
|
265
|
+
console.log('res1 received');
|
|
266
|
+
console.log(res1);
|
|
267
|
+
let jsonRes: BType.InstallPluginResponse = JSON.parse(res1);
|
|
268
|
+
if (jsonRes.status) {
|
|
269
|
+
return jsonRes;
|
|
270
|
+
} else {
|
|
271
|
+
throw jsonRes;
|
|
272
|
+
}
|
|
273
|
+
} catch (e) {
|
|
274
|
+
try {
|
|
275
|
+
return JSON.parse(res1);
|
|
276
|
+
} catch (e1) {
|
|
277
|
+
console.error('Error parsing res in installPlugin:', e1);
|
|
278
|
+
throw e1;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
})
|
|
282
|
+
.catch((err) => {
|
|
283
|
+
console.error('Error installPlugin:', err);
|
|
284
|
+
throw err;
|
|
285
|
+
});
|
|
286
|
+
return res;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
export const uninstallPlugin = (
|
|
290
|
+
pluginName: string
|
|
291
|
+
): Promise<BType.UninstallPluginResponse> => {
|
|
292
|
+
console.log('uninstallPlugin in react-native started');
|
|
293
|
+
let res = Fula.uninstallPlugin(pluginName)
|
|
294
|
+
.then((res1) => {
|
|
295
|
+
try {
|
|
296
|
+
console.log('res1 received');
|
|
297
|
+
console.log(res1);
|
|
298
|
+
let jsonRes: BType.UninstallPluginResponse = JSON.parse(res1);
|
|
299
|
+
if (jsonRes.status) {
|
|
300
|
+
return jsonRes;
|
|
301
|
+
} else {
|
|
302
|
+
throw jsonRes;
|
|
303
|
+
}
|
|
304
|
+
} catch (e) {
|
|
305
|
+
try {
|
|
306
|
+
return JSON.parse(res1);
|
|
307
|
+
} catch (e1) {
|
|
308
|
+
console.error('Error parsing res in uninstallPlugin:', e1);
|
|
309
|
+
throw e1;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
})
|
|
313
|
+
.catch((err) => {
|
|
314
|
+
console.error('Error uninstallPlugin:', err);
|
|
315
|
+
throw err;
|
|
316
|
+
});
|
|
317
|
+
return res;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
export const showPluginStatus = (
|
|
321
|
+
pluginName: string,
|
|
322
|
+
lines: number
|
|
323
|
+
): Promise<BType.ShowPluginStatusResponse> => {
|
|
324
|
+
console.log('showPluginStatus in react-native started');
|
|
325
|
+
let res = Fula.showPluginStatus(pluginName, lines)
|
|
326
|
+
.then((res1) => {
|
|
327
|
+
try {
|
|
328
|
+
console.log('res1 received');
|
|
329
|
+
console.log(res1);
|
|
330
|
+
let jsonRes: BType.ShowPluginStatusResponse = JSON.parse(res1);
|
|
331
|
+
return jsonRes;
|
|
332
|
+
} catch (e) {
|
|
333
|
+
try {
|
|
334
|
+
return JSON.parse(res1);
|
|
335
|
+
} catch (e1) {
|
|
336
|
+
console.error('Error parsing res in showPluginStatus:', e1);
|
|
337
|
+
throw e1;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
})
|
|
341
|
+
.catch((err) => {
|
|
342
|
+
console.error('Error showPluginStatus:', err);
|
|
343
|
+
throw err;
|
|
344
|
+
});
|
|
345
|
+
return res;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
export const getInstallStatus = (
|
|
349
|
+
pluginName: string
|
|
350
|
+
): Promise<BType.GetInstallStatusResponse> => {
|
|
351
|
+
console.log('getInstallStatus in react-native started');
|
|
352
|
+
let res = Fula.getInstallStatus(pluginName)
|
|
353
|
+
.then((res1) => {
|
|
354
|
+
try {
|
|
355
|
+
console.log('res1 received');
|
|
356
|
+
console.log(res1);
|
|
357
|
+
let jsonRes: BType.GetInstallStatusResponse = JSON.parse(res1);
|
|
358
|
+
if (jsonRes.status) {
|
|
359
|
+
return jsonRes;
|
|
360
|
+
} else {
|
|
361
|
+
console.error('Error getting install status:', jsonRes.msg);
|
|
362
|
+
throw jsonRes;
|
|
363
|
+
}
|
|
364
|
+
} catch (e) {
|
|
365
|
+
try {
|
|
366
|
+
return JSON.parse(res1);
|
|
367
|
+
} catch (e1) {
|
|
368
|
+
console.error('Error parsing res in getInstallStatus:', e1);
|
|
369
|
+
throw e1;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
})
|
|
373
|
+
.catch((err) => {
|
|
374
|
+
console.error('Error getInstallStatus:', err);
|
|
375
|
+
throw err;
|
|
376
|
+
});
|
|
377
|
+
return res;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
export const getInstallOutput = (
|
|
381
|
+
pluginName: string,
|
|
382
|
+
params: string
|
|
383
|
+
): Promise<BType.GetInstallOutputResponse> => {
|
|
384
|
+
console.log('getInstallOutput in react-native started');
|
|
385
|
+
let res = Fula.getInstallOutput(pluginName, params)
|
|
386
|
+
.then((res1) => {
|
|
387
|
+
try {
|
|
388
|
+
console.log('res1 received');
|
|
389
|
+
console.log(res1);
|
|
390
|
+
let jsonRes: BType.GetInstallOutputResponse = JSON.parse(res1);
|
|
391
|
+
if (jsonRes.status) {
|
|
392
|
+
return jsonRes;
|
|
393
|
+
} else {
|
|
394
|
+
console.error('Error getting install output:', jsonRes.msg);
|
|
395
|
+
throw jsonRes;
|
|
396
|
+
}
|
|
397
|
+
} catch (e) {
|
|
398
|
+
try {
|
|
399
|
+
return JSON.parse(res1);
|
|
400
|
+
} catch (e1) {
|
|
401
|
+
console.error('Error parsing res in getInstallOutput:', e1);
|
|
402
|
+
throw e1;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
})
|
|
406
|
+
.catch((err) => {
|
|
407
|
+
console.error('Error getInstallOutput:', err);
|
|
408
|
+
throw err;
|
|
409
|
+
});
|
|
410
|
+
return res;
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
export const updatePlugin = (
|
|
414
|
+
pluginName: string
|
|
415
|
+
): Promise<BType.UpdatePluginResponse> => {
|
|
416
|
+
console.log('updatePlugin in react-native started');
|
|
417
|
+
let res = Fula.updatePlugin(pluginName)
|
|
418
|
+
.then((res1) => {
|
|
419
|
+
try {
|
|
420
|
+
console.log('res1 received');
|
|
421
|
+
console.log(res1);
|
|
422
|
+
let jsonRes: BType.UpdatePluginResponse = JSON.parse(res1);
|
|
423
|
+
if (jsonRes.status) {
|
|
424
|
+
return jsonRes;
|
|
425
|
+
} else {
|
|
426
|
+
console.error('Error updating plugin:', jsonRes.msg);
|
|
427
|
+
throw jsonRes;
|
|
428
|
+
}
|
|
429
|
+
} catch (e) {
|
|
430
|
+
try {
|
|
431
|
+
return JSON.parse(res1);
|
|
432
|
+
} catch (e1) {
|
|
433
|
+
console.error('Error parsing res in updatePlugin:', e1);
|
|
434
|
+
throw e1;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
})
|
|
438
|
+
.catch((err) => {
|
|
439
|
+
console.error('Error updatePlugin:', err);
|
|
440
|
+
throw err;
|
|
441
|
+
});
|
|
442
|
+
return res;
|
|
443
|
+
};
|
package/src/types/fxblox.ts
CHANGED
|
@@ -39,3 +39,83 @@ export interface GetDatastoreSizeResponse {
|
|
|
39
39
|
folder_path: string;
|
|
40
40
|
version: string;
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
export interface PluginInfo {
|
|
44
|
+
name: string;
|
|
45
|
+
description: string;
|
|
46
|
+
version: string;
|
|
47
|
+
usage: {
|
|
48
|
+
storage: string;
|
|
49
|
+
compute: string;
|
|
50
|
+
bandwidth: string;
|
|
51
|
+
ram: string;
|
|
52
|
+
gpu: string;
|
|
53
|
+
};
|
|
54
|
+
rewards: Array<{
|
|
55
|
+
type: string;
|
|
56
|
+
currency: string;
|
|
57
|
+
link: string;
|
|
58
|
+
}>;
|
|
59
|
+
socials: Array<{
|
|
60
|
+
telegram?: string;
|
|
61
|
+
twitter?: string;
|
|
62
|
+
email?: string;
|
|
63
|
+
website?: string;
|
|
64
|
+
discord?: string;
|
|
65
|
+
}>;
|
|
66
|
+
requiredInputs: Array<{
|
|
67
|
+
name: string;
|
|
68
|
+
instructions: string;
|
|
69
|
+
type: string;
|
|
70
|
+
default: string;
|
|
71
|
+
}>;
|
|
72
|
+
approved: boolean;
|
|
73
|
+
installed: boolean;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ListPluginsResponse {
|
|
77
|
+
plugins: PluginInfo[];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ListActivePluginsResponse {
|
|
81
|
+
msg: string[] | string;
|
|
82
|
+
status: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface InstallPluginResponse {
|
|
86
|
+
status: boolean;
|
|
87
|
+
msg: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface UninstallPluginResponse {
|
|
91
|
+
status: boolean;
|
|
92
|
+
msg: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface ShowPluginStatusResponse {
|
|
96
|
+
status: string[];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface PluginParam {
|
|
100
|
+
name: string;
|
|
101
|
+
value: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface GetInstallOutputResponse {
|
|
105
|
+
status: boolean;
|
|
106
|
+
msg:
|
|
107
|
+
| string
|
|
108
|
+
| {
|
|
109
|
+
[key: string]: string;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface GetInstallStatusResponse {
|
|
114
|
+
status: boolean;
|
|
115
|
+
msg: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface UpdatePluginResponse {
|
|
119
|
+
status: boolean;
|
|
120
|
+
msg: string;
|
|
121
|
+
}
|