@bugfender/rn-bugfender 2.1.0 → 2.1.1
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/RnBugfender.podspec +15 -0
- package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +117 -40
- package/android/gradle.properties +5 -0
- package/android/src/main/java/com/{bugfender/react → bugfender.react}/RnBugfenderModule.java +0 -0
- package/android/src/main/java/com/{bugfender/react → bugfender.react}/RnBugfenderPackage.java +0 -0
- package/ios/{RnBugfender.m → RnBugfender.mm} +16 -4
- package/ios/RnBugfender.xcodeproj/project.pbxproj +4 -17
- package/lib/commonjs/bugfender.js +14 -26
- package/lib/commonjs/bugfender.js.map +1 -1
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +2 -2
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/override-console-methods.js +9 -9
- package/lib/commonjs/override-console-methods.js.map +1 -1
- package/lib/commonjs/sdk-options.js +5 -34
- package/lib/commonjs/sdk-options.js.map +1 -1
- package/lib/commonjs/types/sdk-options.js +2 -2
- package/lib/commonjs/types/sdk-options.js.map +1 -1
- package/lib/commonjs/user-feedback.js.map +1 -1
- package/lib/module/bugfender.js +12 -22
- package/lib/module/bugfender.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/override-console-methods.js +9 -9
- package/lib/module/override-console-methods.js.map +1 -1
- package/lib/module/sdk-options.js +5 -34
- package/lib/module/sdk-options.js.map +1 -1
- package/lib/module/types/sdk-options.js +2 -2
- package/lib/module/types/sdk-options.js.map +1 -1
- package/lib/module/user-feedback.js.map +1 -1
- package/lib/typescript/bugfender.d.ts +4 -6
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.web.d.ts +1 -1
- package/lib/typescript/override-console-methods.d.ts +1 -2
- package/lib/typescript/sdk-options.d.ts +2 -12
- package/lib/typescript/user-feedback.d.ts +2 -15
- package/package.json +26 -22
- package/src/bugfender.ts +11 -16
- package/src/index.tsx +1 -1
- package/src/index.web.tsx +1 -1
- package/src/override-console-methods.ts +8 -9
- package/src/sdk-options.ts +6 -35
- package/src/types/sdk-options.ts +2 -2
- package/src/user-feedback.ts +3 -16
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -185
- package/android/gradlew.bat +0 -89
- package/lib/commonjs/print-to-console.js +0 -78
- package/lib/commonjs/print-to-console.js.map +0 -1
- package/lib/commonjs/string-formatter.js +0 -55
- package/lib/commonjs/string-formatter.js.map +0 -1
- package/lib/commonjs/types/device.js +0 -2
- package/lib/commonjs/types/device.js.map +0 -1
- package/lib/commonjs/types/log.js +0 -35
- package/lib/commonjs/types/log.js.map +0 -1
- package/lib/commonjs/utilities.js +0 -18
- package/lib/commonjs/utilities.js.map +0 -1
- package/lib/module/print-to-console.js +0 -67
- package/lib/module/print-to-console.js.map +0 -1
- package/lib/module/string-formatter.js +0 -45
- package/lib/module/string-formatter.js.map +0 -1
- package/lib/module/types/device.js +0 -2
- package/lib/module/types/device.js.map +0 -1
- package/lib/module/types/log.js +0 -24
- package/lib/module/types/log.js.map +0 -1
- package/lib/module/utilities.js +0 -11
- package/lib/module/utilities.js.map +0 -1
- package/lib/typescript/print-to-console.d.ts +0 -14
- package/lib/typescript/string-formatter.d.ts +0 -4
- package/lib/typescript/types/device.d.ts +0 -4
- package/lib/typescript/types/log.d.ts +0 -59
- package/lib/typescript/utilities.d.ts +0 -1
- package/src/print-to-console.ts +0 -67
- package/src/string-formatter.ts +0 -44
- package/src/types/device.ts +0 -4
- package/src/types/log.ts +0 -75
- package/src/utilities.ts +0 -8
package/RnBugfender.podspec
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require "json"
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
4
5
|
|
|
5
6
|
Pod::Spec.new do |s|
|
|
6
7
|
s.name = "RnBugfender"
|
|
@@ -18,4 +19,18 @@ Pod::Spec.new do |s|
|
|
|
18
19
|
s.dependency "React-Core"
|
|
19
20
|
s.dependency 'BugfenderSDK', '~> 1.10.5'
|
|
20
21
|
|
|
22
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
23
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
24
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
25
|
+
s.pod_target_xcconfig = {
|
|
26
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
27
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
s.dependency "React-Codegen"
|
|
31
|
+
s.dependency "RCT-Folly"
|
|
32
|
+
s.dependency "RCTRequired"
|
|
33
|
+
s.dependency "RCTTypeSafety"
|
|
34
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
35
|
+
end
|
|
21
36
|
end
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
package/android/build.gradle
CHANGED
|
@@ -1,61 +1,138 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
jcenter()
|
|
7
|
-
}
|
|
2
|
+
repositories {
|
|
3
|
+
google()
|
|
4
|
+
mavenCentral()
|
|
5
|
+
}
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
dependencies {
|
|
8
|
+
classpath 'com.android.tools.build:gradle:3.5.3'
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
def isNewArchitectureEnabled() {
|
|
13
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
apply plugin: 'com.android.library'
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
if (isNewArchitectureEnabled()) {
|
|
19
|
+
apply plugin: 'com.facebook.react'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
def getExtOrDefault(name) {
|
|
23
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['RnBugfender_' + name]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
def getExtOrIntegerDefault(name) {
|
|
27
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['RnBugfender_' + name]).toInteger()
|
|
19
28
|
}
|
|
20
29
|
|
|
21
30
|
android {
|
|
22
|
-
|
|
23
|
-
defaultConfig {
|
|
24
|
-
minSdkVersion safeExtGet('RnBugfender_minSdkVersion', 16)
|
|
25
|
-
targetSdkVersion safeExtGet('RnBugfender_targetSdkVersion', 29)
|
|
26
|
-
versionCode 1
|
|
27
|
-
versionName "1.0"
|
|
31
|
+
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
28
32
|
|
|
33
|
+
defaultConfig {
|
|
34
|
+
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
35
|
+
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
36
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
37
|
+
}
|
|
38
|
+
buildTypes {
|
|
39
|
+
release {
|
|
40
|
+
minifyEnabled false
|
|
29
41
|
}
|
|
42
|
+
}
|
|
30
43
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
compileOptions {
|
|
40
|
-
sourceCompatibility JavaVersion.VERSION_1_8
|
|
41
|
-
targetCompatibility JavaVersion.VERSION_1_8
|
|
42
|
-
}
|
|
44
|
+
lintOptions {
|
|
45
|
+
disable 'GradleCompatible'
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
compileOptions {
|
|
49
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
50
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
51
|
+
}
|
|
43
52
|
}
|
|
44
53
|
|
|
45
54
|
repositories {
|
|
46
|
-
|
|
55
|
+
mavenCentral()
|
|
56
|
+
google()
|
|
57
|
+
|
|
58
|
+
def found = false
|
|
59
|
+
def defaultDir = null
|
|
60
|
+
def androidSourcesName = 'React Native sources'
|
|
61
|
+
|
|
62
|
+
if (rootProject.ext.has('reactNativeAndroidRoot')) {
|
|
63
|
+
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
|
|
64
|
+
} else {
|
|
65
|
+
defaultDir = new File(
|
|
66
|
+
projectDir,
|
|
67
|
+
'/../../../node_modules/react-native/android'
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (defaultDir.exists()) {
|
|
47
72
|
maven {
|
|
48
|
-
|
|
49
|
-
|
|
73
|
+
url defaultDir.toString()
|
|
74
|
+
name androidSourcesName
|
|
50
75
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
76
|
+
|
|
77
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
|
|
78
|
+
found = true
|
|
79
|
+
} else {
|
|
80
|
+
def parentDir = rootProject.projectDir
|
|
81
|
+
|
|
82
|
+
1.upto(5, {
|
|
83
|
+
if (found) return true
|
|
84
|
+
parentDir = parentDir.parentFile
|
|
85
|
+
|
|
86
|
+
def androidSourcesDir = new File(
|
|
87
|
+
parentDir,
|
|
88
|
+
'node_modules/react-native'
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
def androidPrebuiltBinaryDir = new File(
|
|
92
|
+
parentDir,
|
|
93
|
+
'node_modules/react-native/android'
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
if (androidPrebuiltBinaryDir.exists()) {
|
|
97
|
+
maven {
|
|
98
|
+
url androidPrebuiltBinaryDir.toString()
|
|
99
|
+
name androidSourcesName
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
|
|
103
|
+
found = true
|
|
104
|
+
} else if (androidSourcesDir.exists()) {
|
|
105
|
+
maven {
|
|
106
|
+
url androidSourcesDir.toString()
|
|
107
|
+
name androidSourcesName
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
|
|
111
|
+
found = true
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (!found) {
|
|
117
|
+
throw new GradleException(
|
|
118
|
+
"${project.name}: unable to locate React Native android sources. " +
|
|
119
|
+
"Ensure you have you installed React Native as a dependency in your project and try again."
|
|
120
|
+
)
|
|
121
|
+
}
|
|
54
122
|
}
|
|
55
123
|
|
|
124
|
+
|
|
56
125
|
dependencies {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
126
|
+
//noinspection GradleDynamicVersion
|
|
127
|
+
implementation "com.facebook.react:react-native:+"
|
|
128
|
+
//noinspection GradleDynamicVersion
|
|
129
|
+
implementation 'com.bugfender.sdk:android:3.+'
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (isNewArchitectureEnabled()) {
|
|
133
|
+
react {
|
|
134
|
+
jsRootDir = file("../src/")
|
|
135
|
+
libraryName = "RnBugfender"
|
|
136
|
+
codegenJavaPackageName = "com.bugfenderrnbugfender"
|
|
137
|
+
}
|
|
61
138
|
}
|
package/android/src/main/java/com/{bugfender/react → bugfender.react}/RnBugfenderModule.java
RENAMED
|
File without changes
|
package/android/src/main/java/com/{bugfender/react → bugfender.react}/RnBugfenderPackage.java
RENAMED
|
File without changes
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
#import <BugfenderSDK/BugfenderSDK.h>
|
|
3
3
|
#import <React/RCTUtils.h>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
6
|
+
#import "RNRnBugfenderSpec.h"
|
|
7
|
+
#endif
|
|
6
8
|
|
|
9
|
+
@implementation RnBugfender
|
|
7
10
|
RCT_EXPORT_MODULE()
|
|
8
11
|
|
|
9
12
|
RCT_EXPORT_METHOD(activateLogger:(NSString *)key)
|
|
@@ -135,7 +138,7 @@ RCT_EXPORT_METHOD(log:(int)lineNumber method:(NSString *)method file:(NSString *
|
|
|
135
138
|
logLevel = BFLogLevelInfo;
|
|
136
139
|
else if (rawLogLevel == 5)
|
|
137
140
|
logLevel = BFLogLevelFatal;
|
|
138
|
-
|
|
141
|
+
|
|
139
142
|
[Bugfender logWithLineNumber:lineNumber method:method file:file level:logLevel tag:tag message:message];
|
|
140
143
|
}
|
|
141
144
|
|
|
@@ -174,10 +177,10 @@ RCT_EXPORT_METHOD(showUserFeedback:(NSString *)title hint:(NSString *)hint subje
|
|
|
174
177
|
reject(0, @"Feedback not sent", nil);
|
|
175
178
|
}
|
|
176
179
|
}];
|
|
177
|
-
|
|
180
|
+
|
|
178
181
|
UIViewController* vc = RCTPresentedViewController();
|
|
179
182
|
[vc presentViewController:controller animated:YES completion:nil];
|
|
180
|
-
|
|
183
|
+
|
|
181
184
|
/*
|
|
182
185
|
* Another option might be using the window.
|
|
183
186
|
* But this code might not work for complex native setup, for simple cases, might work
|
|
@@ -190,4 +193,13 @@ RCT_EXPORT_METHOD(showUserFeedback:(NSString *)title hint:(NSString *)hint subje
|
|
|
190
193
|
return dispatch_get_main_queue();
|
|
191
194
|
}
|
|
192
195
|
|
|
196
|
+
// Don't compile this code when we build for the old architecture.
|
|
197
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
198
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
199
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
200
|
+
{
|
|
201
|
+
return std::make_shared<facebook::react::NativeRnBugfenderSpecJSI>(params);
|
|
202
|
+
}
|
|
203
|
+
#endif
|
|
204
|
+
|
|
193
205
|
@end
|
|
@@ -6,12 +6,6 @@
|
|
|
6
6
|
objectVersion = 46;
|
|
7
7
|
objects = {
|
|
8
8
|
|
|
9
|
-
/* Begin PBXBuildFile section */
|
|
10
|
-
|
|
11
|
-
5E555C0D2413F4C50049A1A2 /* RnBugfender.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RnBugfender.m */; };
|
|
12
|
-
|
|
13
|
-
/* End PBXBuildFile section */
|
|
14
|
-
|
|
15
9
|
/* Begin PBXCopyFilesBuildPhase section */
|
|
16
10
|
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
|
17
11
|
isa = PBXCopyFilesBuildPhase;
|
|
@@ -26,10 +20,8 @@
|
|
|
26
20
|
|
|
27
21
|
/* Begin PBXFileReference section */
|
|
28
22
|
134814201AA4EA6300B7C361 /* libRnBugfender.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRnBugfender.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
29
|
-
|
|
23
|
+
2427F83828D894B6004EFC8A /* RnBugfender.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RnBugfender.mm; sourceTree = "<group>"; };
|
|
30
24
|
B3E7B5881CC2AC0600A0062D /* RnBugfender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RnBugfender.h; sourceTree = "<group>"; };
|
|
31
|
-
B3E7B5891CC2AC0600A0062D /* RnBugfender.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RnBugfender.m; sourceTree = "<group>"; };
|
|
32
|
-
|
|
33
25
|
/* End PBXFileReference section */
|
|
34
26
|
|
|
35
27
|
/* Begin PBXFrameworksBuildPhase section */
|
|
@@ -54,10 +46,8 @@
|
|
|
54
46
|
58B511D21A9E6C8500147676 = {
|
|
55
47
|
isa = PBXGroup;
|
|
56
48
|
children = (
|
|
57
|
-
|
|
58
49
|
B3E7B5881CC2AC0600A0062D /* RnBugfender.h */,
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
2427F83828D894B6004EFC8A /* RnBugfender.mm */,
|
|
61
51
|
134814211AA4EA7D00B7C361 /* Products */,
|
|
62
52
|
);
|
|
63
53
|
sourceTree = "<group>";
|
|
@@ -119,9 +109,6 @@
|
|
|
119
109
|
isa = PBXSourcesBuildPhase;
|
|
120
110
|
buildActionMask = 2147483647;
|
|
121
111
|
files = (
|
|
122
|
-
|
|
123
|
-
B3E7B58A1CC2AC0600A0062D /* RnBugfender.m in Sources */,
|
|
124
|
-
|
|
125
112
|
);
|
|
126
113
|
runOnlyForDeploymentPostprocessing = 0;
|
|
127
114
|
};
|
|
@@ -156,6 +143,7 @@
|
|
|
156
143
|
COPY_PHASE_STRIP = NO;
|
|
157
144
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
158
145
|
ENABLE_TESTABILITY = YES;
|
|
146
|
+
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
159
147
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
160
148
|
GCC_DYNAMIC_NO_PIC = NO;
|
|
161
149
|
GCC_NO_COMMON_BLOCKS = YES;
|
|
@@ -206,6 +194,7 @@
|
|
|
206
194
|
COPY_PHASE_STRIP = YES;
|
|
207
195
|
ENABLE_NS_ASSERTIONS = NO;
|
|
208
196
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
197
|
+
"EXCLUDED_ARCHS[sdk=*]" = arm64;
|
|
209
198
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
|
210
199
|
GCC_NO_COMMON_BLOCKS = YES;
|
|
211
200
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
@@ -234,7 +223,6 @@
|
|
|
234
223
|
OTHER_LDFLAGS = "-ObjC";
|
|
235
224
|
PRODUCT_NAME = RnBugfender;
|
|
236
225
|
SKIP_INSTALL = YES;
|
|
237
|
-
|
|
238
226
|
};
|
|
239
227
|
name = Debug;
|
|
240
228
|
};
|
|
@@ -251,7 +239,6 @@
|
|
|
251
239
|
OTHER_LDFLAGS = "-ObjC";
|
|
252
240
|
PRODUCT_NAME = RnBugfender;
|
|
253
241
|
SKIP_INSTALL = YES;
|
|
254
|
-
|
|
255
242
|
};
|
|
256
243
|
name = Release;
|
|
257
244
|
};
|
|
@@ -7,13 +7,9 @@ exports.RnBugfender = exports.BugfenderClass = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _stringFormatter = require("./string-formatter");
|
|
10
|
+
var _common = require("@bugfender/common");
|
|
13
11
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var _printToConsole = require("./print-to-console");
|
|
12
|
+
var _userFeedback = require("./user-feedback");
|
|
17
13
|
|
|
18
14
|
var _sdkOptions = require("./sdk-options");
|
|
19
15
|
|
|
@@ -33,11 +29,9 @@ exports.RnBugfender = RnBugfender;
|
|
|
33
29
|
|
|
34
30
|
class BugfenderClass {
|
|
35
31
|
constructor() {
|
|
36
|
-
_defineProperty(this, "stringFormatter", new _stringFormatter.StringFormatter());
|
|
37
|
-
|
|
38
32
|
_defineProperty(this, "overrideConsoleMethods", new (require('./override-console-methods').OverrideConsoleMethods)(window));
|
|
39
33
|
|
|
40
|
-
_defineProperty(this, "printToConsole", new
|
|
34
|
+
_defineProperty(this, "printToConsole", new _common.PrintToConsole(global.console));
|
|
41
35
|
|
|
42
36
|
_defineProperty(this, "sdkOptions", new _sdkOptions.SDKOptions());
|
|
43
37
|
|
|
@@ -46,8 +40,6 @@ class BugfenderClass {
|
|
|
46
40
|
|
|
47
41
|
async init(options) {
|
|
48
42
|
if (!this.initialized) {
|
|
49
|
-
var _validatedOptions$pri, _validatedOptions$pri2;
|
|
50
|
-
|
|
51
43
|
const validatedOptions = this.sdkOptions.init(options); // region before init
|
|
52
44
|
|
|
53
45
|
if (typeof options.deviceName !== 'undefined') {
|
|
@@ -64,13 +56,13 @@ class BugfenderClass {
|
|
|
64
56
|
// region init
|
|
65
57
|
|
|
66
58
|
|
|
67
|
-
_reactNative.Platform.OS === 'ios' ? RnBugfender.activateLogger(validatedOptions.appKey) : RnBugfender.init(validatedOptions.appKey,
|
|
59
|
+
_reactNative.Platform.OS === 'ios' ? RnBugfender.activateLogger(validatedOptions.appKey) : RnBugfender.init(validatedOptions.appKey, validatedOptions.printToConsole ?? false);
|
|
68
60
|
|
|
69
61
|
if (validatedOptions.overrideConsoleMethods) {
|
|
70
|
-
this.overrideConsoleMethods.init(
|
|
62
|
+
this.overrideConsoleMethods.init();
|
|
71
63
|
}
|
|
72
64
|
|
|
73
|
-
this.printToConsole.init(
|
|
65
|
+
this.printToConsole.init(validatedOptions.printToConsole ?? true); // endregion init
|
|
74
66
|
// region after init
|
|
75
67
|
|
|
76
68
|
if (validatedOptions.enableLogcatLogging) {
|
|
@@ -128,10 +120,8 @@ class BugfenderClass {
|
|
|
128
120
|
|
|
129
121
|
async getUserFeedback(options) {
|
|
130
122
|
return new Promise(resolve => {
|
|
131
|
-
var _options;
|
|
132
|
-
|
|
133
123
|
options = { ...new _userFeedback.DefaultUserFeedbackOptions(),
|
|
134
|
-
...(
|
|
124
|
+
...(options ?? {})
|
|
135
125
|
};
|
|
136
126
|
return RnBugfender.showUserFeedback(options.title, options.hint, options.subjectPlaceholder, options.feedbackPlaceholder, options.submitLabel, options.closeLabel).then(value => {
|
|
137
127
|
resolve({
|
|
@@ -157,7 +147,7 @@ class BugfenderClass {
|
|
|
157
147
|
}
|
|
158
148
|
|
|
159
149
|
this.printToConsole.log(...parameters);
|
|
160
|
-
let message =
|
|
150
|
+
let message = (0, _common.format)([...parameters]);
|
|
161
151
|
RnBugfender.debug('', message);
|
|
162
152
|
}
|
|
163
153
|
/**
|
|
@@ -172,7 +162,7 @@ class BugfenderClass {
|
|
|
172
162
|
}
|
|
173
163
|
|
|
174
164
|
this.printToConsole.warn(...parameters);
|
|
175
|
-
let message =
|
|
165
|
+
let message = (0, _common.format)([...parameters]);
|
|
176
166
|
RnBugfender.warning('', message);
|
|
177
167
|
}
|
|
178
168
|
/**
|
|
@@ -187,7 +177,7 @@ class BugfenderClass {
|
|
|
187
177
|
}
|
|
188
178
|
|
|
189
179
|
this.printToConsole.error(...parameters);
|
|
190
|
-
let message =
|
|
180
|
+
let message = (0, _common.format)([...parameters]);
|
|
191
181
|
RnBugfender.error('', message);
|
|
192
182
|
}
|
|
193
183
|
/**
|
|
@@ -202,7 +192,7 @@ class BugfenderClass {
|
|
|
202
192
|
}
|
|
203
193
|
|
|
204
194
|
this.printToConsole.trace(...parameters);
|
|
205
|
-
let message =
|
|
195
|
+
let message = (0, _common.format)([...parameters]);
|
|
206
196
|
RnBugfender.trace('', message);
|
|
207
197
|
}
|
|
208
198
|
/**
|
|
@@ -217,7 +207,7 @@ class BugfenderClass {
|
|
|
217
207
|
}
|
|
218
208
|
|
|
219
209
|
this.printToConsole.info(...parameters);
|
|
220
|
-
let message =
|
|
210
|
+
let message = (0, _common.format)([...parameters]);
|
|
221
211
|
RnBugfender.info('', message);
|
|
222
212
|
}
|
|
223
213
|
/**
|
|
@@ -232,7 +222,7 @@ class BugfenderClass {
|
|
|
232
222
|
}
|
|
233
223
|
|
|
234
224
|
this.printToConsole.error(...parameters);
|
|
235
|
-
let message =
|
|
225
|
+
let message = (0, _common.format)([...parameters]);
|
|
236
226
|
RnBugfender.fatal('', message);
|
|
237
227
|
}
|
|
238
228
|
/**
|
|
@@ -254,10 +244,8 @@ class BugfenderClass {
|
|
|
254
244
|
|
|
255
245
|
|
|
256
246
|
sendLog(log) {
|
|
257
|
-
var _log$line, _log$method, _log$file, _log$level, _log$tag, _log$text;
|
|
258
|
-
|
|
259
247
|
this.printToConsole.printLog(log);
|
|
260
|
-
RnBugfender.log(
|
|
248
|
+
RnBugfender.log(log.line ?? 0, log.method ?? '', log.file ?? '', log.level ?? _common.LogLevel.Debug, log.tag ?? '', log.text ?? '');
|
|
261
249
|
}
|
|
262
250
|
/**
|
|
263
251
|
* Send an issue.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["bugfender.ts"],"names":["LINKING_ERROR","Platform","select","ios","default","RnBugfender","NativeModules","Proxy","get","Error","BugfenderClass","StringFormatter","require","OverrideConsoleMethods","window","PrintToConsole","global","console","SDKOptions","init","options","initialized","validatedOptions","sdkOptions","deviceName","overrideDeviceName","apiURL","setApiUrl","baseURL","setBaseUrl","OS","activateLogger","appKey","printToConsole","overrideConsoleMethods","stringFormatter","enableLogcatLogging","logUIEvents","enableUIEventLogging","registerErrorHandler","enableCrashReporting","setMaximumLocalStorageSize","maximumLocalStorageSize","getDeviceURL","getDeviceUrl","getSessionURL","getSessionUrl","getUserFeedback","Promise","resolve","DefaultUserFeedbackOptions","showUserFeedback","title","hint","subjectPlaceholder","feedbackPlaceholder","submitLabel","closeLabel","then","value","isSent","feedbackURL","_","log","parameters","message","format","debug","warn","warning","error","trace","info","fatal","removeDeviceKey","key","sendLog","printLog","line","method","file","level","LogLevel","Debug","tag","text","sendIssue","sendCrash","sendUserFeedback","setDeviceKey","setDeviceBoolean","setDeviceString","Number","isInteger","setDeviceInteger","setDeviceFloat","forceSendOnce","setForceEnabled","enabled"],"mappings":";;;;;;;AAAA;;AAGA;;AAGA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,aAAa,GAChB,kFAAD,GACAC,sBAASC,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,WAAW,GAAGC,2BAAcD,WAAd,GAChBC,2BAAcD,WADE,GAEhB,IAAIE,KAAJ,CACA,EADA,EAEA;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUT,aAAV,CAAN;AACD;;AAHH,CAFA,CAFJ;;;AAWA,MAAMU,cAAN,CAAqB;AAAA;AAAA,6CACO,IAAIC,gCAAJ,EADP;;AAAA,oDAGjB,KAAKC,OAAO,CAAC,4BAAD,CAAP,CAAsCC,sBAA3C,EAAmEC,MAAnE,CAHiB;;AAAA,4CAIM,IAAIC,8BAAJ,CAAmBC,MAAM,CAACC,OAA1B,CAJN;;AAAA,wCAKc,IAAIC,sBAAJ,EALd;;AAAA,yCAMG,KANH;AAAA;;AAQF,QAAJC,IAAI,CAACC,OAAD,EAAsC;AACrD,QAAI,CAAC,KAAKC,WAAV,EAAuB;AAAA;;AACrB,YAAMC,gBAAgB,GAAG,KAAKC,UAAL,CAAgBJ,IAAhB,CAAqBC,OAArB,CAAzB,CADqB,CAGrB;;AACA,UAAI,OAAOA,OAAO,CAACI,UAAf,KAA8B,WAAlC,EAA+C;AAC7CnB,QAAAA,WAAW,CAACoB,kBAAZ,CAA+BL,OAAO,CAACI,UAAvC;AACD;;AACD,U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AACD;;AAEMC,EAAAA,eAAe,CAACC,OAAD,EAAyB;AAC7C,SAAKjE,cAAL,CAAoBuC,IAApB,CAA0B,4BAA2B0B,OAAQ,EAA7D;AACA7F,IAAAA,WAAW,CAAC4F,eAAZ,CAA4BC,OAA5B;AACD;;AA9UkB","sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport type { ISDKOptions } from './types/sdk-options';\nimport type { UserFeedbackOptions, UserFeedbackResult } from './user-feedback';\nimport { DefaultUserFeedbackOptions } from './user-feedback';\nimport type { DeviceKeyValue } from './types/device';\nimport type { ILogEntry } from './types/log';\nimport { StringFormatter } from './string-formatter';\nimport { LogLevel } from './types/log';\nimport { PrintToConsole } from './print-to-console';\nimport { SDKOptions } from './sdk-options';\n\nconst LINKING_ERROR =\n `The package '@bugfender/rn-bugfender' 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 RnBugfender = NativeModules.RnBugfender\n ? NativeModules.RnBugfender\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nclass BugfenderClass {\n private stringFormatter = new StringFormatter();\n private overrideConsoleMethods =\n new (require('./override-console-methods').OverrideConsoleMethods)(window);\n private printToConsole = new PrintToConsole(global.console);\n private sdkOptions: SDKOptions = new SDKOptions();\n private initialized = false;\n\n public async init(options: ISDKOptions): Promise<void> {\n if (!this.initialized) {\n const validatedOptions = this.sdkOptions.init(options);\n\n // region before init\n if (typeof options.deviceName !== 'undefined') {\n RnBugfender.overrideDeviceName(options.deviceName);\n }\n if (typeof validatedOptions.apiURL !== 'undefined') {\n RnBugfender.setApiUrl(validatedOptions.apiURL);\n }\n if (typeof validatedOptions.baseURL !== 'undefined') {\n RnBugfender.setBaseUrl(validatedOptions.baseURL);\n }\n // endregion before init\n\n // region init\n Platform.OS === 'ios'\n ? RnBugfender.activateLogger(validatedOptions.appKey)\n : RnBugfender.init(validatedOptions.appKey, validatedOptions.printToConsole ?? false);\n\n if (validatedOptions.overrideConsoleMethods) {\n this.overrideConsoleMethods.init(this.stringFormatter);\n }\n\n this.printToConsole.init(validatedOptions.printToConsole ?? true);\n // endregion init\n\n // region after init\n if (validatedOptions.enableLogcatLogging) {\n RnBugfender.enableLogcatLogging();\n }\n if (validatedOptions.logUIEvents) {\n RnBugfender.enableUIEventLogging();\n }\n if (validatedOptions.registerErrorHandler) {\n RnBugfender.enableCrashReporting();\n }\n RnBugfender.setMaximumLocalStorageSize(\n validatedOptions.maximumLocalStorageSize\n );\n // endregion after init\n\n this.initialized = true;\n }\n }\n\n /**\n * @returns Bugfender dashboard URL for the device\n */\n public getDeviceURL(): Promise<string> {\n return RnBugfender.getDeviceUrl();\n }\n\n /**\n * @returns Bugfender dashboard URL for the current session\n */\n public getSessionURL(): Promise<string> {\n return RnBugfender.getSessionUrl();\n }\n\n /**\n * Show a modal which asks for feedback. Once the user closes the modal or sends the feedback\n * the returned promise resolves with the result.\n *\n * ```typescript\n * Bugfender.getUserFeedback().then((result) => {\n * if (result.isSent) {\n * // User sent the feedback\n * // `result.feedbackURL` contains the Bugfender feedback URL\n * } else {\n * // User closed the modal without sending the feedback\n * }\n * });\n * ```\n *\n * @param options Options object to configure modal strings\n * @returns Promise which resolves once the user closes the modal or sends the feedback\n */\n public async getUserFeedback(\n options?: UserFeedbackOptions\n ): Promise<UserFeedbackResult> {\n return new Promise<UserFeedbackResult>((resolve) => {\n options = {\n ...new DefaultUserFeedbackOptions(),\n ...(options ?? {}),\n };\n\n return RnBugfender.showUserFeedback(\n options.title,\n options.hint,\n options.subjectPlaceholder,\n options.feedbackPlaceholder,\n options.submitLabel,\n options.closeLabel\n ).then(\n (value: string) => {\n resolve({\n isSent: true,\n feedbackURL: value,\n });\n },\n (_: any) => {\n resolve({\n isSent: false,\n });\n }\n );\n });\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public log(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public log(msg: string, ...subst: unknown[]): void;\n public log(...parameters: unknown[]): void {\n this.printToConsole.log(...parameters);\n\n let message = this.stringFormatter.format([...parameters]);\n RnBugfender.debug('', message);\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public warn(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public warn(msg: string, ...subst: unknown[]): void;\n public warn(...parameters: unknown[]): void {\n this.printToConsole.warn(...parameters);\n\n let message = this.stringFormatter.format([...parameters]);\n RnBugfender.warning('', message);\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public error(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public error(msg: string, ...subst: unknown[]): void;\n public error(...parameters: unknown[]): void {\n this.printToConsole.error(...parameters);\n\n let message = this.stringFormatter.format([...parameters]);\n RnBugfender.error('', message);\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public trace(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public trace(msg: string, ...subst: unknown[]): void;\n public trace(...parameters: unknown[]): void {\n this.printToConsole.trace(...parameters);\n\n let message = this.stringFormatter.format([...parameters]);\n RnBugfender.trace('', message);\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public info(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public info(msg: string, ...subst: unknown[]): void;\n public info(...parameters: unknown[]): void {\n this.printToConsole.info(...parameters);\n\n let message = this.stringFormatter.format([...parameters]);\n RnBugfender.info('', message);\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public fatal(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public fatal(msg: string, ...subst: unknown[]): void;\n public fatal(...parameters: unknown[]): void {\n this.printToConsole.error(...parameters);\n\n let message = this.stringFormatter.format([...parameters]);\n RnBugfender.fatal('', message);\n }\n\n /**\n * Remove a device associated key-value pair. [Learn more](https://bugfender.com/blog/associated-device-information/).\n *\n * @param key Key identifier\n */\n public removeDeviceKey(key: string): void {\n RnBugfender.removeDeviceKey(key);\n this.printToConsole.info(`Device key \"${key}\" removed`);\n }\n\n /**\n * Use this method if you need more control over the data sent while logging. See `ILogEntry` interface reference to see all the accepted properties.\n *\n * @param log Log object that complies with `ILogEntry` interface.\n */\n public sendLog(log: ILogEntry): void {\n this.printToConsole.printLog(log);\n\n RnBugfender.log(\n log.line ?? 0,\n log.method ?? '',\n log.file ?? '',\n log.level ?? LogLevel.Debug,\n log.tag ?? '',\n log.text ?? ''\n );\n }\n\n /**\n * Send an issue.\n *\n * @param title - Title\n * @param text - Text content\n * @returns Bugfender dashboard URL for the issue.\n */\n public sendIssue(title: string, text: string): Promise<string> {\n this.printToConsole.warn(`Issue: ${title}.\\n${text}`);\n return RnBugfender.sendIssue(title, text);\n }\n\n /**\n * Send a crash report.\n *\n * @param title - Title\n * @param text - Text content\n * @returns Bugfender dashboard URL for the crash.\n */\n public sendCrash(title: string, text: string): Promise<string> {\n this.printToConsole.error(`Crash: ${title}.\\n${text}`);\n return RnBugfender.sendCrash(title, text);\n }\n\n /**\n * Send an user feedback.\n *\n * @param title - Title/Subject\n * @param text - Feedback text\n * @returns Bugfender dashboard URL for the feedback.\n */\n public sendUserFeedback(title: string, text: string): Promise<string> {\n this.printToConsole.info(`User Feedback: ${title}.\\n${text}`);\n return RnBugfender.sendUserFeedback(title, text);\n }\n\n /**\n * Set a device associated key-value pair. [Learn more](https://bugfender.com/blog/associated-device-information/).\n *\n * @param key Key identifier.\n * @param value Value.\n */\n public setDeviceKey(key: string, value: DeviceKeyValue): void {\n this.printToConsole.info(`Device key \"${key}\" set to \"${value}\"`);\n\n if (typeof value === 'boolean') {\n RnBugfender.setDeviceBoolean(key, value);\n } else if (typeof value === 'string') {\n RnBugfender.setDeviceString(key, value);\n } else {\n // typeof value === 'number'\n if (Number.isInteger(value)) {\n RnBugfender.setDeviceInteger(key, value);\n } else {\n RnBugfender.setDeviceFloat(key, value);\n }\n }\n }\n\n /**\n * Synchronizes all logs and issues with the server once, regardless if this device is enabled or not.\n *\n * Logs and issues are synchronized only once. After that, the logs are again sent according to the enabled flag\n * in the Bugfender Console.\n */\n public forceSendOnce(): void {\n this.printToConsole.info(`Force send once`);\n RnBugfender.forceSendOnce();\n }\n\n public setForceEnabled(enabled: boolean): void {\n this.printToConsole.info(`Set force enabled set to ${enabled}`);\n RnBugfender.setForceEnabled(enabled);\n }\n}\n\nexport {\n BugfenderClass, RnBugfender\n}\n"]}
|
|
1
|
+
{"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","RnBugfender","NativeModules","Proxy","get","Error","BugfenderClass","require","OverrideConsoleMethods","window","PrintToConsole","global","console","SDKOptions","init","options","initialized","validatedOptions","sdkOptions","deviceName","overrideDeviceName","apiURL","setApiUrl","baseURL","setBaseUrl","OS","activateLogger","appKey","printToConsole","overrideConsoleMethods","enableLogcatLogging","logUIEvents","enableUIEventLogging","registerErrorHandler","enableCrashReporting","setMaximumLocalStorageSize","maximumLocalStorageSize","getDeviceURL","getDeviceUrl","getSessionURL","getSessionUrl","getUserFeedback","Promise","resolve","DefaultUserFeedbackOptions","showUserFeedback","title","hint","subjectPlaceholder","feedbackPlaceholder","submitLabel","closeLabel","then","value","isSent","feedbackURL","_","log","parameters","message","format","debug","warn","warning","error","trace","info","fatal","removeDeviceKey","key","sendLog","printLog","line","method","file","level","LogLevel","Debug","tag","text","sendIssue","sendCrash","sendUserFeedback","setDeviceKey","setDeviceBoolean","setDeviceString","Number","isInteger","setDeviceInteger","setDeviceFloat","forceSendOnce","setForceEnabled","enabled"],"sources":["bugfender.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport { BugfenderFacade, DeviceKeyValue, LogEntry, LogLevel, PrintToConsole, UserFeedbackResult, format } from '@bugfender/common';\nimport type { ISDKOptions } from './types/sdk-options';\nimport type { UserFeedbackOptions } from './user-feedback';\nimport { DefaultUserFeedbackOptions } from './user-feedback';\nimport { SDKOptions } from './sdk-options';\n\nconst LINKING_ERROR =\n `The package '@bugfender/rn-bugfender' 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 RnBugfender = NativeModules.RnBugfender\n ? NativeModules.RnBugfender\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nclass BugfenderClass implements BugfenderFacade {\n private overrideConsoleMethods =\n new (require('./override-console-methods').OverrideConsoleMethods)(window);\n private printToConsole = new PrintToConsole(global.console);\n private sdkOptions: SDKOptions = new SDKOptions();\n private initialized = false;\n\n public async init(options: ISDKOptions): Promise<void> {\n if (!this.initialized) {\n const validatedOptions = this.sdkOptions.init(options);\n\n // region before init\n if (typeof options.deviceName !== 'undefined') {\n RnBugfender.overrideDeviceName(options.deviceName);\n }\n if (typeof validatedOptions.apiURL !== 'undefined') {\n RnBugfender.setApiUrl(validatedOptions.apiURL);\n }\n if (typeof validatedOptions.baseURL !== 'undefined') {\n RnBugfender.setBaseUrl(validatedOptions.baseURL);\n }\n // endregion before init\n\n // region init\n Platform.OS === 'ios'\n ? RnBugfender.activateLogger(validatedOptions.appKey)\n : RnBugfender.init(validatedOptions.appKey, validatedOptions.printToConsole ?? false);\n\n if (validatedOptions.overrideConsoleMethods) {\n this.overrideConsoleMethods.init();\n }\n\n this.printToConsole.init(validatedOptions.printToConsole ?? true);\n // endregion init\n\n // region after init\n if (validatedOptions.enableLogcatLogging) {\n RnBugfender.enableLogcatLogging();\n }\n if (validatedOptions.logUIEvents) {\n RnBugfender.enableUIEventLogging();\n }\n if (validatedOptions.registerErrorHandler) {\n RnBugfender.enableCrashReporting();\n }\n RnBugfender.setMaximumLocalStorageSize(\n validatedOptions.maximumLocalStorageSize\n );\n // endregion after init\n\n this.initialized = true;\n }\n }\n\n /**\n * @returns Bugfender dashboard URL for the device\n */\n public getDeviceURL(): Promise<string> {\n return RnBugfender.getDeviceUrl();\n }\n\n /**\n * @returns Bugfender dashboard URL for the current session\n */\n public getSessionURL(): Promise<string> {\n return RnBugfender.getSessionUrl();\n }\n\n /**\n * Show a modal which asks for feedback. Once the user closes the modal or sends the feedback\n * the returned promise resolves with the result.\n *\n * ```typescript\n * Bugfender.getUserFeedback().then((result) => {\n * if (result.isSent) {\n * // User sent the feedback\n * // `result.feedbackURL` contains the Bugfender feedback URL\n * } else {\n * // User closed the modal without sending the feedback\n * }\n * });\n * ```\n *\n * @param options Options object to configure modal strings\n * @returns Promise which resolves once the user closes the modal or sends the feedback\n */\n public async getUserFeedback(\n options?: UserFeedbackOptions\n ): Promise<UserFeedbackResult> {\n return new Promise<UserFeedbackResult>((resolve) => {\n options = {\n ...new DefaultUserFeedbackOptions(),\n ...(options ?? {}),\n };\n\n return RnBugfender.showUserFeedback(\n options.title,\n options.hint,\n options.subjectPlaceholder,\n options.feedbackPlaceholder,\n options.submitLabel,\n options.closeLabel\n ).then(\n (value: string) => {\n resolve({\n isSent: true,\n feedbackURL: value,\n });\n },\n (_: any) => {\n resolve({\n isSent: false,\n });\n }\n );\n });\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public log(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public log(msg: string, ...subst: unknown[]): void;\n public log(...parameters: unknown[]): void {\n this.printToConsole.log(...parameters);\n\n let message = format([...parameters]);\n RnBugfender.debug('', message);\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public warn(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public warn(msg: string, ...subst: unknown[]): void;\n public warn(...parameters: unknown[]): void {\n this.printToConsole.warn(...parameters);\n\n let message = format([...parameters]);\n RnBugfender.warning('', message);\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public error(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public error(msg: string, ...subst: unknown[]): void;\n public error(...parameters: unknown[]): void {\n this.printToConsole.error(...parameters);\n\n let message = format([...parameters]);\n RnBugfender.error('', message);\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public trace(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public trace(msg: string, ...subst: unknown[]): void;\n public trace(...parameters: unknown[]): void {\n this.printToConsole.trace(...parameters);\n\n let message = format([...parameters]);\n RnBugfender.trace('', message);\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public info(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public info(msg: string, ...subst: unknown[]): void;\n public info(...parameters: unknown[]): void {\n this.printToConsole.info(...parameters);\n\n let message = format([...parameters]);\n RnBugfender.info('', message);\n }\n\n /**\n * @param obj A JavaScript value to output\n * @param objs List of optional JavaScript values to output\n */\n public fatal(obj: unknown, ...objs: unknown[]): void;\n /**\n * String message with optional substitutions. This mimicks que the `window.console` template messages. [Learn more in MDN](https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions).\n *\n * @param msg Message with optional `%` placeholders\n * @param subst Optional substitutions list\n */\n public fatal(msg: string, ...subst: unknown[]): void;\n public fatal(...parameters: unknown[]): void {\n this.printToConsole.error(...parameters);\n\n let message = format([...parameters]);\n RnBugfender.fatal('', message);\n }\n\n /**\n * Remove a device associated key-value pair. [Learn more](https://bugfender.com/blog/associated-device-information/).\n *\n * @param key Key identifier\n */\n public removeDeviceKey(key: string): void {\n RnBugfender.removeDeviceKey(key);\n this.printToConsole.info(`Device key \"${key}\" removed`);\n }\n\n /**\n * Use this method if you need more control over the data sent while logging. See `ILogEntry` interface reference to see all the accepted properties.\n *\n * @param log Log object that complies with `ILogEntry` interface.\n */\n public sendLog(log: LogEntry): void {\n this.printToConsole.printLog(log);\n\n RnBugfender.log(\n log.line ?? 0,\n log.method ?? '',\n log.file ?? '',\n log.level ?? LogLevel.Debug,\n log.tag ?? '',\n log.text ?? ''\n );\n }\n\n /**\n * Send an issue.\n *\n * @param title - Title\n * @param text - Text content\n * @returns Bugfender dashboard URL for the issue.\n */\n public sendIssue(title: string, text: string): Promise<string> {\n this.printToConsole.warn(`Issue: ${title}.\\n${text}`);\n return RnBugfender.sendIssue(title, text);\n }\n\n /**\n * Send a crash report.\n *\n * @param title - Title\n * @param text - Text content\n * @returns Bugfender dashboard URL for the crash.\n */\n public sendCrash(title: string, text: string): Promise<string> {\n this.printToConsole.error(`Crash: ${title}.\\n${text}`);\n return RnBugfender.sendCrash(title, text);\n }\n\n /**\n * Send an user feedback.\n *\n * @param title - Title/Subject\n * @param text - Feedback text\n * @returns Bugfender dashboard URL for the feedback.\n */\n public sendUserFeedback(title: string, text: string): Promise<string> {\n this.printToConsole.info(`User Feedback: ${title}.\\n${text}`);\n return RnBugfender.sendUserFeedback(title, text);\n }\n\n /**\n * Set a device associated key-value pair. [Learn more](https://bugfender.com/blog/associated-device-information/).\n *\n * @param key Key identifier.\n * @param value Value.\n */\n public setDeviceKey(key: string, value: DeviceKeyValue): void {\n this.printToConsole.info(`Device key \"${key}\" set to \"${value}\"`);\n\n if (typeof value === 'boolean') {\n RnBugfender.setDeviceBoolean(key, value);\n } else if (typeof value === 'string') {\n RnBugfender.setDeviceString(key, value);\n } else {\n // typeof value === 'number'\n if (Number.isInteger(value)) {\n RnBugfender.setDeviceInteger(key, value);\n } else {\n RnBugfender.setDeviceFloat(key, value);\n }\n }\n }\n\n /**\n * Synchronizes all logs and issues with the server once, regardless if this device is enabled or not.\n *\n * Logs and issues are synchronized only once. After that, the logs are again sent according to the enabled flag\n * in the Bugfender Console.\n */\n public forceSendOnce(): void {\n this.printToConsole.info(`Force send once`);\n RnBugfender.forceSendOnce();\n }\n\n public setForceEnabled(enabled: boolean): void {\n this.printToConsole.info(`Set force enabled set to ${enabled}`);\n RnBugfender.setForceEnabled(enabled);\n }\n}\n\nexport {\n BugfenderClass, RnBugfender\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;AACA;;;;AAEA,MAAMA,aAAa,GAChB,kFAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,WAAW,GAAGC,0BAAA,CAAcD,WAAd,GAChBC,0BAAA,CAAcD,WADE,GAEhB,IAAIE,KAAJ,CACA,EADA,EAEA;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUT,aAAV,CAAN;EACD;;AAHH,CAFA,CAFJ;;;AAWA,MAAMU,cAAN,CAAgD;EAAA;IAAA,gDAE5C,KAAKC,OAAO,CAAC,4BAAD,CAAP,CAAsCC,sBAA3C,EAAmEC,MAAnE,CAF4C;;IAAA,wCAGrB,IAAIC,sBAAJ,CAAmBC,MAAM,CAACC,OAA1B,CAHqB;;IAAA,oCAIb,IAAIC,sBAAJ,EAJa;;IAAA,qCAKxB,KALwB;EAAA;;EAO7B,MAAJC,IAAI,CAACC,OAAD,EAAsC;IACrD,IAAI,CAAC,KAAKC,WAAV,EAAuB;MACrB,MAAMC,gBAAgB,GAAG,KAAKC,UAAL,CAAgBJ,IAAhB,CAAqBC,OAArB,CAAzB,CADqB,CAGrB;;MACA,IAAI,OAAOA,OAAO,CAACI,UAAf,KAA8B,WAAlC,EAA+C;QAC7ClB,WAAW,CAACmB,kBAAZ,CAA+BL,OAAO,CAACI,UAA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IAApC,CAAP;EACD;EAED;AACF;AACA;AACA;AACA;AACA;;;EACSI,YAAY,CAACd,GAAD,EAAchB,KAAd,EAA2C;IAC5D,KAAKzB,cAAL,CAAoBsC,IAApB,CAA0B,eAAcG,GAAI,aAAYhB,KAAM,GAA9D;;IAEA,IAAI,OAAOA,KAAP,KAAiB,SAArB,EAAgC;MAC9BpD,WAAW,CAACmF,gBAAZ,CAA6Bf,GAA7B,EAAkChB,KAAlC;IACD,CAFD,MAEO,IAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;MACpCpD,WAAW,CAACoF,eAAZ,CAA4BhB,GAA5B,EAAiChB,KAAjC;IACD,CAFM,MAEA;MACL;MACA,IAAIiC,MAAM,CAACC,SAAP,CAAiBlC,KAAjB,CAAJ,EAA6B;QAC3BpD,WAAW,CAACuF,gBAAZ,CAA6BnB,GAA7B,EAAkChB,KAAlC;MACD,CAFD,MAEO;QACLpD,WAAW,CAACwF,cAAZ,CAA2BpB,GAA3B,EAAgChB,KAAhC;MACD;IACF;EACF;EAED;AACF;AACA;AACA;AACA;AACA;;;EACSqC,aAAa,GAAS;IAC3B,KAAK9D,cAAL,CAAoBsC,IAApB,CAA0B,iBAA1B;IACAjE,WAAW,CAACyF,aAAZ;EACD;;EAEMC,eAAe,CAACC,OAAD,EAAyB;IAC7C,KAAKhE,cAAL,CAAoBsC,IAApB,CAA0B,4BAA2B0B,OAAQ,EAA7D;IACA3F,WAAW,CAAC0F,eAAZ,CAA4BC,OAA5B;EACD;;AA7U6C"}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.Bugfender = void 0;
|
|
|
7
7
|
Object.defineProperty(exports, "LogLevel", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function () {
|
|
10
|
-
return
|
|
10
|
+
return _common.LogLevel;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "SDKOptionsBuilder", {
|
|
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "SDKOptionsBuilder", {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _common = require("@bugfender/common");
|
|
21
21
|
|
|
22
22
|
var _sdkOptions = require("./types/sdk-options");
|
|
23
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Bugfender","BugfenderClass"],"sources":["index.tsx"],"sourcesContent":["import { LogLevel } from '@bugfender/common';\nimport { SDKOptionsBuilder } from './types/sdk-options';\nimport { BugfenderClass } from './bugfender';\n\nconst Bugfender = new BugfenderClass();\n\nexport { Bugfender, LogLevel, SDKOptionsBuilder };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA,MAAMA,SAAS,GAAG,IAAIC,yBAAJ,EAAlB"}
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "Bugfender", {
|
|
|
12
12
|
Object.defineProperty(exports, "LogLevel", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return
|
|
15
|
+
return _common.LogLevel;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "SDKOptionsBuilder", {
|
|
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "SDKOptionsBuilder", {
|
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _common = require("@bugfender/common");
|
|
26
26
|
|
|
27
27
|
var _sdkOptions = require("./types/sdk-options");
|
|
28
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.web.tsx"],"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.web.tsx"],"sourcesContent":["import { LogLevel } from '@bugfender/common';\nimport { SDKOptionsBuilder } from './types/sdk-options';\nimport { Bugfender } from '@bugfender/sdk';\n\nexport { Bugfender, LogLevel, SDKOptionsBuilder };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA"}
|