@truewatchtech/react-native-mobile 0.4.3-alpha.2 → 0.4.3

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 (95) hide show
  1. package/FTMobileReactNativeSDK.podspec +1 -1
  2. package/README.md +0 -34
  3. package/android/build.gradle +2 -2
  4. package/android/src/main/java/com/ft/sdk/reactnative/FTLogImpl.java +10 -2
  5. package/android/src/main/java/com/ft/sdk/reactnative/FTMobileImpl.java +45 -3
  6. package/android/src/main/java/com/ft/sdk/reactnative/FTRUMImpl.java +51 -9
  7. package/android/src/main/java/com/ft/sdk/reactnative/FTTraceImpl.java +5 -2
  8. package/android/src/main/java/com/ft/sdk/reactnative/ViewTiming.java +17 -0
  9. package/android/src/main/java/com/ft/sdk/reactnative/VisitorIdConfigMapper.java +50 -0
  10. package/android/src/newarch/java/com/ft/sdk/reactnative/FTMobileModule.java +5 -0
  11. package/android/src/newarch/java/com/ft/sdk/reactnative/FTRUMModule.java +18 -0
  12. package/android/src/oldarch/java/com/ft/sdk/reactnative/FTMobileModule.java +5 -0
  13. package/android/src/oldarch/java/com/ft/sdk/reactnative/FTRUMModule.java +15 -0
  14. package/android/src/test/java/com/ft/sdk/reactnative/FTMobileImplTest.java +53 -0
  15. package/ios/FTMobileReactNative.mm +37 -2
  16. package/ios/FTReactNativeLog.mm +7 -2
  17. package/ios/FTReactNativeRUM.mm +94 -4
  18. package/ios/FTReactNativeResource.m +6 -0
  19. package/ios/FTReactNativeTrace.mm +4 -2
  20. package/ios/FTReactNativeViewTiming.h +18 -0
  21. package/ios/FTWebSocketResourceData.h +4 -0
  22. package/ios/FTWebSocketResourceData.m +31 -0
  23. package/lib/commonjs/ft_logger.js +3 -1
  24. package/lib/commonjs/ft_logger.js.map +1 -1
  25. package/lib/commonjs/ft_mobile_agent.js +13 -1
  26. package/lib/commonjs/ft_mobile_agent.js.map +1 -1
  27. package/lib/commonjs/ft_rum.js +19 -3
  28. package/lib/commonjs/ft_rum.js.map +1 -1
  29. package/lib/commonjs/ft_tracing.js +2 -1
  30. package/lib/commonjs/ft_tracing.js.map +1 -1
  31. package/lib/commonjs/index.js +7 -0
  32. package/lib/commonjs/index.js.map +1 -1
  33. package/lib/commonjs/rum/FTRumViewTracking.js +147 -0
  34. package/lib/commonjs/rum/FTRumViewTracking.js.map +1 -0
  35. package/lib/commonjs/rum/FTRumWebSocketNative.js.map +1 -1
  36. package/lib/commonjs/rum/FTRumWebSocketTiming.js +19 -1
  37. package/lib/commonjs/rum/FTRumWebSocketTiming.js.map +1 -1
  38. package/lib/commonjs/rum/FTRumWebSocketTracking.js +7 -11
  39. package/lib/commonjs/rum/FTRumWebSocketTracking.js.map +1 -1
  40. package/lib/commonjs/specs/NativeFTMobileReactNative.js.map +1 -1
  41. package/lib/commonjs/specs/NativeFTReactNativeRUM.js.map +1 -1
  42. package/lib/commonjs/version.js +1 -1
  43. package/lib/commonjs/version.js.map +1 -1
  44. package/lib/commonjs/visitorIdConfig.js +37 -0
  45. package/lib/commonjs/visitorIdConfig.js.map +1 -0
  46. package/lib/module/ft_logger.js +3 -1
  47. package/lib/module/ft_logger.js.map +1 -1
  48. package/lib/module/ft_mobile_agent.js +13 -1
  49. package/lib/module/ft_mobile_agent.js.map +1 -1
  50. package/lib/module/ft_rum.js +19 -3
  51. package/lib/module/ft_rum.js.map +1 -1
  52. package/lib/module/ft_tracing.js +2 -1
  53. package/lib/module/ft_tracing.js.map +1 -1
  54. package/lib/module/index.js +1 -0
  55. package/lib/module/index.js.map +1 -1
  56. package/lib/module/rum/FTRumViewTracking.js +140 -0
  57. package/lib/module/rum/FTRumViewTracking.js.map +1 -0
  58. package/lib/module/rum/FTRumWebSocketNative.js.map +1 -1
  59. package/lib/module/rum/FTRumWebSocketTiming.js +19 -1
  60. package/lib/module/rum/FTRumWebSocketTiming.js.map +1 -1
  61. package/lib/module/rum/FTRumWebSocketTracking.js +7 -11
  62. package/lib/module/rum/FTRumWebSocketTracking.js.map +1 -1
  63. package/lib/module/specs/NativeFTMobileReactNative.js.map +1 -1
  64. package/lib/module/specs/NativeFTReactNativeRUM.js.map +1 -1
  65. package/lib/module/version.js +1 -1
  66. package/lib/module/version.js.map +1 -1
  67. package/lib/module/visitorIdConfig.js +31 -0
  68. package/lib/module/visitorIdConfig.js.map +1 -0
  69. package/lib/typescript/ft_logger.d.ts +11 -1
  70. package/lib/typescript/ft_mobile_agent.d.ts +25 -0
  71. package/lib/typescript/ft_rum.d.ts +33 -5
  72. package/lib/typescript/ft_tracing.d.ts +9 -1
  73. package/lib/typescript/index.d.ts +2 -0
  74. package/lib/typescript/rum/FTRumViewTracking.d.ts +32 -0
  75. package/lib/typescript/rum/FTRumWebSocketNative.d.ts +2 -3
  76. package/lib/typescript/rum/FTRumWebSocketTiming.d.ts +6 -1
  77. package/lib/typescript/rum/FTRumWebSocketTracking.d.ts +2 -4
  78. package/lib/typescript/specs/NativeFTMobileReactNative.d.ts +1 -0
  79. package/lib/typescript/specs/NativeFTReactNativeRUM.d.ts +7 -1
  80. package/lib/typescript/version.d.ts +1 -1
  81. package/lib/typescript/visitorIdConfig.d.ts +11 -0
  82. package/package.json +4 -3
  83. package/src/ft_logger.tsx +11 -1
  84. package/src/ft_mobile_agent.tsx +34 -1
  85. package/src/ft_rum.tsx +50 -5
  86. package/src/ft_tracing.tsx +9 -1
  87. package/src/index.tsx +4 -0
  88. package/src/rum/FTRumViewTracking.ts +179 -0
  89. package/src/rum/FTRumWebSocketNative.ts +2 -1
  90. package/src/rum/FTRumWebSocketTiming.ts +34 -2
  91. package/src/rum/FTRumWebSocketTracking.ts +9 -14
  92. package/src/specs/NativeFTMobileReactNative.ts +1 -0
  93. package/src/specs/NativeFTReactNativeRUM.ts +15 -1
  94. package/src/version.ts +1 -1
  95. package/src/visitorIdConfig.ts +123 -0
@@ -9,12 +9,55 @@
9
9
  #import "FTReactNativeRUM.h"
10
10
  #import <TrueWatchSDK/FTMobileAgent.h>
11
11
  #import <TrueWatchSDK/FTExternalDataManager.h>
12
+ #import <TrueWatchSDK/FTExternalDataManager+FrameworkIntegration.h>
13
+ #import "FTReactNativeViewTiming.h"
12
14
  #import "FTReactNativeResource.h"
13
15
  #import <React/RCTConvert.h>
14
16
  #import <React/RCTBridge.h>
15
17
  #import <UIKit/UIKit.h>
16
18
  #import "FTReactNativeUtils.h"
17
19
  #import "FTJSLongTaskMonitor.h"
20
+ #import <TrueWatchSDK/FTVisitorIDConfig+Private.h>
21
+ #include <math.h>
22
+
23
+ static FTVisitorIDConfig *FTVisitorIdConfigFromDictionary(id value, NSError **error) {
24
+ if (!value || value == NSNull.null) return nil;
25
+ NSString *reason = nil;
26
+ FTVisitorIDConfig *config = [FTVisitorIDConfig new];
27
+ if (![value isKindOfClass:NSDictionary.class]) {
28
+ reason = @"visitorIdConfig must be an object";
29
+ } else {
30
+ NSDictionary *map = value;
31
+ config.header = [map[@"header"] isKindOfClass:NSString.class] ? map[@"header"] : nil;
32
+ id hours = map[@"ttlHours"];
33
+ if (hours) {
34
+ double milliseconds = [hours isKindOfClass:NSNumber.class] ? [hours doubleValue] * 3600000 : NAN;
35
+ if (!isfinite(milliseconds) || milliseconds < 1 || milliseconds >= 9223372036854775807.0) reason = @"Visitor ID TTL is out of range";
36
+ else config.ttlHours = [hours doubleValue];
37
+ }
38
+ for (NSString *key in @[@"urlPrefixes", @"regularExpressions"]) {
39
+ id rules = map[key];
40
+ if (!rules) continue;
41
+ if (![rules isKindOfClass:NSArray.class]) { reason = @"Visitor ID rules must be arrays"; break; }
42
+ for (id rule in rules) {
43
+ if (![rule isKindOfClass:NSString.class] || [rule length] == 0) { reason = @"Invalid Visitor ID rule"; break; }
44
+ if ([key isEqualToString:@"urlPrefixes"]) {
45
+ [config addMatchWithURLPrefix:rule];
46
+ } else {
47
+ NSRegularExpression *expression = [NSRegularExpression regularExpressionWithPattern:rule options:0 error:error];
48
+ if (!expression) return nil;
49
+ [config addMatchWithRegularExpression:expression];
50
+ }
51
+ }
52
+ if (reason) break;
53
+ }
54
+ }
55
+ if (reason) {
56
+ if (error) *error = [NSError errorWithDomain:@"com.truewatch.rn.visitor-id-config" code:1 userInfo:@{NSLocalizedDescriptionKey: reason}];
57
+ return nil;
58
+ }
59
+ return [config validatedCopyWithError:error];
60
+ }
18
61
 
