@bugfender/rn-bugfender 1.1.3 → 2.0.0-alpha.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.
Files changed (166) hide show
  1. package/README.md +110 -86
  2. package/RnBugfender.podspec +21 -0
  3. package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  4. package/android/.gradle/{5.6.4 → 7.1/dependencies-accessors}/gc.properties +0 -0
  5. package/android/.gradle/7.1/executionHistory/executionHistory.bin +0 -0
  6. package/android/.gradle/7.1/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/{5.6.4 → 7.1}/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/7.1/fileHashes/fileHashes.bin +0 -0
  9. package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
  10. package/android/.gradle/7.1/gc.properties +0 -0
  11. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  12. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  13. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  14. package/android/.gradle/checksums/checksums.lock +0 -0
  15. package/android/.gradle/{5.6.4/fileHashes/fileHashes.bin → checksums/md5-checksums.bin} +0 -0
  16. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  17. package/android/.idea/compiler.xml +6 -0
  18. package/android/.idea/gradle.xml +1 -2
  19. package/android/.idea/jarRepositories.xml +40 -0
  20. package/android/.idea/misc.xml +4 -110
  21. package/android/.idea/runConfigurations.xml +1 -3
  22. package/android/.idea/uiDesigner.xml +124 -0
  23. package/android/build.gradle +47 -24
  24. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  25. package/android/gradle/wrapper/gradle-wrapper.properties +1 -2
  26. package/android/gradlew +34 -21
  27. package/android/gradlew.bat +24 -19
  28. package/android/src/main/AndroidManifest.xml +4 -3
  29. package/android/src/main/java/com/bugfender/react/{RNBugfenderModule.java → RnBugfenderModule.java} +88 -13
  30. package/android/src/main/java/com/bugfender/react/RnBugfenderPackage.java +28 -0
  31. package/ios/RnBugfender.h +5 -0
  32. package/ios/{RNBugfender.m → RnBugfender.m} +67 -8
  33. package/ios/{RNBugfender.xcodeproj → RnBugfender.xcodeproj}/project.pbxproj +42 -37
  34. package/ios/{RNBugfender.xcodeproj → RnBugfender.xcodeproj}/project.xcworkspace/contents.xcworkspacedata +0 -3
  35. package/ios/{RNBugfender.xcodeproj → RnBugfender.xcodeproj}/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  36. package/ios/RnBugfender.xcodeproj/project.xcworkspace/xcuserdata/fj.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  37. package/ios/{RNBugfender.xcodeproj/xcuserdata/rubenvot.xcuserdatad → RnBugfender.xcodeproj/xcuserdata/fj.xcuserdatad}/xcschemes/xcschememanagement.plist +1 -6
  38. package/lib/commonjs/bugfender.js +338 -0
  39. package/lib/commonjs/bugfender.js.map +1 -0
  40. package/lib/commonjs/index.js +28 -0
  41. package/lib/commonjs/index.js.map +1 -0
  42. package/lib/commonjs/index.web.js +30 -0
  43. package/lib/commonjs/index.web.js.map +1 -0
  44. package/lib/commonjs/override-console-methods.js +91 -0
  45. package/lib/commonjs/override-console-methods.js.map +1 -0
  46. package/lib/commonjs/print-to-console.js +78 -0
  47. package/lib/commonjs/print-to-console.js.map +1 -0
  48. package/lib/commonjs/sdk-options.js +81 -0
  49. package/lib/commonjs/sdk-options.js.map +1 -0
  50. package/lib/commonjs/string-formatter.js +55 -0
  51. package/lib/commonjs/string-formatter.js.map +1 -0
  52. package/lib/commonjs/types/device.js +2 -0
  53. package/lib/commonjs/types/device.js.map +1 -0
  54. package/lib/commonjs/types/log.js +35 -0
  55. package/lib/commonjs/types/log.js.map +1 -0
  56. package/lib/commonjs/types/sdk-options.js +55 -0
  57. package/lib/commonjs/types/sdk-options.js.map +1 -0
  58. package/lib/commonjs/user-feedback.js +31 -0
  59. package/lib/commonjs/user-feedback.js.map +1 -0
  60. package/lib/module/bugfender.js +323 -0
  61. package/lib/module/bugfender.js.map +1 -0
  62. package/lib/module/index.js +6 -0
  63. package/lib/module/index.js.map +1 -0
  64. package/lib/module/index.web.js +5 -0
  65. package/lib/module/index.web.js.map +1 -0
  66. package/lib/module/override-console-methods.js +75 -0
  67. package/lib/module/override-console-methods.js.map +1 -0
  68. package/lib/module/print-to-console.js +67 -0
  69. package/lib/module/print-to-console.js.map +1 -0
  70. package/lib/module/sdk-options.js +72 -0
  71. package/lib/module/sdk-options.js.map +1 -0
  72. package/lib/module/string-formatter.js +45 -0
  73. package/lib/module/string-formatter.js.map +1 -0
  74. package/lib/module/types/device.js +2 -0
  75. package/lib/module/types/device.js.map +1 -0
  76. package/lib/module/types/log.js +24 -0
  77. package/lib/module/types/log.js.map +1 -0
  78. package/lib/module/types/sdk-options.js +46 -0
  79. package/lib/module/types/sdk-options.js.map +1 -0
  80. package/lib/module/user-feedback.js +22 -0
  81. package/lib/module/user-feedback.js.map +1 -0
  82. package/lib/typescript/bugfender.d.ts +163 -0
  83. package/lib/typescript/index.d.ts +5 -0
  84. package/lib/typescript/index.web.d.ts +4 -0
  85. package/lib/typescript/override-console-methods.d.ts +10 -0
  86. package/lib/typescript/print-to-console.d.ts +14 -0
  87. package/lib/typescript/sdk-options.d.ts +16 -0
  88. package/lib/typescript/string-formatter.d.ts +4 -0
  89. package/lib/typescript/types/device.d.ts +4 -0
  90. package/lib/typescript/types/log.d.ts +59 -0
  91. package/lib/typescript/types/sdk-options.d.ts +40 -0
  92. package/lib/typescript/user-feedback.d.ts +31 -0
  93. package/package.json +146 -12
  94. package/src/bugfender.ts +360 -0
  95. package/src/index.tsx +7 -0
  96. package/src/index.web.tsx +5 -0
  97. package/src/override-console-methods.ts +53 -0
  98. package/src/print-to-console.ts +67 -0
  99. package/src/sdk-options.ts +68 -0
  100. package/src/string-formatter.ts +44 -0
  101. package/src/types/device.ts +4 -0
  102. package/src/types/log.ts +75 -0
  103. package/src/types/sdk-options.ts +81 -0
  104. package/src/user-feedback.ts +33 -0
  105. package/.idea/codeStyles/Project.xml +0 -116
  106. package/.idea/modules.xml +0 -8
  107. package/.idea/rn-bugfender.iml +0 -9
  108. package/.idea/vcs.xml +0 -6
  109. package/RNBugfender.podspec +0 -26
  110. package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
  111. package/android/.idea/caches/build_file_checksums.ser +0 -0
  112. package/android/.idea/codeStyles/Project.xml +0 -116
  113. package/android/.idea/libraries/Gradle__com_android_support_appcompat_v7_23_0_1_aar.xml +0 -15
  114. package/android/.idea/libraries/Gradle__com_android_support_recyclerview_v7_23_0_1_aar.xml +0 -12
  115. package/android/.idea/libraries/Gradle__com_android_support_support_annotations_23_0_1_jar.xml +0 -11
  116. package/android/.idea/libraries/Gradle__com_android_support_support_v4_23_0_1_aar.xml +0 -16
  117. package/android/.idea/libraries/Gradle__com_bugfender_sdk_android_3_0_5_aar.xml +0 -12
  118. package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_0_8_1_aar.xml +0 -12
  119. package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_0_8_1_aar.xml +0 -12
  120. package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_0_8_1_aar.xml +0 -12
  121. package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_0_8_1_aar.xml +0 -12
  122. package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp_0_8_1_aar.xml +0 -12
  123. package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_20_1_aar.xml +0 -16
  124. package/android/.idea/libraries/Gradle__com_facebook_stetho_stetho_1_2_0_jar.xml +0 -11
  125. package/android/.idea/libraries/Gradle__com_facebook_stetho_stetho_okhttp_1_2_0_jar.xml +0 -11
  126. package/android/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_core_2_2_3_jar.xml +0 -11
  127. package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_0_jar.xml +0 -11
  128. package/android/.idea/libraries/Gradle__com_nineoldandroids_library_2_4_0_jar.xml +0 -11
  129. package/android/.idea/libraries/Gradle__com_parse_bolts_bolts_android_1_1_4_jar.xml +0 -11
  130. package/android/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_2_5_0_jar.xml +0 -11
  131. package/android/.idea/libraries/Gradle__com_squareup_okhttp_okhttp_ws_2_5_0_jar.xml +0 -11
  132. package/android/.idea/libraries/Gradle__com_squareup_okio_okio_1_6_0_jar.xml +0 -11
  133. package/android/.idea/libraries/Gradle__commons_cli_commons_cli_1_2_jar.xml +0 -13
  134. package/android/.idea/libraries/Gradle__org_webkit_android_jsc_r174650_aar.xml +0 -10
  135. package/android/.idea/modules.xml +0 -8
  136. package/android/android.iml +0 -116
  137. package/android/build/generated/source/buildConfig/debug/com/bugfender/react/BuildConfig.java +0 -13
  138. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -11
  139. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json +0 -1
  140. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
  141. package/android/build/intermediates/compile_library_classes/debug/classes.jar +0 -0
  142. package/android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  143. package/android/build/intermediates/incremental/debug-mergeJniLibs/merge-state +0 -0
  144. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  145. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  146. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
  147. package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +0 -1
  148. package/android/build/intermediates/incremental/packageDebugResources/merger.xml +0 -2
  149. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/bugfender/react/BuildConfig.class +0 -0
  150. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/bugfender/react/RNBugfenderModule.class +0 -0
  151. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/bugfender/react/RNBugfenderPackage.class +0 -0
  152. package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
  153. package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +0 -11
  154. package/android/build/intermediates/merged_manifests/debug/output.json +0 -1
  155. package/android/build/intermediates/res/symbol-table-with-package/debug/package-aware-r.txt +0 -1309
  156. package/android/build/intermediates/runtime_library_classes/debug/classes.jar +0 -0
  157. package/android/build/intermediates/symbols/debug/R.txt +0 -1783
  158. package/android/build/intermediates/transforms/mergeJniLibs/debug/__content__.json +0 -1
  159. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -37
  160. package/android/local.properties +0 -8
  161. package/android/src/main/java/com/bugfender/react/RNBugfenderPackage.java +0 -29
  162. package/bugfender.js +0 -188
  163. package/example/.babelrc +0 -3
  164. package/example/.watchmanconfig +0 -1
  165. package/example/App.js +0 -121
  166. package/ios/RNBugfender.h +0 -7
