@sentry/react-native 5.25.0-alpha.2 → 5.25.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/CHANGELOG.md +13 -63
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java +87 -0
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +7 -102
- package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +0 -10
- package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +0 -10
- package/dist/js/NativeRNSentry.d.ts +1 -3
- package/dist/js/NativeRNSentry.d.ts.map +1 -1
- package/dist/js/NativeRNSentry.js.map +1 -1
- package/dist/js/client.d.ts +0 -4
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +2 -12
- package/dist/js/client.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +26 -7
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/default.d.ts.map +1 -1
- package/dist/js/integrations/default.js +1 -9
- package/dist/js/integrations/default.js.map +1 -1
- package/dist/js/integrations/exports.d.ts +1 -2
- package/dist/js/integrations/exports.d.ts.map +1 -1
- package/dist/js/integrations/exports.js +1 -2
- package/dist/js/integrations/exports.js.map +1 -1
- package/dist/js/integrations/index.d.ts +0 -1
- package/dist/js/integrations/index.d.ts.map +1 -1
- package/dist/js/integrations/index.js +0 -1
- package/dist/js/integrations/index.js.map +1 -1
- package/dist/js/misc.d.ts +2 -0
- package/dist/js/misc.d.ts.map +1 -1
- package/dist/js/misc.js +4 -2
- package/dist/js/misc.js.map +1 -1
- package/dist/js/options.d.ts +2 -24
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/touchevents.d.ts.map +1 -1
- package/dist/js/touchevents.js +30 -57
- package/dist/js/touchevents.js.map +1 -1
- package/dist/js/utils/environment.d.ts +0 -4
- package/dist/js/utils/environment.d.ts.map +1 -1
- package/dist/js/utils/environment.js +0 -8
- package/dist/js/utils/environment.js.map +1 -1
- package/dist/js/utils/error.d.ts +1 -0
- package/dist/js/utils/error.d.ts.map +1 -1
- package/dist/js/utils/error.js.map +1 -1
- package/dist/js/utils/worldwide.d.ts +0 -6
- package/dist/js/utils/worldwide.d.ts.map +1 -1
- package/dist/js/utils/worldwide.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.d.ts.map +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts +1 -7
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +1 -25
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.mm +9 -34
- package/ios/RNSentryBreadcrumb.h +4 -0
- package/ios/RNSentryBreadcrumb.m +19 -0
- package/package.json +1 -1
- package/sentry.gradle +1 -1
- package/src/js/NativeRNSentry.ts +1 -3
- package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -3
- package/ts3.8/dist/js/client.d.ts +0 -4
- package/ts3.8/dist/js/integrations/exports.d.ts +1 -2
- package/ts3.8/dist/js/integrations/index.d.ts +0 -1
- package/ts3.8/dist/js/misc.d.ts +2 -0
- package/ts3.8/dist/js/options.d.ts +2 -24
- package/ts3.8/dist/js/utils/environment.d.ts +0 -4
- package/ts3.8/dist/js/utils/error.d.ts +1 -0
- package/ts3.8/dist/js/utils/worldwide.d.ts +0 -6
- package/ts3.8/dist/js/version.d.ts +1 -1
- package/ts3.8/dist/js/wrapper.d.ts +1 -7
- package/android/src/main/java/io/sentry/react/RNSentryReplayBreadcrumbConverter.java +0 -178
- package/dist/js/replay/mobilereplay.d.ts +0 -36
- package/dist/js/replay/mobilereplay.d.ts.map +0 -1
- package/dist/js/replay/mobilereplay.js +0 -99
- package/dist/js/replay/mobilereplay.js.map +0 -1
- package/dist/js/replay/networkUtils.d.ts +0 -8
- package/dist/js/replay/networkUtils.d.ts.map +0 -1
- package/dist/js/replay/networkUtils.js +0 -52
- package/dist/js/replay/networkUtils.js.map +0 -1
- package/dist/js/replay/xhrUtils.d.ts +0 -6
- package/dist/js/replay/xhrUtils.d.ts.map +0 -1
- package/dist/js/replay/xhrUtils.js +0 -31
- package/dist/js/replay/xhrUtils.js.map +0 -1
- package/dist/js/utils/clientutils.d.ts +0 -10
- package/dist/js/utils/clientutils.d.ts.map +0 -1
- package/dist/js/utils/clientutils.js +0 -9
- package/dist/js/utils/clientutils.js.map +0 -1
- package/ios/RNSentryReplay.h +0 -8
- package/ios/RNSentryReplay.m +0 -60
- package/ios/RNSentryReplayBreadcrumbConverter.h +0 -16
- package/ios/RNSentryReplayBreadcrumbConverter.m +0 -172
- package/ts3.8/dist/js/replay/mobilereplay.d.ts +0 -36
- package/ts3.8/dist/js/replay/networkUtils.d.ts +0 -8
- package/ts3.8/dist/js/replay/xhrUtils.d.ts +0 -6
- package/ts3.8/dist/js/utils/clientutils.d.ts +0 -10
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"xhrUtils.d.ts","sourceRoot":"","sources":["../../../src/js/replay/xhrUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAkD,MAAM,eAAe,CAAC;AAMhH;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAyBlH"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { dropUndefinedKeys } from '@sentry/utils';
|
|
2
|
-
import { getBodySize, parseContentLengthHeader } from './networkUtils';
|
|
3
|
-
/**
|
|
4
|
-
* Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.
|
|
5
|
-
*/
|
|
6
|
-
export function enrichXhrBreadcrumbsForMobileReplay(breadcrumb, hint) {
|
|
7
|
-
if (breadcrumb.category !== 'xhr' || !hint) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
const xhrHint = hint;
|
|
11
|
-
if (!xhrHint.xhr) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const now = Date.now();
|
|
15
|
-
const { startTimestamp = now, endTimestamp = now, input, xhr } = xhrHint;
|
|
16
|
-
const reqSize = getBodySize(input);
|
|
17
|
-
const resSize = xhr.getResponseHeader('content-length')
|
|
18
|
-
? parseContentLengthHeader(xhr.getResponseHeader('content-length'))
|
|
19
|
-
: _getBodySize(xhr.response, xhr.responseType);
|
|
20
|
-
breadcrumb.data = dropUndefinedKeys(Object.assign({ start_timestamp: startTimestamp, end_timestamp: endTimestamp, request_body_size: reqSize, response_body_size: resSize }, breadcrumb.data));
|
|
21
|
-
}
|
|
22
|
-
function _getBodySize(body, responseType) {
|
|
23
|
-
try {
|
|
24
|
-
const bodyStr = responseType === 'json' && body && typeof body === 'object' ? JSON.stringify(body) : body;
|
|
25
|
-
return getBodySize(bodyStr);
|
|
26
|
-
}
|
|
27
|
-
catch (_a) {
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=xhrUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"xhrUtils.js","sourceRoot":"","sources":["../../../src/js/replay/xhrUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAEvE;;GAEG;AACH,MAAM,UAAU,mCAAmC,CAAC,UAAsB,EAAE,IAAgC;IAC1G,IAAI,UAAU,CAAC,QAAQ,KAAK,KAAK,IAAI,CAAC,IAAI,EAAE;QAC1C,OAAO;KACR;IAED,MAAM,OAAO,GAAG,IAAwB,CAAC;IACzC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;QAChB,OAAO;KACR;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,EAAE,cAAc,GAAG,GAAG,EAAE,YAAY,GAAG,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IAEzE,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,GAAG,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;QACrD,CAAC,CAAC,wBAAwB,CAAC,GAAG,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;QACnE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IAEjD,UAAU,CAAC,IAAI,GAAG,iBAAiB,iBACjC,eAAe,EAAE,cAAc,EAC/B,aAAa,EAAE,YAAY,EAC3B,iBAAiB,EAAE,OAAO,EAC1B,kBAAkB,EAAE,OAAO,IACxB,UAAU,CAAC,IAAI,EAClB,CAAC;AACL,CAAC;AAOD,SAAS,YAAY,CACnB,IAAgC,EAChC,YAA4C;IAE5C,IAAI;QACF,MAAM,OAAO,GAAG,YAAY,KAAK,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1G,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;KAC7B;IAAC,WAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC","sourcesContent":["import type { Breadcrumb, BreadcrumbHint, SentryWrappedXMLHttpRequest, XhrBreadcrumbHint } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport type { RequestBody } from './networkUtils';\nimport { getBodySize, parseContentLengthHeader } from './networkUtils';\n\n/**\n * Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.\n */\nexport function enrichXhrBreadcrumbsForMobileReplay(breadcrumb: Breadcrumb, hint: BreadcrumbHint | undefined): void {\n if (breadcrumb.category !== 'xhr' || !hint) {\n return;\n }\n\n const xhrHint = hint as Partial<XhrHint>;\n if (!xhrHint.xhr) {\n return;\n }\n\n const now = Date.now();\n const { startTimestamp = now, endTimestamp = now, input, xhr } = xhrHint;\n\n const reqSize = getBodySize(input);\n const resSize = xhr.getResponseHeader('content-length')\n ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))\n : _getBodySize(xhr.response, xhr.responseType);\n\n breadcrumb.data = dropUndefinedKeys({\n start_timestamp: startTimestamp,\n end_timestamp: endTimestamp,\n request_body_size: reqSize,\n response_body_size: resSize,\n ...breadcrumb.data,\n });\n}\n\ntype XhrHint = XhrBreadcrumbHint & {\n xhr: XMLHttpRequest & SentryWrappedXMLHttpRequest;\n input?: RequestBody;\n};\n\nfunction _getBodySize(\n body: XMLHttpRequest['response'],\n responseType: XMLHttpRequest['responseType'],\n): number | undefined {\n try {\n const bodyStr = responseType === 'json' && body && typeof body === 'object' ? JSON.stringify(body) : body;\n return getBodySize(bodyStr);\n } catch {\n return undefined;\n }\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Client } from '@sentry/types';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if the provided Sentry client has hooks implemented.
|
|
4
|
-
* @param client The Sentry client object to check.
|
|
5
|
-
* @returns True if the client has hooks, false otherwise.
|
|
6
|
-
*/
|
|
7
|
-
export declare function hasHooks(client: Client): client is Client & {
|
|
8
|
-
on: Required<Client>['on'];
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=clientutils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientutils.d.ts","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG;IAAE,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAA;CAAE,CAE1F"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if the provided Sentry client has hooks implemented.
|
|
3
|
-
* @param client The Sentry client object to check.
|
|
4
|
-
* @returns True if the client has hooks, false otherwise.
|
|
5
|
-
*/
|
|
6
|
-
export function hasHooks(client) {
|
|
7
|
-
return client.on !== undefined;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=clientutils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientutils.js","sourceRoot":"","sources":["../../../src/js/utils/clientutils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,OAAO,MAAM,CAAC,EAAE,KAAK,SAAS,CAAC;AACjC,CAAC","sourcesContent":["import type { Client } from '@sentry/types';\n\n/**\n * Checks if the provided Sentry client has hooks implemented.\n * @param client The Sentry client object to check.\n * @returns True if the client has hooks, false otherwise.\n */\nexport function hasHooks(client: Client): client is Client & { on: Required<Client>['on'] } {\n return client.on !== undefined;\n}\n"]}
|
package/ios/RNSentryReplay.h
DELETED
package/ios/RNSentryReplay.m
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
#import "RNSentryReplay.h"
|
|
2
|
-
#import "RNSentryReplayBreadcrumbConverter.h"
|
|
3
|
-
|
|
4
|
-
#if SENTRY_TARGET_REPLAY_SUPPORTED
|
|
5
|
-
|
|
6
|
-
@implementation RNSentryReplay {
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
+ (void)updateOptions:(NSMutableDictionary *)options {
|
|
10
|
-
NSDictionary *experiments = options[@"_experiments"];
|
|
11
|
-
[options removeObjectForKey:@"_experiments"];
|
|
12
|
-
if (experiments == nil) {
|
|
13
|
-
NSLog(@"Session replay disabled via configuration");
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (experiments[@"replaysSessionSampleRate"] == nil &&
|
|
18
|
-
experiments[@"replaysOnErrorSampleRate"] == nil) {
|
|
19
|
-
NSLog(@"Session replay disabled via configuration");
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
NSLog(@"Setting up session replay");
|
|
24
|
-
NSDictionary *replayOptions = options[@"mobileReplayOptions"] ?: @{};
|
|
25
|
-
|
|
26
|
-
[options setValue:@{
|
|
27
|
-
@"sessionReplay" : @{
|
|
28
|
-
@"sessionSampleRate" : experiments[@"replaysSessionSampleRate"]
|
|
29
|
-
?: [NSNull null],
|
|
30
|
-
@"errorSampleRate" : experiments[@"replaysOnErrorSampleRate"]
|
|
31
|
-
?: [NSNull null],
|
|
32
|
-
@"redactAllImages" : replayOptions[@"maskAllImages"] ?: [NSNull null],
|
|
33
|
-
@"redactAllText" : replayOptions[@"maskAllText"] ?: [NSNull null],
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
forKey:@"experimental"];
|
|
37
|
-
|
|
38
|
-
[RNSentryReplay addReplayRNRedactClasses:replayOptions];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
+ (void)addReplayRNRedactClasses:(NSDictionary *_Nullable)replayOptions {
|
|
42
|
-
NSMutableArray *_Nonnull classesToRedact = [[NSMutableArray alloc] init];
|
|
43
|
-
if ([replayOptions[@"maskAllImages"] boolValue] == YES) {
|
|
44
|
-
[classesToRedact addObject:NSClassFromString(@"RCTImageView")];
|
|
45
|
-
}
|
|
46
|
-
if ([replayOptions[@"maskAllText"] boolValue] == YES) {
|
|
47
|
-
[classesToRedact addObject:NSClassFromString(@"RCTTextView")];
|
|
48
|
-
}
|
|
49
|
-
[PrivateSentrySDKOnly addReplayRedactClasses:classesToRedact];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
+ (void)postInit {
|
|
53
|
-
RNSentryReplayBreadcrumbConverter *breadcrumbConverter =
|
|
54
|
-
[[RNSentryReplayBreadcrumbConverter alloc] init];
|
|
55
|
-
[PrivateSentrySDKOnly configureSessionReplayWith:breadcrumbConverter
|
|
56
|
-
screenshotProvider:nil];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@end
|
|
60
|
-
#endif
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
@import Sentry;
|
|
2
|
-
|
|
3
|
-
#if SENTRY_TARGET_REPLAY_SUPPORTED
|
|
4
|
-
@class SentryRRWebEvent;
|
|
5
|
-
|
|
6
|
-
@interface RNSentryReplayBreadcrumbConverter
|
|
7
|
-
: NSObject <SentryReplayBreadcrumbConverter>
|
|
8
|
-
|
|
9
|
-
- (instancetype _Nonnull)init;
|
|
10
|
-
|
|
11
|
-
+ (NSString* _Nullable) getTouchPathMessageFrom:(NSArray* _Nullable) path;
|
|
12
|
-
|
|
13
|
-
- (id<SentryRRWebEvent> _Nullable)convertFrom:(SentryBreadcrumb *_Nonnull) breadcrumb;
|
|
14
|
-
|
|
15
|
-
@end
|
|
16
|
-
#endif
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
#import "RNSentryReplayBreadcrumbConverter.h"
|
|
2
|
-
|
|
3
|
-
@import Sentry;
|
|
4
|
-
|
|
5
|
-
#if SENTRY_TARGET_REPLAY_SUPPORTED
|
|
6
|
-
|
|
7
|
-
@implementation RNSentryReplayBreadcrumbConverter {
|
|
8
|
-
SentrySRDefaultBreadcrumbConverter *defaultConverter;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
- (instancetype _Nonnull)init {
|
|
12
|
-
if (self = [super init]) {
|
|
13
|
-
self->defaultConverter =
|
|
14
|
-
[SentrySessionReplayIntegration createDefaultBreadcrumbConverter];
|
|
15
|
-
}
|
|
16
|
-
return self;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
- (id<SentryRRWebEvent> _Nullable)convertFrom:
|
|
20
|
-
(SentryBreadcrumb *_Nonnull)breadcrumb {
|
|
21
|
-
assert(breadcrumb.timestamp != nil);
|
|
22
|
-
|
|
23
|
-
if ([breadcrumb.category isEqualToString:@"sentry.event"] ||
|
|
24
|
-
[breadcrumb.category isEqualToString:@"sentry.transaction"]) {
|
|
25
|
-
// Do not add Sentry Event breadcrumbs to replay
|
|
26
|
-
return nil;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if ([breadcrumb.category isEqualToString:@"http"]) {
|
|
30
|
-
// Drop native network breadcrumbs to avoid duplicates
|
|
31
|
-
return nil;
|
|
32
|
-
}
|
|
33
|
-
if ([breadcrumb.type isEqualToString:@"navigation"] && ![breadcrumb.category isEqualToString:@"navigation"]) {
|
|
34
|
-
// Drop native navigation breadcrumbs to avoid duplicates
|
|
35
|
-
return nil;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if ([breadcrumb.category isEqualToString:@"touch"]) {
|
|
39
|
-
return [self convertTouch:breadcrumb];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if ([breadcrumb.category isEqualToString:@"navigation"]) {
|
|
43
|
-
return [SentrySessionReplayIntegration
|
|
44
|
-
createBreadcrumbwithTimestamp:breadcrumb.timestamp
|
|
45
|
-
category:breadcrumb.category
|
|
46
|
-
message:nil
|
|
47
|
-
level:breadcrumb.level
|
|
48
|
-
data:breadcrumb.data];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if ([breadcrumb.category isEqualToString:@"xhr"]) {
|
|
52
|
-
return [self convertNavigation:breadcrumb];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
SentryRRWebEvent *nativeBreadcrumb =
|
|
56
|
-
[self->defaultConverter convertFrom:breadcrumb];
|
|
57
|
-
|
|
58
|
-
// ignore native navigation breadcrumbs
|
|
59
|
-
if (nativeBreadcrumb && nativeBreadcrumb.data &&
|
|
60
|
-
nativeBreadcrumb.data[@"payload"] &&
|
|
61
|
-
nativeBreadcrumb.data[@"payload"][@"category"] &&
|
|
62
|
-
[nativeBreadcrumb.data[@"payload"][@"category"]
|
|
63
|
-
isEqualToString:@"navigation"]) {
|
|
64
|
-
return nil;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return nativeBreadcrumb;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
- (id<SentryRRWebEvent> _Nullable) convertTouch:(SentryBreadcrumb *_Nonnull)breadcrumb {
|
|
71
|
-
if (breadcrumb.data == nil) {
|
|
72
|
-
return nil;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
NSMutableArray *path = [breadcrumb.data valueForKey:@"path"];
|
|
76
|
-
NSString* message = [RNSentryReplayBreadcrumbConverter getTouchPathMessageFrom:path];
|
|
77
|
-
|
|
78
|
-
return [SentrySessionReplayIntegration
|
|
79
|
-
createBreadcrumbwithTimestamp:breadcrumb.timestamp
|
|
80
|
-
category:@"ui.tap"
|
|
81
|
-
message:message
|
|
82
|
-
level:breadcrumb.level
|
|
83
|
-
data:breadcrumb.data];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
+ (NSString* _Nullable) getTouchPathMessageFrom:(NSArray* _Nullable) path {
|
|
87
|
-
if (path == nil) {
|
|
88
|
-
return nil;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
NSInteger pathCount = [path count];
|
|
92
|
-
if (pathCount <= 0) {
|
|
93
|
-
return nil;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
NSMutableString *message = [[NSMutableString alloc] init];
|
|
97
|
-
for (NSInteger i = MIN(3, pathCount - 1); i >= 0; i--) {
|
|
98
|
-
NSDictionary *item = [path objectAtIndex:i];
|
|
99
|
-
if (item == nil) {
|
|
100
|
-
return nil; // There should be no nil (undefined) from JS, but to be safe we check it here
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
id name = [item objectForKey:@"name"];
|
|
104
|
-
id label = [item objectForKey:@"label"];
|
|
105
|
-
BOOL hasName = [name isKindOfClass:[NSString class]];
|
|
106
|
-
BOOL hasLabel = [label isKindOfClass:[NSString class]];
|
|
107
|
-
if (!hasName && !hasLabel) {
|
|
108
|
-
return nil; // This again should never be allowed in JS, but to be safe we check it here
|
|
109
|
-
}
|
|
110
|
-
if (hasLabel) {
|
|
111
|
-
[message appendString:(NSString *)label];
|
|
112
|
-
} else if (hasName) {
|
|
113
|
-
[message appendString:(NSString *)name];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
id element = [item objectForKey:@"element"];
|
|
117
|
-
id file = [item objectForKey:@"file"];
|
|
118
|
-
BOOL hasElement = [element isKindOfClass:[NSString class]];
|
|
119
|
-
BOOL hasFile = [file isKindOfClass:[NSString class]];
|
|
120
|
-
if (hasElement && hasFile) {
|
|
121
|
-
[message appendFormat:@"(%@, %@)", (NSString *)element, (NSString *)file];
|
|
122
|
-
} else if (hasElement) {
|
|
123
|
-
[message appendFormat:@"(%@)", (NSString *)element];
|
|
124
|
-
} else if (hasFile) {
|
|
125
|
-
[message appendFormat:@"(%@)", (NSString *)file];
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (i > 0) {
|
|
129
|
-
[message appendString:@" > "];
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return message;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
- (id<SentryRRWebEvent> _Nullable)convertNavigation: (SentryBreadcrumb *_Nonnull)breadcrumb {
|
|
137
|
-
NSNumber* startTimestamp = [breadcrumb.data[@"start_timestamp"] isKindOfClass:[NSNumber class]]
|
|
138
|
-
? breadcrumb.data[@"start_timestamp"] : nil;
|
|
139
|
-
NSNumber* endTimestamp = [breadcrumb.data[@"end_timestamp"] isKindOfClass:[NSNumber class]]
|
|
140
|
-
? breadcrumb.data[@"end_timestamp"] : nil;
|
|
141
|
-
NSString* url = [breadcrumb.data[@"url"] isKindOfClass:[NSString class]]
|
|
142
|
-
? breadcrumb.data[@"url"] : nil;
|
|
143
|
-
|
|
144
|
-
if (startTimestamp == nil || endTimestamp == nil || url == nil) {
|
|
145
|
-
return nil;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
NSMutableDictionary* data = [[NSMutableDictionary alloc] init];
|
|
149
|
-
if ([breadcrumb.data[@"method"] isKindOfClass:[NSString class]]) {
|
|
150
|
-
data[@"method"] = breadcrumb.data[@"method"];
|
|
151
|
-
}
|
|
152
|
-
if ([breadcrumb.data[@"status_code"] isKindOfClass:[NSNumber class]]) {
|
|
153
|
-
data[@"statusCode"] = breadcrumb.data[@"status_code"];
|
|
154
|
-
}
|
|
155
|
-
if ([breadcrumb.data[@"request_body_size"] isKindOfClass:[NSNumber class]]) {
|
|
156
|
-
data[@"requestBodySize"] = breadcrumb.data[@"request_body_size"];
|
|
157
|
-
}
|
|
158
|
-
if ([breadcrumb.data[@"response_body_size"] isKindOfClass:[NSNumber class]]) {
|
|
159
|
-
data[@"responseBodySize"] = breadcrumb.data[@"response_body_size"];
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return [SentrySessionReplayIntegration
|
|
163
|
-
createNetworkBreadcrumbWithTimestamp:[NSDate dateWithTimeIntervalSince1970:(startTimestamp.doubleValue / 1000)]
|
|
164
|
-
endTimestamp:[NSDate dateWithTimeIntervalSince1970:(endTimestamp.doubleValue / 1000)]
|
|
165
|
-
operation:@"resource.http"
|
|
166
|
-
description:url
|
|
167
|
-
data:data];
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
@end
|
|
171
|
-
|
|
172
|
-
#endif
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { IntegrationFnResult } from '@sentry/types';
|
|
2
|
-
export declare const MOBILE_REPLAY_INTEGRATION_NAME = "MobileReplay";
|
|
3
|
-
export interface MobileReplayOptions {
|
|
4
|
-
/**
|
|
5
|
-
* Mask all text in recordings
|
|
6
|
-
*/
|
|
7
|
-
maskAllText?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Mask all text in recordings
|
|
10
|
-
*/
|
|
11
|
-
maskAllImages?: boolean;
|
|
12
|
-
}
|
|
13
|
-
type MobileReplayIntegration = IntegrationFnResult & {
|
|
14
|
-
options: Required<MobileReplayOptions>;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* The Mobile Replay Integration, let's you adjust the default mobile replay options.
|
|
18
|
-
* To be passed to `Sentry.init` with `replaysOnErrorSampleRate` or `replaysSessionSampleRate`.
|
|
19
|
-
*
|
|
20
|
-
* ```javascript
|
|
21
|
-
* Sentry.init({
|
|
22
|
-
* _experiments: {
|
|
23
|
-
* replaysOnErrorSampleRate: 1.0,
|
|
24
|
-
* replaysSessionSampleRate: 1.0,
|
|
25
|
-
* },
|
|
26
|
-
* integrations: [mobileReplayIntegration({
|
|
27
|
-
* // Adjust the default options
|
|
28
|
-
* })],
|
|
29
|
-
* });
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @experimental
|
|
33
|
-
*/
|
|
34
|
-
export declare const mobileReplayIntegration: (initOptions?: MobileReplayOptions) => MobileReplayIntegration;
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=mobilereplay.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react-native" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
/** Convert a Content-Length header to number/undefined. */
|
|
4
|
-
export declare function parseContentLengthHeader(header: string | null | undefined): number | undefined;
|
|
5
|
-
export type RequestBody = null | Blob | FormData | URLSearchParams | string | ArrayBuffer | undefined;
|
|
6
|
-
/** Get the size of a body. */
|
|
7
|
-
export declare function getBodySize(body: RequestBody): number | undefined;
|
|
8
|
-
//# sourceMappingURL=networkUtils.d.ts.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Breadcrumb, BreadcrumbHint } from '@sentry/types';
|
|
2
|
-
/**
|
|
3
|
-
* Enrich an XHR breadcrumb with additional data for Mobile Replay network tab.
|
|
4
|
-
*/
|
|
5
|
-
export declare function enrichXhrBreadcrumbsForMobileReplay(breadcrumb: Breadcrumb, hint: BreadcrumbHint | undefined): void;
|
|
6
|
-
//# sourceMappingURL=xhrUtils.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Client } from '@sentry/types';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if the provided Sentry client has hooks implemented.
|
|
4
|
-
* @param client The Sentry client object to check.
|
|
5
|
-
* @returns True if the client has hooks, false otherwise.
|
|
6
|
-
*/
|
|
7
|
-
export declare function hasHooks(client: Client): client is Client & {
|
|
8
|
-
on: Required<Client>['on'];
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=clientutils.d.ts.map
|