19
62
  @interface FTReactNativeRUM ()
20
63
  @property (atomic, strong, nullable) FTJSLongTaskMonitor *jsLongTaskMonitor;
@@ -67,6 +110,21 @@ RCT_REMAP_METHOD(onCreateView,
67
110
  rejecter:(RCTPromiseRejectBlock)reject){
68
111
  [self onCreateView:viewName loadTime:loadTime resolve:resolve reject:reject];
69
112
  }
113
+ RCT_REMAP_METHOD(onCreateViewWithLoadStart,
114
+ viewName:(NSString *)viewName loadTime:(double)loadTime loadStartEpochMs:(double)loadStartEpochMs
115
+ findEventsWithResolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
116
+ [self onCreateViewWithLoadStart:viewName loadTime:loadTime loadStartEpochMs:loadStartEpochMs resolve:resolve reject:reject];
117
+ }
118
+ RCT_REMAP_METHOD(updateViewLoadingTime,
119
+ duration:(double)duration
120
+ findEventsWithResolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
121
+ [self updateViewLoadingTime:duration resolve:resolve reject:reject];
122
+ }
123
+ RCT_REMAP_METHOD(startViewWithTrackingType,
124
+ viewName:(NSString *)viewName property:(NSDictionary *)property trackingType:(double)trackingType
125
+ findEventsWithResolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
126
+ [self startViewWithTrackingType:viewName property:property trackingType:trackingType resolve:resolve reject:reject];
127
+ }
70
128
  RCT_REMAP_METHOD(startView,
71
129
  viewName:(NSString *)viewName property:(NSDictionary *)property
72
130
  findEventsWithResolver:(RCTPromiseResolveBlock)resolve
@@ -162,19 +220,51 @@ RCT_REMAP_METHOD(addResource,
162
220
  resolve(nil);
163
221
  }
164
222
 
223
+ - (void)onCreateViewWithLoadStart:(NSString *)viewName loadTime:(double)loadTime loadStartEpochMs:(double)loadStartEpochMs resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
224
+ NSNumber *duration = FTViewDurationNanoseconds(loadTime);
225
+ [[FTExternalDataManager sharedManager] onCreateView:viewName loadTime:duration loadStartEpochNs:duration.longLongValue > 0 ? FTViewEpochNanoseconds(loadStartEpochMs) : nil];
226
+ resolve(nil);
227
+ }
228
+
229
+ - (void)startViewWithTrackingType:(NSString *)viewName property:(NSDictionary *)property trackingType:(double)trackingType resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
230
+ if (trackingType != 0 && trackingType != 1) {
231
+ reject(@"E_VIEW_TRACKING_TYPE", @"trackingType must be Manual (0) or Automatic (1)", nil);
232
+ return;
233
+ }
234
+ [[FTExternalDataManager sharedManager] startViewWithName:viewName property:property trackingType:(FTRUMViewTrackingType)(NSInteger)trackingType];
235
+ resolve(nil);
236
+ }
237
+
165
238
  - (void)onCreateView:(NSString *)viewName loadTime:(double)loadTime resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
166
239
  [[FTExternalDataManager sharedManager] onCreateView:viewName loadTime:@(loadTime)];
167
240
  resolve(nil);
168
241
  }
169
242
 
243
+ - (void)updateViewLoadingTime:(double)duration resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
244
+ if (!isfinite(duration) || duration < 0 || duration > 9007199254740991.0 || duration != floor(duration)) {
245
+ reject(@"E_VIEW_LOADING_TIME", @"duration must be a non-negative safe integer in nanoseconds", nil);
246
+ return;
247
+ }
248
+ [[FTExternalDataManager sharedManager] updateViewLoadingTime:@((int64_t)duration)];
249
+ resolve(nil);
250
+ }
251
+
170
252
  - (void)setConfig:(NSDictionary *)context resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
253
+ NSError *visitorError = nil;
254
+ FTVisitorIDConfig *visitorConfig = FTVisitorIdConfigFromDictionary(context[@"visitorIdConfig"], &visitorError);
255
+ if (visitorError) { reject(@"E_VISITOR_ID_CONFIG", visitorError.localizedDescription, visitorError); return; }
171
256
  NSString *rumAppId = [RCTConvert NSString:context[@"iOSAppId"]];
172
257
  FTRumConfig *rumConfig = [[FTRumConfig alloc]initWithAppid:rumAppId];