@@ -0,0 +1,163 @@
1
+ import type { ISDKOptions } from './types/sdk-options';
2
+ import type { UserFeedbackOptions, UserFeedbackResult } from './user-feedback';
3
+ import type { DeviceKeyValue } from './types/device';
4
+ import type { ILogEntry } from './types/log';
5
+ declare const RnBugfender: any;
6
+ declare class BugfenderClass {
7
+ private stringFormatter;
8
+ private overrideConsoleMethods;
9
+ private printToConsole;
10
+ private sdkOptions;
11
+ private initialized;
12
+ init(options: ISDKOptions): Promise<void>;
13
+ /**
14
+ * @returns Bugfender dashboard URL for the device
15
+ */
16
+ getDeviceURL(): Promise<string>;
17
+ /**
18
+ * @returns Bugfender dashboard URL for the current session
19
+ */
20
+ getSessionURL(): Promise<string>;
21
+ /**
22
+ * Show a modal which asks for feedback. Once the user closes the modal or sends the feedback
23
+ * the returned promise resolves with the result.
24
+ *
25
+ * ```typescript
26
+ * Bugfender.getUserFeedback().then((result) => {
27
+ * if (result.isSent) {
28
+ * // User sent the feedback
29
+ * // `result.feedbackURL` contains the Bugfender feedback URL
30
+ * } else {
31
+ * // User closed the modal without sending the feedback
32
+ * }
33
+ * });
34
+ * ```
35
+ *
36
+ * @param options Options object to configure modal strings
37
+ * @returns Promise which resolves once the user closes the modal or sends the feedback
38
+ */
39
+ getUserFeedback(options?: UserFeedbackOptions): Promise<UserFeedbackResult>;
40
+ /**
41
+ * @param obj A JavaScript value to output
42
+ * @param objs List of optional JavaScript values to output
43
+ */
44
+ log(obj: unknown, ...objs: unknown[]): void;
45
+ /**
46
+ * 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).
47
+ *
48
+ * @param msg Message with optional `%` placeholders
49
+ * @param subst Optional substitutions list
50
+ */
51
+ log(msg: string, ...subst: unknown[]): void;
52
+ /**
53
+ * @param obj A JavaScript value to output
54
+ * @param objs List of optional JavaScript values to output
55
+ */
56
+ warn(obj: unknown, ...objs: unknown[]): void;
57
+ /**
58
+ * 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).
59
+ *
60
+ * @param msg Message with optional `%` placeholders
61
+ * @param subst Optional substitutions list
62
+ */
63
+ warn(msg: string, ...subst: unknown[]): void;
64
+ /**
65
+ * @param obj A JavaScript value to output
66
+ * @param objs List of optional JavaScript values to output
67
+ */
68
+ error(obj: unknown, ...objs: unknown[]): void;
69
+ /**
70
+ * 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).
71
+ *
72
+ * @param msg Message with optional `%` placeholders
73
+ * @param subst Optional substitutions list
74
+ */
75
+ error(msg: string, ...subst: unknown[]): void;
76
+ /**
77
+ * @param obj A JavaScript value to output
78
+ * @param objs List of optional JavaScript values to output
79
+ */
80
+ trace(obj: unknown, ...objs: unknown[]): void;
81
+ /**
82
+ * 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).
83
+ *
84
+ * @param msg Message with optional `%` placeholders
85
+ * @param subst Optional substitutions list
86
+ */
87
+ trace(msg: string, ...subst: unknown[]): void;
88
+ /**
89
+ * @param obj A JavaScript value to output
90
+ * @param objs List of optional JavaScript values to output
91
+ */
92
+ info(obj: unknown, ...objs: unknown[]): void;
93
+ /**
94
+ * 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).
95
+ *
96
+ * @param msg Message with optional `%` placeholders
97
+ * @param subst Optional substitutions list
98
+ */
99
+ info(msg: string, ...subst: unknown[]): void;
100
+ /**
101
+ * @param obj A JavaScript value to output
102
+ * @param objs List of optional JavaScript values to output
103
+ */
104
+ fatal(obj: unknown, ...objs: unknown[]): void;
105
+ /**
106
+ * 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).
107
+ *
108
+ * @param msg Message with optional `%` placeholders
109
+ * @param subst Optional substitutions list
110
+ */
111
+ fatal(msg: string, ...subst: unknown[]): void;
112
+ /**
113
+ * Remove a device associated key-value pair. [Learn more](https://bugfender.com/blog/associated-device-information/).
114
+ *
115
+ * @param key Key identifier
116
+ */
117
+ removeDeviceKey(key: string): void;
118
+ /**
119
+ * Use this method if you need more control over the data sent while logging. See `ILogEntry` interface reference to see all the accepted properties.
120
+ *
121
+ * @param log Log object that complies with `ILogEntry` interface.
122
+ */
123
+ sendLog(log: ILogEntry): void;
124
+ /**
125
+ * Send an issue.
126
+ *
127
+ * @param title - Title
128
+ * @param text - Text content
129
+ * @returns Bugfender dashboard URL for the issue.
130
+ */
131
+ sendIssue(title: string, text: string): Promise<string>;
132
+ /**
133
+ * Send a crash report.
134
+ *
135
+ * @param title - Title
136
+ * @param text - Text content
137
+ * @returns Bugfender dashboard URL for the crash.
138
+ */
139
+ sendCrash(title: string, text: string): Promise<string>;
140
+ /**
141
+ * Send an user feedback.
142
+ *
143
+ * @param title - Title/Subject
144
+ * @param text - Feedback text
145
+ * @returns Bugfender dashboard URL for the feedback.
146
+ */
147
+ sendUserFeedback(title: string, text: string): Promise<string>;
148
+ /**
149
+ * Set a device associated key-value pair. [Learn more](https://bugfender.com/blog/associated-device-information/).
150
+ *
151
+ * @param key Key identifier.
152
+ * @param value Value.
153
+ */
154
+ setDeviceKey(key: string, value: DeviceKeyValue): void;
155
+ /**
156
+ * Synchronizes all logs and issues with the server once, regardless if this device is enabled or not.
157
+ *
158
+ * Logs and issues are synchronized only once. After that, the logs are again sent according to the enabled flag
159
+ * in the Bugfender Console.
160
+ */
161
+ forceSendOnce(): void;
162
+ }
163
+ export { BugfenderClass, RnBugfender };
@@ -0,0 +1,5 @@
1
+ import { LogLevel } from './types/log';
2
+ import { SDKOptionsBuilder } from './types/sdk-options';
3
+ import { BugfenderClass } from './bugfender';
4
+ declare const Bugfender: BugfenderClass;
5
+ export { Bugfender, LogLevel, SDKOptionsBuilder };
@@ -0,0 +1,4 @@
1
+ import { LogLevel } from './types/log';
2
+ import { SDKOptionsBuilder } from './types/sdk-options';
3
+ import { Bugfender } from '@bugfender/sdk';
4
+ export { Bugfender, LogLevel, SDKOptionsBuilder };
@@ -0,0 +1,10 @@
1
+ import type { StringFormatter } from "./string-formatter";
2
+ /**
3
+ * Overrides the `window.console` methods in order to execute the Bugfender equivalent logging
4
+ * methods while keeping the original browser functionality.
5
+ */
6
+ export declare class OverrideConsoleMethods {
7
+ protected window: Window;
8
+ constructor(window: Window);
9
+ init(stringFormatter: StringFormatter): void;
10
+ }
@@ -0,0 +1,14 @@
1
+ import type { ILogEntry } from "./types/log";
2
+ export declare class PrintToConsole {
3
+ protected readonly console: Console;
4
+ protected printToConsole: boolean;
5
+ constructor(console: Console);
6
+ init(printToConsole: boolean): void;
7
+ error(...parameters: unknown[]): void;
8
+ info(...parameters: unknown[]): void;
9
+ log(...parameters: unknown[]): void;
10
+ debug(...parameters: unknown[]): void;
11
+ trace(...parameters: unknown[]): void;
12
+ warn(...parameters: unknown[]): void;
13
+ printLog(log: ILogEntry): void;
14
+ }
@@ -0,0 +1,16 @@
1
+ import type { ISDKOptions } from "./types/sdk-options";
2
+ export declare class SDKOptions {
3
+ protected rules: {
4
+ appKey: string[];
5
+ apiURL: string[];
6
+ baseURL: string[];
7
+ overrideConsoleMethods: string[];
8
+ printToConsole: string[];
9
+ logBrowserEvents: string[];
10
+ logUIEvents: string[];
11
+ registerErrorHandler: string[];
12
+ version: string[];
13
+ };
14
+ init(options: ISDKOptions): ISDKOptions;
15
+ protected validate(options: ISDKOptions): void;
16
+ }
@@ -0,0 +1,4 @@
1
+ export declare class StringFormatter {
2
+ format(parameters: unknown[]): string;
3
+ private toString;
4
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Device Key Value
3
+ */
4
+ export declare type DeviceKeyValue = string | number | boolean;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Log Levels
3
+ *
4
+ * Check the main README to see how to access the `LogLevel` enum.
5
+ */
6
+ export declare enum LogLevel {
7
+ Debug = 0,
8
+ Warning = 1,
9
+ Error = 2,
10
+ Trace = 3,
11
+ Info = 4,
12
+ Fatal = 5
13
+ }
14
+ /**
15
+ * @hidden
16
+ */
17
+ export declare const LOG_LEVELS: LogLevel[];
18
+ /**
19
+ * @hidden
20
+ */
21
+ export interface ILogEntryShort {
22
+ /** Date ISO */
23
+ x: string;
24
+ /** Text */
25
+ t: string;
26
+ /** Method */
27
+ m: string;
28
+ /** Absolute Time */
29
+ at: number;
30
+ /** Tag */
31
+ tg: string;
32
+ /** File */
33
+ f: string;
34
+ /** Line */
35
+ l: number;
36
+ /** Level */
37
+ ll: number;
38
+ /** URL */
39
+ u: string;
40
+ }
41
+ /**
42
+ * Log Entry object interface
43
+ */
44
+ export interface ILogEntry {
45
+ /** The line number where the log was triggered from */
46
+ line?: number;
47
+ /** The log's level based on LogLevel constant */
48
+ level?: LogLevel;
49
+ /** The log's tag */
50
+ tag?: string;
51
+ /** The method name where the log was triggered from */
52
+ method?: string;
53
+ /** The file name where the log was triggered from */
54
+ file?: string;
55
+ /** The log's text content */
56
+ text?: string;
57
+ /** The log's origin URL. This attribute is ignored on Android & iOS */
58
+ url?: string;
59
+ }
@@ -0,0 +1,40 @@
1
+ export interface ISDKCommonOptions {
2
+ /** The app key to log into */
3
+ appKey: string;
4
+ /** Base URL to Bugfender API */
5
+ apiURL?: string;
6
+ /** Base URL to Bugfender web dashboard */
7
+ baseURL?: string;
8
+ /** Override default `window.console` so it also logs to Bugfender. Defaults to `true`. */
9
+ overrideConsoleMethods?: boolean;
10
+ /** Print also with `window.console` when Bugfender logging methods are called. Defaults to `true`. */
11
+ printToConsole?: boolean;
12
+ /** Register a handler for most common UI events to report them to Bugfender. Defaults to `true`. */
13
+ logUIEvents?: boolean;
14
+ /** Register error handler for uncaught errors that reports a crash to Bugfender. Defaults to `true`. */
15
+ registerErrorHandler?: boolean;
16
+ /** Sets the name for the device. If the Device Name is not set, then the platform standard device name will be automatically sent */
17
+ deviceName?: string;
18
+ }
19
+ export interface ISDKWebOptions {
20
+ /** Register a handler for most common browser events to report them to Bugfender (Web specific). Defaults to `true`. */
21
+ logBrowserEvents?: boolean;
22
+ /** App build identifier (Web specific) */
23
+ build?: string;
24
+ /** App version identifier (Web specific) */
25
+ version?: string;
26
+ }
27
+ export interface ISDKNativeOptions {
28
+ /** Logs all logs written via Logcat (Android specific). Defaults to `false`. */
29
+ enableLogcatLogging?: boolean;
30
+ }
31
+ export declare type ISDKOptions = ISDKCommonOptions & ISDKNativeOptions & ISDKWebOptions;
32
+ export declare class SDKOptionsBuilder {
33
+ private commonOptions;
34
+ private nativeOptions?;
35
+ private webOptions?;
36
+ constructor(commonOptions: ISDKCommonOptions);
37
+ native(nativeOptions: ISDKNativeOptions): SDKOptionsBuilder;
38
+ web(webOptions: ISDKWebOptions): SDKOptionsBuilder;
39
+ build(): ISDKOptions;
40
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Options object for `Bugfender.getUserFeedback` with customised modal strings.
3
+ */
4
+ export interface UserFeedbackOptions {
5
+ /** Default: `Feedback`. */
6
+ title?: string;
7
+ /** Default `Please insert your feedback here and click send`. */
8
+ hint?: string;
9
+ /** Default: `Subject…`. */
10
+ subjectPlaceholder?: string;
11
+ /** Default: `Your feedback…`. */
12
+ feedbackPlaceholder?: string;
13
+ /** Default: `Send`. */
14
+ submitLabel?: string;
15
+ /** Default: `Close`. This attribute is only used on iOS */
16
+ closeLabel?: string;
17
+ }
18
+ export declare class DefaultUserFeedbackOptions implements Required<UserFeedbackOptions> {
19
+ title: string;
20
+ hint: string;
21
+ subjectPlaceholder: string;
22
+ feedbackPlaceholder: string;
23
+ submitLabel: string;
24
+ closeLabel: string;
25
+ }
26
+ export interface UserFeedbackResult {
27
+ /** `true` if the user has sent the feedback. `false` if she has closed the modal without sending it. */
28
+ isSent: boolean;
29
+ /** If the feedback was sent this will contain the Bugfender URL for the feedback. */
30
+ feedbackURL?: string;
31
+ }
package/package.json CHANGED
@@ -1,25 +1,159 @@
1
1
  {
2
2
  "name": "@bugfender/rn-bugfender",
3
- "version": "1.1.3",
3
+ "version": "2.0.0-alpha.0",
4
4
  "description": "React Native bindings for Bugfender SDK",
5
- "main": "bugfender.js",
6
- "directories": {
7
- "example": "example"
8
- },
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "README.md",
12
+ "src",
13
+ "lib",
14
+ "android",
15
+ "ios",
16
+ "cpp",
17
+ "RnBugfender.podspec",
18
+ "!lib/typescript/example",
19
+ "!android/build",
20
+ "!ios/build",
21
+ "!**/__tests__",
22
+ "!**/__fixtures__",
23
+ "!**/__mocks__"
24
+ ],
9
25
  "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1"
11
- },
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://github.com/bugfender/rn-bugfender.git"
26
+ "test": "jest",
27
+ "typescript": "tsc --noEmit",
28
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
29
+ "prepare": "bob build",
30
+ "release": "release-it",
31
+ "example": "yarn --cwd example",
32
+ "pods": "cd example && pod-install --quiet",
33
+ "bootstrap": "yarn example && yarn && yarn pods"
15
34
  },
