@sentry/react-native 5.0.0-alpha.1 → 5.0.0-alpha.11
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/CHANGELOG.md +403 -4
- package/README.md +6 -0
- package/RNSentry.podspec +22 -5
- package/android/build.gradle +20 -2
- package/android/src/main/java/io/sentry/react/{RNSentryModule.java → RNSentryModuleImpl.java} +174 -114
- package/android/src/main/java/io/sentry/react/RNSentryPackage.java +35 -19
- package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +119 -0
- package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +119 -0
- package/dist/js/NativeRNSentry.d.ts +52 -0
- package/dist/js/NativeRNSentry.d.ts.map +1 -0
- package/dist/js/NativeRNSentry.js +4 -0
- package/dist/js/NativeRNSentry.js.map +1 -0
- package/dist/js/client.d.ts +18 -6
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +96 -37
- package/dist/js/client.js.map +1 -1
- package/dist/js/index.d.ts +4 -3
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +3 -2
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts +9 -0
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +0 -2
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/index.d.ts +2 -0
- package/dist/js/integrations/index.d.ts.map +1 -1
- package/dist/js/integrations/index.js +2 -0
- package/dist/js/integrations/index.js.map +1 -1
- package/dist/js/integrations/modulesloader.d.ts +17 -0
- package/dist/js/integrations/modulesloader.d.ts.map +1 -0
- package/dist/js/integrations/modulesloader.js +39 -0
- package/dist/js/integrations/modulesloader.js.map +1 -0
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +10 -7
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/reactnativeinfo.d.ts +23 -0
- package/dist/js/integrations/reactnativeinfo.d.ts.map +1 -0
- package/dist/js/integrations/reactnativeinfo.js +43 -0
- package/dist/js/integrations/reactnativeinfo.js.map +1 -0
- package/dist/js/integrations/screenshot.d.ts +23 -0
- package/dist/js/integrations/screenshot.d.ts.map +1 -0
- package/dist/js/integrations/screenshot.js +39 -0
- package/dist/js/integrations/screenshot.js.map +1 -0
- package/dist/js/integrations/sdkinfo.d.ts +4 -1
- package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
- package/dist/js/integrations/sdkinfo.js +13 -7
- package/dist/js/integrations/sdkinfo.js.map +1 -1
- package/dist/js/measurements.d.ts +4 -0
- package/dist/js/measurements.d.ts.map +1 -1
- package/dist/js/measurements.js +12 -1
- package/dist/js/measurements.js.map +1 -1
- package/dist/js/misc.d.ts +9 -0
- package/dist/js/misc.d.ts.map +1 -0
- package/dist/js/misc.js +17 -0
- package/dist/js/misc.js.map +1 -0
- package/dist/js/options.d.ts +45 -9
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/scope.d.ts +10 -2
- package/dist/js/scope.d.ts.map +1 -1
- package/dist/js/scope.js +13 -1
- package/dist/js/scope.js.map +1 -1
- package/dist/js/sdk.d.ts +25 -0
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +86 -27
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tools/ModulesCollector.d.ts +17 -0
- package/dist/js/tools/ModulesCollector.d.ts.map +1 -0
- package/dist/js/tools/ModulesCollector.js +109 -0
- package/dist/js/tools/ModulesCollector.js.map +1 -0
- package/dist/js/tools/collectModules.d.ts +2 -0
- package/dist/js/tools/collectModules.d.ts.map +1 -0
- package/dist/js/tools/collectModules.js +11 -0
- package/dist/js/tools/collectModules.js.map +1 -0
- package/dist/js/touchevents.d.ts +8 -0
- package/dist/js/touchevents.d.ts.map +1 -1
- package/dist/js/touchevents.js +10 -5
- package/dist/js/touchevents.js.map +1 -1
- package/dist/js/tracing/nativeframes.js.map +1 -1
- package/dist/js/tracing/reactnativenavigation.d.ts +9 -0
- package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnativenavigation.js +20 -12
- package/dist/js/tracing/reactnativenavigation.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts +15 -6
- package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
- package/dist/js/tracing/reactnativetracing.js +16 -9
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/tracing/reactnavigation.d.ts +7 -1
- package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigation.js +31 -23
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/tracing/reactnavigationv4.d.ts +9 -9
- package/dist/js/tracing/reactnavigationv4.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigationv4.js +27 -15
- package/dist/js/tracing/reactnavigationv4.js.map +1 -1
- package/dist/js/tracing/routingInstrumentation.d.ts +1 -1
- package/dist/js/tracing/routingInstrumentation.d.ts.map +1 -1
- package/dist/js/tracing/routingInstrumentation.js.map +1 -1
- package/dist/js/tracing/utils.d.ts +4 -3
- package/dist/js/tracing/utils.d.ts.map +1 -1
- package/dist/js/tracing/utils.js +7 -10
- package/dist/js/tracing/utils.js.map +1 -1
- package/dist/js/transports/TextEncoder.d.ts +3 -0
- package/dist/js/transports/TextEncoder.d.ts.map +1 -0
- package/dist/js/transports/TextEncoder.js +12 -0
- package/dist/js/transports/TextEncoder.js.map +1 -0
- package/dist/js/transports/native.d.ts +10 -1
- package/dist/js/transports/native.d.ts.map +1 -1
- package/dist/js/transports/native.js +15 -4
- package/dist/js/transports/native.js.map +1 -1
- package/dist/js/user.d.ts +6 -0
- package/dist/js/user.d.ts.map +1 -0
- package/dist/js/user.js +1 -0
- package/dist/js/user.js.map +1 -0
- package/dist/js/utils/envelope.d.ts +12 -0
- package/dist/js/utils/envelope.d.ts.map +1 -0
- package/dist/js/utils/envelope.js +21 -0
- package/dist/js/utils/envelope.js.map +1 -0
- package/dist/js/utils/environment.d.ts +7 -0
- package/dist/js/utils/environment.d.ts.map +1 -0
- package/dist/js/utils/environment.js +14 -0
- package/dist/js/utils/environment.js.map +1 -0
- package/dist/js/utils/ignorerequirecyclelogs.d.ts +6 -0
- package/dist/js/utils/ignorerequirecyclelogs.d.ts.map +1 -0
- package/dist/js/utils/ignorerequirecyclelogs.js +15 -0
- package/dist/js/utils/ignorerequirecyclelogs.js.map +1 -0
- package/dist/js/utils/outcome.d.ts +6 -0
- package/dist/js/utils/outcome.d.ts.map +1 -0
- package/dist/js/utils/outcome.js +19 -0
- package/dist/js/utils/outcome.js.map +1 -0
- package/dist/js/utils/safe.d.ts +18 -0
- package/dist/js/utils/safe.d.ts.map +1 -0
- package/dist/js/utils/safe.js +46 -0
- package/dist/js/utils/safe.js.map +1 -0
- package/dist/js/utils/worldwide.d.ts +13 -0
- package/dist/js/utils/worldwide.d.ts.map +1 -0
- package/dist/js/utils/worldwide.js +4 -0
- package/dist/js/utils/worldwide.js.map +1 -0
- package/dist/js/vendor/buffer/index.d.ts +2 -0
- package/dist/js/vendor/buffer/index.d.ts.map +1 -0
- package/dist/js/vendor/buffer/index.js +2 -0
- package/dist/js/vendor/buffer/index.js.map +1 -0
- package/dist/js/vendor/buffer/utf8ToBytes.d.ts +10 -0
- package/dist/js/vendor/buffer/utf8ToBytes.d.ts.map +1 -0
- package/dist/js/vendor/buffer/utf8ToBytes.js +82 -0
- package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -0
- package/dist/js/vendor/index.d.ts +2 -0
- package/dist/js/vendor/index.d.ts.map +1 -0
- package/dist/js/vendor/index.js +2 -0
- package/dist/js/vendor/index.js.map +1 -0
- package/dist/js/version.d.ts +2 -1
- package/dist/js/version.d.ts.map +1 -1
- package/dist/js/version.js +2 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts +13 -4
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +129 -71
- package/dist/js/wrapper.js.map +1 -1
- package/ios/{RNSentry.m → RNSentry.mm} +98 -57
- package/package.json +32 -26
- package/sample-new-architecture/react-native.config.js +10 -0
- package/scripts/collect-modules.sh +43 -0
- package/sentry.gradle +57 -6
- package/src/js/NativeRNSentry.ts +66 -0
- package/dist/js/definitions.d.ts +0 -52
- package/dist/js/definitions.d.ts.map +0 -1
- package/dist/js/definitions.js +0 -1
- package/dist/js/definitions.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/js/vendor/buffer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,GACZ,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/js/vendor/buffer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,GACZ,MAAM,eAAe,CAAC","sourcesContent":["export {\n utf8ToBytes,\n} from './utf8ToBytes';\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a string to a byte array
|
|
3
|
+
*
|
|
4
|
+
* This is a utf8ToBytes function from the buffer module (with added types)
|
|
5
|
+
* https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/index.js#L1956
|
|
6
|
+
*
|
|
7
|
+
* License: MIT (https://github.com/feross/buffer)
|
|
8
|
+
*/
|
|
9
|
+
export declare function utf8ToBytes(string: string, units?: number): number[];
|
|
10
|
+
//# sourceMappingURL=utf8ToBytes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utf8ToBytes.d.ts","sourceRoot":"","sources":["../../../../src/js/vendor/buffer/utf8ToBytes.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CA8EpE"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Convert a string to a byte array
|
|
4
|
+
*
|
|
5
|
+
* This is a utf8ToBytes function from the buffer module (with added types)
|
|
6
|
+
* https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/index.js#L1956
|
|
7
|
+
*
|
|
8
|
+
* License: MIT (https://github.com/feross/buffer)
|
|
9
|
+
*/
|
|
10
|
+
export function utf8ToBytes(string, units) {
|
|
11
|
+
units = units || Infinity;
|
|
12
|
+
let codePoint;
|
|
13
|
+
const length = string.length;
|
|
14
|
+
let leadSurrogate = null;
|
|
15
|
+
const bytes = [];
|
|
16
|
+
for (let i = 0; i < length; ++i) {
|
|
17
|
+
codePoint = string.charCodeAt(i);
|
|
18
|
+
// is surrogate component
|
|
19
|
+
if (codePoint > 0xD7FF && codePoint < 0xE000) {
|
|
20
|
+
// last char was a lead
|
|
21
|
+
if (!leadSurrogate) {
|
|
22
|
+
// no lead yet
|
|
23
|
+
if (codePoint > 0xDBFF) {
|
|
24
|
+
// unexpected trail
|
|
25
|
+
if ((units -= 3) > -1)
|
|
26
|
+
bytes.push(0xEF, 0xBF, 0xBD);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
else if (i + 1 === length) {
|
|
30
|
+
// unpaired lead
|
|
31
|
+
if ((units -= 3) > -1)
|
|
32
|
+
bytes.push(0xEF, 0xBF, 0xBD);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
// valid lead
|
|
36
|
+
leadSurrogate = codePoint;
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
// 2 leads in a row
|
|
40
|
+
if (codePoint < 0xDC00) {
|
|
41
|
+
if ((units -= 3) > -1)
|
|
42
|
+
bytes.push(0xEF, 0xBF, 0xBD);
|
|
43
|
+
leadSurrogate = codePoint;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
// valid surrogate pair
|
|
47
|
+
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
|
|
48
|
+
}
|
|
49
|
+
else if (leadSurrogate) {
|
|
50
|
+
// valid bmp char, but last char was a lead
|
|
51
|
+
if ((units -= 3) > -1)
|
|
52
|
+
bytes.push(0xEF, 0xBF, 0xBD);
|
|
53
|
+
}
|
|
54
|
+
leadSurrogate = null;
|
|
55
|
+
// encode utf8
|
|
56
|
+
if (codePoint < 0x80) {
|
|
57
|
+
if ((units -= 1) < 0)
|
|
58
|
+
break;
|
|
59
|
+
bytes.push(codePoint);
|
|
60
|
+
}
|
|
61
|
+
else if (codePoint < 0x800) {
|
|
62
|
+
if ((units -= 2) < 0)
|
|
63
|
+
break;
|
|
64
|
+
bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);
|
|
65
|
+
}
|
|
66
|
+
else if (codePoint < 0x10000) {
|
|
67
|
+
if ((units -= 3) < 0)
|
|
68
|
+
break;
|
|
69
|
+
bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
|
|
70
|
+
}
|
|
71
|
+
else if (codePoint < 0x110000) {
|
|
72
|
+
if ((units -= 4) < 0)
|
|
73
|
+
break;
|
|
74
|
+
bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
throw new Error('Invalid code point');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return bytes;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=utf8ToBytes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utf8ToBytes.js","sourceRoot":"","sources":["../../../../src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,IAAI,EACxB,SAAS,IAAI,GAAG,GAAG,IAAI,GAAG,IAAI,EAC9B,SAAS,IAAI,GAAG,GAAG,IAAI,GAAG,IAAI,EAC9B,SAAS,GAAG,IAAI,GAAG,IAAI,CACxB,CAAA;SACF;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;SACtC;KACF;IAED,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["/* eslint-disable */\n\n/**\n * Convert a string to a byte array\n *\n * This is a utf8ToBytes function from the buffer module (with added types)\n * https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/index.js#L1956\n *\n * License: MIT (https://github.com/feross/buffer)\n */\nexport function utf8ToBytes(string: string, units?: number): number[] {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes: number[] = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,GACZ,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/js/vendor/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,GACZ,MAAM,UAAU,CAAC","sourcesContent":["\nexport {\n utf8ToBytes,\n} from './buffer';\n"]}
|
package/dist/js/version.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
|
|
1
2
|
export declare const SDK_NAME = "sentry.javascript.react-native";
|
|
2
|
-
export declare const SDK_VERSION = "5.0.0-alpha.
|
|
3
|
+
export declare const SDK_VERSION = "5.0.0-alpha.11";
|
|
3
4
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/js/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AACzD,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAC3D,eAAO,MAAM,QAAQ,mCAAmC,CAAC;AACzD,eAAO,MAAM,WAAW,mBAAmB,CAAC"}
|
package/dist/js/version.js
CHANGED
package/dist/js/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.0.0-alpha.11';\n"]}
|
package/dist/js/wrapper.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Breadcrumb, Envelope, EnvelopeItem, Event, Package, SeverityLevel, User } from '@sentry/types';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
|
-
import { NativeAppStartResponse, NativeDeviceContextsResponse, NativeFramesResponse, NativeReleaseResponse,
|
|
3
|
+
import { NativeAppStartResponse, NativeDeviceContextsResponse, NativeFramesResponse, NativeReleaseResponse, Spec } from './NativeRNSentry';
|
|
4
4
|
import { ReactNativeOptions } from './options';
|
|
5
|
+
export interface Screenshot {
|
|
6
|
+
data: Uint8Array;
|
|
7
|
+
contentType: string;
|
|
8
|
+
filename: string;
|
|
9
|
+
}
|
|
5
10
|
interface SentryNativeWrapper {
|
|
6
11
|
enableNative: boolean;
|
|
7
12
|
nativeIsReady: boolean;
|
|
8
13
|
platform: typeof Platform.OS;
|
|
9
14
|
_NativeClientError: Error;
|
|
10
15
|
_DisabledNativeError: Error;
|
|
11
|
-
|
|
16
|
+
_processItem(envelopeItem: EnvelopeItem): EnvelopeItem;
|
|
12
17
|
_processLevels(event: Event): Event;
|
|
13
18
|
_processLevel(level: SeverityLevel): SeverityLevel;
|
|
14
19
|
_serializeObject(data: {
|
|
@@ -16,17 +21,20 @@ interface SentryNativeWrapper {
|
|
|
16
21
|
}): {
|
|
17
22
|
[key: string]: string;
|
|
18
23
|
};
|
|
19
|
-
_isModuleLoaded(module:
|
|
24
|
+
_isModuleLoaded(module: Spec | undefined): module is Spec;
|
|
25
|
+
_getBreadcrumbs(event: Event): Breadcrumb[] | undefined;
|
|
20
26
|
isNativeTransportAvailable(): boolean;
|
|
21
27
|
initNativeSdk(options: ReactNativeOptions): PromiseLike<boolean>;
|
|
22
28
|
closeNativeSdk(): PromiseLike<void>;
|
|
23
29
|
sendEnvelope(envelope: Envelope): Promise<void>;
|
|
30
|
+
captureScreenshot(): Promise<Screenshot[] | null>;
|
|
24
31
|
fetchNativeRelease(): PromiseLike<NativeReleaseResponse>;
|
|
25
32
|
fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse>;
|
|
26
33
|
fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;
|
|
27
34
|
fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;
|
|
28
35
|
fetchNativeSdkInfo(): PromiseLike<Package | null>;
|
|
29
36
|
disableNativeFramesTracking(): void;
|
|
37
|
+
enableNativeFramesTracking(): void;
|
|
30
38
|
addBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
31
39
|
setContext(key: string, context: {
|
|
32
40
|
[key: string]: unknown;
|
|
@@ -36,6 +44,7 @@ interface SentryNativeWrapper {
|
|
|
36
44
|
setUser(user: User | null): void;
|
|
37
45
|
setTag(key: string, value: string): void;
|
|
38
46
|
nativeCrash(): void;
|
|
47
|
+
fetchModules(): Promise<Record<string, string> | null>;
|
|
39
48
|
}
|
|
40
49
|
/**
|
|
41
50
|
* Our internal interface for calling native functions
|
package/dist/js/wrapper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/js/wrapper.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/js/wrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,OAAO,EACP,aAAa,EACb,IAAI,EACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAiB,QAAQ,EAAwB,MAAM,cAAc,CAAC;AAG7E,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EAErB,IAAI,EACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAS/C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,mBAAmB;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,OAAO,QAAQ,CAAC,EAAE,CAAC;IAE7B,kBAAkB,EAAE,KAAK,CAAC;IAC1B,oBAAoB,EAAE,KAAK,CAAC;IAE5B,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,YAAY,CAAC;IACvD,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;IACpC,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAAC;IACnD,gBAAgB,CAAC,IAAI,EAAE;QAAE,CAA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C;IAC5C,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC,WAAW,IAAI,IAAI,CAAC;IAEpB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;CACxD;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,mBAkhBpB,CAAC"}
|
package/dist/js/wrapper.js
CHANGED
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
import { __awaiter, __rest } from "tslib";
|
|
2
|
-
import { logger, SentryError } from '@sentry/utils';
|
|
3
|
-
import { NativeModules, Platform } from 'react-native';
|
|
4
|
-
|
|
2
|
+
import { logger, normalize, SentryError } from '@sentry/utils';
|
|
3
|
+
import { NativeModules, Platform, TurboModuleRegistry } from 'react-native';
|
|
4
|
+
import { isHardCrash } from './misc';
|
|
5
|
+
import { isTurboModuleEnabled } from './utils/environment';
|
|
6
|
+
import { utf8ToBytes } from './vendor';
|
|
7
|
+
const RNSentry = isTurboModuleEnabled()
|
|
8
|
+
? TurboModuleRegistry.getEnforcing('RNSentry')
|
|
9
|
+
: NativeModules.RNSentry;
|
|
5
10
|
/**
|
|
6
11
|
* Our internal interface for calling native functions
|
|
7
12
|
*/
|
|
8
13
|
export const NATIVE = {
|
|
14
|
+
fetchModules() {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
if (!this.enableNative) {
|
|
17
|
+
throw this._DisabledNativeError;
|
|
18
|
+
}
|
|
19
|
+
if (!this._isModuleLoaded(RNSentry)) {
|
|
20
|
+
throw this._NativeClientError;
|
|
21
|
+
}
|
|
22
|
+
const raw = yield RNSentry.fetchModules();
|
|
23
|
+
if (raw) {
|
|
24
|
+
return JSON.parse(raw);
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
});
|
|
28
|
+
},
|
|
9
29
|
/**
|
|
10
30
|
* Sending the envelope over the bridge to native
|
|
11
31
|
* @param envelope Envelope
|
|
12
32
|
*/
|
|
13
33
|
sendEnvelope(envelope) {
|
|
14
|
-
var _a, _b, _c, _d;
|
|
15
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
35
|
if (!this.enableNative) {
|
|
17
36
|
logger.warn('Event was skipped as native SDK is not enabled.');
|
|
@@ -20,62 +39,43 @@ export const NATIVE = {
|
|
|
20
39
|
if (!this._isModuleLoaded(RNSentry)) {
|
|
21
40
|
throw this._NativeClientError;
|
|
22
41
|
}
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
sent through the scope sync feature. This causes duplicate breadcrumbs.
|
|
37
|
-
We then remove the breadcrumbs in all cases but if it is handled == false,
|
|
38
|
-
this is a signal that the app would crash and android would lose the breadcrumbs by the time the app is restarted to read
|
|
39
|
-
the envelope.
|
|
40
|
-
*/
|
|
41
|
-
if (((_d = (_c = (_b = (_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.mechanism) === null || _d === void 0 ? void 0 : _d.handled) != false && event.breadcrumbs) {
|
|
42
|
-
event.breadcrumbs = [];
|
|
43
|
-
}
|
|
44
|
-
envelopeItems[1] = event;
|
|
45
|
-
}
|
|
46
|
-
// Content type is not inside BaseEnvelopeItemHeaders.
|
|
47
|
-
envelopeItems[0].content_type = 'application/json';
|
|
48
|
-
const itemPayload = JSON.stringify(envelopeItems[1]);
|
|
49
|
-
let length = itemPayload.length;
|
|
50
|
-
try {
|
|
51
|
-
length = yield RNSentry.getStringBytesLength(itemPayload);
|
|
52
|
-
}
|
|
53
|
-
catch (_e) {
|
|
54
|
-
// The native call failed, we do nothing, we have payload.length as a fallback
|
|
55
|
-
}
|
|
56
|
-
envelopeItems[0].length = length;
|
|
57
|
-
const itemHeader = JSON.stringify(envelopeItems[0]);
|
|
58
|
-
envelopeItemsBuilder += `\n${itemHeader}\n${itemPayload}`;
|
|
42
|
+
const [EOL] = utf8ToBytes('\n');
|
|
43
|
+
const [envelopeHeader, envelopeItems] = envelope;
|
|
44
|
+
const headerString = JSON.stringify(envelopeHeader);
|
|
45
|
+
let envelopeBytes = utf8ToBytes(headerString);
|
|
46
|
+
envelopeBytes.push(EOL);
|
|
47
|
+
let hardCrashed = false;
|
|
48
|
+
for (const rawItem of envelopeItems) {
|
|
49
|
+
const [itemHeader, itemPayload] = this._processItem(rawItem);
|
|
50
|
+
let bytesContentType;
|
|
51
|
+
let bytesPayload = [];
|
|
52
|
+
if (typeof itemPayload === 'string') {
|
|
53
|
+
bytesContentType = 'text/plain';
|
|
54
|
+
bytesPayload = utf8ToBytes(itemPayload);
|
|
59
55
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
else if (itemPayload instanceof Uint8Array) {
|
|
57
|
+
bytesContentType = typeof itemHeader.content_type === 'string'
|
|
58
|
+
? itemHeader.content_type
|
|
59
|
+
: 'application/octet-stream';
|
|
60
|
+
bytesPayload = [...itemPayload];
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
bytesContentType = 'application/json';
|
|
64
|
+
bytesPayload = utf8ToBytes(JSON.stringify(itemPayload));
|
|
65
|
+
if (!hardCrashed) {
|
|
66
|
+
hardCrashed = isHardCrash(itemPayload);
|
|
68
67
|
}
|
|
69
|
-
const itemPayload = JSON.parse(JSON.stringify(envelopeItems[1]));
|
|
70
|
-
// The envelope item is created (and its length determined) on the iOS side of the native bridge.
|
|
71
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
72
|
-
yield RNSentry.captureEnvelope({
|
|
73
|
-
header,
|
|
74
|
-
payload: itemPayload,
|
|
75
|
-
});
|
|
76
68
|
}
|
|
69
|
+
// Content type is not inside BaseEnvelopeItemHeaders.
|
|
70
|
+
itemHeader.content_type = bytesContentType;
|
|
71
|
+
itemHeader.length = bytesPayload.length;
|
|
72
|
+
const serializedItemHeader = JSON.stringify(itemHeader);
|
|
73
|
+
envelopeBytes.push(...utf8ToBytes(serializedItemHeader));
|
|
74
|
+
envelopeBytes.push(EOL);
|
|
75
|
+
envelopeBytes = envelopeBytes.concat(bytesPayload);
|
|
76
|
+
envelopeBytes.push(EOL);
|
|
77
77
|
}
|
|
78
|
-
;
|
|
78
|
+
yield RNSentry.captureEnvelope(envelopeBytes, { store: hardCrashed });
|
|
79
79
|
});
|
|
80
80
|
},
|
|
81
81
|
/**
|
|
@@ -210,20 +210,22 @@ export const NATIVE = {
|
|
|
210
210
|
if (!this._isModuleLoaded(RNSentry)) {
|
|
211
211
|
throw this._NativeClientError;
|
|
212
212
|
}
|
|
213
|
-
// separate and
|
|
214
|
-
let
|
|
215
|
-
let
|
|
213
|
+
// separate and serialize all non-default user keys.
|
|
214
|
+
let userKeys = null;
|
|
215
|
+
let userDataKeys = null;
|
|
216
216
|
if (user) {
|
|
217
|
-
const { id, ip_address, email, username } = user, otherKeys = __rest(user, ["id", "ip_address", "email", "username"]);
|
|
218
|
-
|
|
219
|
-
email,
|
|
217
|
+
const { id, ip_address, email, username, segment } = user, otherKeys = __rest(user, ["id", "ip_address", "email", "username", "segment"]);
|
|
218
|
+
const requiredUser = {
|
|
220
219
|
id,
|
|
221
220
|
ip_address,
|
|
221
|
+
email,
|
|
222
222
|
username,
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
segment,
|
|
224
|
+
};
|
|
225
|
+
userKeys = this._serializeObject(requiredUser);
|
|
226
|
+
userDataKeys = this._serializeObject(otherKeys);
|
|
225
227
|
}
|
|
226
|
-
RNSentry.setUser(
|
|
228
|
+
RNSentry.setUser(userKeys, userDataKeys);
|
|
227
229
|
},
|
|
228
230
|
/**
|
|
229
231
|
* Sets a tag in the native module.
|
|
@@ -273,7 +275,7 @@ export const NATIVE = {
|
|
|
273
275
|
level: breadcrumb.level
|
|
274
276
|
? this._processLevel(breadcrumb.level)
|
|
275
277
|
: undefined, data: breadcrumb.data
|
|
276
|
-
?
|
|
278
|
+
? normalize(breadcrumb.data)
|
|
277
279
|
: undefined }));
|
|
278
280
|
},
|
|
279
281
|
/**
|
|
@@ -300,7 +302,7 @@ export const NATIVE = {
|
|
|
300
302
|
if (!this._isModuleLoaded(RNSentry)) {
|
|
301
303
|
throw this._NativeClientError;
|
|
302
304
|
}
|
|
303
|
-
RNSentry.setContext(key, context !== null ?
|
|
305
|
+
RNSentry.setContext(key, context !== null ? normalize(context) : null);
|
|
304
306
|
},
|
|
305
307
|
/**
|
|
306
308
|
* Closes the Native Layer SDK
|
|
@@ -327,19 +329,55 @@ export const NATIVE = {
|
|
|
327
329
|
}
|
|
328
330
|
RNSentry.disableNativeFramesTracking();
|
|
329
331
|
},
|
|
332
|
+
enableNativeFramesTracking() {
|
|
333
|
+
if (!this.enableNative) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
if (!this._isModuleLoaded(RNSentry)) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
RNSentry.enableNativeFramesTracking();
|
|
340
|
+
},
|
|
330
341
|
isNativeTransportAvailable() {
|
|
331
342
|
return this.enableNative && this._isModuleLoaded(RNSentry);
|
|
332
343
|
},
|
|
344
|
+
captureScreenshot() {
|
|
345
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
346
|
+
if (!this.enableNative) {
|
|
347
|
+
throw this._DisabledNativeError;
|
|
348
|
+
}
|
|
349
|
+
if (!this._isModuleLoaded(RNSentry)) {
|
|
350
|
+
throw this._NativeClientError;
|
|
351
|
+
}
|
|
352
|
+
try {
|
|
353
|
+
const raw = yield RNSentry.captureScreenshot();
|
|
354
|
+
return raw.map((item) => (Object.assign(Object.assign({}, item), { data: new Uint8Array(item.data) })));
|
|
355
|
+
}
|
|
356
|
+
catch (e) {
|
|
357
|
+
logger.warn('Failed to capture screenshot', e);
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
},
|
|
333
362
|
/**
|
|
334
363
|
* Gets the event from envelopeItem and applies the level filter to the selected event.
|
|
335
364
|
* @param data An envelope item containing the event.
|
|
336
365
|
* @returns The event from envelopeItem or undefined.
|
|
337
366
|
*/
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
367
|
+
_processItem(item) {
|
|
368
|
+
const [itemHeader, itemPayload] = item;
|
|
369
|
+
if (itemHeader.type == 'event' || itemHeader.type == 'transaction') {
|
|
370
|
+
const event = this._processLevels(itemPayload);
|
|
371
|
+
if (NATIVE.platform === 'android') {
|
|
372
|
+
if ('message' in event) {
|
|
373
|
+
// @ts-ignore Android still uses the old message object, without this the serialization of events will break.
|
|
374
|
+
event.message = { message: event.message };
|
|
375
|
+
}
|
|
376
|
+
event.breadcrumbs = this._getBreadcrumbs(event);
|
|
377
|
+
}
|
|
378
|
+
return [itemHeader, event];
|
|
341
379
|
}
|
|
342
|
-
return
|
|
380
|
+
return item;
|
|
343
381
|
},
|
|
344
382
|
/**
|
|
345
383
|
* Serializes all values of root-level keys into strings.
|
|
@@ -389,6 +427,26 @@ export const NATIVE = {
|
|
|
389
427
|
},
|
|
390
428
|
_DisabledNativeError: new SentryError('Native is disabled'),
|
|
391
429
|
_NativeClientError: new SentryError("Native Client is not available, can't start on native."),
|
|
430
|
+
/**
|
|
431
|
+
* Get breadcrumbs (removes breadcrumbs from handled exceptions on Android)
|
|
432
|
+
*
|
|
433
|
+
* We do this to avoid duplicate breadcrumbs on Android as sentry-android applies the breadcrumbs
|
|
434
|
+
* from the native scope onto every envelope sent through it. This scope will contain the breadcrumbs
|
|
435
|
+
* sent through the scope sync feature. This causes duplicate breadcrumbs.
|
|
436
|
+
* We then remove the breadcrumbs in all cases but if it is handled == false,
|
|
437
|
+
* this is a signal that the app would crash and android would lose the breadcrumbs by the time the app is restarted to read
|
|
438
|
+
* the envelope.
|
|
439
|
+
*/
|
|
440
|
+
_getBreadcrumbs(event) {
|
|
441
|
+
let breadcrumbs = event.breadcrumbs;
|
|
442
|
+
const hardCrashed = isHardCrash(event);
|
|
443
|
+
if (NATIVE.platform === 'android'
|
|
444
|
+
&& event.breadcrumbs
|
|
445
|
+
&& !hardCrashed) {
|
|
446
|
+
breadcrumbs = [];
|
|
447
|
+
}
|
|
448
|
+
return breadcrumbs;
|
|
449
|
+
},
|
|
392
450
|
enableNative: true,
|
|
393
451
|
nativeIsReady: false,
|
|
394
452
|
platform: Platform.OS,
|