173
- if ([context.allKeys containsObject:@"sampleRate"]) {
174
- rumConfig.sampleRate = [RCTConvert double:context[@"sampleRate"]] * 100;
258
+ rumConfig.visitorIDConfig = visitorConfig;
259
+ if ([context.allKeys containsObject:@"sessionSamplingRate"]) {
260
+ rumConfig.sessionSamplingRate = [RCTConvert double:context[@"sessionSamplingRate"]];
261
+ } else if ([context.allKeys containsObject:@"sampleRate"]) {
262
+ rumConfig.sessionSamplingRate = [RCTConvert double:context[@"sampleRate"]] * 100;
175
263
  }
176
- if ([context.allKeys containsObject:@"sessionOnErrorSampleRate"]) {
177
- rumConfig.sessionOnErrorSampleRate = [RCTConvert double:context[@"sessionOnErrorSampleRate"]]*100;
264
+ if ([context.allKeys containsObject:@"sessionOnErrorSamplingRate"]) {
265
+ rumConfig.sessionOnErrorSamplingRate = [RCTConvert double:context[@"sessionOnErrorSamplingRate"]];
266
+ } else if ([context.allKeys containsObject:@"sessionOnErrorSampleRate"]) {
267
+ rumConfig.sessionOnErrorSamplingRate = [RCTConvert double:context[@"sessionOnErrorSampleRate"]] * 100;
178
268
  }
179
269
  if ([context.allKeys containsObject:@"enableNativeUserAction"]) {
180
270
  rumConfig.enableTraceUserAction = [RCTConvert BOOL:context[@"enableNativeUserAction"]];
@@ -1,4 +1,5 @@
1
1
  #import "FTReactNativeResource.h"
2
+ #import "FTWebSocketResourceData.h"
2
3
  #import <TrueWatchSDK/FTExternalDataManager.h>
3
4
  #import <TrueWatchSDK/FTResourceMetricsModel.h>
4
5
  #import <TrueWatchSDK/FTResourceContentModel.h>
@@ -14,6 +15,11 @@ void FTAddReactNativeResource(NSString *key, NSDictionary *content, NSDictionary
14
15
  if (metrics.allKeys.count>0) {
15
16
  metricsModel = [[FTResourceMetricsModel alloc]init];
16
17
  metricsModel.duration = [RCTConvert NSNumber:metrics[@"duration"]];
18
+ int64_t startNs, endNs;
19
+ if ([content[@"webSocketHandshake"] boolValue] && FTWebSocketResourceInterval(metrics, &startNs, &endNs)) {
20
+ metricsModel.fetchStartNsTimeInterval = startNs;
21
+ metricsModel.fetchEndNsTimeInterval = endNs;
22
+ }
17
23
  metricsModel.resource_dns = [RCTConvert NSNumber:metrics[@"resource_dns"]];
18
24
  metricsModel.resource_tcp = [RCTConvert NSNumber:metrics[@"resource_tcp"]];
19
25
  metricsModel.resource_ssl = [RCTConvert NSNumber:metrics[@"resource_ssl"]];
@@ -101,8 +101,10 @@ RCT_REMAP_METHOD(cancelWebSocketTrace,
101
101
 
102
102
  - (void)setConfig:(NSDictionary *)context resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
103
103
  FTTraceConfig *trace = [[FTTraceConfig alloc]init];
104
- if ([context.allKeys containsObject:@"sampleRate"]) {
105
- trace.sampleRate = [RCTConvert double:context[@"sampleRate"]] * 100;
104
+ if ([context.allKeys containsObject:@"traceSamplingRate"]) {
105
+ trace.traceSamplingRate = [RCTConvert double:context[@"traceSamplingRate"]];
106
+ } else if ([context.allKeys containsObject:@"sampleRate"]) {
107
+ trace.traceSamplingRate = [RCTConvert double:context[@"sampleRate"]] * 100;
106
108
  }
107
109
  if ([context.allKeys containsObject:@"traceType"]) {
108
110
  int traceType = [RCTConvert int:context[@"traceType"]];
@@ -0,0 +1,18 @@
1
+ #import <Foundation/Foundation.h>
2
+ #include <math.h>
3
+ #include <stdint.h>
4
+
5
+ // Use an exclusive 2^63 bound: double cannot represent INT64_MAX exactly.
6
+ static inline NSNumber *FTViewDurationNanoseconds(double value) {
7
+ return isfinite(value) && value > 0 && value < 0x1p63 ? @((int64_t)value) : @0;
8
+ }
9
+
10
+ static inline NSNumber *FTViewEpochNanoseconds(double milliseconds) {
11
+ if (!isfinite(milliseconds) || milliseconds <= 0 || milliseconds >= 0x1p63 / 1000000.0) return nil;
12
+ // Split before multiplication so integer millisecond epochs stay exact.
13
+ int64_t whole = (int64_t)milliseconds;
14
+ int64_t fraction = (int64_t)((milliseconds - whole) * 1000000.0);
15
+ if (whole > INT64_MAX / 1000000 || fraction > INT64_MAX - whole * 1000000) return nil;
16
+ int64_t nanoseconds = whole * 1000000 + fraction;
17
+ return nanoseconds > 0 ? @(nanoseconds) : nil;
18
+ }
@@ -5,6 +5,10 @@
5
5
  FOUNDATION_EXPORT NSDictionary *FTWebSocketResourceData(NSDictionary *content, NSDictionary *metrics,
6
6
  NSDictionary *metadata, NSString *event);
7
7
 
8
+ // Exact capture interval from decimal int64 nanosecond strings. Missing or
9
+ // invalid endpoints reject the whole pair; processing time is never substituted.
10
+ FOUNDATION_EXPORT BOOL FTWebSocketResourceInterval(NSDictionary *metrics, int64_t *start, int64_t *end);
11
+
8
12
  // Same precedence and polarity as the native Resource URL policy: the block
9
13
  // list wins when both callbacks exist. This decides collection, not business IO.
10
14
  FOUNDATION_EXPORT BOOL FTWebSocketShouldCollectResource(NSURL *url,
@@ -2,6 +2,32 @@
2
2
  #import <objc/message.h>
3
3
  #include <math.h>
4
4
  #include <string.h>
5
+ #include <stdint.h>
6
+
7
+ static BOOL FTWebSocketEpochNanoseconds(id value, int64_t *result) {
8
+ if (![value isKindOfClass:NSString.class]) return NO;
9
+ NSString *text = value;
10
+ if (text.length == 0 || text.length > 19 || [text characterAtIndex:0] == '0') return NO;
11
+ int64_t number = 0;
12
+ for (NSUInteger index = 0; index < text.length; index++) {
13
+ unichar character = [text characterAtIndex:index];
14
+ if (character < '0' || character > '9') return NO;
15
+ int digit = character - '0';
16
+ if (number > (INT64_MAX - digit) / 10) return NO;
17
+ number = number * 10 + digit;
18
+ }
19
+ *result = number;
20
+ return YES;
21
+ }
22
+
23
+ BOOL FTWebSocketResourceInterval(NSDictionary *metrics, int64_t *start, int64_t *end) {
24
+ int64_t startNs, endNs;
25
+ if (!FTWebSocketEpochNanoseconds(metrics[@"fetchStartNsTimeInterval"], &startNs) ||
26
+ !FTWebSocketEpochNanoseconds(metrics[@"fetchEndNsTimeInterval"], &endNs) || endNs < startNs) return NO;
27
+ *start = startNs;
28
+ *end = endNs;
29
+ return YES;
30
+ }
5
31
 
6
32
  BOOL FTWebSocketDiscardTraceResource(id interceptor, NSString *key) {
7
33
  if (!interceptor || !key.length) return NO;
@@ -70,6 +96,11 @@ NSDictionary *FTWebSocketResourceData(NSDictionary *content, NSDictionary *metri
70
96
  id duration = metrics[@"duration"];
71
97
  if ([duration isKindOfClass:NSNumber.class] && isfinite([duration doubleValue]) && [duration doubleValue] >= 0)
72
98
  resultMetrics[@"duration"] = duration; // JS event-boundary duration, already in nanoseconds.
99
+ int64_t startNs, endNs;
100
+ if (FTWebSocketResourceInterval(metrics, &startNs, &endNs)) {
101
+ resultMetrics[@"fetchStartNsTimeInterval"] = metrics[@"fetchStartNsTimeInterval"];
102
+ resultMetrics[@"fetchEndNsTimeInterval"] = metrics[@"fetchEndNsTimeInterval"];
103
+ }
73
104
  if ([metadata[@"httpProtocol"] isKindOfClass:NSString.class]) resultMetrics[@"resource_http_protocol"] = metadata[@"httpProtocol"];
74
105
  return @{@"content": resource, @"metrics": resultMetrics};
75
106
  }
@@ -29,8 +29,10 @@ let FTLogCacheDiscard = exports.FTLogCacheDiscard = /*#__PURE__*/function (FTLog
29
29
  }({});
30
30
  /**
31
31
  * Configure log output configuration.
32
- * @param sampleRate sampling rate
32
+ * @param logSamplingRate Log sampling percentage in [0, 100], default 100. Supports fractional percentages and takes precedence over sampleRate.
33
+ * @param sampleRate Deprecated log sampling probability in [0, 1], default 1. Used only when logSamplingRate is omitted; multiplied by 100 before passing to Native.
33
34
  * @param enableLinkRumData whether to link with RUM
35
+ * @param enableWebViewLog Collect Browser Logs SDK events from WebViews, default false
34
36
  * @param enableCustomLog whether to enable custom logs
35
37
  * @param discardStrategy log discard strategy
36
38
  * @param logLevelFilters log level filter
@@ -1 +1 @@
1
- {"version":3,"names":["_ft_mobile_agent","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","FTLogStatus","exports","FTLogCacheDiscard","FTReactNativeLogWrapper","constructor","default","logConfig","config","logger","logging","content","logStatus","property","mergedProperties","bridgeContextManager","mergeWithLocalPropertiesSync","logWithStatusString","toString","enumLogStatus","FTReactNativeLog"],"sources":["ft_logger.tsx"],"sourcesContent":["import { bridgeContextManager } from './ft_mobile_agent';\n/**\n * Set log level.\n */\nexport enum FTLogStatus {\n info,\n warning,\n error,\n critical,\n ok,\n}\n/**\n * Log discard method.\n */\nexport enum FTLogCacheDiscard {\n discard,\n discardOldest,\n}\n/**\n * Configure log output configuration.\n * @param sampleRate sampling rate\n * @param enableLinkRumData whether to link with RUM\n * @param enableCustomLog whether to enable custom logs\n * @param discardStrategy log discard strategy\n * @param logLevelFilters log level filter\n * @param globalContext custom global parameters\n * @param logCacheLimitCount get maximum log entry count limit [1000,), default 5000\n */\nexport interface FTLogConfig {\n sampleRate?: number;\n enableLinkRumData?: boolean;\n enableCustomLog?: boolean;\n discardStrategy?: FTLogCacheDiscard;\n logLevelFilters?: Array<FTLogStatus>;\n globalContext?: object;\n logCacheLimitCount?: number;\n}\n\ntype FTReactNativeLogType = {\n /**\n *Configure log output configuration to enable log collection.\n */\n logConfig(config: FTLogConfig): Promise<void>;\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logging(\n content: string,\n logStatus: FTLogStatus,\n property?: object\n ): Promise<void>;\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logWithStatusString(\n content: string,\n logStatus: string,\n property?: object\n ): Promise<void>;\n};\n\nclass FTReactNativeLogWrapper {\n /* eslint-disable @typescript-eslint/no-var-requires */\n private logger: FTReactNativeLogType =\n require('./specs/NativeFTReactNativeLog').default;\n /* eslint-enable @typescript-eslint/no-var-requires */\n\n /**\n *Configure log output configuration to enable log collection.\n */\n logConfig(config: FTLogConfig): Promise<void> {\n return this.logger.logConfig(config);\n }\n\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logging(\n content: string,\n logStatus: FTLogStatus | string,\n property?: object\n ): Promise<void> {\n // Automatically merge bridge context properties with local properties\n const mergedProperties =\n bridgeContextManager.mergeWithLocalPropertiesSync(property);\n\n if (typeof logStatus === 'string') {\n return this.logger.logWithStatusString(\n content,\n logStatus.toString(),\n mergedProperties\n );\n }\n let enumLogStatus: FTLogStatus = logStatus as FTLogStatus;\n return this.logger.logging(content, enumLogStatus, mergedProperties);\n }\n}\nexport const FTReactNativeLog: FTReactNativeLogWrapper =\n new FTReactNativeLogWrapper();\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAyD,SAAAC,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe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B,OAAA,CAAAkB,gBAAA,GACpD,IAAIhB,uBAAuB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_ft_mobile_agent","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","FTLogStatus","exports","FTLogCacheDiscard","FTReactNativeLogWrapper","constructor","default","logConfig","config","logger","logging","content","logStatus","property","mergedProperties","bridgeContextManager","mergeWithLocalPropertiesSync","logWithStatusString","toString","enumLogStatus","FTReactNativeLog"],"sources":["ft_logger.tsx"],"sourcesContent":["import { bridgeContextManager } from './ft_mobile_agent';\n/**\n * Set log level.\n */\nexport enum FTLogStatus {\n info,\n warning,\n error,\n critical,\n ok,\n}\n/**\n * Log discard method.\n */\nexport enum FTLogCacheDiscard {\n discard,\n discardOldest,\n}\n/**\n * Configure log output configuration.\n * @param logSamplingRate Log sampling percentage in [0, 100], default 100. Supports fractional percentages and takes precedence over sampleRate.\n * @param sampleRate Deprecated log sampling probability in [0, 1], default 1. Used only when logSamplingRate is omitted; multiplied by 100 before passing to Native.\n * @param enableLinkRumData whether to link with RUM\n * @param enableWebViewLog Collect Browser Logs SDK events from WebViews, default false\n * @param enableCustomLog whether to enable custom logs\n * @param discardStrategy log discard strategy\n * @param logLevelFilters log level filter\n * @param globalContext custom global parameters\n * @param logCacheLimitCount get maximum log entry count limit [1000,), default 5000\n */\nexport interface FTLogConfig {\n /**\n * Log sampling percentage in [0, 100], default 100.\n * Supports fractional percentages: 12.5 means 12.5%, not 0.125.\n * Takes precedence over sampleRate when both are supplied, including 0.\n */\n logSamplingRate?: number;\n /** @deprecated Use logSamplingRate. Probability in [0, 1], default 1; 0.125 maps to 12.5%. Ignored when logSamplingRate is supplied. */\n sampleRate?: number;\n enableLinkRumData?: boolean;\n enableCustomLog?: boolean;\n enableWebViewLog?: boolean;\n discardStrategy?: FTLogCacheDiscard;\n logLevelFilters?: Array<FTLogStatus>;\n globalContext?: object;\n logCacheLimitCount?: number;\n}\n\ntype FTReactNativeLogType = {\n /**\n *Configure log output configuration to enable log collection.\n */\n logConfig(config: FTLogConfig): Promise<void>;\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logging(\n content: string,\n logStatus: FTLogStatus,\n property?: object\n ): Promise<void>;\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logWithStatusString(\n content: string,\n logStatus: string,\n property?: object\n ): Promise<void>;\n};\n\nclass FTReactNativeLogWrapper {\n /* eslint-disable @typescript-eslint/no-var-requires */\n private logger: FTReactNativeLogType =\n require('./specs/NativeFTReactNativeLog').default;\n /* eslint-enable @typescript-eslint/no-var-requires */\n\n /**\n *Configure log output configuration to enable log collection.\n */\n logConfig(config: FTLogConfig): Promise<void> {\n return this.logger.logConfig(config);\n }\n\n /**\n * Output log.\n * @param content log content\n * @param status log status\n * @param property log context (optional)\n */\n logging(\n content: string,\n logStatus: FTLogStatus | string,\n property?: object\n ): Promise<void> {\n // Automatically merge bridge context properties with local properties\n const mergedProperties =\n bridgeContextManager.mergeWithLocalPropertiesSync(property);\n\n if (typeof logStatus === 'string') {\n return this.logger.logWithStatusString(\n content,\n logStatus.toString(),\n mergedProperties\n );\n }\n let enumLogStatus: FTLogStatus = logStatus as FTLogStatus;\n return this.logger.logging(content, enumLogStatus, mergedProperties);\n }\n}\nexport const FTReactNativeLog: FTReactNativeLogWrapper =\n new FTReactNativeLogWrapper();\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAyD,SAAAC,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAA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C,QAAiB,EACF;IACf;IACA,MAAMC,gBAAgB,GACpBC,qCAAoB,CAACC,4BAA4B,CAACH,QAAQ,CAAC;IAE7D,IAAI,OAAOD,SAAS,KAAK,QAAQ,EAAE;MACjC,OAAO,IAAI,CAACH,MAAM,CAACQ,mBAAmB,CACpCN,OAAO,EACPC,SAAS,CAACM,QAAQ,CAAC,CAAC,EACpBJ,gBACF,CAAC;IACH;IACA,IAAIK,aAA0B,GAAGP,SAAwB;IACzD,OAAO,IAAI,CAACH,MAAM,CAACC,OAAO,CAACC,OAAO,EAAEQ,aAAa,EAAEL,gBAAgB,CAAC;EACtE;AACF;AACO,MAAMM,gBAAyC,GAAAlB,OAAA,CAAAkB,gBAAA,GACpD,IAAIhB,uBAAuB,CAAC,CAAC","ignoreList":[]}
@@ -150,6 +150,8 @@ let FTDBCacheDiscard = exports.FTDBCacheDiscard = /*#__PURE__*/function (FTDBCac
150
150
  /**
151
151
  * Values that can be modified by remote config override rules.
152
152
  * These values will adjust the fetched remote configuration before it is applied.
153
+ * Omitted fields are not changed by this rule. Sampling percentages use [0, 100]
154
+ * and support fractions (12.5 means 12.5%); legacy probabilities use [0, 1].
153
155
  */
154
156
  /**
155
157
  * Remote config override rules .
@@ -214,7 +216,14 @@ class FTMobileReactNativeWrapper {
214
216
  if (config.serverUrl != null && config.serverUrl.length > 0 && config.datakitUrl == null) {
215
217
  config.datakitUrl = config.serverUrl;
216
218
  }
217
- return this.sdk.sdkConfig(config);
219
+ const nativeConfig = {
220
+ ...config
221
+ };
222
+ // Keep undefined equivalent to omission; explicit null overrides legacy hosts.
223
+ if (nativeConfig.allowWebViewHost === undefined) {
224
+ delete nativeConfig.allowWebViewHost;
225
+ }
226
+ return this.sdk.sdkConfig(nativeConfig);
218
227
  }
219
228
  setDatakitURL(datakitUrl) {
220
229
  return this.sdk.setDatakitURL(datakitUrl);
@@ -225,6 +234,9 @@ class FTMobileReactNativeWrapper {
225
234
  bindRUMUserData(userId, userName, userEmail, extra) {
226
235
  return this.sdk.bindRUMUserData(userId, userName, userEmail, extra);
227
236
  }
237
+ resetVisitorId() {
238
+ return this.sdk.resetVisitorId();
239
+ }
228
240
  unbindRUMUserData() {
229
241
  return this.sdk.unbindRUMUserData();
230
242
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_version","_FTRumWebSocketTracking","_BridgeContextManager","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BridgeContextManager","constructor","Map","initializeSDKInfo","sdkBridgeInfo","react_native","sdkVersion","properties","set","JSON","stringify","getInstance","instance","appendBridgeContext","entries","forEach","key","longTaskContextEnabled","syncLongTaskContext","error","console","warn","configureLongTaskContext","enabled","rum","default","setLongTaskContext","mergeWithLocalPropertiesSync","localProperties","merged","assign","bridgeContextManager","exports","EnvType","FTDBCacheDiscard","FTMobileReactNativeWrapper","getEmitter","_NativeModules$FTMobi","emitter","nativeEventModule","NativeModules","FTMobileReactNative","sdk","NativeEventEmitter","sdkConfig","config","serverUrl","length","datakitUrl","setDatakitURL","setDatawayURL","datawayUrl","clientToken","bindRUMUserData","userId","userName","userEmail","extra","unbindRUMUserData","appendGlobalContext","context","appendLogGlobalContext","appendRUMGlobalContext","trackEventFromExtension","identifier","flushSyncData","shutDown","FTRumWebSocketTracking","stopLongTaskTracking","clearAllData","updateRemoteConfig","updateRemoteConfigWithMiniUpdateInterval","interval","rules","addRemoteConfigListener","listener","addListener"],"sources":["ft_mobile_agent.tsx"],"sourcesContent":["import {\n EmitterSubscription,\n NativeEventEmitter,\n NativeModules,\n} from 'react-native';\nimport type { Spec as NativeFTMobileReactNativeSpec } from './specs/NativeFTMobileReactNative';\nimport type { Spec as NativeFTReactNativeRUMSpec } from './specs/NativeFTReactNativeRUM';\nimport { version as sdkVersion } from './version';\nimport { FTRumWebSocketTracking } from './rum/FTRumWebSocketTracking';\n\n/**\n * Bridge context manager for managing shared properties across RUM and Logger modules\n * This class provides a centralized way to store and retrieve global properties that will be\n * automatically merged with local properties when making calls to RUM and Logger functions\n */\nclass BridgeContextManager {\n private static instance: BridgeContextManager;\n private properties: Map<string, any> = new Map();\n private longTaskContextEnabled = false;\n\n private constructor() {\n // Initialize with SDK version information\n this.initializeSDKInfo();\n }\n\n /**\n * Initialize SDK information properties\n * @private\n */\n private initializeSDKInfo(): void {\n // Create sdk_bridge_info with version information\n const sdkBridgeInfo = {\n react_native: sdkVersion,\n };\n\n // Set the sdk_bridge_info property\n this.properties.set('sdk_bridge_info', JSON.stringify(sdkBridgeInfo));\n }\n\n /**\n * Get singleton instance of BridgeContextManager\n * @returns BridgeContextManager instance\n */\n public static getInstance(): BridgeContextManager {\n if (!BridgeContextManager.instance) {\n BridgeContextManager.instance = new BridgeContextManager();\n }\n return BridgeContextManager.instance;\n }\n\n /**\n * Add bridge context properties that will be automatically merged with local properties\n * @param properties Object containing key-value pairs\n */\n public appendBridgeContext(properties: Record<string, any>): void {\n // Store properties locally in JavaScript\n try {\n // Store properties locally in JavaScript\n Object.entries(properties).forEach(([key, value]) => {\n this.properties.set(key, value);\n });\n if (this.longTaskContextEnabled) {\n this.syncLongTaskContext();\n }\n } catch (error) {\n console.warn('Failed to append bridge context:', error);\n }\n }\n\n public configureLongTaskContext(enabled: boolean): void {\n this.longTaskContextEnabled = enabled;\n if (enabled) {\n this.syncLongTaskContext();\n }\n }\n\n private syncLongTaskContext(): void {\n try {\n // Apply the snapshot before JS can block. An async native call may run after\n // the frame that detects the long task and attach stale context to it.\n const rum: NativeFTReactNativeRUMSpec =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('./specs/NativeFTReactNativeRUM').default;\n rum.setLongTaskContext(this.mergeWithLocalPropertiesSync());\n } catch (error) {\n // Context synchronization must not make a destroyed/older bridge crash the host.\n console.warn('Failed to sync JS long task bridge context:', error);\n }\n }\n\n /**\n * Merge bridge context properties with local properties\n * Bridge context properties take precedence over local properties\n * @param localProperties Local properties to merge with bridge context properties\n * @returns Merged properties object\n */\n public mergeWithLocalPropertiesSync(\n localProperties?: object\n ): Record<string, any> {\n try {\n const merged: Record<string, any> = {};\n\n // First add local properties (if any)\n if (localProperties) {\n Object.assign(merged, localProperties);\n }\n\n // Then add bridge context properties (these will override local properties with same keys)\n this.properties.forEach((value, key) => {\n merged[key] = value;\n });\n\n return merged;\n } catch (error) {\n console.warn(\n 'Failed to merge bridge context with local properties:',\n error\n );\n // Return empty object or only local properties on error\n return localProperties ? { ...localProperties } : {};\n }\n }\n}\n\n// Internal bridge context manager - not exported\nexport const bridgeContextManager = BridgeContextManager.getInstance();\n\n/**\n * Environment.\n */\nexport enum EnvType {\n prod,\n gray,\n pre,\n common,\n local,\n}\nexport enum FTDBCacheDiscard {\n discard,\n discardOldest,\n}\n\n/**\n * Remote config override rule matching condition for custom keys. Supports exact match and contains match.\n * For exact match, set the value directly, for example: \"userid\": \"test_user\", which means the rule will be applied when the custom key \"userid\" is exactly \"test_user\".\n * For contains match, set the value as an object with a \"contains\" field, for example: \"userid\": { \"contains\": \"test_user\" }, which means the rule will be applied when the custom key \"userid\" contains the object \"test_user\".\n */\nexport type FTRemoteConfigCustomKeyContainsMatch = {\n contains: string | number | boolean;\n};\n\n/**\n * Matching rules for remote config override\n * Defines matching conditions using customKeys\n */\nexport type FTRemoteConfigOverrideMatch = {\n customKeys?: Record<\n string,\n string | number | boolean | FTRemoteConfigCustomKeyContainsMatch\n >;\n};\n\n/**\n * Values that can be modified by remote config override rules.\n * These values will adjust the fetched remote configuration before it is applied.\n */\nexport type FTRemoteConfigOverrideValues = {\n env?: string;\n serviceName?: string;\n autoSync?: boolean;\n compressIntakeRequests?: boolean;\n syncPageSize?: number;\n syncSleepTime?: number;\n rumSampleRate?: number;\n rumSessionOnErrorSampleRate?: number;\n rumEnableTraceUserAction?: boolean;\n rumEnableTraceUserView?: boolean;\n rumEnableTraceUserResource?: boolean;\n rumEnableResourceHostIP?: boolean;\n rumEnableTrackAppUIBlock?: boolean;\n rumBlockDurationMs?: number;\n rumEnableTrackAppCrash?: boolean;\n rumEnableTrackAppANR?: boolean;\n rumEnableTraceWebView?: boolean;\n rumAllowWebViewHost?: Array<string>;\n traceSampleRate?: number;\n traceEnableAutoTrace?: boolean;\n traceType?: string;\n logSampleRate?: number;\n logLevelFilters?: Array<string>;\n logEnableCustomLog?: boolean;\n logEnableConsoleLog?: boolean;\n};\n\n/**\n * Remote config override rules .\n * Adjust the fetched remote configuration before application.\n */\nexport type FTRemoteConfigOverrideRule = {\n id?: string;\n enabled?: boolean;\n match: FTRemoteConfigOverrideMatch;\n override: FTRemoteConfigOverrideValues;\n};\n/**\n * Final result of the remote config update\n * @param triggerType the type of remote config update trigger, auto or manual\n * @param success whether the remote config update was successful\n * @param platform the platform of the device, ios or android\n * @param timestamp the timestamp when the remote config update was triggered\n * @param rawJson the final remote config update result, in JSON string format\n * @param errorCode the error code if the remote config update failed, may be null if the update was successful\n * @param errorMessage the error message if the remote config update failed, may be null if the update was successful\n * @param appliedOverrideRuleIds the list of override rule IDs applied in this remote config update, may be null if no rules were applied\n */\nexport type FTRemoteConfigResult = {\n triggerType: 'auto' | 'manual';\n success: boolean;\n platform: 'ios' | 'android';\n timestamp: number;\n rawJson?: string;\n errorCode?: string | number;\n errorMessage?: string;\n appliedOverrideRuleIds?: string[];\n};\n/**\n * Configure SDK startup parameters.\n * @param serverUrl data reporting address, deprecated, use [datakitUrl] instead\n * @param datakitUrl datakit access URL address, example: http://10.0.0.1:9529, default port 9529. Choose one between datakit and dataway configuration\n * @param datawayUrl dataway access URL address, example: http://10.0.0.1:9528, default port 9528, note: the device installing the SDK needs to be able to access this address. Note: choose one between datakit and dataway configuration\n * @param clientToken dataway authentication token, needs to be configured together with [datawayUrl]\n * @param debug set whether to allow log printing, default false\n * @param env environment, default prod\n * @param service set the name of the business or service it belongs to, default: `df_rum_ios`, `df_rum_android`\n * @param autoSync whether data is automatically synchronized and uploaded, default: true\n * @param syncPageSize number of synchronized items per request during data synchronization, minimum value 5, default: 10\n * @param syncSleepTime interval time between each request during data synchronization, unit milliseconds, 0 < syncSleepTime < 100\n * @param enableDataIntegerCompatible whether to enable data integer compatibility during data synchronization, enabled by default\n * @param compressIntakeRequests whether to compress synchronized data\n * @param enableDataFilter whether to enable SDK-side local data filters, enabled by default\n * @param dataFilters local blocklist filter rules. Supported categories include `logging` and `rum`. Any data that matches a rule will be discarded.\n * @param globalContext custom global parameters\n * @param groupIdentifiers iOS side sets the AppGroups Identifier array corresponding to the collected Widget Extension\n * @param enableLimitWithDbSize set whether to enable using db to limit data size, after enabling, `FTLogConfig.logCacheLimitCount` and `FTRUMConfig.rumCacheLimitCount` will no longer take effect\n * @param dbCacheLimit db cache limit size, minimum value 30MB, default 100MB, unit byte\n * @param dbDiscardStrategy db data discard strategy\n * @param dataModifier data modifier, modify individual fields {key:value}, after setting, the SDK will replace the original value with the set value according to the key\n * @param lineDataModifier data modifier, modify single data {\"measurement\":measurement,\"data\":{key:value}}, after setting, the SDK will replace the original value with the set value according to the key\n * @param remoteConfiguration Set whether to enable remote dynamic configuration\n * @param remoteConfigMiniUpdateInterval Set remote dynamic configuration minimum update interval, unit seconds, default 12*60*60\n * @param remoteConfigOverrideRules Remote config override rules .Adjust the fetched remote configuration before application.\n */\nexport interface FTMobileConfig {\n /**\n * @deprecated \"serverUrl\" parameter renamed to \"datakitUrl\"\n */\n serverUrl?: string;\n datakitUrl?: string;\n datawayUrl?: string;\n clientToken?: string;\n debug?: boolean;\n envType?: EnvType;\n env?: string;\n service?: string;\n autoSync?: boolean;\n syncPageSize?: number;\n syncSleepTime?: number;\n enableDataIntegerCompatible?: boolean;\n compressIntakeRequests?: boolean;\n enableDataFilter?: boolean;\n dataFilters?: Record<string, Array<string>>;\n globalContext?: object;\n groupIdentifiers?: Array<string>;\n enableLimitWithDbSize?: boolean;\n dbCacheLimit?: number;\n dbDiscardStrategy?: FTDBCacheDiscard;\n dataModifier?: object;\n lineDataModifier?: object;\n remoteConfiguration?: boolean;\n remoteConfigMiniUpdateInterval?: number;\n remoteConfigOverrideRules?: Array<FTRemoteConfigOverrideRule>;\n}\n\ntype FTMobileReactNativeType = {\n /**\n * SDK initialization method.\n * @param config SDK initialization configuration items.\n * @returns a Promise.\n */\n sdkConfig(config: FTMobileConfig): Promise<void>;\n /**\n * Dynamically set the Datakit upload URL after SDK initialization.\n * @param datakitUrl Datakit upload URL.\n * @returns a Promise.\n */\n setDatakitURL(datakitUrl: string): Promise<void>;\n /**\n * Dynamically set the Dataway upload URL and client token after SDK initialization.\n * @param datawayUrl Dataway upload URL.\n * @param clientToken Dataway authentication token.\n * @returns a Promise.\n */\n setDatawayURL(datawayUrl: string, clientToken: string): Promise<void>;\n /**\n * Bind user.\n * @param userId user ID.\n * @param userName user name.\n * @param userEmail user email\n * @param extra additional user information\n * @returns a Promise.\n */\n bindRUMUserData(\n userId: string,\n userName?: string,\n userEmail?: string,\n extra?: object\n ): Promise<void>;\n /**\n * Unbind user.\n * @returns a Promise.\n */\n unbindRUMUserData(): Promise<void>;\n /**\n * Add custom global parameters. Applies to RUM and Log data\n * @param context custom global parameters.\n * @returns a Promise.\n */\n appendGlobalContext(context: object): Promise<void>;\n /**\n * Add custom RUM global parameters. Applies to RUM data\n * @param context custom RUM global parameters.\n * @returns a Promise.\n */\n appendRUMGlobalContext(context: object): Promise<void>;\n /**\n * Add custom RUM and Log global parameters. Applies to Log data\n * @param context custom Log global parameters.\n * @returns a Promise.\n */\n appendLogGlobalContext(context: object): Promise<void>;\n /**\n * Actively synchronize data. When `FTMobileConfig.autoSync=false` is configured, you need to actively trigger this method to synchronize data.\n * @returns a Promise.\n */\n flushSyncData(): Promise<void>;\n\n /**\n * Synchronize events in iOS Widget Extension, iOS only\n * @param groupIdentifier app groupId\n * @returns {groupIdentifier:string,datas:Array<object>} can be used to view data collected in Extension.\n */\n trackEventFromExtension(identifier: string): Promise<object>;\n /**\n * Shut down objects currently running in the SDK\n */\n shutDown(): Promise<void>;\n /**\n * Clear all data that has not yet been uploaded to the server.\n */\n clearAllData(): Promise<void>;\n /**\n * Add bridge context properties that will be automatically merged with local properties\n * @param properties Object containing key-value pairs\n */\n appendBridgeContext(properties: Record<string, any>): void;\n /**\n * Update remote configuration, after enabling remote configuration, you can call this method to update the configuration in real time.\n */\n updateRemoteConfig(): Promise<FTRemoteConfigResult>;\n /**\n * Update remote configuration with minimum update interval, after enabling remote configuration, you can call this method to update the configuration in real time.\n * This method is used to set the minimum update interval for remote configuration updates. If the time since the last update is less than the specified interval, the update will not be performed.\n * @param interval minimum update interval, unit seconds\n * @param rules Remote config override rules .Adjust the fetched remote configuration before application.\n * @returns the result of the remote config update\n */\n updateRemoteConfigWithMiniUpdateInterval(\n interval: number,\n rules?: Array<FTRemoteConfigOverrideRule>\n ): Promise<FTRemoteConfigResult>;\n /**\n * Listen for auto remote configuration updates triggered by the native SDK.\n * Manual updates are returned through the update Promise instead of this event.\n */\n addRemoteConfigListener(\n listener: (result: FTRemoteConfigResult) => void\n ): EmitterSubscription;\n};\n\nclass FTMobileReactNativeWrapper implements FTMobileReactNativeType {\n /* eslint-disable @typescript-eslint/no-var-requires */\n private sdk: NativeFTMobileReactNativeSpec =\n require('./specs/NativeFTMobileReactNative').default;\n private rum: NativeFTReactNativeRUMSpec =\n require('./specs/NativeFTReactNativeRUM').default;\n /* eslint-enable @typescript-eslint/no-var-requires */\n\n private emitter: NativeEventEmitter | null = null;\n\n private getEmitter(): NativeEventEmitter {\n if (this.emitter) {\n return this.emitter;\n }\n\n const nativeEventModule = NativeModules.FTMobileReactNative ?? this.sdk;\n this.emitter = new NativeEventEmitter(nativeEventModule as never);\n return this.emitter;\n }\n\n sdkConfig(config: FTMobileConfig): Promise<void> {\n if (\n config.serverUrl != null &&\n config.serverUrl.length > 0 &&\n config.datakitUrl == null\n ) {\n config.datakitUrl = config.serverUrl;\n }\n return this.sdk.sdkConfig(config);\n }\n setDatakitURL(datakitUrl: string): Promise<void> {\n return this.sdk.setDatakitURL(datakitUrl);\n }\n setDatawayURL(datawayUrl: string, clientToken: string): Promise<void> {\n return this.sdk.setDatawayURL(datawayUrl, clientToken);\n }\n bindRUMUserData(\n userId: string,\n userName?: string,\n userEmail?: string,\n extra?: object\n ): Promise<void> {\n return this.sdk.bindRUMUserData(userId, userName, userEmail, extra);\n }\n unbindRUMUserData(): Promise<void> {\n return this.sdk.unbindRUMUserData();\n }\n appendGlobalContext(context: object): Promise<void> {\n return this.sdk.appendGlobalContext(context);\n }\n appendLogGlobalContext(context: object): Promise<void> {\n return this.sdk.appendLogGlobalContext(context);\n }\n appendRUMGlobalContext(context: object): Promise<void> {\n return this.sdk.appendRUMGlobalContext(context);\n }\n trackEventFromExtension(identifier: string): Promise<object> {\n return this.sdk.trackEventFromExtension(identifier);\n }\n flushSyncData(): Promise<void> {\n return this.sdk.flushSyncData();\n }\n async shutDown(): Promise<void> {\n bridgeContextManager.configureLongTaskContext(false);\n try {\n FTRumWebSocketTracking.shutDown();\n await this.rum.stopLongTaskTracking();\n } finally {\n await this.sdk.shutDown();\n }\n }\n clearAllData(): Promise<void> {\n return this.sdk.clearAllData();\n }\n appendBridgeContext(properties: Record<string, any>): void {\n // Store properties in JS and update the native long task snapshot when enabled.\n bridgeContextManager.appendBridgeContext(properties);\n }\n updateRemoteConfig(): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfig() as Promise<FTRemoteConfigResult>;\n }\n updateRemoteConfigWithMiniUpdateInterval(\n interval: number,\n rules?: Array<FTRemoteConfigOverrideRule>\n ): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfigWithMiniUpdateInterval(\n interval,\n rules\n ) as Promise<FTRemoteConfigResult>;\n }\n addRemoteConfigListener(\n listener: (result: FTRemoteConfigResult) => void\n ): EmitterSubscription {\n return this.getEmitter().addListener('ft_remote_config_callback', listener);\n }\n}\nexport const FTMobileReactNative: FTMobileReactNativeType =\n new FTMobileReactNativeWrapper();\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;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AAC5B,GAAG,CAAC4B,kBAAkB,CAAC,CAAC;EACtC;EACAC,wCAAwCA,CACtCC,QAAgB,EAChBC,KAAyC,EACV;IAC/B,OAAO,IAAI,CAAC/B,GAAG,CAAC6B,wCAAwC,CACtDC,QAAQ,EACRC,KACF,CAAC;EACH;EACAC,uBAAuBA,CACrBC,QAAgD,EAC3B;IACrB,OAAO,IAAI,CAACvC,UAAU,CAAC,CAAC,CAACwC,WAAW,CAAC,2BAA2B,EAAED,QAAQ,CAAC;EAC7E;AACF;AACO,MAAMlC,mBAA4C,GAAAT,OAAA,CAAAS,mBAAA,GACvD,IAAIN,0BAA0B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_version","_FTRumWebSocketTracking","_BridgeContextManager","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BridgeContextManager","constructor","Map","initializeSDKInfo","sdkBridgeInfo","react_native","sdkVersion","properties","set","JSON","stringify","getInstance","instance","appendBridgeContext","entries","forEach","key","longTaskContextEnabled","syncLongTaskContext","error","console","warn","configureLongTaskContext","enabled","rum","default","setLongTaskContext","mergeWithLocalPropertiesSync","localProperties","merged","assign","bridgeContextManager","exports","EnvType","FTDBCacheDiscard","FTMobileReactNativeWrapper","getEmitter","_NativeModules$FTMobi","emitter","nativeEventModule","NativeModules","FTMobileReactNative","sdk","NativeEventEmitter","sdkConfig","config","serverUrl","length","datakitUrl","nativeConfig","allowWebViewHost","undefined","setDatakitURL","setDatawayURL","datawayUrl","clientToken","bindRUMUserData","userId","userName","userEmail","extra","resetVisitorId","unbindRUMUserData","appendGlobalContext","context","appendLogGlobalContext","appendRUMGlobalContext","trackEventFromExtension","identifier","flushSyncData","shutDown","FTRumWebSocketTracking","stopLongTaskTracking","clearAllData","updateRemoteConfig","updateRemoteConfigWithMiniUpdateInterval","interval","rules","addRemoteConfigListener","listener","addListener"],"sources":["ft_mobile_agent.tsx"],"sourcesContent":["import {\n EmitterSubscription,\n NativeEventEmitter,\n NativeModules,\n} from 'react-native';\nimport type { Spec as NativeFTMobileReactNativeSpec } from './specs/NativeFTMobileReactNative';\nimport type { Spec as NativeFTReactNativeRUMSpec } from './specs/NativeFTReactNativeRUM';\nimport { version as sdkVersion } from './version';\nimport { FTRumWebSocketTracking } from './rum/FTRumWebSocketTracking';\n\n/**\n * Bridge context manager for managing shared properties across RUM and Logger modules\n * This class provides a centralized way to store and retrieve global properties that will be\n * automatically merged with local properties when making calls to RUM and Logger functions\n */\nclass BridgeContextManager {\n private static instance: BridgeContextManager;\n private properties: Map<string, any> = new Map();\n private longTaskContextEnabled = false;\n\n private constructor() {\n // Initialize with SDK version information\n this.initializeSDKInfo();\n }\n\n /**\n * Initialize SDK information properties\n * @private\n */\n private initializeSDKInfo(): void {\n // Create sdk_bridge_info with version information\n const sdkBridgeInfo = {\n react_native: sdkVersion,\n };\n\n // Set the sdk_bridge_info property\n this.properties.set('sdk_bridge_info', JSON.stringify(sdkBridgeInfo));\n }\n\n /**\n * Get singleton instance of BridgeContextManager\n * @returns BridgeContextManager instance\n */\n public static getInstance(): BridgeContextManager {\n if (!BridgeContextManager.instance) {\n BridgeContextManager.instance = new BridgeContextManager();\n }\n return BridgeContextManager.instance;\n }\n\n /**\n * Add bridge context properties that will be automatically merged with local properties\n * @param properties Object containing key-value pairs\n */\n public appendBridgeContext(properties: Record<string, any>): void {\n // Store properties locally in JavaScript\n try {\n // Store properties locally in JavaScript\n Object.entries(properties).forEach(([key, value]) => {\n this.properties.set(key, value);\n });\n if (this.longTaskContextEnabled) {\n this.syncLongTaskContext();\n }\n } catch (error) {\n console.warn('Failed to append bridge context:', error);\n }\n }\n\n public configureLongTaskContext(enabled: boolean): void {\n this.longTaskContextEnabled = enabled;\n if (enabled) {\n this.syncLongTaskContext();\n }\n }\n\n private syncLongTaskContext(): void {\n try {\n // Apply the snapshot before JS can block. An async native call may run after\n // the frame that detects the long task and attach stale context to it.\n const rum: NativeFTReactNativeRUMSpec =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('./specs/NativeFTReactNativeRUM').default;\n rum.setLongTaskContext(this.mergeWithLocalPropertiesSync());\n } catch (error) {\n // Context synchronization must not make a destroyed/older bridge crash the host.\n console.warn('Failed to sync JS long task bridge context:', error);\n }\n }\n\n /**\n * Merge bridge context properties with local properties\n * Bridge context properties take precedence over local properties\n * @param localProperties Local properties to merge with bridge context properties\n * @returns Merged properties object\n */\n public mergeWithLocalPropertiesSync(\n localProperties?: object\n ): Record<string, any> {\n try {\n const merged: Record<string, any> = {};\n\n // First add local properties (if any)\n if (localProperties) {\n Object.assign(merged, localProperties);\n }\n\n // Then add bridge context properties (these will override local properties with same keys)\n this.properties.forEach((value, key) => {\n merged[key] = value;\n });\n\n return merged;\n } catch (error) {\n console.warn(\n 'Failed to merge bridge context with local properties:',\n error\n );\n // Return empty object or only local properties on error\n return localProperties ? { ...localProperties } : {};\n }\n }\n}\n\n// Internal bridge context manager - not exported\nexport const bridgeContextManager = BridgeContextManager.getInstance();\n\n/**\n * Environment.\n */\nexport enum EnvType {\n prod,\n gray,\n pre,\n common,\n local,\n}\nexport enum FTDBCacheDiscard {\n discard,\n discardOldest,\n}\n\n/**\n * Remote config override rule matching condition for custom keys. Supports exact match and contains match.\n * For exact match, set the value directly, for example: \"userid\": \"test_user\", which means the rule will be applied when the custom key \"userid\" is exactly \"test_user\".\n * For contains match, set the value as an object with a \"contains\" field, for example: \"userid\": { \"contains\": \"test_user\" }, which means the rule will be applied when the custom key \"userid\" contains the object \"test_user\".\n */\nexport type FTRemoteConfigCustomKeyContainsMatch = {\n contains: string | number | boolean;\n};\n\n/**\n * Matching rules for remote config override\n * Defines matching conditions using customKeys\n */\nexport type FTRemoteConfigOverrideMatch = {\n customKeys?: Record<\n string,\n string | number | boolean | FTRemoteConfigCustomKeyContainsMatch\n >;\n};\n\n/**\n * Values that can be modified by remote config override rules.\n * These values will adjust the fetched remote configuration before it is applied.\n * Omitted fields are not changed by this rule. Sampling percentages use [0, 100]\n * and support fractions (12.5 means 12.5%); legacy probabilities use [0, 1].\n */\nexport type FTRemoteConfigOverrideValues = {\n env?: string;\n serviceName?: string;\n autoSync?: boolean;\n compressIntakeRequests?: boolean;\n syncPageSize?: number;\n syncSleepTime?: number;\n /** RUM session sampling percentage override in [0, 100]; takes precedence over rumSampleRate, including 0. */\n sessionSamplingRate?: number;\n /** Error session sampling percentage override in [0, 100]; takes precedence over rumSessionOnErrorSampleRate, including 0. */\n sessionOnErrorSamplingRate?: number;\n /** Trace sampling percentage override in [0, 100]; takes precedence over traceSampleRate, including 0. */\n traceSamplingRate?: number;\n /** Log sampling percentage override in [0, 100]; takes precedence over logSampleRate, including 0. */\n logSamplingRate?: number;\n /** Session Replay sampling percentage override in [0, 100]; fractional percentages are supported. */\n sessionReplaySamplingRate?: number;\n /** Error replay sampling percentage override in [0, 100]; fractional percentages are supported. */\n sessionReplayOnErrorSamplingRate?: number;\n /** @deprecated Use sessionSamplingRate. Legacy RUM probability override in [0, 1]; 0.125 maps to 12.5%. */\n rumSampleRate?: number;\n /** @deprecated Use sessionOnErrorSamplingRate. Legacy error session probability override in [0, 1]. */\n rumSessionOnErrorSampleRate?: number;\n rumEnableTraceUserAction?: boolean;\n rumEnableTraceUserView?: boolean;\n rumEnableTraceUserResource?: boolean;\n rumEnableResourceHostIP?: boolean;\n rumEnableTrackAppUIBlock?: boolean;\n rumBlockDurationMs?: number;\n rumEnableTrackAppCrash?: boolean;\n rumEnableTrackAppANR?: boolean;\n rumEnableTraceWebView?: boolean;\n rumAllowWebViewHost?: Array<string>;\n /** @deprecated Use traceSamplingRate. Legacy Trace probability override in [0, 1]. */\n traceSampleRate?: number;\n traceEnableAutoTrace?: boolean;\n traceType?: string;\n /** @deprecated Use logSamplingRate. Legacy log probability override in [0, 1]. */\n logSampleRate?: number;\n logLevelFilters?: Array<string>;\n logEnableCustomLog?: boolean;\n logEnableWebViewLog?: boolean;\n logEnableConsoleLog?: boolean;\n};\n\n/**\n * Remote config override rules .\n * Adjust the fetched remote configuration before application.\n */\nexport type FTRemoteConfigOverrideRule = {\n id?: string;\n enabled?: boolean;\n match: FTRemoteConfigOverrideMatch;\n override: FTRemoteConfigOverrideValues;\n};\n/**\n * Final result of the remote config update\n * @param triggerType the type of remote config update trigger, auto or manual\n * @param success whether the remote config update was successful\n * @param platform the platform of the device, ios or android\n * @param timestamp the timestamp when the remote config update was triggered\n * @param rawJson the final remote config update result, in JSON string format\n * @param errorCode the error code if the remote config update failed, may be null if the update was successful\n * @param errorMessage the error message if the remote config update failed, may be null if the update was successful\n * @param appliedOverrideRuleIds the list of override rule IDs applied in this remote config update, may be null if no rules were applied\n */\nexport type FTRemoteConfigResult = {\n triggerType: 'auto' | 'manual';\n success: boolean;\n platform: 'ios' | 'android';\n timestamp: number;\n rawJson?: string;\n errorCode?: string | number;\n errorMessage?: string;\n appliedOverrideRuleIds?: string[];\n};\n/**\n * Configure SDK startup parameters.\n * @param serverUrl data reporting address, deprecated, use [datakitUrl] instead\n * @param datakitUrl datakit access URL address, example: http://10.0.0.1:9529, default port 9529. Choose one between datakit and dataway configuration\n * @param datawayUrl dataway access URL address, example: http://10.0.0.1:9528, default port 9528, note: the device installing the SDK needs to be able to access this address. Note: choose one between datakit and dataway configuration\n * @param clientToken dataway authentication token, needs to be configured together with [datawayUrl]\n * @param debug set whether to allow log printing, default false\n * @param env environment, default prod\n * @param service set the name of the business or service it belongs to, default: `df_rum_ios`, `df_rum_android`\n * @param autoSync whether data is automatically synchronized and uploaded, default: true\n * @param syncPageSize number of synchronized items per request during data synchronization, minimum value 5, default: 10\n * @param syncSleepTime interval time between each request during data synchronization, unit milliseconds, 0 < syncSleepTime < 100\n * @param enableDataIntegerCompatible whether to enable data integer compatibility during data synchronization, enabled by default\n * @param compressIntakeRequests whether to compress synchronized data\n * @param enableDataFilter whether to enable SDK-side local data filters, enabled by default\n * @param dataFilters local blocklist filter rules. Supported categories include `logging` and `rum`. Any data that matches a rule will be discarded.\n * @param globalContext custom global parameters\n * @param groupIdentifiers iOS side sets the AppGroups Identifier array corresponding to the collected Widget Extension\n * @param enableLimitWithDbSize set whether to enable using db to limit data size, after enabling, `FTLogConfig.logCacheLimitCount` and `FTRUMConfig.rumCacheLimitCount` will no longer take effect\n * @param dbCacheLimit db cache limit size, minimum value 30MB, default 100MB, unit byte\n * @param dbDiscardStrategy db data discard strategy\n * @param dataModifier data modifier, modify individual fields {key:value}, after setting, the SDK will replace the original value with the set value according to the key\n * @param lineDataModifier data modifier, modify single data {\"measurement\":measurement,\"data\":{key:value}}, after setting, the SDK will replace the original value with the set value according to the key\n * @param remoteConfiguration Set whether to enable remote dynamic configuration\n * @param remoteConfigMiniUpdateInterval Set remote dynamic configuration minimum update interval, unit seconds, default 12*60*60\n * @param remoteConfigOverrideRules Remote config override rules .Adjust the fetched remote configuration before application.\n */\nexport interface FTMobileConfig {\n /**\n * @deprecated \"serverUrl\" parameter renamed to \"datakitUrl\"\n */\n serverUrl?: string;\n datakitUrl?: string;\n datawayUrl?: string;\n clientToken?: string;\n debug?: boolean;\n envType?: EnvType;\n env?: string;\n service?: string;\n autoSync?: boolean;\n syncPageSize?: number;\n syncSleepTime?: number;\n enableDataIntegerCompatible?: boolean;\n compressIntakeRequests?: boolean;\n enableDataFilter?: boolean;\n dataFilters?: Record<string, Array<string>>;\n /** Shared WebView host allowlist for RUM and Log. Omitted uses the legacy RUM\n * config; null allows every host; [] disables bridge access. Remote config wins.\n */\n allowWebViewHost?: Array<string> | null;\n globalContext?: object;\n groupIdentifiers?: Array<string>;\n enableLimitWithDbSize?: boolean;\n dbCacheLimit?: number;\n dbDiscardStrategy?: FTDBCacheDiscard;\n dataModifier?: object;\n lineDataModifier?: object;\n remoteConfiguration?: boolean;\n remoteConfigMiniUpdateInterval?: number;\n remoteConfigOverrideRules?: Array<FTRemoteConfigOverrideRule>;\n}\n\ntype FTMobileReactNativeType = {\n /**\n * SDK initialization method.\n * @param config SDK initialization configuration items.\n * @returns a Promise.\n */\n sdkConfig(config: FTMobileConfig): Promise<void>;\n /**\n * Dynamically set the Datakit upload URL after SDK initialization.\n * @param datakitUrl Datakit upload URL.\n * @returns a Promise.\n */\n setDatakitURL(datakitUrl: string): Promise<void>;\n /**\n * Dynamically set the Dataway upload URL and client token after SDK initialization.\n * @param datawayUrl Dataway upload URL.\n * @param clientToken Dataway authentication token.\n * @returns a Promise.\n */\n setDatawayURL(datawayUrl: string, clientToken: string): Promise<void>;\n /**\n * Bind user.\n * @param userId user ID.\n * @param userName user name.\n * @param userEmail user email\n * @param extra additional user information\n * @returns a Promise.\n */\n bindRUMUserData(\n userId: string,\n userName?: string,\n userEmail?: string,\n extra?: object\n ): Promise<void>;\n /**\n * Unbind user.\n * @returns a Promise.\n */\n unbindRUMUserData(): Promise<void>;\n /** Rotate the native anonymous Visitor ID for subsequent requests. */\n resetVisitorId(): Promise<void>;\n /**\n * Add custom global parameters. Applies to RUM and Log data\n * @param context custom global parameters.\n * @returns a Promise.\n */\n appendGlobalContext(context: object): Promise<void>;\n /**\n * Add custom RUM global parameters. Applies to RUM data\n * @param context custom RUM global parameters.\n * @returns a Promise.\n */\n appendRUMGlobalContext(context: object): Promise<void>;\n /**\n * Add custom RUM and Log global parameters. Applies to Log data\n * @param context custom Log global parameters.\n * @returns a Promise.\n */\n appendLogGlobalContext(context: object): Promise<void>;\n /**\n * Actively synchronize data. When `FTMobileConfig.autoSync=false` is configured, you need to actively trigger this method to synchronize data.\n * @returns a Promise.\n */\n flushSyncData(): Promise<void>;\n\n /**\n * Synchronize events in iOS Widget Extension, iOS only\n * @param groupIdentifier app groupId\n * @returns {groupIdentifier:string,datas:Array<object>} can be used to view data collected in Extension.\n */\n trackEventFromExtension(identifier: string): Promise<object>;\n /**\n * Shut down objects currently running in the SDK\n */\n shutDown(): Promise<void>;\n /**\n * Clear all data that has not yet been uploaded to the server.\n */\n clearAllData(): Promise<void>;\n /**\n * Add bridge context properties that will be automatically merged with local properties\n * @param properties Object containing key-value pairs\n */\n appendBridgeContext(properties: Record<string, any>): void;\n /**\n * Update remote configuration, after enabling remote configuration, you can call this method to update the configuration in real time.\n */\n updateRemoteConfig(): Promise<FTRemoteConfigResult>;\n /**\n * Update remote configuration with minimum update interval, after enabling remote configuration, you can call this method to update the configuration in real time.\n * This method is used to set the minimum update interval for remote configuration updates. If the time since the last update is less than the specified interval, the update will not be performed.\n * @param interval minimum update interval, unit seconds\n * @param rules Remote config override rules .Adjust the fetched remote configuration before application.\n * @returns the result of the remote config update\n */\n updateRemoteConfigWithMiniUpdateInterval(\n interval: number,\n rules?: Array<FTRemoteConfigOverrideRule>\n ): Promise<FTRemoteConfigResult>;\n /**\n * Listen for auto remote configuration updates triggered by the native SDK.\n * Manual updates are returned through the update Promise instead of this event.\n */\n addRemoteConfigListener(\n listener: (result: FTRemoteConfigResult) => void\n ): EmitterSubscription;\n};\n\nclass FTMobileReactNativeWrapper implements FTMobileReactNativeType {\n /* eslint-disable @typescript-eslint/no-var-requires */\n private sdk: NativeFTMobileReactNativeSpec =\n require('./specs/NativeFTMobileReactNative').default;\n private rum: NativeFTReactNativeRUMSpec =\n require('./specs/NativeFTReactNativeRUM').default;\n /* eslint-enable @typescript-eslint/no-var-requires */\n\n private emitter: NativeEventEmitter | null = null;\n\n private getEmitter(): NativeEventEmitter {\n if (this.emitter) {\n return this.emitter;\n }\n\n const nativeEventModule = NativeModules.FTMobileReactNative ?? this.sdk;\n this.emitter = new NativeEventEmitter(nativeEventModule as never);\n return this.emitter;\n }\n\n sdkConfig(config: FTMobileConfig): Promise<void> {\n if (\n config.serverUrl != null &&\n config.serverUrl.length > 0 &&\n config.datakitUrl == null\n ) {\n config.datakitUrl = config.serverUrl;\n }\n const nativeConfig = { ...config };\n // Keep undefined equivalent to omission; explicit null overrides legacy hosts.\n if (nativeConfig.allowWebViewHost === undefined) {\n delete nativeConfig.allowWebViewHost;\n }\n return this.sdk.sdkConfig(nativeConfig);\n }\n setDatakitURL(datakitUrl: string): Promise<void> {\n return this.sdk.setDatakitURL(datakitUrl);\n }\n setDatawayURL(datawayUrl: string, clientToken: string): Promise<void> {\n return this.sdk.setDatawayURL(datawayUrl, clientToken);\n }\n bindRUMUserData(\n userId: string,\n userName?: string,\n userEmail?: string,\n extra?: object\n ): Promise<void> {\n return this.sdk.bindRUMUserData(userId, userName, userEmail, extra);\n }\n resetVisitorId(): Promise<void> {\n return this.sdk.resetVisitorId();\n }\n unbindRUMUserData(): Promise<void> {\n return this.sdk.unbindRUMUserData();\n }\n appendGlobalContext(context: object): Promise<void> {\n return this.sdk.appendGlobalContext(context);\n }\n appendLogGlobalContext(context: object): Promise<void> {\n return this.sdk.appendLogGlobalContext(context);\n }\n appendRUMGlobalContext(context: object): Promise<void> {\n return this.sdk.appendRUMGlobalContext(context);\n }\n trackEventFromExtension(identifier: string): Promise<object> {\n return this.sdk.trackEventFromExtension(identifier);\n }\n flushSyncData(): Promise<void> {\n return this.sdk.flushSyncData();\n }\n async shutDown(): Promise<void> {\n bridgeContextManager.configureLongTaskContext(false);\n try {\n FTRumWebSocketTracking.shutDown();\n await this.rum.stopLongTaskTracking();\n } finally {\n await this.sdk.shutDown();\n }\n }\n clearAllData(): Promise<void> {\n return this.sdk.clearAllData();\n }\n appendBridgeContext(properties: Record<string, any>): void {\n // Store properties in JS and update the native long task snapshot when enabled.\n bridgeContextManager.appendBridgeContext(properties);\n }\n updateRemoteConfig(): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfig() as Promise<FTRemoteConfigResult>;\n }\n updateRemoteConfigWithMiniUpdateInterval(\n interval: number,\n rules?: Array<FTRemoteConfigOverrideRule>\n ): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfigWithMiniUpdateInterval(\n interval,\n rules\n ) as Promise<FTRemoteConfigResult>;\n }\n addRemoteConfigListener(\n listener: (result: FTRemoteConfigResult) => void\n ): EmitterSubscription {\n return this.getEmitter().addListener('ft_remote_config_callback', listener);\n }\n}\nex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gD,oBAAoB,CAAC,CAAC;IACvC,CAAC,SAAS;MACR,MAAM,IAAI,CAAC9B,GAAG,CAAC4B,QAAQ,CAAC,CAAC;IAC3B;EACF;EACAG,YAAYA,CAAA,EAAkB;IAC5B,OAAO,IAAI,CAAC/B,GAAG,CAAC+B,YAAY,CAAC,CAAC;EAChC;EACA5D,mBAAmBA,CAACN,UAA+B,EAAQ;IACzD;IACAwB,oBAAoB,CAAClB,mBAAmB,CAACN,UAAU,CAAC;EACtD;EACAmE,kBAAkBA,CAAA,EAAkC;IAClD,OAAO,IAAI,CAAChC,GAAG,CAACgC,kBAAkB,CAAC,CAAC;EACtC;EACAC,wCAAwCA,CACtCC,QAAgB,EAChBC,KAAyC,EACV;IAC/B,OAAO,IAAI,CAACnC,GAAG,CAACiC,wCAAwC,CACtDC,QAAQ,EACRC,KACF,CAAC;EACH;EACAC,uBAAuBA,CACrBC,QAAgD,EAC3B;IACrB,OAAO,IAAI,CAAC3C,UAAU,CAAC,CAAC,CAAC4C,WAAW,CAAC,2BAA2B,EAAED,QAAQ,CAAC;EAC7E;AACF;AACO,MAAMtC,mBAA4C,GAAAT,OAAA,CAAAS,mBAAA,GACvD,IAAIN,0BAA0B,CAAC,CAAC","ignoreList":[]}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.IOSCrashMonitoringType = exports.FTReactNativeRUM = exports.FTRUMCacheDiscard = exports.ErrorMonitorType = exports.DeviceMetricsMonitorType = exports.DetectFrequency = void 0;
7
+ var _visitorIdConfig = require("./visitorIdConfig");
7
8
  var _reactNative = require("react-native");
8
9
  var _FTRumErrorTracking = require("./rum/FTRumErrorTracking");
9
10
  var _FTRumActionTracking = require("./rum/FTRumActionTracking");
@@ -74,8 +75,10 @@ let IOSCrashMonitoringType = exports.IOSCrashMonitoringType = /*#__PURE__*/funct
74
75
  * Set RUM tracking conditions.
75
76
  * @param androidAppId appId, apply during monitoring
76
77
  * @param iOSAppId appId, apply during monitoring
77
- * @param sampleRate sampling rate
78
- * @param sessionOnErrorSampleRate error session sampling rate. For sessions not sampled, if ERROR is hit, collect data 1 minute before the error occurs
78
+ * @param sessionSamplingRate RUM session sampling percentage in [0, 100], default 100. Supports fractional percentages and takes precedence over sampleRate.
79
+ * @param sessionOnErrorSamplingRate Sampling percentage in [0, 100] for otherwise unsampled sessions when an error occurs, default 0. Supports fractional percentages and takes precedence over sessionOnErrorSampleRate.
80
+ * @param sampleRate Deprecated RUM session sampling probability in [0, 1], default 1. Used only when sessionSamplingRate is omitted; multiplied by 100 before passing to Native.
81
+ * @param sessionOnErrorSampleRate Deprecated error session sampling probability in [0, 1], default 0. Used only when sessionOnErrorSamplingRate is omitted; multiplied by 100 before passing to Native.
79
82
  * @param enableAutoTrackUserAction whether to automatically collect react-native control click events, can set actionName with accessibilityLabel when enabled
80
83
  * @param enableTrackError whether to automatically collect react-native Error
81
84
  * @param enableTrackNativeCrash whether to collect Native Error
@@ -99,7 +102,7 @@ let IOSCrashMonitoringType = exports.IOSCrashMonitoringType = /*#__PURE__*/funct
99
102
  * @param rumCacheLimitCount RUM max cache size, default 100_000
100
103
  * @param rumDiscardStrategy RUM data discard strategy
101
104
  * @param enableTraceWebView Set whether to enable WebView data collection, default true
102
- * @param allowWebViewHost Set specific hosts or domains allowed to collect WebView data, nil means collect all
105
+ * @param allowWebViewHost Deprecated; use FTMobileConfig.allowWebViewHost for shared WebView host filtering.
103
106
  * @param iosCrashMonitoringType iOS crash monitoring type , default is highCompatibility, which does not include Mach exceptions for better compatibility. you must enable system crash monitoring to get crash stack traces and crash information.
104
107
  */
105
108
  /**
@@ -137,6 +140,13 @@ class FTReactNativeRUMWrapper {
137
140
  _defineProperty(this, "rum", require('./specs/NativeFTReactNativeRUM').default);
138
141
  }
139
142
  setConfig(config) {
143
+ if (config.visitorIdConfig != null) {
144
+ try {
145
+ (0, _visitorIdConfig.validateVisitorIdConfig)(config.visitorIdConfig);
146
+ } catch (error) {
147
+ return Promise.reject(error);
148
+ }
149
+ }
140
150
  _ft_mobile_agent.bridgeContextManager.configureLongTaskContext(config.enableLongTask === true);
141
151
  const webSocketLifecycle = _FTRumWebSocketTracking.FTRumWebSocketTracking.getLifecycleVersion();
142
152
  const webSocketConfigVersion = ++this.webSocketConfigVersion;
@@ -183,6 +193,12 @@ class FTReactNativeRUMWrapper {
183
193
  onCreateView(viewName, loadTime) {
184
194
  return this.rum.onCreateView(viewName, loadTime);
185
195
  }
196
+ updateViewLoadingTime(duration) {
197
+ if (!Number.isSafeInteger(duration) || duration < 0) {
198
+ return Promise.reject(new RangeError('duration must be a non-negative safe integer in nanoseconds'));
199
+ }
200
+ return this.rum.updateViewLoadingTime(duration);
201
+ }
186
202
  startView(viewName, property) {
187
203
  // Automatically merge bridge context properties with local properties
188
204
  const mergedProperties = _ft_mobile_agent.bridgeContextManager.mergeWithLocalPropertiesSync(property);