@bugfender/rn-bugfender 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RnBugfender.podspec +15 -0
- package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +117 -40
- package/android/gradle.properties +5 -0
- package/android/src/main/java/com/{bugfender/react → bugfender.react}/RnBugfenderModule.java +0 -0
- package/android/src/main/java/com/{bugfender/react → bugfender.react}/RnBugfenderPackage.java +0 -0
- package/ios/{RnBugfender.m → RnBugfender.mm} +16 -4
- package/ios/RnBugfender.xcodeproj/project.pbxproj +4 -17
- package/lib/commonjs/bugfender.js +14 -26
- package/lib/commonjs/bugfender.js.map +1 -1
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +2 -2
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/override-console-methods.js +9 -9
- package/lib/commonjs/override-console-methods.js.map +1 -1
- package/lib/commonjs/sdk-options.js +5 -34
- package/lib/commonjs/sdk-options.js.map +1 -1
- package/lib/commonjs/types/sdk-options.js +2 -2
- package/lib/commonjs/types/sdk-options.js.map +1 -1
- package/lib/commonjs/user-feedback.js.map +1 -1
- package/lib/module/bugfender.js +12 -22
- package/lib/module/bugfender.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/override-console-methods.js +9 -9
- package/lib/module/override-console-methods.js.map +1 -1
- package/lib/module/sdk-options.js +5 -34
- package/lib/module/sdk-options.js.map +1 -1
- package/lib/module/types/sdk-options.js +2 -2
- package/lib/module/types/sdk-options.js.map +1 -1
- package/lib/module/user-feedback.js.map +1 -1
- package/lib/typescript/bugfender.d.ts +4 -6
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.web.d.ts +1 -1
- package/lib/typescript/override-console-methods.d.ts +1 -2
- package/lib/typescript/sdk-options.d.ts +2 -12
- package/lib/typescript/user-feedback.d.ts +2 -15
- package/package.json +26 -22
- package/src/bugfender.ts +11 -16
- package/src/index.tsx +1 -1
- package/src/index.web.tsx +1 -1
- package/src/override-console-methods.ts +8 -9
- package/src/sdk-options.ts +6 -35
- package/src/types/sdk-options.ts +2 -2
- package/src/user-feedback.ts +3 -16
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -185
- package/android/gradlew.bat +0 -89
- package/lib/commonjs/print-to-console.js +0 -78
- package/lib/commonjs/print-to-console.js.map +0 -1
- package/lib/commonjs/string-formatter.js +0 -55
- package/lib/commonjs/string-formatter.js.map +0 -1
- package/lib/commonjs/types/device.js +0 -2
- package/lib/commonjs/types/device.js.map +0 -1
- package/lib/commonjs/types/log.js +0 -35
- package/lib/commonjs/types/log.js.map +0 -1
- package/lib/commonjs/utilities.js +0 -18
- package/lib/commonjs/utilities.js.map +0 -1
- package/lib/module/print-to-console.js +0 -67
- package/lib/module/print-to-console.js.map +0 -1
- package/lib/module/string-formatter.js +0 -45
- package/lib/module/string-formatter.js.map +0 -1
- package/lib/module/types/device.js +0 -2
- package/lib/module/types/device.js.map +0 -1
- package/lib/module/types/log.js +0 -24
- package/lib/module/types/log.js.map +0 -1
- package/lib/module/utilities.js +0 -11
- package/lib/module/utilities.js.map +0 -1
- package/lib/typescript/print-to-console.d.ts +0 -14
- package/lib/typescript/string-formatter.d.ts +0 -4
- package/lib/typescript/types/device.d.ts +0 -4
- package/lib/typescript/types/log.d.ts +0 -59
- package/lib/typescript/utilities.d.ts +0 -1
- package/src/print-to-console.ts +0 -67
- package/src/string-formatter.ts +0 -44
- package/src/types/device.ts +0 -4
- package/src/types/log.ts +0 -75
- package/src/utilities.ts +0 -8
package/lib/module/utilities.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["utilities.ts"],"names":["removeUndefinedAttributes","object","Object","entries","forEach","key","value","undefined"],"mappings":"AAAA,OAAO,SAASA,yBAAT,CAAmCC,MAAnC,EAAgD;AACrDC,EAAAA,MAAM,CAACC,OAAP,CAAeF,MAAf,EAAuBG,OAAvB,CAA+B,QAAkB;AAAA,QAAjB,CAACC,GAAD,EAAMC,KAAN,CAAiB;;AAC/C,QAAIA,KAAK,KAAKC,SAAd,EAAyB;AACvB;AACA,aAAON,MAAM,CAACI,GAAD,CAAb;AACD;AACF,GALD;AAMD","sourcesContent":["export function removeUndefinedAttributes(object: any) {\n Object.entries(object).forEach(([key, value]) => {\n if (value === undefined) {\n // @ts-ignore\n delete object[key];\n }\n });\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function removeUndefinedAttributes(object: any): void;
|
package/src/print-to-console.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {format} from 'util';
|
|
2
|
-
import type {ILogEntry} from "./types/log";
|
|
3
|
-
import {LogLevel} from "./types/log";
|
|
4
|
-
|
|
5
|
-
export class PrintToConsole {
|
|
6
|
-
protected printToConsole: boolean = false;
|
|
7
|
-
|
|
8
|
-
constructor(
|
|
9
|
-
protected readonly console: Console,
|
|
10
|
-
) {
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public init(printToConsole: boolean): void {
|
|
14
|
-
this.printToConsole = printToConsole;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
public error(...parameters: unknown[]): void {
|
|
18
|
-
if (this.printToConsole) {
|
|
19
|
-
this.console.error(...parameters);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public info(...parameters: unknown[]): void {
|
|
24
|
-
if (this.printToConsole) {
|
|
25
|
-
this.console.info(...parameters);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
public log(...parameters: unknown[]): void {
|
|
30
|
-
if (this.printToConsole) {
|
|
31
|
-
this.console.log(...parameters);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public debug(...parameters: unknown[]): void {
|
|
36
|
-
if (this.printToConsole) {
|
|
37
|
-
this.console.debug(...parameters);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public trace(...parameters: unknown[]): void {
|
|
42
|
-
if (this.printToConsole) {
|
|
43
|
-
this.console.trace(...parameters);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public warn(...parameters: unknown[]): void {
|
|
48
|
-
if (this.printToConsole) {
|
|
49
|
-
this.console.warn(...parameters);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
public printLog(log: ILogEntry): void {
|
|
54
|
-
if (this.printToConsole) {
|
|
55
|
-
// Log to browser console
|
|
56
|
-
// debug, warning, error, trace, info, fatal
|
|
57
|
-
const levelToMethod = ['log', 'warn', 'error', 'trace', 'info', 'error'];
|
|
58
|
-
const method = levelToMethod[log.level || LogLevel.Debug];
|
|
59
|
-
const tag = log.tag ? `[${log.tag}] ` : '';
|
|
60
|
-
const location = [log.file || '', log.method || '', log.line || ''].filter(p => p !== '').join(':');
|
|
61
|
-
const message = `${tag}${format(log.text)} ${location}`;
|
|
62
|
-
|
|
63
|
-
// @ts-ignore
|
|
64
|
-
this.console[method](message);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
package/src/string-formatter.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {format} from "util";
|
|
2
|
-
|
|
3
|
-
export class StringFormatter {
|
|
4
|
-
public format(parameters: unknown[]): string {
|
|
5
|
-
const [, ...textParams] = parameters;
|
|
6
|
-
let [textFormat] = parameters as string[];
|
|
7
|
-
let text: string;
|
|
8
|
-
|
|
9
|
-
try {
|
|
10
|
-
// Our sanitizer gives better results, try with it first
|
|
11
|
-
textFormat = this.toString(textFormat);
|
|
12
|
-
} catch {
|
|
13
|
-
// Fallback to `format`
|
|
14
|
-
textFormat = format(textFormat);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (textParams.length > 0) {
|
|
18
|
-
text = format(textFormat, ...textParams);
|
|
19
|
-
} else {
|
|
20
|
-
text = textFormat;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return text;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
private toString(value: unknown): string {
|
|
27
|
-
// Depending on the type we prefer to do `String` or `stringify`
|
|
28
|
-
const isToString = ['string', 'symbol', 'bigint', 'function'].includes(typeof value) || value instanceof Error;
|
|
29
|
-
|
|
30
|
-
if (isToString) {
|
|
31
|
-
try {
|
|
32
|
-
return String(value);
|
|
33
|
-
} catch {
|
|
34
|
-
return JSON.stringify(value);
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
try {
|
|
38
|
-
return JSON.stringify(value);
|
|
39
|
-
} catch {
|
|
40
|
-
return String(value);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
package/src/types/device.ts
DELETED
package/src/types/log.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Log Levels
|
|
3
|
-
*
|
|
4
|
-
* Check the main README to see how to access the `LogLevel` enum.
|
|
5
|
-
*/
|
|
6
|
-
export enum LogLevel {
|
|
7
|
-
Debug = 0,
|
|
8
|
-
Warning = 1,
|
|
9
|
-
Error = 2,
|
|
10
|
-
Trace = 3,
|
|
11
|
-
Info = 4,
|
|
12
|
-
Fatal = 5,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
export const LOG_LEVELS: LogLevel[] = [
|
|
19
|
-
LogLevel.Debug,
|
|
20
|
-
LogLevel.Warning,
|
|
21
|
-
LogLevel.Error,
|
|
22
|
-
LogLevel.Trace,
|
|
23
|
-
LogLevel.Info,
|
|
24
|
-
LogLevel.Fatal,
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @hidden
|
|
29
|
-
*/
|
|
30
|
-
export interface ILogEntryShort {
|
|
31
|
-
/** Date ISO */
|
|
32
|
-
x: string;
|
|
33
|
-
/** Text */
|
|
34
|
-
t: string;
|
|
35
|
-
/** Method */
|
|
36
|
-
m: string;
|
|
37
|
-
/** Absolute Time */
|
|
38
|
-
at: number;
|
|
39
|
-
/** Tag */
|
|
40
|
-
tg: string;
|
|
41
|
-
/** File */
|
|
42
|
-
f: string;
|
|
43
|
-
/** Line */
|
|
44
|
-
l: number;
|
|
45
|
-
/** Level */
|
|
46
|
-
ll: number;
|
|
47
|
-
/** URL */
|
|
48
|
-
u: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Log Entry object interface
|
|
53
|
-
*/
|
|
54
|
-
export interface ILogEntry {
|
|
55
|
-
/** The line number where the log was triggered from */
|
|
56
|
-
line?: number;
|
|
57
|
-
|
|
58
|
-
/** The log's level based on LogLevel constant */
|
|
59
|
-
level?: LogLevel;
|
|
60
|
-
|
|
61
|
-
/** The log's tag */
|
|
62
|
-
tag?: string;
|
|
63
|
-
|
|
64
|
-
/** The method name where the log was triggered from */
|
|
65
|
-
method?: string;
|
|
66
|
-
|
|
67
|
-
/** The file name where the log was triggered from */
|
|
68
|
-
file?: string;
|
|
69
|
-
|
|
70
|
-
/** The log's text content */
|
|
71
|
-
text?: string;
|
|
72
|
-
|
|
73
|
-
/** The log's origin URL. This attribute is ignored on Android & iOS */
|
|
74
|
-
url?: string;
|
|
75
|
-
}
|