@bugfender/rn-bugfender 2.0.0 → 2.1.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/README.md +16 -1
- package/android/src/main/java/com/bugfender/react/RnBugfenderModule.java +2 -2
- package/lib/commonjs/bugfender.js +21 -13
- package/lib/commonjs/bugfender.js.map +1 -1
- package/lib/commonjs/sdk-options.js +1 -0
- package/lib/commonjs/sdk-options.js.map +1 -1
- package/lib/commonjs/types/sdk-options.js +3 -2
- package/lib/commonjs/types/sdk-options.js.map +1 -1
- package/lib/module/bugfender.js +24 -15
- package/lib/module/bugfender.js.map +1 -1
- package/lib/module/sdk-options.js +1 -0
- package/lib/module/sdk-options.js.map +1 -1
- package/lib/module/types/sdk-options.js +3 -2
- package/lib/module/types/sdk-options.js.map +1 -1
- package/lib/typescript/bugfender.d.ts +1 -0
- package/lib/typescript/types/sdk-options.d.ts +2 -0
- package/package.json +2 -2
- package/src/bugfender.ts +29 -21
- package/src/sdk-options.ts +1 -0
- package/src/types/sdk-options.ts +3 -0
- package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -18
- package/android/.idea/jarRepositories.xml +0 -40
- package/android/.idea/misc.xml +0 -8
- package/android/.idea/runConfigurations.xml +0 -10
- package/android/.idea/uiDesigner.xml +0 -124
- package/android/.idea/vcs.xml +0 -6
- package/ios/RnBugfender.xcodeproj/project.xcworkspace/xcuserdata/fj.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RnBugfender.xcodeproj/xcuserdata/fj.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
package/README.md
CHANGED
|
@@ -47,6 +47,20 @@ Download the latest release from [Github](https://github.com/bugfender/Bugfender
|
|
|
47
47
|
|
|
48
48
|
* Make sure you have linked `SystemConfiguration.framework`, `Security.framework`, `MobileCoreServices.framework` and `libc++.tbd` as well.
|
|
49
49
|
|
|
50
|
+
## Upgrading from version 1.x
|
|
51
|
+
After updating to version 2.x from version 1.x you should perform the following extra steps:
|
|
52
|
+
### Android
|
|
53
|
+
Open `MainApplication` class inside `android/app/src/main/java/com.<your_app>/` folder and remove any references to `com.bugfender.react.RNBugfenderPackage`
|
|
54
|
+
### iOS
|
|
55
|
+
Open `Podfile` inside `ios` folder and remove the following line:
|
|
56
|
+
```
|
|
57
|
+
pod 'RNBugfender', :path => '../node_modules/@bugfender/rn-bugfender'
|
|
58
|
+
```
|
|
59
|
+
and then execute the following command under `ios` folder:
|
|
60
|
+
```
|
|
61
|
+
pod deintegrate && pod install
|
|
62
|
+
```
|
|
63
|
+
|
|
50
64
|
## RNBugfender Usage
|
|
51
65
|
```typescript
|
|
52
66
|
import { Bugfender, LogLevel } from '@bugfender/rn-bugfender';
|
|
@@ -61,6 +75,7 @@ Bugfender.init({
|
|
|
61
75
|
// logUIEvents: true,
|
|
62
76
|
// registerErrorHandler: true,
|
|
63
77
|
// deviceName: 'Anonymous',
|
|
78
|
+
// maximumLocalStorageSize: 5 * 1024 * 1024, // Native specific
|
|
64
79
|
// enableLogcatLogging: false, // Android specific
|
|
65
80
|
// logBrowserEvents: true, // Web specific
|
|
66
81
|
// build: '42', // Web specific
|
|
@@ -150,7 +165,7 @@ Bugfender.forceSendOnce();
|
|
|
150
165
|
The changelog of the Bugfender Web SDK can be found in ReleaseNotes under the [react-native](https://bugfender.releasenotes.io/tag/react-native) tag. For all the Bugfender product changes please visit the general release notes.
|
|
151
166
|
|
|
152
167
|
### 2.x Breaking Changes
|
|
153
|
-
The
|
|
168
|
+
The React Native SDK API has changed in order be unified with [Bugfender Web SDK](https://www.npmjs.com/package/@bugfender/sdk):
|
|
154
169
|
* The following methods have been removed and replaced with init method attributes:
|
|
155
170
|
* `setApiUrl`
|
|
156
171
|
* `setBaseUrl`
|
|
@@ -60,8 +60,8 @@ public class RnBugfenderModule extends ReactContextBaseJavaModule implements Act
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
@ReactMethod
|
|
63
|
-
public void setMaximumLocalStorageSize(Integer
|
|
64
|
-
Bugfender.setMaximumLocalStorageSize(
|
|
63
|
+
public void setMaximumLocalStorageSize(Integer sizeInBytes) {
|
|
64
|
+
Bugfender.setMaximumLocalStorageSize(sizeInBytes);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
@ReactMethod
|
|
@@ -13,8 +13,6 @@ var _stringFormatter = require("./string-formatter");
|
|
|
13
13
|
|
|
14
14
|
var _log = require("./types/log");
|
|
15
15
|
|
|
16
|
-
var _overrideConsoleMethods = require("./override-console-methods");
|
|
17
|
-
|
|
18
16
|
var _printToConsole = require("./print-to-console");
|
|
19
17
|
|
|
20
18
|
var _sdkOptions = require("./sdk-options");
|
|
@@ -37,7 +35,7 @@ class BugfenderClass {
|
|
|
37
35
|
constructor() {
|
|
38
36
|
_defineProperty(this, "stringFormatter", new _stringFormatter.StringFormatter());
|
|
39
37
|
|
|
40
|
-
_defineProperty(this, "overrideConsoleMethods", new
|
|
38
|
+
_defineProperty(this, "overrideConsoleMethods", new (require('./override-console-methods').OverrideConsoleMethods)(window));
|
|
41
39
|
|
|
42
40
|
_defineProperty(this, "printToConsole", new _printToConsole.PrintToConsole(global.console));
|
|
43
41
|
|
|
@@ -48,16 +46,13 @@ class BugfenderClass {
|
|
|
48
46
|
|
|
49
47
|
async init(options) {
|
|
50
48
|
if (!this.initialized) {
|
|
51
|
-
var _validatedOptions$pri;
|
|
49
|
+
var _validatedOptions$pri, _validatedOptions$pri2;
|
|
52
50
|
|
|
53
|
-
const validatedOptions = this.sdkOptions.init(options); //
|
|
51
|
+
const validatedOptions = this.sdkOptions.init(options); // region before init
|
|
54
52
|
|
|
55
53
|
if (typeof options.deviceName !== 'undefined') {
|
|
56
54
|
RnBugfender.overrideDeviceName(options.deviceName);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
_reactNative.Platform.OS === 'ios' ? RnBugfender.activateLogger(validatedOptions.appKey) : RnBugfender.init(validatedOptions.appKey, false);
|
|
55
|
+
}
|
|
61
56
|
|
|
62
57
|
if (typeof validatedOptions.apiURL !== 'undefined') {
|
|
63
58
|
RnBugfender.setApiUrl(validatedOptions.apiURL);
|
|
@@ -65,8 +60,19 @@ class BugfenderClass {
|
|
|
65
60
|
|
|
66
61
|
if (typeof validatedOptions.baseURL !== 'undefined') {
|
|
67
62
|
RnBugfender.setBaseUrl(validatedOptions.baseURL);
|
|
63
|
+
} // endregion before init
|
|
64
|
+
// region init
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
_reactNative.Platform.OS === 'ios' ? RnBugfender.activateLogger(validatedOptions.appKey) : RnBugfender.init(validatedOptions.appKey, (_validatedOptions$pri = validatedOptions.printToConsole) !== null && _validatedOptions$pri !== void 0 ? _validatedOptions$pri : false);
|
|
68
|
+
|
|
69
|
+
if (validatedOptions.overrideConsoleMethods) {
|
|
70
|
+
this.overrideConsoleMethods.init(this.stringFormatter);
|
|
68
71
|
}
|
|
69
72
|
|
|
73
|
+
this.printToConsole.init((_validatedOptions$pri2 = validatedOptions.printToConsole) !== null && _validatedOptions$pri2 !== void 0 ? _validatedOptions$pri2 : true); // endregion init
|
|
74
|
+
// region after init
|
|
75
|
+
|
|
70
76
|
if (validatedOptions.enableLogcatLogging) {
|
|
71
77
|
RnBugfender.enableLogcatLogging();
|
|
72
78
|
}
|
|
@@ -79,11 +85,8 @@ class BugfenderClass {
|
|
|
79
85
|
RnBugfender.enableCrashReporting();
|
|
80
86
|
}
|
|
81
87
|
|
|
82
|
-
|
|
83
|
-
this.overrideConsoleMethods.init(this.stringFormatter);
|
|
84
|
-
}
|
|
88
|
+
RnBugfender.setMaximumLocalStorageSize(validatedOptions.maximumLocalStorageSize); // endregion after init
|
|
85
89
|
|
|
86
|
-
this.printToConsole.init((_validatedOptions$pri = validatedOptions.printToConsole) !== null && _validatedOptions$pri !== void 0 ? _validatedOptions$pri : true);
|
|
87
90
|
this.initialized = true;
|
|
88
91
|
}
|
|
89
92
|
}
|
|
@@ -332,6 +335,11 @@ class BugfenderClass {
|
|
|
332
335
|
RnBugfender.forceSendOnce();
|
|
333
336
|
}
|
|
334
337
|
|
|
338
|
+
setForceEnabled(enabled) {
|
|
339
|
+
this.printToConsole.info(`Set force enabled set to ${enabled}`);
|
|
340
|
+
RnBugfender.setForceEnabled(enabled);
|
|
341
|
+
}
|
|
342
|
+
|
|
335
343
|
}
|
|
336
344
|
|
|
337
345
|
exports.BugfenderClass = BugfenderClass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["bugfender.ts"],"names":["LINKING_ERROR","Platform","select","ios","default","RnBugfender","NativeModules","Proxy","get","Error","BugfenderClass","StringFormatter","OverrideConsoleMethods","window","PrintToConsole","global","console","SDKOptions","init","options","initialized","validatedOptions","sdkOptions","deviceName","overrideDeviceName","OS","activateLogger","appKey","apiURL","setApiUrl","baseURL","setBaseUrl","enableLogcatLogging","logUIEvents","enableUIEventLogging","registerErrorHandler","enableCrashReporting","overrideConsoleMethods","stringFormatter","printToConsole","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"],"mappings":";;;;;;;AAAA;;AAGA;;AAGA;;AACA;;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,oDAEc,IAAIC,8CAAJ,CAA2BC,MAA3B,CAFd;;AAAA,4CAGM,IAAIC,8BAAJ,CAAmBC,MAAM,CAACC,OAA1B,CAHN;;AAAA,wCAIc,IAAIC,sBAAJ,EAJd;;AAAA,yCAKG,KALH;AAAA;;AAOF,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;AAC7ClB,QAAAA,WA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,EAApD;AACA,WAAO7E,WAAW,CAAC+E,SAAZ,CAAsBnC,KAAtB,EAA6BiC,IAA7B,CAAP;AACD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACSG,EAAAA,gBAAgB,CAACpC,KAAD,EAAgBiC,IAAhB,EAA+C;AACpE,SAAK3C,cAAL,CAAoB8B,IAApB,CAA0B,kBAAiBpB,KAAM,MAAKiC,IAAK,EAA3D;AACA,WAAO7E,WAAW,CAACgF,gBAAZ,CAA6BpC,KAA7B,EAAoCiC,IAApC,CAAP;AACD;AAED;AACF;AACA;AACA;AACA;AACA;;;AACSI,EAAAA,YAAY,CAACd,GAAD,EAAchB,KAAd,EAA2C;AAC5D,SAAKjB,cAAL,CAAoB8B,IAApB,CAA0B,eAAcG,GAAI,aAAYhB,KAAM,GAA9D;;AAEA,QAAI,OAAOA,KAAP,KAAiB,SAArB,EAAgC;AAC9BnD,MAAAA,WAAW,CAACkF,gBAAZ,CAA6Bf,GAA7B,EAAkChB,KAAlC;AACD,KAFD,MAEO,IAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;AACpCnD,MAAAA,WAAW,CAACmF,eAAZ,CAA4BhB,GAA5B,EAAiChB,KAAjC;AACD,KAFM,MAEA;AACL;AACA,UAAIiC,MAAM,CAACC,SAAP,CAAiBlC,KAAjB,CAAJ,EAA6B;AAC3BnD,QAAAA,WAAW,CAACsF,gBAAZ,CAA6BnB,GAA7B,EAAkChB,KAAlC;AACD,OAFD,MAEO;AACLnD,QAAAA,WAAW,CAACuF,cAAZ,CAA2BpB,GAA3B,EAAgChB,KAAhC;AACD;AACF;AACF;AAED;AACF;AACA;AACA;AACA;AACA;;;AACSqC,EAAAA,aAAa,GAAS;AAC3B,SAAKtD,cAAL,CAAoB8B,IAApB,CAA0B,iBAA1B;AACAhE,IAAAA,WAAW,CAACwF,aAAZ;AACD;;AArUkB","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 { OverrideConsoleMethods } from \"./override-console-methods\";\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 = new 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 // Needs to be executed prior initialization\n if (typeof options.deviceName !== 'undefined') {\n RnBugfender.overrideDeviceName(options.deviceName);\n }\n\n // Library initialization\n Platform.OS === 'ios'\n ? RnBugfender.activateLogger(validatedOptions.appKey)\n : RnBugfender.init(validatedOptions.appKey, false);\n\n if (typeof validatedOptions.apiURL !== 'undefined') {\n RnBugfender.setApiUrl(validatedOptions.apiURL);\n }\n\n if (typeof validatedOptions.baseURL !== 'undefined') {\n RnBugfender.setBaseUrl(validatedOptions.baseURL);\n }\n\n if (validatedOptions.enableLogcatLogging) {\n RnBugfender.enableLogcatLogging();\n }\n\n if (validatedOptions.logUIEvents) {\n RnBugfender.enableUIEventLogging();\n }\n\n if (validatedOptions.registerErrorHandler) {\n RnBugfender.enableCrashReporting();\n }\n\n if (validatedOptions.overrideConsoleMethods) {\n this.overrideConsoleMethods.init(this.stringFormatter);\n }\n\n this.printToConsole.init(validatedOptions.printToConsole ?? true);\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\nexport {\n BugfenderClass, RnBugfender\n}\n"]}
|
|
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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A0B,iBAA1B;AACAnE,IAAAA,WAAW,CAAC2F,aAAZ;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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["sdk-options.ts"],"names":["SDKOptions","appKey","apiURL","baseURL","overrideConsoleMethods","printToConsole","logBrowserEvents","logUIEvents","registerErrorHandler","version","init","options","validate","enableLogcatLogging","urlValidator","RegExp","Object","entries","rules","forEach","key","value","rule","Error","includes","test"],"mappings":";;;;;;;AACA;;;;AAEO,MAAMA,UAAN,CAAiB;AAAA;AAAA,mCACJ;AAChBC,MAAAA,MAAM,EAAE,CAAC,UAAD,EAAa,QAAb,CADQ;AAEhBC,MAAAA,MAAM,EAAE,CAAC,QAAD,EAAW,KAAX,CAFQ;AAGhBC,MAAAA,OAAO,EAAE,CAAC,QAAD,EAAW,KAAX,CAHO;AAIhBC,MAAAA,sBAAsB,EAAE,CAAC,SAAD,CAJR;AAKhBC,MAAAA,cAAc,EAAE,CAAC,SAAD,CALA;AAMhBC,MAAAA,gBAAgB,EAAE,CAAC,SAAD,CANF;AAOhBC,MAAAA,WAAW,EAAE,CAAC,SAAD,CAPG;AAQhBC,MAAAA,oBAAoB,EAAE,CAAC,SAAD,CARN;AAShBC,MAAAA,OAAO,EAAE,CAAC,QAAD;AATO,KADI;AAAA;;AAafC,EAAAA,IAAI,CAACC,OAAD,EAAoC;AAC7C;AACA,SAAKC,QAAL,CAAcD,OAAd;AAEAA,IAAAA,OAAO,GAAG,EAAE,GAAGA;AAAL,KAAV;AACA,8CAA0BA,OAA1B,EAL6C,CAO7C;;AACA,WAAO;AACLP,MAAAA,sBAAsB,EAAE,IADnB;AAELC,MAAAA,cAAc,EAAE,IAFX;AAGLE,MAAAA,WAAW,EAAE,IAHR;AAILC,MAAAA,oBAAoB,EAAE,IAJjB;AAKLK,MAAAA,mBAAmB,EAAE,KALhB;
|
|
1
|
+
{"version":3,"sources":["sdk-options.ts"],"names":["SDKOptions","appKey","apiURL","baseURL","overrideConsoleMethods","printToConsole","logBrowserEvents","logUIEvents","registerErrorHandler","version","init","options","validate","enableLogcatLogging","maximumLocalStorageSize","urlValidator","RegExp","Object","entries","rules","forEach","key","value","rule","Error","includes","test"],"mappings":";;;;;;;AACA;;;;AAEO,MAAMA,UAAN,CAAiB;AAAA;AAAA,mCACJ;AAChBC,MAAAA,MAAM,EAAE,CAAC,UAAD,EAAa,QAAb,CADQ;AAEhBC,MAAAA,MAAM,EAAE,CAAC,QAAD,EAAW,KAAX,CAFQ;AAGhBC,MAAAA,OAAO,EAAE,CAAC,QAAD,EAAW,KAAX,CAHO;AAIhBC,MAAAA,sBAAsB,EAAE,CAAC,SAAD,CAJR;AAKhBC,MAAAA,cAAc,EAAE,CAAC,SAAD,CALA;AAMhBC,MAAAA,gBAAgB,EAAE,CAAC,SAAD,CANF;AAOhBC,MAAAA,WAAW,EAAE,CAAC,SAAD,CAPG;AAQhBC,MAAAA,oBAAoB,EAAE,CAAC,SAAD,CARN;AAShBC,MAAAA,OAAO,EAAE,CAAC,QAAD;AATO,KADI;AAAA;;AAafC,EAAAA,IAAI,CAACC,OAAD,EAAoC;AAC7C;AACA,SAAKC,QAAL,CAAcD,OAAd;AAEAA,IAAAA,OAAO,GAAG,EAAE,GAAGA;AAAL,KAAV;AACA,8CAA0BA,OAA1B,EAL6C,CAO7C;;AACA,WAAO;AACLP,MAAAA,sBAAsB,EAAE,IADnB;AAELC,MAAAA,cAAc,EAAE,IAFX;AAGLE,MAAAA,WAAW,EAAE,IAHR;AAILC,MAAAA,oBAAoB,EAAE,IAJjB;AAKLK,MAAAA,mBAAmB,EAAE,KALhB;AAMLC,MAAAA,uBAAuB,EAAE,IAAI,IAAJ,GAAW,IAN/B;AAOL,SAAGH;AAPE,KAAP;AASD;;AAESC,EAAAA,QAAQ,CAACD,OAAD,EAA6B;AAC7C,UAAMI,YAAY,GAAG,IAAIC,MAAJ,CAAW,iBAAX,CAArB;AAEAC,IAAAA,MAAM,CAACC,OAAP,CAAe,KAAKC,KAApB,EAA2BC,OAA3B,CAAmC,QAAkB;AAAA,UAAjB,CAACC,GAAD,EAAMF,KAAN,CAAiB;AACnD;AACA,YAAMG,KAAK,GAAGX,OAAO,CAACU,GAAD,CAArB;AAEAF,MAAAA,KAAK,CAACC,OAAN,CAAcG,IAAI,IAAI;AACpB,YAAIA,IAAI,KAAK,UAAb,EAAyB;AACvB,cAAI,OAAOD,KAAP,KAAiB,WAArB,EAAkC;AAChC,kBAAM,IAAIE,KAAJ,CAAW,uBAAsBH,GAAI,yBAArC,CAAN;AACD;AACF,SAJD,MAIO,IAAIE,IAAI,KAAK,QAAb,EAAuB;AAC5B,cAAI,CAAC,CAAC,QAAD,EAAW,WAAX,EAAwBE,QAAxB,CAAiC,OAAOH,KAAxC,CAAL,EAAqD;AACnD,kBAAM,IAAIE,KAAJ,CAAW,IAAGH,GAAI,4BAAlB,CAAN;AACD;AACF,SAJM,MAIA,IAAIE,IAAI,KAAK,KAAb,EAAoB;AACzB,cAAI,OAAOD,KAAP,KAAiB,WAAjB,IAAgC,CAACP,YAAY,CAACW,IAAb,CAAkBJ,KAAlB,CAArC,EAA+D;AAC7D,kBAAM,IAAIE,KAAJ,CAAW,IAAGH,GAAI,+BAAlB,CAAN;AACD;AACF,SAJM,MAIA,IAAIE,IAAI,KAAK,SAAb,EAAwB;AAC7B,cAAI,CAAC,CAAC,SAAD,EAAY,WAAZ,EAAyBE,QAAzB,CAAkC,OAAOH,KAAzC,CAAL,EAAsD;AACpD,kBAAM,IAAIE,KAAJ,CAAW,IAAGH,GAAI,6BAAlB,CAAN;AACD;AACF;AACF,OAlBD;AAmBD,KAvBD;AAwBD;;AA3DqB","sourcesContent":["import type {ISDKOptions} from \"./types/sdk-options\";\nimport {removeUndefinedAttributes} from \"./utilities\";\n\nexport class SDKOptions {\n protected rules = {\n appKey: ['required', 'string'],\n apiURL: ['string', 'url'],\n baseURL: ['string', 'url'],\n overrideConsoleMethods: ['boolean'],\n printToConsole: ['boolean'],\n logBrowserEvents: ['boolean'],\n logUIEvents: ['boolean'],\n registerErrorHandler: ['boolean'],\n version: ['string'],\n };\n\n public init(options: ISDKOptions): ISDKOptions {\n // Validate user provided options\n this.validate(options);\n\n options = { ...options };\n removeUndefinedAttributes(options);\n\n // Set default values if needed\n return {\n overrideConsoleMethods: true,\n printToConsole: true,\n logUIEvents: true,\n registerErrorHandler: true,\n enableLogcatLogging: false,\n maximumLocalStorageSize: 5 * 1024 * 1024,\n ...options,\n };\n }\n\n protected validate(options: ISDKOptions): void {\n const urlValidator = new RegExp(/^http(s)?:\\/\\//i);\n\n Object.entries(this.rules).forEach(([key, rules]) => {\n // @ts-ignore\n const value = options[key];\n\n rules.forEach(rule => {\n if (rule === 'required') {\n if (typeof value === 'undefined') {\n throw new Error(`Bugfender requires '${key}' option to initialize.`)\n }\n } else if (rule === 'string') {\n if (!['string', 'undefined'].includes(typeof value)) {\n throw new Error(`'${key}' option must be a string.`);\n }\n } else if (rule === 'url') {\n if (typeof value !== 'undefined' && !urlValidator.test(value)) {\n throw new Error(`'${key}' option must be a valid URL.`);\n }\n } else if (rule === 'boolean') {\n if (!['boolean', 'undefined'].includes(typeof value)) {\n throw new Error(`'${key}' option must be a boolean.`);\n }\n }\n })\n });\n }\n}\n"]}
|
|
@@ -31,7 +31,7 @@ class SDKOptionsBuilder {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
build() {
|
|
34
|
-
var _this$webOptions, _this$webOptions2, _this$webOptions3, _this$nativeOptions;
|
|
34
|
+
var _this$webOptions, _this$webOptions2, _this$webOptions3, _this$nativeOptions, _this$nativeOptions2;
|
|
35
35
|
|
|
36
36
|
const options = {
|
|
37
37
|
appKey: this.commonOptions.appKey,
|
|
@@ -45,7 +45,8 @@ class SDKOptionsBuilder {
|
|
|
45
45
|
logBrowserEvents: (_this$webOptions = this.webOptions) === null || _this$webOptions === void 0 ? void 0 : _this$webOptions.logBrowserEvents,
|
|
46
46
|
build: (_this$webOptions2 = this.webOptions) === null || _this$webOptions2 === void 0 ? void 0 : _this$webOptions2.build,
|
|
47
47
|
version: (_this$webOptions3 = this.webOptions) === null || _this$webOptions3 === void 0 ? void 0 : _this$webOptions3.version,
|
|
48
|
-
enableLogcatLogging: (_this$nativeOptions = this.nativeOptions) === null || _this$nativeOptions === void 0 ? void 0 : _this$nativeOptions.enableLogcatLogging
|
|
48
|
+
enableLogcatLogging: (_this$nativeOptions = this.nativeOptions) === null || _this$nativeOptions === void 0 ? void 0 : _this$nativeOptions.enableLogcatLogging,
|
|
49
|
+
maximumLocalStorageSize: (_this$nativeOptions2 = this.nativeOptions) === null || _this$nativeOptions2 === void 0 ? void 0 : _this$nativeOptions2.maximumLocalStorageSize
|
|
49
50
|
};
|
|
50
51
|
(0, _utilities.removeUndefinedAttributes)(options);
|
|
51
52
|
return options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["sdk-options.ts"],"names":["SDKOptionsBuilder","constructor","commonOptions","native","nativeOptions","web","webOptions","build","options","appKey","apiURL","baseURL","overrideConsoleMethods","printToConsole","logUIEvents","registerErrorHandler","deviceName","logBrowserEvents","version","enableLogcatLogging"],"mappings":";;;;;;;AAAA;;;;
|
|
1
|
+
{"version":3,"sources":["sdk-options.ts"],"names":["SDKOptionsBuilder","constructor","commonOptions","native","nativeOptions","web","webOptions","build","options","appKey","apiURL","baseURL","overrideConsoleMethods","printToConsole","logUIEvents","registerErrorHandler","deviceName","logBrowserEvents","version","enableLogcatLogging","maximumLocalStorageSize"],"mappings":";;;;;;;AAAA;;;;AAuCO,MAAMA,iBAAN,CAAwB;AAK7BC,EAAAA,WAAW,CAACC,aAAD,EAAmC;AAAA;;AAAA;;AAAA;;AAC5C,SAAKA,aAAL,GAAqBA,aAArB;AACD;;AAEMC,EAAAA,MAAM,CAACC,aAAD,EAAsD;AACjE,SAAKA,aAAL,GAAqBA,aAArB;AACA,WAAO,IAAP;AACD;;AAEMC,EAAAA,GAAG,CAACC,UAAD,EAAgD;AACxD,SAAKA,UAAL,GAAkBA,UAAlB;AACA,WAAO,IAAP;AACD;;AAEMC,EAAAA,KAAK,GAAgB;AAAA;;AAC1B,UAAMC,OAAoB,GAAG;AAC3BC,MAAAA,MAAM,EAAE,KAAKP,aAAL,CAAmBO,MADA;AAE3BC,MAAAA,MAAM,EAAE,KAAKR,aAAL,CAAmBQ,MAFA;AAG3BC,MAAAA,OAAO,EAAE,KAAKT,aAAL,CAAmBS,OAHD;AAI3BC,MAAAA,sBAAsB,EAAE,KAAKV,aAAL,CAAmBU,sBAJhB;AAK3BC,MAAAA,cAAc,EAAE,KAAKX,aAAL,CAAmBW,cALR;AAM3BC,MAAAA,WAAW,EAAE,KAAKZ,aAAL,CAAmBY,WANL;AAO3BC,MAAAA,oBAAoB,EAAE,KAAKb,aAAL,CAAmBa,oBAPd;AAQ3BC,MAAAA,UAAU,EAAE,KAAKd,aAAL,CAAmBc,UARJ;AAS3BC,MAAAA,gBAAgB,sBAAE,KAAKX,UAAP,qDAAE,iBAAiBW,gBATR;AAU3BV,MAAAA,KAAK,uBAAE,KAAKD,UAAP,sDAAE,kBAAiBC,KAVG;AAW3BW,MAAAA,OAAO,uBAAE,KAAKZ,UAAP,sDAAE,kBAAiBY,OAXC;AAY3BC,MAAAA,mBAAmB,yBAAE,KAAKf,aAAP,wDAAE,oBAAoBe,mBAZd;AAa3BC,MAAAA,uBAAuB,0BAAE,KAAKhB,aAAP,yDAAE,qBAAoBgB;AAblB,KAA7B;AAgBA,8CAA0BZ,OAA1B;AAEA,WAAOA,OAAP;AACD;;AAvC4B","sourcesContent":["import {removeUndefinedAttributes} from \"../utilities\";\n\nexport interface ISDKCommonOptions {\n /** The app key to log into */\n appKey: string;\n /** Base URL to Bugfender API */\n apiURL?: string;\n /** Base URL to Bugfender web dashboard */\n baseURL?: string;\n /** Override default `window.console` so it also logs to Bugfender. Defaults to `true`. */\n overrideConsoleMethods?: boolean;\n /** Print also with `window.console` when Bugfender logging methods are called. Defaults to `true`. */\n printToConsole?: boolean;\n /** Register a handler for most common UI events to report them to Bugfender. Defaults to `true`. */\n logUIEvents?: boolean;\n /** Register error handler for uncaught errors that reports a crash to Bugfender. Defaults to `true`. */\n registerErrorHandler?: boolean;\n /** Sets the name for the device. If the Device Name is not set, then the platform standard device name will be automatically sent */\n deviceName?: string;\n}\n\nexport interface ISDKWebOptions {\n /** Register a handler for most common browser events to report them to Bugfender (Web specific). Defaults to `true`. */\n logBrowserEvents?: boolean;\n /** App build identifier (Web specific) */\n build?: string;\n /** App version identifier (Web specific) */\n version?: string;\n}\n\nexport interface ISDKNativeOptions {\n /** Set the maximum size to store local log files in bytes (Native specific). Range accepted is from 1 MB to 50 MB. Defaults to 5 MB. **/\n maximumLocalStorageSize?: number;\n /** Logs all logs written via Logcat (Android specific). Defaults to `false`. */\n enableLogcatLogging?: boolean;\n}\n\nexport type ISDKOptions = ISDKCommonOptions & ISDKNativeOptions & ISDKWebOptions;\n\nexport class SDKOptionsBuilder {\n private commonOptions: ISDKCommonOptions;\n private nativeOptions?: ISDKNativeOptions;\n private webOptions?: ISDKWebOptions;\n\n constructor(commonOptions: ISDKCommonOptions) {\n this.commonOptions = commonOptions;\n }\n\n public native(nativeOptions: ISDKNativeOptions): SDKOptionsBuilder {\n this.nativeOptions = nativeOptions;\n return this;\n }\n\n public web(webOptions: ISDKWebOptions): SDKOptionsBuilder {\n this.webOptions = webOptions;\n return this;\n }\n\n public build(): ISDKOptions {\n const options: ISDKOptions = {\n appKey: this.commonOptions.appKey,\n apiURL: this.commonOptions.apiURL,\n baseURL: this.commonOptions.baseURL,\n overrideConsoleMethods: this.commonOptions.overrideConsoleMethods,\n printToConsole: this.commonOptions.printToConsole,\n logUIEvents: this.commonOptions.logUIEvents,\n registerErrorHandler: this.commonOptions.registerErrorHandler,\n deviceName: this.commonOptions.deviceName,\n logBrowserEvents: this.webOptions?.logBrowserEvents,\n build: this.webOptions?.build,\n version: this.webOptions?.version,\n enableLogcatLogging: this.nativeOptions?.enableLogcatLogging,\n maximumLocalStorageSize: this.nativeOptions?.maximumLocalStorageSize,\n };\n\n removeUndefinedAttributes(options);\n\n return options;\n }\n}\n"]}
|
package/lib/module/bugfender.js
CHANGED
|
@@ -3,10 +3,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
3
3
|
import { NativeModules, Platform } from 'react-native';
|
|
4
4
|
import { DefaultUserFeedbackOptions } from './user-feedback';
|
|
5
5
|
import { StringFormatter } from './string-formatter';
|
|
6
|
-
import { LogLevel } from
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { SDKOptions } from "./sdk-options";
|
|
6
|
+
import { LogLevel } from './types/log';
|
|
7
|
+
import { PrintToConsole } from './print-to-console';
|
|
8
|
+
import { SDKOptions } from './sdk-options';
|
|
10
9
|
const LINKING_ERROR = `The package '@bugfender/rn-bugfender' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
11
10
|
ios: "- You have run 'pod install'\n",
|
|
12
11
|
default: ''
|
|
@@ -22,7 +21,7 @@ class BugfenderClass {
|
|
|
22
21
|
constructor() {
|
|
23
22
|
_defineProperty(this, "stringFormatter", new StringFormatter());
|
|
24
23
|
|
|
25
|
-
_defineProperty(this, "overrideConsoleMethods", new OverrideConsoleMethods(window));
|
|
24
|
+
_defineProperty(this, "overrideConsoleMethods", new (require('./override-console-methods').OverrideConsoleMethods)(window));
|
|
26
25
|
|
|
27
26
|
_defineProperty(this, "printToConsole", new PrintToConsole(global.console));
|
|
28
27
|
|
|
@@ -33,16 +32,13 @@ class BugfenderClass {
|
|
|
33
32
|
|
|
34
33
|
async init(options) {
|
|
35
34
|
if (!this.initialized) {
|
|
36
|
-
var _validatedOptions$pri;
|
|
35
|
+
var _validatedOptions$pri, _validatedOptions$pri2;
|
|
37
36
|
|
|
38
|
-
const validatedOptions = this.sdkOptions.init(options); //
|
|
37
|
+
const validatedOptions = this.sdkOptions.init(options); // region before init
|
|
39
38
|
|
|
40
39
|
if (typeof options.deviceName !== 'undefined') {
|
|
41
40
|
RnBugfender.overrideDeviceName(options.deviceName);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Platform.OS === 'ios' ? RnBugfender.activateLogger(validatedOptions.appKey) : RnBugfender.init(validatedOptions.appKey, false);
|
|
41
|
+
}
|
|
46
42
|
|
|
47
43
|
if (typeof validatedOptions.apiURL !== 'undefined') {
|
|
48
44
|
RnBugfender.setApiUrl(validatedOptions.apiURL);
|
|
@@ -50,8 +46,19 @@ class BugfenderClass {
|
|
|
50
46
|
|
|
51
47
|
if (typeof validatedOptions.baseURL !== 'undefined') {
|
|
52
48
|
RnBugfender.setBaseUrl(validatedOptions.baseURL);
|
|
49
|
+
} // endregion before init
|
|
50
|
+
// region init
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
Platform.OS === 'ios' ? RnBugfender.activateLogger(validatedOptions.appKey) : RnBugfender.init(validatedOptions.appKey, (_validatedOptions$pri = validatedOptions.printToConsole) !== null && _validatedOptions$pri !== void 0 ? _validatedOptions$pri : false);
|
|
54
|
+
|
|
55
|
+
if (validatedOptions.overrideConsoleMethods) {
|
|
56
|
+
this.overrideConsoleMethods.init(this.stringFormatter);
|
|
53
57
|
}
|
|
54
58
|
|
|
59
|
+
this.printToConsole.init((_validatedOptions$pri2 = validatedOptions.printToConsole) !== null && _validatedOptions$pri2 !== void 0 ? _validatedOptions$pri2 : true); // endregion init
|
|
60
|
+
// region after init
|
|
61
|
+
|
|
55
62
|
if (validatedOptions.enableLogcatLogging) {
|
|
56
63
|
RnBugfender.enableLogcatLogging();
|
|
57
64
|
}
|
|
@@ -64,11 +71,8 @@ class BugfenderClass {
|
|
|
64
71
|
RnBugfender.enableCrashReporting();
|
|
65
72
|
}
|
|
66
73
|
|
|
67
|
-
|
|
68
|
-
this.overrideConsoleMethods.init(this.stringFormatter);
|
|
69
|
-
}
|
|
74
|
+
RnBugfender.setMaximumLocalStorageSize(validatedOptions.maximumLocalStorageSize); // endregion after init
|
|
70
75
|
|
|
71
|
-
this.printToConsole.init((_validatedOptions$pri = validatedOptions.printToConsole) !== null && _validatedOptions$pri !== void 0 ? _validatedOptions$pri : true);
|
|
72
76
|
this.initialized = true;
|
|
73
77
|
}
|
|
74
78
|
}
|
|
@@ -317,6 +321,11 @@ class BugfenderClass {
|
|
|
317
321
|
RnBugfender.forceSendOnce();
|
|
318
322
|
}
|
|
319
323
|
|
|
324
|
+
setForceEnabled(enabled) {
|
|
325
|
+
this.printToConsole.info(`Set force enabled set to ${enabled}`);
|
|
326
|
+
RnBugfender.setForceEnabled(enabled);
|
|
327
|
+
}
|
|
328
|
+
|
|
320
329
|
}
|
|
321
330
|
|
|
322
331
|
export { BugfenderClass, RnBugfender };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["bugfender.ts"],"names":["NativeModules","Platform","DefaultUserFeedbackOptions","StringFormatter","LogLevel","OverrideConsoleMethods","PrintToConsole","SDKOptions","LINKING_ERROR","select","ios","default","RnBugfender","Proxy","get","Error","BugfenderClass","window","global","console","init","options","initialized","validatedOptions","sdkOptions","deviceName","overrideDeviceName","OS","activateLogger","appKey","apiURL","setApiUrl","baseURL","setBaseUrl","enableLogcatLogging","logUIEvents","enableUIEventLogging","registerErrorHandler","enableCrashReporting","overrideConsoleMethods","stringFormatter","printToConsole","getDeviceURL","getDeviceUrl","getSessionURL","getSessionUrl","getUserFeedback","Promise","resolve","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","Debug","tag","text","sendIssue","sendCrash","sendUserFeedback","setDeviceKey","setDeviceBoolean","setDeviceString","Number","isInteger","setDeviceInteger","setDeviceFloat","forceSendOnce"],"mappings":";;AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAGA,SAASC,0BAAT,QAA2C,iBAA3C;AAGA,SAASC,eAAT,QAAgC,oBAAhC;AACA,SAASC,QAAT,QAAyB,aAAzB;AACA,SAASC,s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KgC,IAAK,EAA3D;AACA,WAAOtE,WAAW,CAACyE,gBAAZ,CAA6BnC,KAA7B,EAAoCgC,IAApC,CAAP;AACD;AAED;AACF;AACA;AACA;AACA;AACA;;;AACSI,EAAAA,YAAY,CAACb,GAAD,EAAchB,KAAd,EAA2C;AAC5D,SAAKhB,cAAL,CAAoB6B,IAApB,CAA0B,eAAcG,GAAI,aAAYhB,KAAM,GAA9D;;AAEA,QAAI,OAAOA,KAAP,KAAiB,SAArB,EAAgC;AAC9B7C,MAAAA,WAAW,CAAC2E,gBAAZ,CAA6Bd,GAA7B,EAAkChB,KAAlC;AACD,KAFD,MAEO,IAAI,OAAOA,KAAP,KAAiB,QAArB,EAA+B;AACpC7C,MAAAA,WAAW,CAAC4E,eAAZ,CAA4Bf,GAA5B,EAAiChB,KAAjC;AACD,KAFM,MAEA;AACL;AACA,UAAIgC,MAAM,CAACC,SAAP,CAAiBjC,KAAjB,CAAJ,EAA6B;AAC3B7C,QAAAA,WAAW,CAAC+E,gBAAZ,CAA6BlB,GAA7B,EAAkChB,KAAlC;AACD,OAFD,MAEO;AACL7C,QAAAA,WAAW,CAACgF,cAAZ,CAA2BnB,GAA3B,EAAgChB,KAAhC;AACD;AACF;AACF;AAED;AACF;AACA;AACA;AACA;AACA;;;AACSoC,EAAAA,aAAa,GAAS;AAC3B,SAAKpD,cAAL,CAAoB6B,IAApB,CAA0B,iBAA1B;AACA1D,IAAAA,WAAW,CAACiF,aAAZ;AACD;;AArUkB;;AAwUrB,SACE7E,cADF,EACkBJ,WADlB","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 { OverrideConsoleMethods } from \"./override-console-methods\";\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 = new 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 // Needs to be executed prior initialization\n if (typeof options.deviceName !== 'undefined') {\n RnBugfender.overrideDeviceName(options.deviceName);\n }\n\n // Library initialization\n Platform.OS === 'ios'\n ? RnBugfender.activateLogger(validatedOptions.appKey)\n : RnBugfender.init(validatedOptions.appKey, false);\n\n if (typeof validatedOptions.apiURL !== 'undefined') {\n RnBugfender.setApiUrl(validatedOptions.apiURL);\n }\n\n if (typeof validatedOptions.baseURL !== 'undefined') {\n RnBugfender.setBaseUrl(validatedOptions.baseURL);\n }\n\n if (validatedOptions.enableLogcatLogging) {\n RnBugfender.enableLogcatLogging();\n }\n\n if (validatedOptions.logUIEvents) {\n RnBugfender.enableUIEventLogging();\n }\n\n if (validatedOptions.registerErrorHandler) {\n RnBugfender.enableCrashReporting();\n }\n\n if (validatedOptions.overrideConsoleMethods) {\n this.overrideConsoleMethods.init(this.stringFormatter);\n }\n\n this.printToConsole.init(validatedOptions.printToConsole ?? true);\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\nexport {\n BugfenderClass, RnBugfender\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["bugfender.ts"],"names":["NativeModules","Platform","DefaultUserFeedbackOptions","StringFormatter","LogLevel","PrintToConsole","SDKOptions","LINKING_ERROR","select","ios","default","RnBugfender","Proxy","get","Error","BugfenderClass","require","OverrideConsoleMethods","window","global","console","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","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","Debug","tag","text","sendIssue","sendCrash","sendUserFeedback","setDeviceKey","setDeviceBoolean","set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B,CAA0B,iBAA1B;AACA9D,IAAAA,WAAW,CAACqF,aAAZ;AACD;;AAEMC,EAAAA,eAAe,CAACC,OAAD,EAAyB;AAC7C,SAAK/D,cAAL,CAAoBsC,IAApB,CAA0B,4BAA2ByB,OAAQ,EAA7D;AACAvF,IAAAA,WAAW,CAACsF,eAAZ,CAA4BC,OAA5B;AACD;;AA9UkB;;AAiVrB,SACEnF,cADF,EACkBJ,WADlB","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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["sdk-options.ts"],"names":["removeUndefinedAttributes","SDKOptions","appKey","apiURL","baseURL","overrideConsoleMethods","printToConsole","logBrowserEvents","logUIEvents","registerErrorHandler","version","init","options","validate","enableLogcatLogging","urlValidator","RegExp","Object","entries","rules","forEach","key","value","rule","Error","includes","test"],"mappings":";;AACA,SAAQA,yBAAR,QAAwC,aAAxC;AAEA,OAAO,MAAMC,UAAN,CAAiB;AAAA;AAAA,mCACJ;AAChBC,MAAAA,MAAM,EAAE,CAAC,UAAD,EAAa,QAAb,CADQ;AAEhBC,MAAAA,MAAM,EAAE,CAAC,QAAD,EAAW,KAAX,CAFQ;AAGhBC,MAAAA,OAAO,EAAE,CAAC,QAAD,EAAW,KAAX,CAHO;AAIhBC,MAAAA,sBAAsB,EAAE,CAAC,SAAD,CAJR;AAKhBC,MAAAA,cAAc,EAAE,CAAC,SAAD,CALA;AAMhBC,MAAAA,gBAAgB,EAAE,CAAC,SAAD,CANF;AAOhBC,MAAAA,WAAW,EAAE,CAAC,SAAD,CAPG;AAQhBC,MAAAA,oBAAoB,EAAE,CAAC,SAAD,CARN;AAShBC,MAAAA,OAAO,EAAE,CAAC,QAAD;AATO,KADI;AAAA;;AAafC,EAAAA,IAAI,CAACC,OAAD,EAAoC;AAC7C;AACA,SAAKC,QAAL,CAAcD,OAAd;AAEAA,IAAAA,OAAO,GAAG,EAAE,GAAGA;AAAL,KAAV;AACAZ,IAAAA,yBAAyB,CAACY,OAAD,CAAzB,CAL6C,CAO7C;;AACA,WAAO;AACLP,MAAAA,sBAAsB,EAAE,IADnB;AAELC,MAAAA,cAAc,EAAE,IAFX;AAGLE,MAAAA,WAAW,EAAE,IAHR;AAILC,MAAAA,oBAAoB,EAAE,IAJjB;AAKLK,MAAAA,mBAAmB,EAAE,KALhB;
|
|
1
|
+
{"version":3,"sources":["sdk-options.ts"],"names":["removeUndefinedAttributes","SDKOptions","appKey","apiURL","baseURL","overrideConsoleMethods","printToConsole","logBrowserEvents","logUIEvents","registerErrorHandler","version","init","options","validate","enableLogcatLogging","maximumLocalStorageSize","urlValidator","RegExp","Object","entries","rules","forEach","key","value","rule","Error","includes","test"],"mappings":";;AACA,SAAQA,yBAAR,QAAwC,aAAxC;AAEA,OAAO,MAAMC,UAAN,CAAiB;AAAA;AAAA,mCACJ;AAChBC,MAAAA,MAAM,EAAE,CAAC,UAAD,EAAa,QAAb,CADQ;AAEhBC,MAAAA,MAAM,EAAE,CAAC,QAAD,EAAW,KAAX,CAFQ;AAGhBC,MAAAA,OAAO,EAAE,CAAC,QAAD,EAAW,KAAX,CAHO;AAIhBC,MAAAA,sBAAsB,EAAE,CAAC,SAAD,CAJR;AAKhBC,MAAAA,cAAc,EAAE,CAAC,SAAD,CALA;AAMhBC,MAAAA,gBAAgB,EAAE,CAAC,SAAD,CANF;AAOhBC,MAAAA,WAAW,EAAE,CAAC,SAAD,CAPG;AAQhBC,MAAAA,oBAAoB,EAAE,CAAC,SAAD,CARN;AAShBC,MAAAA,OAAO,EAAE,CAAC,QAAD;AATO,KADI;AAAA;;AAafC,EAAAA,IAAI,CAACC,OAAD,EAAoC;AAC7C;AACA,SAAKC,QAAL,CAAcD,OAAd;AAEAA,IAAAA,OAAO,GAAG,EAAE,GAAGA;AAAL,KAAV;AACAZ,IAAAA,yBAAyB,CAACY,OAAD,CAAzB,CAL6C,CAO7C;;AACA,WAAO;AACLP,MAAAA,sBAAsB,EAAE,IADnB;AAELC,MAAAA,cAAc,EAAE,IAFX;AAGLE,MAAAA,WAAW,EAAE,IAHR;AAILC,MAAAA,oBAAoB,EAAE,IAJjB;AAKLK,MAAAA,mBAAmB,EAAE,KALhB;AAMLC,MAAAA,uBAAuB,EAAE,IAAI,IAAJ,GAAW,IAN/B;AAOL,SAAGH;AAPE,KAAP;AASD;;AAESC,EAAAA,QAAQ,CAACD,OAAD,EAA6B;AAC7C,UAAMI,YAAY,GAAG,IAAIC,MAAJ,CAAW,iBAAX,CAArB;AAEAC,IAAAA,MAAM,CAACC,OAAP,CAAe,KAAKC,KAApB,EAA2BC,OAA3B,CAAmC,QAAkB;AAAA,UAAjB,CAACC,GAAD,EAAMF,KAAN,CAAiB;AACnD;AACA,YAAMG,KAAK,GAAGX,OAAO,CAACU,GAAD,CAArB;AAEAF,MAAAA,KAAK,CAACC,OAAN,CAAcG,IAAI,IAAI;AACpB,YAAIA,IAAI,KAAK,UAAb,EAAyB;AACvB,cAAI,OAAOD,KAAP,KAAiB,WAArB,EAAkC;AAChC,kBAAM,IAAIE,KAAJ,CAAW,uBAAsBH,GAAI,yBAArC,CAAN;AACD;AACF,SAJD,MAIO,IAAIE,IAAI,KAAK,QAAb,EAAuB;AAC5B,cAAI,CAAC,CAAC,QAAD,EAAW,WAAX,EAAwBE,QAAxB,CAAiC,OAAOH,KAAxC,CAAL,EAAqD;AACnD,kBAAM,IAAIE,KAAJ,CAAW,IAAGH,GAAI,4BAAlB,CAAN;AACD;AACF,SAJM,MAIA,IAAIE,IAAI,KAAK,KAAb,EAAoB;AACzB,cAAI,OAAOD,KAAP,KAAiB,WAAjB,IAAgC,CAACP,YAAY,CAACW,IAAb,CAAkBJ,KAAlB,CAArC,EAA+D;AAC7D,kBAAM,IAAIE,KAAJ,CAAW,IAAGH,GAAI,+BAAlB,CAAN;AACD;AACF,SAJM,MAIA,IAAIE,IAAI,KAAK,SAAb,EAAwB;AAC7B,cAAI,CAAC,CAAC,SAAD,EAAY,WAAZ,EAAyBE,QAAzB,CAAkC,OAAOH,KAAzC,CAAL,EAAsD;AACpD,kBAAM,IAAIE,KAAJ,CAAW,IAAGH,GAAI,6BAAlB,CAAN;AACD;AACF;AACF,OAlBD;AAmBD,KAvBD;AAwBD;;AA3DqB","sourcesContent":["import type {ISDKOptions} from \"./types/sdk-options\";\nimport {removeUndefinedAttributes} from \"./utilities\";\n\nexport class SDKOptions {\n protected rules = {\n appKey: ['required', 'string'],\n apiURL: ['string', 'url'],\n baseURL: ['string', 'url'],\n overrideConsoleMethods: ['boolean'],\n printToConsole: ['boolean'],\n logBrowserEvents: ['boolean'],\n logUIEvents: ['boolean'],\n registerErrorHandler: ['boolean'],\n version: ['string'],\n };\n\n public init(options: ISDKOptions): ISDKOptions {\n // Validate user provided options\n this.validate(options);\n\n options = { ...options };\n removeUndefinedAttributes(options);\n\n // Set default values if needed\n return {\n overrideConsoleMethods: true,\n printToConsole: true,\n logUIEvents: true,\n registerErrorHandler: true,\n enableLogcatLogging: false,\n maximumLocalStorageSize: 5 * 1024 * 1024,\n ...options,\n };\n }\n\n protected validate(options: ISDKOptions): void {\n const urlValidator = new RegExp(/^http(s)?:\\/\\//i);\n\n Object.entries(this.rules).forEach(([key, rules]) => {\n // @ts-ignore\n const value = options[key];\n\n rules.forEach(rule => {\n if (rule === 'required') {\n if (typeof value === 'undefined') {\n throw new Error(`Bugfender requires '${key}' option to initialize.`)\n }\n } else if (rule === 'string') {\n if (!['string', 'undefined'].includes(typeof value)) {\n throw new Error(`'${key}' option must be a string.`);\n }\n } else if (rule === 'url') {\n if (typeof value !== 'undefined' && !urlValidator.test(value)) {\n throw new Error(`'${key}' option must be a valid URL.`);\n }\n } else if (rule === 'boolean') {\n if (!['boolean', 'undefined'].includes(typeof value)) {\n throw new Error(`'${key}' option must be a boolean.`);\n }\n }\n })\n });\n }\n}\n"]}
|
|
@@ -23,7 +23,7 @@ export class SDKOptionsBuilder {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
build() {
|
|
26
|
-
var _this$webOptions, _this$webOptions2, _this$webOptions3, _this$nativeOptions;
|
|
26
|
+
var _this$webOptions, _this$webOptions2, _this$webOptions3, _this$nativeOptions, _this$nativeOptions2;
|
|
27
27
|
|
|
28
28
|
const options = {
|
|
29
29
|
appKey: this.commonOptions.appKey,
|
|
@@ -37,7 +37,8 @@ export class SDKOptionsBuilder {
|
|
|
37
37
|
logBrowserEvents: (_this$webOptions = this.webOptions) === null || _this$webOptions === void 0 ? void 0 : _this$webOptions.logBrowserEvents,
|
|
38
38
|
build: (_this$webOptions2 = this.webOptions) === null || _this$webOptions2 === void 0 ? void 0 : _this$webOptions2.build,
|
|
39
39
|
version: (_this$webOptions3 = this.webOptions) === null || _this$webOptions3 === void 0 ? void 0 : _this$webOptions3.version,
|
|
40
|
-
enableLogcatLogging: (_this$nativeOptions = this.nativeOptions) === null || _this$nativeOptions === void 0 ? void 0 : _this$nativeOptions.enableLogcatLogging
|
|
40
|
+
enableLogcatLogging: (_this$nativeOptions = this.nativeOptions) === null || _this$nativeOptions === void 0 ? void 0 : _this$nativeOptions.enableLogcatLogging,
|
|
41
|
+
maximumLocalStorageSize: (_this$nativeOptions2 = this.nativeOptions) === null || _this$nativeOptions2 === void 0 ? void 0 : _this$nativeOptions2.maximumLocalStorageSize
|
|
41
42
|
};
|
|
42
43
|
removeUndefinedAttributes(options);
|
|
43
44
|
return options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["sdk-options.ts"],"names":["removeUndefinedAttributes","SDKOptionsBuilder","constructor","commonOptions","native","nativeOptions","web","webOptions","build","options","appKey","apiURL","baseURL","overrideConsoleMethods","printToConsole","logUIEvents","registerErrorHandler","deviceName","logBrowserEvents","version","enableLogcatLogging"],"mappings":";;AAAA,SAAQA,yBAAR,QAAwC,cAAxC;
|
|
1
|
+
{"version":3,"sources":["sdk-options.ts"],"names":["removeUndefinedAttributes","SDKOptionsBuilder","constructor","commonOptions","native","nativeOptions","web","webOptions","build","options","appKey","apiURL","baseURL","overrideConsoleMethods","printToConsole","logUIEvents","registerErrorHandler","deviceName","logBrowserEvents","version","enableLogcatLogging","maximumLocalStorageSize"],"mappings":";;AAAA,SAAQA,yBAAR,QAAwC,cAAxC;AAuCA,OAAO,MAAMC,iBAAN,CAAwB;AAK7BC,EAAAA,WAAW,CAACC,aAAD,EAAmC;AAAA;;AAAA;;AAAA;;AAC5C,SAAKA,aAAL,GAAqBA,aAArB;AACD;;AAEMC,EAAAA,MAAM,CAACC,aAAD,EAAsD;AACjE,SAAKA,aAAL,GAAqBA,aAArB;AACA,WAAO,IAAP;AACD;;AAEMC,EAAAA,GAAG,CAACC,UAAD,EAAgD;AACxD,SAAKA,UAAL,GAAkBA,UAAlB;AACA,WAAO,IAAP;AACD;;AAEMC,EAAAA,KAAK,GAAgB;AAAA;;AAC1B,UAAMC,OAAoB,GAAG;AAC3BC,MAAAA,MAAM,EAAE,KAAKP,aAAL,CAAmBO,MADA;AAE3BC,MAAAA,MAAM,EAAE,KAAKR,aAAL,CAAmBQ,MAFA;AAG3BC,MAAAA,OAAO,EAAE,KAAKT,aAAL,CAAmBS,OAHD;AAI3BC,MAAAA,sBAAsB,EAAE,KAAKV,aAAL,CAAmBU,sBAJhB;AAK3BC,MAAAA,cAAc,EAAE,KAAKX,aAAL,CAAmBW,cALR;AAM3BC,MAAAA,WAAW,EAAE,KAAKZ,aAAL,CAAmBY,WANL;AAO3BC,MAAAA,oBAAoB,EAAE,KAAKb,aAAL,CAAmBa,oBAPd;AAQ3BC,MAAAA,UAAU,EAAE,KAAKd,aAAL,CAAmBc,UARJ;AAS3BC,MAAAA,gBAAgB,sBAAE,KAAKX,UAAP,qDAAE,iBAAiBW,gBATR;AAU3BV,MAAAA,KAAK,uBAAE,KAAKD,UAAP,sDAAE,kBAAiBC,KAVG;AAW3BW,MAAAA,OAAO,uBAAE,KAAKZ,UAAP,sDAAE,kBAAiBY,OAXC;AAY3BC,MAAAA,mBAAmB,yBAAE,KAAKf,aAAP,wDAAE,oBAAoBe,mBAZd;AAa3BC,MAAAA,uBAAuB,0BAAE,KAAKhB,aAAP,yDAAE,qBAAoBgB;AAblB,KAA7B;AAgBArB,IAAAA,yBAAyB,CAACS,OAAD,CAAzB;AAEA,WAAOA,OAAP;AACD;;AAvC4B","sourcesContent":["import {removeUndefinedAttributes} from \"../utilities\";\n\nexport interface ISDKCommonOptions {\n /** The app key to log into */\n appKey: string;\n /** Base URL to Bugfender API */\n apiURL?: string;\n /** Base URL to Bugfender web dashboard */\n baseURL?: string;\n /** Override default `window.console` so it also logs to Bugfender. Defaults to `true`. */\n overrideConsoleMethods?: boolean;\n /** Print also with `window.console` when Bugfender logging methods are called. Defaults to `true`. */\n printToConsole?: boolean;\n /** Register a handler for most common UI events to report them to Bugfender. Defaults to `true`. */\n logUIEvents?: boolean;\n /** Register error handler for uncaught errors that reports a crash to Bugfender. Defaults to `true`. */\n registerErrorHandler?: boolean;\n /** Sets the name for the device. If the Device Name is not set, then the platform standard device name will be automatically sent */\n deviceName?: string;\n}\n\nexport interface ISDKWebOptions {\n /** Register a handler for most common browser events to report them to Bugfender (Web specific). Defaults to `true`. */\n logBrowserEvents?: boolean;\n /** App build identifier (Web specific) */\n build?: string;\n /** App version identifier (Web specific) */\n version?: string;\n}\n\nexport interface ISDKNativeOptions {\n /** Set the maximum size to store local log files in bytes (Native specific). Range accepted is from 1 MB to 50 MB. Defaults to 5 MB. **/\n maximumLocalStorageSize?: number;\n /** Logs all logs written via Logcat (Android specific). Defaults to `false`. */\n enableLogcatLogging?: boolean;\n}\n\nexport type ISDKOptions = ISDKCommonOptions & ISDKNativeOptions & ISDKWebOptions;\n\nexport class SDKOptionsBuilder {\n private commonOptions: ISDKCommonOptions;\n private nativeOptions?: ISDKNativeOptions;\n private webOptions?: ISDKWebOptions;\n\n constructor(commonOptions: ISDKCommonOptions) {\n this.commonOptions = commonOptions;\n }\n\n public native(nativeOptions: ISDKNativeOptions): SDKOptionsBuilder {\n this.nativeOptions = nativeOptions;\n return this;\n }\n\n public web(webOptions: ISDKWebOptions): SDKOptionsBuilder {\n this.webOptions = webOptions;\n return this;\n }\n\n public build(): ISDKOptions {\n const options: ISDKOptions = {\n appKey: this.commonOptions.appKey,\n apiURL: this.commonOptions.apiURL,\n baseURL: this.commonOptions.baseURL,\n overrideConsoleMethods: this.commonOptions.overrideConsoleMethods,\n printToConsole: this.commonOptions.printToConsole,\n logUIEvents: this.commonOptions.logUIEvents,\n registerErrorHandler: this.commonOptions.registerErrorHandler,\n deviceName: this.commonOptions.deviceName,\n logBrowserEvents: this.webOptions?.logBrowserEvents,\n build: this.webOptions?.build,\n version: this.webOptions?.version,\n enableLogcatLogging: this.nativeOptions?.enableLogcatLogging,\n maximumLocalStorageSize: this.nativeOptions?.maximumLocalStorageSize,\n };\n\n removeUndefinedAttributes(options);\n\n return options;\n }\n}\n"]}
|
|
@@ -25,6 +25,8 @@ export interface ISDKWebOptions {
|
|
|
25
25
|
version?: string;
|
|
26
26
|
}
|
|
27
27
|
export interface ISDKNativeOptions {
|
|
28
|
+
/** Set the maximum size to store local log files in bytes (Native specific). Range accepted is from 1 MB to 50 MB. Defaults to 5 MB. **/
|
|
29
|
+
maximumLocalStorageSize?: number;
|
|
28
30
|
/** Logs all logs written via Logcat (Android specific). Defaults to `false`. */
|
|
29
31
|
enableLogcatLogging?: boolean;
|
|
30
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bugfender/rn-bugfender",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "React Native bindings for Bugfender SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
]
|
|
154
154
|
},
|
|
155
155
|
"dependencies": {
|
|
156
|
-
"@bugfender/sdk": "^2.
|
|
156
|
+
"@bugfender/sdk": "^2.1.0",
|
|
157
157
|
"util": "^0.12.4"
|
|
158
158
|
}
|
|
159
159
|
}
|
package/src/bugfender.ts
CHANGED
|
@@ -5,10 +5,9 @@ import { DefaultUserFeedbackOptions } from './user-feedback';
|
|
|
5
5
|
import type { DeviceKeyValue } from './types/device';
|
|
6
6
|
import type { ILogEntry } from './types/log';
|
|
7
7
|
import { StringFormatter } from './string-formatter';
|
|
8
|
-
import { LogLevel } from
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { SDKOptions } from "./sdk-options";
|
|
8
|
+
import { LogLevel } from './types/log';
|
|
9
|
+
import { PrintToConsole } from './print-to-console';
|
|
10
|
+
import { SDKOptions } from './sdk-options';
|
|
12
11
|
|
|
13
12
|
const LINKING_ERROR =
|
|
14
13
|
`The package '@bugfender/rn-bugfender' doesn't seem to be linked. Make sure: \n\n` +
|
|
@@ -29,7 +28,8 @@ const RnBugfender = NativeModules.RnBugfender
|
|
|
29
28
|
|
|
30
29
|
class BugfenderClass {
|
|
31
30
|
private stringFormatter = new StringFormatter();
|
|
32
|
-
private overrideConsoleMethods =
|
|
31
|
+
private overrideConsoleMethods =
|
|
32
|
+
new (require('./override-console-methods').OverrideConsoleMethods)(window);
|
|
33
33
|
private printToConsole = new PrintToConsole(global.console);
|
|
34
34
|
private sdkOptions: SDKOptions = new SDKOptions();
|
|
35
35
|
private initialized = false;
|
|
@@ -38,41 +38,44 @@ class BugfenderClass {
|
|
|
38
38
|
if (!this.initialized) {
|
|
39
39
|
const validatedOptions = this.sdkOptions.init(options);
|
|
40
40
|
|
|
41
|
-
//
|
|
41
|
+
// region before init
|
|
42
42
|
if (typeof options.deviceName !== 'undefined') {
|
|
43
43
|
RnBugfender.overrideDeviceName(options.deviceName);
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
// Library initialization
|
|
47
|
-
Platform.OS === 'ios'
|
|
48
|
-
? RnBugfender.activateLogger(validatedOptions.appKey)
|
|
49
|
-
: RnBugfender.init(validatedOptions.appKey, false);
|
|
50
|
-
|
|
51
45
|
if (typeof validatedOptions.apiURL !== 'undefined') {
|
|
52
46
|
RnBugfender.setApiUrl(validatedOptions.apiURL);
|
|
53
47
|
}
|
|
54
|
-
|
|
55
48
|
if (typeof validatedOptions.baseURL !== 'undefined') {
|
|
56
49
|
RnBugfender.setBaseUrl(validatedOptions.baseURL);
|
|
57
50
|
}
|
|
51
|
+
// endregion before init
|
|
58
52
|
|
|
53
|
+
// region init
|
|
54
|
+
Platform.OS === 'ios'
|
|
55
|
+
? RnBugfender.activateLogger(validatedOptions.appKey)
|
|
56
|
+
: RnBugfender.init(validatedOptions.appKey, validatedOptions.printToConsole ?? false);
|
|
57
|
+
|
|
58
|
+
if (validatedOptions.overrideConsoleMethods) {
|
|
59
|
+
this.overrideConsoleMethods.init(this.stringFormatter);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
this.printToConsole.init(validatedOptions.printToConsole ?? true);
|
|
63
|
+
// endregion init
|
|
64
|
+
|
|
65
|
+
// region after init
|
|
59
66
|
if (validatedOptions.enableLogcatLogging) {
|
|
60
67
|
RnBugfender.enableLogcatLogging();
|
|
61
68
|
}
|
|
62
|
-
|
|
63
69
|
if (validatedOptions.logUIEvents) {
|
|
64
70
|
RnBugfender.enableUIEventLogging();
|
|
65
71
|
}
|
|
66
|
-
|
|
67
72
|
if (validatedOptions.registerErrorHandler) {
|
|
68
73
|
RnBugfender.enableCrashReporting();
|
|
69
74
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this.printToConsole.init(validatedOptions.printToConsole ?? true);
|
|
75
|
+
RnBugfender.setMaximumLocalStorageSize(
|
|
76
|
+
validatedOptions.maximumLocalStorageSize
|
|
77
|
+
);
|
|
78
|
+
// endregion after init
|
|
76
79
|
|
|
77
80
|
this.initialized = true;
|
|
78
81
|
}
|
|
@@ -353,6 +356,11 @@ class BugfenderClass {
|
|
|
353
356
|
this.printToConsole.info(`Force send once`);
|
|
354
357
|
RnBugfender.forceSendOnce();
|
|
355
358
|
}
|
|
359
|
+
|
|
360
|
+
public setForceEnabled(enabled: boolean): void {
|
|
361
|
+
this.printToConsole.info(`Set force enabled set to ${enabled}`);
|
|
362
|
+
RnBugfender.setForceEnabled(enabled);
|
|
363
|
+
}
|
|
356
364
|
}
|
|
357
365
|
|
|
358
366
|
export {
|
package/src/sdk-options.ts
CHANGED
package/src/types/sdk-options.ts
CHANGED
|
@@ -29,6 +29,8 @@ export interface ISDKWebOptions {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export interface ISDKNativeOptions {
|
|
32
|
+
/** Set the maximum size to store local log files in bytes (Native specific). Range accepted is from 1 MB to 50 MB. Defaults to 5 MB. **/
|
|
33
|
+
maximumLocalStorageSize?: number;
|
|
32
34
|
/** Logs all logs written via Logcat (Android specific). Defaults to `false`. */
|
|
33
35
|
enableLogcatLogging?: boolean;
|
|
34
36
|
}
|
|
@@ -68,6 +70,7 @@ export class SDKOptionsBuilder {
|
|
|
68
70
|
build: this.webOptions?.build,
|
|
69
71
|
version: this.webOptions?.version,
|
|
70
72
|
enableLogcatLogging: this.nativeOptions?.enableLogcatLogging,
|
|
73
|
+
maximumLocalStorageSize: this.nativeOptions?.maximumLocalStorageSize,
|
|
71
74
|
};
|
|
72
75
|
|
|
73
76
|
removeUndefinedAttributes(options);
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
package/android/.idea/gradle.xml
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="GradleMigrationSettings" migrationVersion="1" />
|
|
4
|
-
<component name="GradleSettings">
|
|
5
|
-
<option name="linkedExternalProjectsSettings">
|
|
6
|
-
<GradleProjectSettings>
|
|
7
|
-
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
8
|
-
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
9
|
-
<option name="gradleJvm" value="#JAVA_HOME" />
|
|
10
|
-
<option name="modules">
|
|
11
|
-
<set>
|
|
12
|
-
<option value="$PROJECT_DIR$" />
|
|
13
|
-
</set>
|
|
14
|
-
</option>
|
|
15
|
-
</GradleProjectSettings>
|
|
16
|
-
</option>
|
|
17
|
-
</component>
|
|
18
|
-
</project>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="RemoteRepositoriesConfiguration">
|
|
4
|
-
<remote-repository>
|
|
5
|
-
<option name="id" value="central" />
|
|
6
|
-
<option name="name" value="Maven Central repository" />
|
|
7
|
-
<option name="url" value="https://repo1.maven.org/maven2" />
|
|
8
|
-
</remote-repository>
|
|
9
|
-
<remote-repository>
|
|
10
|
-
<option name="id" value="jboss.community" />
|
|
11
|
-
<option name="name" value="JBoss Community repository" />
|
|
12
|
-
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
|
13
|
-
</remote-repository>
|
|
14
|
-
<remote-repository>
|
|
15
|
-
<option name="id" value="MavenRepo" />
|
|
16
|
-
<option name="name" value="MavenRepo" />
|
|
17
|
-
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
|
18
|
-
</remote-repository>
|
|
19
|
-
<remote-repository>
|
|
20
|
-
<option name="id" value="BintrayJCenter" />
|
|
21
|
-
<option name="name" value="BintrayJCenter" />
|
|
22
|
-
<option name="url" value="https://jcenter.bintray.com/" />
|
|
23
|
-
</remote-repository>
|
|
24
|
-
<remote-repository>
|
|
25
|
-
<option name="id" value="maven" />
|
|
26
|
-
<option name="name" value="maven" />
|
|
27
|
-
<option name="url" value="file:$PROJECT_DIR$/../node_modules/react-native/android/" />
|
|
28
|
-
</remote-repository>
|
|
29
|
-
<remote-repository>
|
|
30
|
-
<option name="id" value="MavenLocal" />
|
|
31
|
-
<option name="name" value="MavenLocal" />
|
|
32
|
-
<option name="url" value="file:$MAVEN_REPOSITORY$/" />
|
|
33
|
-
</remote-repository>
|
|
34
|
-
<remote-repository>
|
|
35
|
-
<option name="id" value="Google" />
|
|
36
|
-
<option name="name" value="Google" />
|
|
37
|
-
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
|
38
|
-
</remote-repository>
|
|
39
|
-
</component>
|
|
40
|
-
</project>
|
package/android/.idea/misc.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
4
|
-
<component name="FrameworkDetectionExcludesConfiguration">
|
|
5
|
-
<file type="web" url="file://$PROJECT_DIR$" />
|
|
6
|
-
</component>
|
|
7
|
-
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK" />
|
|
8
|
-
</project>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="RunConfigurationProducerService">
|
|
4
|
-
<option name="ignoredProducers">
|
|
5
|
-
<set>
|
|
6
|
-
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
|
7
|
-
</set>
|
|
8
|
-
</option>
|
|
9
|
-
</component>
|
|
10
|
-
</project>
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="Palette2">
|
|
4
|
-
<group name="Swing">
|
|
5
|
-
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
6
|
-
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
|
7
|
-
</item>
|
|
8
|
-
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
9
|
-
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
|
10
|
-
</item>
|
|
11
|
-
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
12
|
-
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
|
13
|
-
</item>
|
|
14
|
-
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
|
15
|
-
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
|
16
|
-
</item>
|
|
17
|
-
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
18
|
-
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
|
19
|
-
<initial-values>
|
|
20
|
-
<property name="text" value="Button" />
|
|
21
|
-
</initial-values>
|
|
22
|
-
</item>
|
|
23
|
-
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
24
|
-
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
|
25
|
-
<initial-values>
|
|
26
|
-
<property name="text" value="RadioButton" />
|
|
27
|
-
</initial-values>
|
|
28
|
-
</item>
|
|
29
|
-
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
30
|
-
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
|
31
|
-
<initial-values>
|
|
32
|
-
<property name="text" value="CheckBox" />
|
|
33
|
-
</initial-values>
|
|
34
|
-
</item>
|
|
35
|
-
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
36
|
-
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
|
37
|
-
<initial-values>
|
|
38
|
-
<property name="text" value="Label" />
|
|
39
|
-
</initial-values>
|
|
40
|
-
</item>
|
|
41
|
-
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
42
|
-
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
43
|
-
<preferred-size width="150" height="-1" />
|
|
44
|
-
</default-constraints>
|
|
45
|
-
</item>
|
|
46
|
-
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
47
|
-
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
48
|
-
<preferred-size width="150" height="-1" />
|
|
49
|
-
</default-constraints>
|
|
50
|
-
</item>
|
|
51
|
-
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
52
|
-
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
|
53
|
-
<preferred-size width="150" height="-1" />
|
|
54
|
-
</default-constraints>
|
|
55
|
-
</item>
|
|
56
|
-
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
57
|
-
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
58
|
-
<preferred-size width="150" height="50" />
|
|
59
|
-
</default-constraints>
|
|
60
|
-
</item>
|
|
61
|
-
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
62
|
-
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
63
|
-
<preferred-size width="150" height="50" />
|
|
64
|
-
</default-constraints>
|
|
65
|
-
</item>
|
|
66
|
-
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
67
|
-
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
68
|
-
<preferred-size width="150" height="50" />
|
|
69
|
-
</default-constraints>
|
|
70
|
-
</item>
|
|
71
|
-
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
72
|
-
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
|
73
|
-
</item>
|
|
74
|
-
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
75
|
-
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
76
|
-
<preferred-size width="150" height="50" />
|
|
77
|
-
</default-constraints>
|
|
78
|
-
</item>
|
|
79
|
-
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
80
|
-
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
|
81
|
-
<preferred-size width="150" height="50" />
|
|
82
|
-
</default-constraints>
|
|
83
|
-
</item>
|
|
84
|
-
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
85
|
-
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
|
86
|
-
<preferred-size width="150" height="50" />
|
|
87
|
-
</default-constraints>
|
|
88
|
-
</item>
|
|
89
|
-
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
90
|
-
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
|
91
|
-
<preferred-size width="200" height="200" />
|
|
92
|
-
</default-constraints>
|
|
93
|
-
</item>
|
|
94
|
-
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
95
|
-
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
|
96
|
-
<preferred-size width="200" height="200" />
|
|
97
|
-
</default-constraints>
|
|
98
|
-
</item>
|
|
99
|
-
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
|
100
|
-
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
|
101
|
-
</item>
|
|
102
|
-
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
103
|
-
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
|
104
|
-
</item>
|
|
105
|
-
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
106
|
-
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
|
107
|
-
</item>
|
|
108
|
-
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
109
|
-
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
|
110
|
-
</item>
|
|
111
|
-
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
112
|
-
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
|
113
|
-
<preferred-size width="-1" height="20" />
|
|
114
|
-
</default-constraints>
|
|
115
|
-
</item>
|
|
116
|
-
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
|
117
|
-
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
|
118
|
-
</item>
|
|
119
|
-
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
|
120
|
-
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
|
121
|
-
</item>
|
|
122
|
-
</group>
|
|
123
|
-
</component>
|
|
124
|
-
</project>
|
package/android/.idea/vcs.xml
DELETED
|
Binary file
|
package/ios/RnBugfender.xcodeproj/xcuserdata/fj.xcuserdatad/xcschemes/xcschememanagement.plist
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>SchemeUserState</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>RnBugfender.xcscheme_^#shared#^_</key>
|
|
8
|
-
<dict>
|
|
9
|
-
<key>orderHint</key>
|
|
10
|
-
<integer>0</integer>
|
|
11
|
-
</dict>
|
|
12
|
-
</dict>
|
|
13
|
-
</dict>
|
|
14
|
-
</plist>
|