@functionland/react-native-fula 0.4.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/LICENSE +21 -0
- package/README.md +35 -0
- 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/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.5.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.5.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.5.1/fileChanges/last-build.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.5.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +19 -0
- package/android/.idea/jarRepositories.xml +50 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +67 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/android/gradle.properties +1 -0
- package/android/gradlew +240 -0
- package/android/gradlew.bat +91 -0
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/land/fx/fula/ConfigRef.java +7 -0
- package/android/src/main/java/land/fx/fula/Cryptography.java +47 -0
- package/android/src/main/java/land/fx/fula/FulaModule.java +443 -0
- package/android/src/main/java/land/fx/fula/FulaPackage.java +32 -0
- package/android/src/main/java/land/fx/fula/SharedPreferenceHelper.java +65 -0
- package/android/src/main/java/land/fx/fula/StaticHelper.java +13 -0
- package/android/src/main/java/land/fx/fula/ThreadUtils.java +42 -0
- package/ios/FulaModule.h +10 -0
- package/ios/FulaModule.m +149 -0
- package/ios/FulaModule.xcodeproj/project.pbxproj +267 -0
- package/lib/commonjs/index.js +11 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/interfaces/fulaNativeModule.js +19 -0
- package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -0
- package/lib/commonjs/protocols/fula.js +130 -0
- package/lib/commonjs/protocols/fula.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/interfaces/fulaNativeModule.js +12 -0
- package/lib/module/interfaces/fulaNativeModule.js.map +1 -0
- package/lib/module/protocols/fula.js +113 -0
- package/lib/module/protocols/fula.js.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/interfaces/fulaNativeModule.d.ts +17 -0
- package/lib/typescript/protocols/fula.d.ts +70 -0
- package/package.json +152 -0
- package/react-native-fula.podspec +19 -0
- package/src/index.tsx +1 -0
- package/src/interfaces/fulaNativeModule.ts +39 -0
- package/src/protocols/fula.ts +116 -0
package/ios/FulaModule.m
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#import <React/RCTLog.h>
|
|
2
|
+
#import "FulaModule.h"
|
|
3
|
+
#import <Mobile/Mobile.h>
|
|
4
|
+
|
|
5
|
+
@implementation FulaModule
|
|
6
|
+
|
|
7
|
+
RCT_EXPORT_MODULE()
|
|
8
|
+
|
|
9
|
+
- (id) init {
|
|
10
|
+
self = [super init];
|
|
11
|
+
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
|
12
|
+
|
|
13
|
+
//Get the docs directory
|
|
14
|
+
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
|
|
15
|
+
NSString *folderPath = [documentsDirectoryPath stringByAppendingPathComponent:@"fula"];
|
|
16
|
+
|
|
17
|
+
if (![[NSFileManager defaultManager] fileExistsAtPath:folderPath])
|
|
18
|
+
[[NSFileManager defaultManager] createDirectoryAtPath:folderPath withIntermediateDirectories:true attributes:nil error:nil];
|
|
19
|
+
|
|
20
|
+
fula = [[MobileFula alloc] init:folderPath];
|
|
21
|
+
return self;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
RCT_REMAP_METHOD(addBox,
|
|
25
|
+
addBox:(nonnull NSString*)boxAddr
|
|
26
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
27
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
28
|
+
{
|
|
29
|
+
NSError *error = nil;
|
|
30
|
+
BOOL result= [fula addBox:boxAddr error:&error];
|
|
31
|
+
if(error) {
|
|
32
|
+
NSLog(@"addBox error: %@",error);
|
|
33
|
+
reject(@"addBox_failure", @"error", error);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
NSNumber *output = [NSNumber numberWithBool:result];
|
|
37
|
+
resolve(output);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
RCT_REMAP_METHOD(send,
|
|
41
|
+
send:(nonnull NSString*)filePath
|
|
42
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
43
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
44
|
+
{
|
|
45
|
+
NSError *error = nil;
|
|
46
|
+
NSString *result= [fula send:filePath error:&error];
|
|
47
|
+
|
|
48
|
+
if(error) {
|
|
49
|
+
NSLog(@"send error: %@",error);
|
|
50
|
+
reject(@"send_failure", @"error", error);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
resolve(result);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
RCT_REMAP_METHOD(encryptSend,
|
|
57
|
+
encryptSend:(nonnull NSString*)filePath
|
|
58
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
59
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
60
|
+
{
|
|
61
|
+
NSError *error = nil;
|
|
62
|
+
NSString *result= [fula encryptSend:filePath error:&error];
|
|
63
|
+
|
|
64
|
+
if(error) {
|
|
65
|
+
NSLog(@"encryptSend error: %@",error);
|
|
66
|
+
reject(@"encryptSend_failure", @"error", error);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
resolve(result);
|
|
70
|
+
}
|
|
71
|
+
RCT_REMAP_METHOD(receiveFile,
|
|
72
|
+
receiveFile:(nonnull NSString*)fileId
|
|
73
|
+
withFileName:(nonnull NSString*)fileName
|
|
74
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
75
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
76
|
+
{
|
|
77
|
+
NSError *error = nil;
|
|
78
|
+
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
|
79
|
+
|
|
80
|
+
//Get the docs directory
|
|
81
|
+
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
|
|
82
|
+
NSString *folderPath = [documentsDirectoryPath stringByAppendingPathComponent:@"fula/received"];
|
|
83
|
+
NSString *filePath= [folderPath stringByAppendingPathComponent:fileName];
|
|
84
|
+
|
|
85
|
+
if (![[NSFileManager defaultManager] fileExistsAtPath:folderPath])
|
|
86
|
+
[[NSFileManager defaultManager] createDirectoryAtPath:folderPath withIntermediateDirectories:true attributes:nil error:nil];
|
|
87
|
+
|
|
88
|
+
BOOL result= [fula receiveFile:fileId filePath:filePath error:&error];
|
|
89
|
+
|
|
90
|
+
if(error) {
|
|
91
|
+
NSLog(@"receiveFile error: %@",error);
|
|
92
|
+
reject(@"receiveFile_failure", @"error", error);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if(!result){
|
|
96
|
+
resolve(nil);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
resolve(filePath);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
RCT_REMAP_METHOD(receiveFileInfo,
|
|
103
|
+
receiveFileInfo:(nonnull NSString*)fileId
|
|
104
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
105
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
106
|
+
{
|
|
107
|
+
NSError *error = nil;
|
|
108
|
+
NSString* result= [fula receiveFileInfo:fileId error:&error];
|
|
109
|
+
|
|
110
|
+
if(error) {
|
|
111
|
+
NSLog(@"receiveFileInfo error: %@",error);
|
|
112
|
+
reject(@"receiveFileInfo_failure", @"error", error);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
resolve(result);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
RCT_REMAP_METHOD(receiveDecryptFile,
|
|
120
|
+
receiveDecryptFile:(nonnull NSString*)ref
|
|
121
|
+
withFileName:(nonnull NSString*)fileName
|
|
122
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
123
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
124
|
+
{
|
|
125
|
+
NSError *error = nil;
|
|
126
|
+
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
|
127
|
+
|
|
128
|
+
//Get the docs directory
|
|
129
|
+
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
|
|
130
|
+
NSString *folderPath = [documentsDirectoryPath stringByAppendingPathComponent:@"fula/received"];
|
|
131
|
+
NSString *filePath= [folderPath stringByAppendingPathComponent:fileName];
|
|
132
|
+
|
|
133
|
+
if (![[NSFileManager defaultManager] fileExistsAtPath:folderPath])
|
|
134
|
+
[[NSFileManager defaultManager] createDirectoryAtPath:folderPath withIntermediateDirectories:true attributes:nil error:nil];
|
|
135
|
+
|
|
136
|
+
BOOL result= [fula receiveDecryptFile:ref filePath:filePath error:&error];
|
|
137
|
+
|
|
138
|
+
if(error) {
|
|
139
|
+
NSLog(@"receiveDecryptFile error: %@",error);
|
|
140
|
+
reject(@"receiveDecryptFile_failure", @"error", error);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if(!result){
|
|
144
|
+
resolve(nil);
|
|
145
|
+
}
|
|
146
|
+
resolve(filePath);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@end
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 46;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
|
10
|
+
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
11
|
+
isa = PBXCopyFilesBuildPhase;
|
|
12
|
+
buildActionMask = 2147483647;
|
|
13
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
|
14
|
+
dstSubfolderSpec = 16;
|
|
15
|
+
files = (
|
|
16
|
+
);
|
|
17
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
18
|
+
};
|
|
19
|
+
/* End PBXCopyFilesBuildPhase section */
|
|
20
|
+
|
|
21
|
+
/* Begin PBXFileReference section */
|
|
22
|
+
11C0B56928882C93007D9057 /* FulaModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FulaModule.h; sourceTree = "<group>"; };
|
|
23
|
+
11C0B56A28882C93007D9057 /* FulaModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FulaModule.m; sourceTree = "<group>"; };
|
|
24
|
+
134814201AA4EA6300B7C361 /* libFulaModule.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFulaModule.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
25
|
+
/* End PBXFileReference section */
|
|
26
|
+
|
|
27
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
28
|
+
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
|
29
|
+
isa = PBXFrameworksBuildPhase;
|
|
30
|
+
buildActionMask = 2147483647;
|
|
31
|
+
files = (
|
|
32
|
+
);
|
|
33
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
34
|
+
};
|
|
35
|
+
/* End PBXFrameworksBuildPhase section */
|
|
36
|
+
|
|
37
|
+
/* Begin PBXGroup section */
|
|
38
|
+
134814211AA4EA7D00B7C361 /* Products */ = {
|
|
39
|
+
isa = PBXGroup;
|
|
40
|
+
children = (
|
|
41
|
+
134814201AA4EA6300B7C361 /* libFulaModule.a */,
|
|
42
|
+
);
|
|
43
|
+
name = Products;
|
|
44
|
+
sourceTree = "<group>";
|
|
45
|
+
};
|
|
46
|
+
58B511D21A9E6C8500147676 = {
|
|
47
|
+
isa = PBXGroup;
|
|
48
|
+
children = (
|
|
49
|
+
11C0B56928882C93007D9057 /* FulaModule.h */,
|
|
50
|
+
11C0B56A28882C93007D9057 /* FulaModule.m */,
|
|
51
|
+
134814211AA4EA7D00B7C361 /* Products */,
|
|
52
|
+
);
|
|
53
|
+
sourceTree = "<group>";
|
|
54
|
+
};
|
|
55
|
+
/* End PBXGroup section */
|
|
56
|
+
|
|
57
|
+
/* Begin PBXNativeTarget section */
|
|
58
|
+
58B511DA1A9E6C8500147676 /* FulaModule */ = {
|
|
59
|
+
isa = PBXNativeTarget;
|
|
60
|
+
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "FulaModule" */;
|
|
61
|
+
buildPhases = (
|
|
62
|
+
58B511D71A9E6C8500147676 /* Sources */,
|
|
63
|
+
58B511D81A9E6C8500147676 /* Frameworks */,
|
|
64
|
+
58B511D91A9E6C8500147676 /* CopyFiles */,
|
|
65
|
+
);
|
|
66
|
+
buildRules = (
|
|
67
|
+
);
|
|
68
|
+
dependencies = (
|
|
69
|
+
);
|
|
70
|
+
name = FulaModule;
|
|
71
|
+
productName = RCTDataManager;
|
|
72
|
+
productReference = 134814201AA4EA6300B7C361 /* libFulaModule.a */;
|
|
73
|
+
productType = "com.apple.product-type.library.static";
|
|
74
|
+
};
|
|
75
|
+
/* End PBXNativeTarget section */
|
|
76
|
+
|
|
77
|
+
/* Begin PBXProject section */
|
|
78
|
+
58B511D31A9E6C8500147676 /* Project object */ = {
|
|
79
|
+
isa = PBXProject;
|
|
80
|
+
attributes = {
|
|
81
|
+
LastUpgradeCheck = 0920;
|
|
82
|
+
ORGANIZATIONNAME = Facebook;
|
|
83
|
+
TargetAttributes = {
|
|
84
|
+
58B511DA1A9E6C8500147676 = {
|
|
85
|
+
CreatedOnToolsVersion = 6.1.1;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "FulaModule" */;
|
|
90
|
+
compatibilityVersion = "Xcode 3.2";
|
|
91
|
+
developmentRegion = English;
|
|
92
|
+
hasScannedForEncodings = 0;
|
|
93
|
+
knownRegions = (
|
|
94
|
+
English,
|
|
95
|
+
en,
|
|
96
|
+
);
|
|
97
|
+
mainGroup = 58B511D21A9E6C8500147676;
|
|
98
|
+
productRefGroup = 58B511D21A9E6C8500147676;
|
|
99
|
+
projectDirPath = "";
|
|
100
|
+
projectRoot = "";
|
|
101
|
+
targets = (
|
|
102
|
+
58B511DA1A9E6C8500147676 /* FulaModule */,
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
/* End PBXProject section */
|
|
106
|
+
|
|
107
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
108
|
+
58B511D71A9E6C8500147676 /* Sources */ = {
|
|
109
|
+
isa = PBXSourcesBuildPhase;
|
|
110
|
+
buildActionMask = 2147483647;
|
|
111
|
+
files = (
|
|
112
|
+
);
|
|
113
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
114
|
+
};
|
|
115
|
+
/* End PBXSourcesBuildPhase section */
|
|
116
|
+
|
|
117
|
+
/* Begin XCBuildConfiguration section */
|
|
118
|
+
58B511ED1A9E6C8500147676 /* Debug */ = {
|
|
119
|
+
isa = XCBuildConfiguration;
|
|
120
|
+
buildSettings = {
|
|
121
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
122
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
123
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
124
|
+
CLANG_ENABLE_MODULES = YES;
|
|
125
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
126
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
127
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
128
|
+
CLANG_WARN_COMMA = YES;
|
|
129
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
130
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
131
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
132
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
133
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
134
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
135
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
136
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
137
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
138
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
139
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
140
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
141
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
142
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
143
|
+
COPY_PHASE_STRIP = NO;
|
|
144
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
145
|
+
ENABLE_TESTABILITY = YES;
|
|
146
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
147
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
148
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
149
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
150
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
151
|
+
"DEBUG=1",
|
|
152
|
+
"$(inherited)",
|
|
153
|
+
);
|
|
154
|
+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
|
155
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
156
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
157
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
158
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
159
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
160
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
161
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
162
|
+
MTL_ENABLE_DEBUG_INFO = YES;
|
|
163
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
164
|
+
SDKROOT = iphoneos;
|
|
165
|
+
};
|
|
166
|
+
name = Debug;
|
|
167
|
+
};
|
|
168
|
+
58B511EE1A9E6C8500147676 /* Release */ = {
|
|
169
|
+
isa = XCBuildConfiguration;
|
|
170
|
+
buildSettings = {
|
|
171
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
172
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
|
173
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
174
|
+
CLANG_ENABLE_MODULES = YES;
|
|
175
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
176
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
177
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
178
|
+
CLANG_WARN_COMMA = YES;
|
|
179
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
180
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
181
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
182
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
183
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
184
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
185
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
186
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
187
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
188
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
189
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
190
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
191
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
192
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
193
|
+
COPY_PHASE_STRIP = YES;
|
|
194
|
+
ENABLE_NS_ASSERTIONS = NO;
|
|
195
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
196
|
+
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
197
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
198
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
199
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
200
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
201
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
202
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
203
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
204
|
+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
|
205
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
|
206
|
+
SDKROOT = iphoneos;
|
|
207
|
+
VALIDATE_PRODUCT = YES;
|
|
208
|
+
};
|
|
209
|
+
name = Release;
|
|
210
|
+
};
|
|
211
|
+
58B511F01A9E6C8500147676 /* Debug */ = {
|
|
212
|
+
isa = XCBuildConfiguration;
|
|
213
|
+
buildSettings = {
|
|
214
|
+
HEADER_SEARCH_PATHS = (
|
|
215
|
+
"$(inherited)",
|
|
216
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
217
|
+
"$(SRCROOT)/../../../React/**",
|
|
218
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
219
|
+
);
|
|
220
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
221
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
222
|
+
PRODUCT_NAME = FulaModule;
|
|
223
|
+
SKIP_INSTALL = YES;
|
|
224
|
+
};
|
|
225
|
+
name = Debug;
|
|
226
|
+
};
|
|
227
|
+
58B511F11A9E6C8500147676 /* Release */ = {
|
|
228
|
+
isa = XCBuildConfiguration;
|
|
229
|
+
buildSettings = {
|
|
230
|
+
HEADER_SEARCH_PATHS = (
|
|
231
|
+
"$(inherited)",
|
|
232
|
+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
|
233
|
+
"$(SRCROOT)/../../../React/**",
|
|
234
|
+
"$(SRCROOT)/../../react-native/React/**",
|
|
235
|
+
);
|
|
236
|
+
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
237
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
238
|
+
PRODUCT_NAME = FulaModule;
|
|
239
|
+
SKIP_INSTALL = YES;
|
|
240
|
+
};
|
|
241
|
+
name = Release;
|
|
242
|
+
};
|
|
243
|
+
/* End XCBuildConfiguration section */
|
|
244
|
+
|
|
245
|
+
/* Begin XCConfigurationList section */
|
|
246
|
+
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "FulaModule" */ = {
|
|
247
|
+
isa = XCConfigurationList;
|
|
248
|
+
buildConfigurations = (
|
|
249
|
+
58B511ED1A9E6C8500147676 /* Debug */,
|
|
250
|
+
58B511EE1A9E6C8500147676 /* Release */,
|
|
251
|
+
);
|
|
252
|
+
defaultConfigurationIsVisible = 0;
|
|
253
|
+
defaultConfigurationName = Release;
|
|
254
|
+
};
|
|
255
|
+
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "FulaModule" */ = {
|
|
256
|
+
isa = XCConfigurationList;
|
|
257
|
+
buildConfigurations = (
|
|
258
|
+
58B511F01A9E6C8500147676 /* Debug */,
|
|
259
|
+
58B511F11A9E6C8500147676 /* Release */,
|
|
260
|
+
);
|
|
261
|
+
defaultConfigurationIsVisible = 0;
|
|
262
|
+
defaultConfigurationName = Release;
|
|
263
|
+
};
|
|
264
|
+
/* End XCConfigurationList section */
|
|
265
|
+
};
|
|
266
|
+
rootObject = 58B511D31A9E6C8500147676 /* Project object */;
|
|
267
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.fula = void 0;
|
|
7
|
+
var _fula = _interopRequireWildcard(require("./protocols/fula"));
|
|
8
|
+
exports.fula = _fula;
|
|
9
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * as fula from './protocols/fula';"],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
const LINKING_ERROR = `The package 'react-native-fula' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
9
|
+
ios: "- You have run 'pod install'\n",
|
|
10
|
+
default: ''
|
|
11
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
12
|
+
const Fula = _reactNative.NativeModules.FulaModule ? _reactNative.NativeModules.FulaModule : new Proxy({}, {
|
|
13
|
+
get() {
|
|
14
|
+
throw new Error(LINKING_ERROR);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
var _default = Fula;
|
|
18
|
+
exports.default = _default;
|
|
19
|
+
//# sourceMappingURL=fulaNativeModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","Fula","NativeModules","FulaModule","Proxy","get","Error"],"sources":["fulaNativeModule.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\ninterface FulaNativeModule {\n init: (\n identity: string | null, //Private key of did identity\n storePath: string | null, //You can leave empty\n bloxAddr: string //Blox multiadddr needs to be manually entered now\n ) => Promise<[string]>;\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: (fulaTargetFilename: string, localFilename: string) => Promise<string>;\n ls: (path: string) => Promise<string>;\n readFile: (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;AAqBA,MAAMA,aAAa,GAChB,4EAA2E,GAC5EC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,IAAI,GAAGC,0BAAa,CAACC,UAAU,GACjCD,0BAAa,CAACC,UAAU,GACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAK,CAACV,aAAa,CAAC;EAChC;AACF,CAAC,CACF;AAAC,eAESK,IAAI;AAAA"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.writeFileContent = exports.writeFile = exports.shutdown = exports.readFile = exports.put = exports.push = exports.mkdir = exports.ls = exports.init = exports.has = exports.get = void 0;
|
|
7
|
+
var _fulaNativeModule = _interopRequireDefault(require("../interfaces/fulaNativeModule"));
|
|
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
|
|
14
|
+
*/
|
|
15
|
+
const init = (identity, storePath, bloxAddr) => {
|
|
16
|
+
console.log('init in react-native started', identity, storePath, bloxAddr);
|
|
17
|
+
return _fulaNativeModule.default.init(identity, storePath, bloxAddr);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get gets the value corresponding to the given key from the local datastore.
|
|
22
|
+
// The key must be a valid ipld.Link.
|
|
23
|
+
* @param key
|
|
24
|
+
* @returns value
|
|
25
|
+
*/
|
|
26
|
+
exports.init = init;
|
|
27
|
+
const get = key => {
|
|
28
|
+
return _fulaNativeModule.default.get(key);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Has checks whether the value corresponding to the given key is present in the local datastore.
|
|
33
|
+
// The key must be a valid ipld.Link.
|
|
34
|
+
* @param key
|
|
35
|
+
* @returns boolean
|
|
36
|
+
*/
|
|
37
|
+
exports.get = get;
|
|
38
|
+
const has = key => {
|
|
39
|
+
return _fulaNativeModule.default.has(key);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Push requests the given addr to download the root cid from this node.
|
|
44
|
+
// The addr must be a valid multiaddr that includes peer ID.
|
|
45
|
+
// this function.
|
|
46
|
+
* @param addr
|
|
47
|
+
* @returns null or error
|
|
48
|
+
*/
|
|
49
|
+
exports.has = has;
|
|
50
|
+
const push = () => {
|
|
51
|
+
return _fulaNativeModule.default.push();
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Put stores the given key value onto the local datastore.
|
|
56
|
+
// The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding
|
|
57
|
+
// to the given key.
|
|
58
|
+
* @param key, value
|
|
59
|
+
* @returns null or string
|
|
60
|
+
*/
|
|
61
|
+
exports.push = push;
|
|
62
|
+
const put = (value, codec) => {
|
|
63
|
+
return _fulaNativeModule.default.put(value, codec);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* mkdir creates a directory at the given path.
|
|
68
|
+
* @param path
|
|
69
|
+
* @returns string: new cid of the root
|
|
70
|
+
*/
|
|
71
|
+
exports.put = put;
|
|
72
|
+
const mkdir = path => {
|
|
73
|
+
return _fulaNativeModule.default.mkdir(path);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* writeFileContent writes content at a given path
|
|
78
|
+
* @param path
|
|
79
|
+
* @returns string: new cid of the root
|
|
80
|
+
*/
|
|
81
|
+
exports.mkdir = mkdir;
|
|
82
|
+
const writeFileContent = (path, content) => {
|
|
83
|
+
return _fulaNativeModule.default.writeFileContent(path, content);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
// reads content of the file form localFilename (should include full absolute path to local file with read permission
|
|
88
|
+
// writes content to the specified location by fulaTargetFilename in Fula filesystem
|
|
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
|
|
92
|
+
*/
|
|
93
|
+
exports.writeFileContent = writeFileContent;
|
|
94
|
+
const writeFile = (fulaTargetFilename, localFilename) => {
|
|
95
|
+
return _fulaNativeModule.default.writeFile(fulaTargetFilename, localFilename);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* ls lists the name of files and folders at a given path
|
|
100
|
+
* @param path
|
|
101
|
+
* @returns string: list of items
|
|
102
|
+
* TODO: Findout how is the string and convert to array
|
|
103
|
+
*/
|
|
104
|
+
exports.writeFile = writeFile;
|
|
105
|
+
const ls = path => {
|
|
106
|
+
return _fulaNativeModule.default.ls(path);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* readFile reads content of a given path
|
|
111
|
+
* @param path
|
|
112
|
+
* @returns string: cotent
|
|
113
|
+
*/
|
|
114
|
+
exports.ls = ls;
|
|
115
|
+
const readFile = path => {
|
|
116
|
+
return _fulaNativeModule.default.readFile(path);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Shutdown closes all resources used by Client.
|
|
121
|
+
// After calling this function Client must be discarded.
|
|
122
|
+
* @param
|
|
123
|
+
* @returns
|
|
124
|
+
*/
|
|
125
|
+
exports.readFile = readFile;
|
|
126
|
+
const shutdown = () => {
|
|
127
|
+
return _fulaNativeModule.default.shutdown();
|
|
128
|
+
};
|
|
129
|
+
exports.shutdown = shutdown;
|
|
130
|
+
//# sourceMappingURL=fula.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["init","identity","storePath","bloxAddr","console","log","Fula","get","key","has","push","put","value","codec","mkdir","path","writeFileContent","content","writeFile","fulaTargetFilename","localFilename","ls","readFile","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 */\nexport const init = (\n identity: string | null, //privateKey of did identity\n storePath: string | null,\n bloxAddr: string,\n): Promise<[string]> => {\n console.log('init in react-native started',identity, storePath, bloxAddr);\n return Fula.init(identity, storePath, bloxAddr);\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 = (path: string, content: string): 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 // 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 = (fulaTargetFilename: string, localFilename: string): 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 */\n export const ls = (path: string): Promise<string> => {\n return Fula.ls(path);\n};\n\n/**\n * readFile reads content of a given path\n * @param path\n * @returns string: cotent\n */\n export const readFile = (path: string): Promise<string> => {\n return Fula.readFile(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;AACO,MAAMA,IAAI,GAAG,CAClBC,QAAuB,EACvBC,SAAwB,EACxBC,QAAgB,KACM;EACtBC,OAAO,CAACC,GAAG,CAAC,8BAA8B,EAACJ,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,CAAC;EACzE,OAAOG,yBAAI,CAACN,IAAI,CAACC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,CAAC;AACjD,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;AAKQ,MAAMO,QAAQ,GAAIP,IAAY,IAAsB;EAC1D,OAAOT,yBAAI,CAACgB,QAAQ,CAACP,IAAI,CAAC;AAC5B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA;AAMO,MAAMQ,QAAQ,GAAG,MAAqB;EAC3C,OAAOjB,yBAAI,CAACiB,QAAQ,EAAE;AACxB,CAAC;AAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fula"],"sources":["index.tsx"],"sourcesContent":["export * as fula from './protocols/fula';"],"mappings":"uBAAsB,kBAAkB;AAAA,kBAA5BA,IAAI"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
const LINKING_ERROR = `The package 'react-native-fula' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
3
|
+
ios: "- You have run 'pod install'\n",
|
|
4
|
+
default: ''
|
|
5
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
6
|
+
const Fula = NativeModules.FulaModule ? NativeModules.FulaModule : new Proxy({}, {
|
|
7
|
+
get() {
|
|
8
|
+
throw new Error(LINKING_ERROR);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
export default Fula;
|
|
12
|
+
//# sourceMappingURL=fulaNativeModule.js.map
|
|
@@ -0,0 +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';\n\ninterface FulaNativeModule {\n init: (\n identity: string | null, //Private key of did identity\n storePath: string | null, //You can leave empty\n bloxAddr: string //Blox multiadddr needs to be manually entered now\n ) => Promise<[string]>;\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: (fulaTargetFilename: string, localFilename: string) => Promise<string>;\n ls: (path: string) => Promise<string>;\n readFile: (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;AAqBtD,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"}
|