16
35
  "keywords": [
17
36
  "bugfender",
18
37
  "logging",
19
38
  "debug"
20
39
  ],
21
- "author": "Bugfender",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/bugfender/rn-bugfender.git",
43
+ "baseUrl": "https://github.com/bugfender/rn-bugfender.git"
44
+ },
45
+ "author": {
46
+ "name": "Bugfender"
47
+ },
22
48
  "license": "ISC",
49
+ "readmeFilename": "README.md",
50
+ "bugs": {
51
+ "url": "https://github.com/bugfender/rn-bugfender/issues"
52
+ },
23
53
  "homepage": "https://github.com/bugfender/rn-bugfender.git#readme",
24
- "dependencies": {}
54
+ "publishConfig": {
55
+ "registry": "https://registry.npmjs.org/"
56
+ },
57
+ "devDependencies": {
58
+ "@commitlint/config-conventional": "^11.0.0",
59
+ "@react-native-community/eslint-config": "^2.0.0",
60
+ "@release-it/conventional-changelog": "^2.0.0",
61
+ "@types/jest": "^26.0.0",
62
+ "@types/react": "^16.9.19",
63
+ "@types/react-native": "0.62.13",
64
+ "commitlint": "^11.0.0",
65
+ "eslint": "^7.2.0",
66
+ "eslint-config-prettier": "^7.0.0",
67
+ "eslint-plugin-prettier": "^3.1.3",
68
+ "husky": "^6.0.0",
69
+ "jest": "^26.0.1",
70
+ "pod-install": "^0.1.0",
71
+ "prettier": "^2.0.5",
72
+ "react": "16.13.1",
73
+ "react-native": "0.63.4",
74
+ "react-native-builder-bob": "^0.18.0",
75
+ "release-it": "^14.2.2",
76
+ "typescript": "^4.1.3"
77
+ },
78
+ "peerDependencies": {
79
+ "react": "*",
80
+ "react-native": "*"
81
+ },
82
+ "jest": {
83
+ "preset": "react-native",
84
+ "modulePathIgnorePatterns": [
85
+ "<rootDir>/example/node_modules",
86
+ "<rootDir>/lib/"
87
+ ]
88
+ },
89
+ "commitlint": {
90
+ "extends": [
91
+ "@commitlint/config-conventional"
92
+ ]
93
+ },
94
+ "release-it": {
95
+ "git": {
96
+ "commitMessage": "chore: release ${version}",
97
+ "tagName": "v${version}"
98
+ },
99
+ "npm": {
100
+ "publish": true
101
+ },
102
+ "github": {
103
+ "release": true
104
+ },
105
+ "plugins": {
106
+ "@release-it/conventional-changelog": {
107
+ "preset": "angular"
108
+ }
109
+ }
110
+ },
111
+ "eslintConfig": {
112
+ "root": true,
113
+ "extends": [
114
+ "@react-native-community",
115
+ "prettier"
116
+ ],
117
+ "rules": {
118
+ "prettier/prettier": [
119
+ "error",
120
+ {
121
+ "quoteProps": "consistent",
122
+ "singleQuote": true,
123
+ "tabWidth": 2,
124
+ "trailingComma": "es5",
125
+ "useTabs": false
126
+ }
127
+ ]
128
+ }
129
+ },
130
+ "eslintIgnore": [
131
+ "node_modules/",
132
+ "lib/"
133
+ ],
134
+ "prettier": {
135
+ "quoteProps": "consistent",
136
+ "singleQuote": true,
137
+ "tabWidth": 2,
138
+ "trailingComma": "es5",
139
+ "useTabs": false
140
+ },
141
+ "react-native-builder-bob": {
142
+ "source": "src",
143
+ "output": "lib",
144
+ "targets": [
145
+ "commonjs",
146
+ "module",
147
+ [
148
+ "typescript",
149
+ {
150
+ "project": "tsconfig.build.json"
151
+ }
152
+ ]
153
+ ]
154
+ },
155
+ "dependencies": {
156
+ "@bugfender/sdk": "^2.0.0-alpha.0",
157
+ "util": "^0.12.4"
158
+ }
25
159
  }