@truewatchtech/react-native-mobile 0.4.1 → 0.4.2

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.
@@ -12,14 +12,14 @@ Pod::Spec.new do |s|
12
12
  s.authors = package["author"]
13
13
 
14
14
  s.platforms = { :ios => "10.0" }
15
- s.source = { :git => "https://github.com/GuanceCloud/datakit-react-native.git", :tag => "#{s.version}" }
15
+ s.source = { :git => "https://github.com/TrueWatchTech/datakit-react-native.git", :tag => "#{s.version}" }
16
16
 
17
17
 
18
18
  s.source_files = "ios/**/*.{h,m,mm,swift}"
19
19
 
20
20
 
21
21
  s.dependency "React-Core"
22
- s.dependency 'FTMobileSDK', '1.6.2'
22
+ s.dependency 'FTMobileSDK', '1.6.5'
23
23
 
24
24
  xcconfig = {
25
25
  "HEADER_SEARCH_PATHS" => "$(inherited) " +
@@ -179,7 +179,7 @@ repositories {
179
179
  dependencies {
180
180
  // noinspection GradleDynamicVersion
181
181
  implementation 'com.facebook.react:react-native:+'
182
- implementation 'com.truewatch.ft.mobile.sdk.tracker.agent:ft-sdk:1.7.0'
182
+ implementation 'com.truewatch.ft.mobile.sdk.tracker.agent:ft-sdk:1.7.2'
183
183
  implementation 'com.truewatch.ft.mobile.sdk.tracker.agent:ft-native:1.1.2'
184
184
 
185
185
  // implementation files('../example/android/app/libs/ft-sdk-debug.aar')
@@ -271,7 +271,8 @@ public class FTMobileImpl {
271
271
  return false;
272
272
  }
273
273
 
274
- if (actual instanceof String actualString) {
274
+ if (actual instanceof String) {
275
+ String actualString = (String) actual;
275
276
  Object normalizedActual = parseJsonStringIfNeeded(actualString);
276
277
  if (normalizedActual != actual) {
277
278
  return isEqualValue(normalizedActual, expected);
@@ -298,18 +299,23 @@ public class FTMobileImpl {
298
299
  }
299
300
 
300
301
  private boolean matchesCustomKey(Object actual, Object expected) {
301
- if (expected instanceof Map<?, ?> expectedMap && expectedMap.containsKey("contains")) {
302
- return containsValue(actual, expectedMap.get("contains"));
302
+ if (expected instanceof Map) {
303
+ Map<?, ?> expectedMap = (Map<?, ?>) expected;
304
+ if (expectedMap.containsKey("contains")) {
305
+ return containsValue(actual, expectedMap.get("contains"));
306
+ }
303
307
  }
304
308
  return isEqualValue(actual, expected);
305
309
  }
306
310
 
307
311
  private boolean containsValue(Object actual, Object expectedValue) {
308
- Object normalizedActual = actual instanceof String actualString
309
- ? parseJsonStringIfNeeded(actualString)
310
- : actual;
312
+ Object normalizedActual = actual;
313
+ if (actual instanceof String) {
314
+ normalizedActual = parseJsonStringIfNeeded((String) actual);
315
+ }
311
316
 
312
- if (normalizedActual instanceof JSONArray actualArray) {
317
+ if (normalizedActual instanceof JSONArray) {
318
+ JSONArray actualArray = (JSONArray) normalizedActual;
313
319
  try {
314
320
  for (int i = 0; i < actualArray.length(); i++) {
315
321
  if (isEqualValue(actualArray.get(i), expectedValue)) {
@@ -338,6 +344,29 @@ public class FTMobileImpl {
338
344
  return value;
339
345
  }
340
346
 
347
+ @Nullable
348
+ private HashMap<String, String[]> convertDataFilters(@Nullable Map<String, Object> filters) {
349
+ if (filters == null) {
350
+ return null;
351
+ }
352
+ HashMap<String, String[]> convertedFilters = new HashMap<>();
353
+ for (Map.Entry<String, Object> entry : filters.entrySet()) {
354
+ Object value = entry.getValue();
355
+ if (!(value instanceof List<?>)) {
356
+ continue;
357
+ }
358
+ List<?> filterList = (List<?>) value;
359
+ List<String> filterValues = new ArrayList<>();
360
+ for (Object filter : filterList) {
361
+ if (filter != null) {
362
+ filterValues.add(filter.toString());
363
+ }
364
+ }
365
+ convertedFilters.put(entry.getKey(), filterValues.toArray(new String[0]));
366
+ }
367
+ return convertedFilters;
368
+ }
369
+
341
370
  public void sdkConfig(ReadableMap context, Promise promise) {
342
371
  Map<String, Object> map = context.toHashMap();
343
372
  String datakitUrl = (String) map.get("datakitUrl");
@@ -349,6 +378,8 @@ public class FTMobileImpl {
349
378
  Integer syncSleepTime = ReactNativeUtils.convertToNativeInt(map.get("syncSleepTime"));
350
379
  Boolean enableDataIntegerCompatible = (Boolean) map.get("enableDataIntegerCompatible");
351
380
  Boolean compressIntakeRequests = (Boolean) map.get("compressIntakeRequests");
381
+ Boolean enableDataFilter = (Boolean) map.get("enableDataFilter");
382
+ Map<String, Object> dataFilters = (Map<String, Object>) map.get("dataFilters");
352
383
  Integer env = ReactNativeUtils.convertToNativeInt(map.get("envType"));
353
384
  String serviceName = (String) map.get("service");
354
385
  Map<String, Object> globalContext = (Map<String, Object>) map.get("globalContext");
@@ -404,6 +435,13 @@ public class FTMobileImpl {
404
435
  if (compressIntakeRequests != null && compressIntakeRequests) {
405
436
  sdkConfig.setCompressIntakeRequests(compressIntakeRequests);
406
437
  }
438
+ if (enableDataFilter != null) {
439
+ sdkConfig.setEnableDataFilter(enableDataFilter);
440
+ }
441
+ HashMap<String, String[]> convertedDataFilters = convertDataFilters(dataFilters);
442
+ if (convertedDataFilters != null) {
443
+ sdkConfig.setDataFilters(convertedDataFilters);
444
+ }
407
445
  if (globalContext != null) {
408
446
  for (Map.Entry<String, Object> entry : globalContext.entrySet()) {
409
447
  sdkConfig.addGlobalContext(entry.getKey(), entry.getValue().toString());
@@ -67,4 +67,9 @@ public class FTRUMModule extends ReactContextBaseJavaModule {
67
67
  public void stopResource(String key, ReadableMap map, Promise promise) {
68
68
  impl.stopResource(key, map, promise);
69
69
  }
70
+
71
+ @ReactMethod
72
+ public void addResource(String key, ReadableMap resource, ReadableMap metrics, Promise promise) {
73
+ impl.addResource(key, resource, metrics, promise);
74
+ }
70
75
  }
@@ -421,6 +421,12 @@ RCT_REMAP_METHOD(clearAllData,
421
421
  if ([context.allKeys containsObject:@"compressIntakeRequests"]) {
422
422
  config.compressIntakeRequests = [RCTConvert BOOL:context[@"compressIntakeRequests"]];
423
423
  }
424
+ if ([context.allKeys containsObject:@"enableDataFilter"]) {
425
+ config.enableDataFilter = [RCTConvert BOOL:context[@"enableDataFilter"]];
426
+ }
427
+ if ([context.allKeys containsObject:@"dataFilters"]) {
428
+ config.dataFilters = [RCTConvert NSDictionary:context[@"dataFilters"]];
429
+ }
424
430
  if ([context.allKeys containsObject:@"globalContext"]) {
425
431
  config.globalContext = [RCTConvert NSDictionary:context[@"globalContext"]];
426
432
  }
@@ -156,6 +156,8 @@ let FTDBCacheDiscard = exports.FTDBCacheDiscard = /*#__PURE__*/function (FTDBCac
156
156
  * @param syncSleepTime interval time between each request during data synchronization, unit milliseconds, 0 < syncSleepTime < 100
157
157
  * @param enableDataIntegerCompatible whether to enable data integer compatibility during data synchronization, enabled by default
158
158
  * @param compressIntakeRequests whether to compress synchronized data
159
+ * @param enableDataFilter whether to enable SDK-side local data filters, enabled by default
160
+ * @param dataFilters local blocklist filter rules. Supported categories include `logging` and `rum`. Any data that matches a rule will be discarded.
159
161
  * @param globalContext custom global parameters
160
162
  * @param groupIdentifiers iOS side sets the AppGroups Identifier array corresponding to the collected Widget Extension
161
163
  * @param enableLimitWithDbSize set whether to enable using db to limit data size, after enabling, `FTLogConfig.logCacheLimitCount` and `FTRUMConfig.rumCacheLimitCount` will no longer take effect
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_version","_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","error","console","warn","mergeWithLocalPropertiesSync","localProperties","merged","assign","bridgeContextManager","exports","EnvType","FTDBCacheDiscard","FTMobileReactNativeWrapper","default","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","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 { version as sdkVersion } from './version';\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\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 } catch (error) {\n console.warn('Failed to append 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 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 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: FTMobileReactNativeType =\n require('./specs/NativeFTMobileReactNative').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 shutDown(): Promise<void> {\n return this.sdk.shutDown();\n }\n clearAllData(): Promise<void> {\n return this.sdk.clearAllData();\n }\n appendBridgeContext(properties: Record<string, any>): void {\n // Use bridgeContextManager to store properties in JavaScript and send to native SDK\n bridgeContextManager.appendBridgeContext(properties);\n }\n updateRemoteConfig(): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfig();\n }\n updateRemoteConfigWithMiniUpdateInterval(\n interval: number,\n rules?: Array<FTRemoteConfigOverrideRule>\n ): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfigWithMiniUpdateInterval(interval, rules);\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;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAAkD,IAAAE,qBAAA;AAAA,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,CAA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AK,CAAC;EAC3E;EACAC,uBAAuBA,CACrBC,QAAgD,EAC3B;IACrB,OAAO,IAAI,CAACrC,UAAU,CAAC,CAAC,CAACsC,WAAW,CAAC,2BAA2B,EAAED,QAAQ,CAAC;EAC7E;AACF;AACO,MAAMhC,mBAA4C,GAAAV,OAAA,CAAAU,mBAAA,GACvD,IAAIP,0BAA0B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_version","_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","error","console","warn","mergeWithLocalPropertiesSync","localProperties","merged","assign","bridgeContextManager","exports","EnvType","FTDBCacheDiscard","FTMobileReactNativeWrapper","default","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","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 { version as sdkVersion } from './version';\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\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 } catch (error) {\n console.warn('Failed to append 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: FTMobileReactNativeType =\n require('./specs/NativeFTMobileReactNative').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 shutDown(): Promise<void> {\n return this.sdk.shutDown();\n }\n clearAllData(): Promise<void> {\n return this.sdk.clearAllData();\n }\n appendBridgeContext(properties: Record<string, any>): void {\n // Use bridgeContextManager to store properties in JavaScript and send to native SDK\n bridgeContextManager.appendBridgeContext(properties);\n }\n updateRemoteConfig(): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfig();\n }\n updateRemoteConfigWithMiniUpdateInterval(\n interval: number,\n rules?: Array<FTRemoteConfigOverrideRule>\n ): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfigWithMiniUpdateInterval(interval, rules);\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;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAAkD,IAAAE,qBAAA;AAAA,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,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAElD;AACA;AACA;AACA;AACA;AACA,MAAMgB,oBAAoB,CAAC;E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Property(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // generated by genversion
8
- const version = exports.version = '0.4.1';
8
+ const version = exports.version = '0.4.2';
9
9
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version","exports"],"sources":["version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '0.4.1';\n"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["version","exports"],"sources":["version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '0.4.2';\n"],"mappings":";;;;;;AAAA;AACO,MAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,OAAO","ignoreList":[]}
@@ -157,6 +157,8 @@ export let FTDBCacheDiscard = /*#__PURE__*/function (FTDBCacheDiscard) {
157
157
  * @param syncSleepTime interval time between each request during data synchronization, unit milliseconds, 0 < syncSleepTime < 100
158
158
  * @param enableDataIntegerCompatible whether to enable data integer compatibility during data synchronization, enabled by default
159
159
  * @param compressIntakeRequests whether to compress synchronized data
160
+ * @param enableDataFilter whether to enable SDK-side local data filters, enabled by default
161
+ * @param dataFilters local blocklist filter rules. Supported categories include `logging` and `rum`. Any data that matches a rule will be discarded.
160
162
  * @param globalContext custom global parameters
161
163
  * @param groupIdentifiers iOS side sets the AppGroups Identifier array corresponding to the collected Widget Extension
162
164
  * @param enableLimitWithDbSize set whether to enable using db to limit data size, after enabling, `FTLogConfig.logCacheLimitCount` and `FTRUMConfig.rumCacheLimitCount` will no longer take effect
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","version","sdkVersion","BridgeContextManager","constructor","_defineProperty","Map","initializeSDKInfo","sdkBridgeInfo","react_native","properties","set","JSON","stringify","getInstance","instance","appendBridgeContext","Object","entries","forEach","key","value","error","console","warn","mergeWithLocalPropertiesSync","localProperties","merged","assign","_BridgeContextManager","bridgeContextManager","EnvType","FTDBCacheDiscard","FTMobileReactNativeWrapper","require","default","getEmitter","_NativeModules$FTMobi","emitter","nativeEventModule","FTMobileReactNative","sdk","sdkConfig","config","serverUrl","length","datakitUrl","setDatakitURL","setDatawayURL","datawayUrl","clientToken","bindRUMUserData","userId","userName","userEmail","extra","unbindRUMUserData","appendGlobalContext","context","appendLogGlobalContext","appendRUMGlobalContext","trackEventFromExtension","identifier","flushSyncData","shutDown","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 { version as sdkVersion } from './version';\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\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 } catch (error) {\n console.warn('Failed to append 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 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 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: FTMobileReactNativeType =\n require('./specs/NativeFTMobileReactNative').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 shutDown(): Promise<void> {\n return this.sdk.shutDown();\n }\n clearAllData(): Promise<void> {\n return this.sdk.clearAllData();\n }\n appendBridgeContext(properties: Record<string, any>): void {\n // Use bridgeContextManager to store properties in JavaScript and send to native SDK\n bridgeContextManager.appendBridgeContext(properties);\n }\n updateRemoteConfig(): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfig();\n }\n updateRemoteConfigWithMiniUpdateInterval(\n interval: number,\n rules?: Array<FTRemoteConfigOverrideRule>\n ): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfigWithMiniUpdateInterval(interval, rules);\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,SAEEA,kBAAkB,EAClBC,aAAa,QACR,cAAc;AACrB,SAASC,OAAO,IAAIC,UAAU,QAAQ,WAAW;;AAEjD;AACA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,CAAC;EAIjBC,WAAWA,CAAA,EAAG;IAAAC,eAAA,qBAFiB,IAAIC,GAAG,CAAC,CAAC;IAG9C;IACA,IAAI,CAACC,iBAAiB,CAAC,CAAC;EAC1B;;EAEA;AACF;AACA;AACA;EACUA,iBAAiBA,CAAA,EAAS;IAChC;IACA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AAmB;IAC3D,OAAO,IAAI,CAACrB,GAAG,CAACoB,uBAAuB,CAACC,UAAU,CAAC;EACrD;EACAC,aAAaA,CAAA,EAAkB;IAC7B,OAAO,IAAI,CAACtB,GAAG,CAACsB,aAAa,CAAC,CAAC;EACjC;EACAC,QAAQA,CAAA,EAAkB;IACxB,OAAO,IAAI,CAACvB,GAAG,CAACuB,QAAQ,CAAC,CAAC;EAC5B;EACAC,YAAYA,CAAA,EAAkB;IAC5B,OAAO,IAAI,CAACxB,GAAG,CAACwB,YAAY,CAAC,CAAC;EAChC;EACAjD,mBAAmBA,CAACN,UAA+B,EAAQ;IACzD;IACAoB,oBAAoB,CAACd,mBAAmB,CAACN,UAAU,CAAC;EACtD;EACAwD,kBAAkBA,CAAA,EAAkC;IAClD,OAAO,IAAI,CAACzB,GAAG,CAACyB,kBAAkB,CAAC,CAAC;EACtC;EACAC,wCAAwCA,CACtCC,QAAgB,EAChBC,KAAyC,EACV;IAC/B,OAAO,IAAI,CAAC5B,GAAG,CAAC0B,wCAAwC,CAACC,QAAQ,EAAEC,KAAK,CAAC;EAC3E;EACAC,uBAAuBA,CACrBC,QAAgD,EAC3B;IACrB,OAAO,IAAI,CAACnC,UAAU,CAAC,CAAC,CAACoC,WAAW,CAAC,2BAA2B,EAAED,QAAQ,CAAC;EAC7E;AACF;AACA,OAAO,MAAM/B,mBAA4C,GACvD,IAAIP,0BAA0B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NativeEventEmitter","NativeModules","version","sdkVersion","BridgeContextManager","constructor","_defineProperty","Map","initializeSDKInfo","sdkBridgeInfo","react_native","properties","set","JSON","stringify","getInstance","instance","appendBridgeContext","Object","entries","forEach","key","value","error","console","warn","mergeWithLocalPropertiesSync","localProperties","merged","assign","_BridgeContextManager","bridgeContextManager","EnvType","FTDBCacheDiscard","FTMobileReactNativeWrapper","require","default","getEmitter","_NativeModules$FTMobi","emitter","nativeEventModule","FTMobileReactNative","sdk","sdkConfig","config","serverUrl","length","datakitUrl","setDatakitURL","setDatawayURL","datawayUrl","clientToken","bindRUMUserData","userId","userName","userEmail","extra","unbindRUMUserData","appendGlobalContext","context","appendLogGlobalContext","appendRUMGlobalContext","trackEventFromExtension","identifier","flushSyncData","shutDown","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 { version as sdkVersion } from './version';\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\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 } catch (error) {\n console.warn('Failed to append 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: FTMobileReactNativeType =\n require('./specs/NativeFTMobileReactNative').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 shutDown(): Promise<void> {\n return this.sdk.shutDown();\n }\n clearAllData(): Promise<void> {\n return this.sdk.clearAllData();\n }\n appendBridgeContext(properties: Record<string, any>): void {\n // Use bridgeContextManager to store properties in JavaScript and send to native SDK\n bridgeContextManager.appendBridgeContext(properties);\n }\n updateRemoteConfig(): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfig();\n }\n updateRemoteConfigWithMiniUpdateInterval(\n interval: number,\n rules?: Array<FTRemoteConfigOverrideRule>\n ): Promise<FTRemoteConfigResult> {\n return this.sdk.updateRemoteConfigWithMiniUpdateInterval(interval, rules);\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,SAEEA,kBAAkB,EAClBC,aAAa,QACR,cAAc;AACrB,SAASC,OAAO,IAAIC,UAAU,QAAQ,WAAW;;AAEjD;AACA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,CAAC;EAIjBC,WAAWA,CAAA,EAAG;IAAAC,eAAA,qBAFiB,IAAIC,GAAG,CAAC,CAAC;IAG9C;IACA,IAAI,CAACC,iBAAiB,CAAC,CAAC;EAC1B;;EAEA;AACF;AACA;AACA;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AAO,CAAC;EACjD;EACAG,uBAAuBA,CAACC,UAAkB,EAAmB;IAC3D,OAAO,IAAI,CAACrB,GAAG,CAACoB,uBAAuB,CAACC,UAAU,CAAC;EACrD;EACAC,aAAaA,CAAA,EAAkB;IAC7B,OAAO,IAAI,CAACtB,GAAG,CAACsB,aAAa,CAAC,CAAC;EACjC;EACAC,QAAQA,CAAA,EAAkB;IACxB,OAAO,IAAI,CAACvB,GAAG,CAACuB,QAAQ,CAAC,CAAC;EAC5B;EACAC,YAAYA,CAAA,EAAkB;IAC5B,OAAO,IAAI,CAACxB,GAAG,CAACwB,YAAY,CAAC,CAAC;EAChC;EACAjD,mBAAmBA,CAACN,UAA+B,EAAQ;IACzD;IACAoB,oBAAoB,CAACd,mBAAmB,CAACN,UAAU,CAAC;EACtD;EACAwD,kBAAkBA,CAAA,EAAkC;IAClD,OAAO,IAAI,CAACzB,GAAG,CAACyB,kBAAkB,CAAC,CAAC;EACtC;EACAC,wCAAwCA,CACtCC,QAAgB,EAChBC,KAAyC,EACV;IAC/B,OAAO,IAAI,CAAC5B,GAAG,CAAC0B,wCAAwC,CAACC,QAAQ,EAAEC,KAAK,CAAC;EAC3E;EACAC,uBAAuBA,CACrBC,QAAgD,EAC3B;IACrB,OAAO,IAAI,CAACnC,UAAU,CAAC,CAAC,CAACoC,WAAW,CAAC,2BAA2B,EAAED,QAAQ,CAAC;EAC7E;AACF;AACA,OAAO,MAAM/B,mBAA4C,GACvD,IAAIP,0BAA0B,CAAC,CAAC","ignoreList":[]}
@@ -1,3 +1,3 @@
1
1
  // generated by genversion
2
- export const version = '0.4.1';
2
+ export const version = '0.4.2';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["version"],"sources":["version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '0.4.1';\n"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["version"],"sources":["version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '0.4.2';\n"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAO","ignoreList":[]}
@@ -137,6 +137,8 @@ export type FTRemoteConfigResult = {
137
137
  * @param syncSleepTime interval time between each request during data synchronization, unit milliseconds, 0 < syncSleepTime < 100
138
138
  * @param enableDataIntegerCompatible whether to enable data integer compatibility during data synchronization, enabled by default
139
139
  * @param compressIntakeRequests whether to compress synchronized data
140
+ * @param enableDataFilter whether to enable SDK-side local data filters, enabled by default
141
+ * @param dataFilters local blocklist filter rules. Supported categories include `logging` and `rum`. Any data that matches a rule will be discarded.
140
142
  * @param globalContext custom global parameters
141
143
  * @param groupIdentifiers iOS side sets the AppGroups Identifier array corresponding to the collected Widget Extension
142
144
  * @param enableLimitWithDbSize set whether to enable using db to limit data size, after enabling, `FTLogConfig.logCacheLimitCount` and `FTRUMConfig.rumCacheLimitCount` will no longer take effect
@@ -165,6 +167,8 @@ export interface FTMobileConfig {
165
167
  syncSleepTime?: number;
166
168
  enableDataIntegerCompatible?: boolean;
167
169
  compressIntakeRequests?: boolean;
170
+ enableDataFilter?: boolean;
171
+ dataFilters?: Record<string, Array<string>>;
168
172
  globalContext?: object;
169
173
  groupIdentifiers?: Array<string>;
170
174
  enableLimitWithDbSize?: boolean;
@@ -1 +1 @@
1
- export declare const version = "0.4.1";
1
+ export declare const version = "0.4.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truewatchtech/react-native-mobile",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Base on TrueWatchTech Android iOS React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -45,14 +45,14 @@
45
45
  ],
46
46
  "repository": {
47
47
  "type": "git",
48
- "url": "git+https://github.com/GuanceCloud/datakit-react-native.git"
48
+ "url": "git+https://github.com/TrueWatchTech/datakit-react-native.git"
49
49
  },
50
50
  "author": "Brandon <brandonfaustine@gmail.com> (https://github.com/Br4ndonZhang)",
51
51
  "license": "Apache-2.0",
52
52
  "bugs": {
53
- "url": "https://github.com/GuanceCloud/datakit-react-native.git/issues"
53
+ "url": "https://github.com/TrueWatchTech/datakit-react-native.git/issues"
54
54
  },
55
- "homepage": "https://github.com/GuanceCloud/datakit-react-native.git#readme",
55
+ "homepage": "https://github.com/TrueWatchTech/datakit-react-native.git#readme",
56
56
  "publishConfig": {
57
57
  "registry": "https://registry.npmjs.org/"
58
58
  },
@@ -209,6 +209,8 @@ export type FTRemoteConfigResult = {
209
209
  * @param syncSleepTime interval time between each request during data synchronization, unit milliseconds, 0 < syncSleepTime < 100
210
210
  * @param enableDataIntegerCompatible whether to enable data integer compatibility during data synchronization, enabled by default
211
211
  * @param compressIntakeRequests whether to compress synchronized data
212
+ * @param enableDataFilter whether to enable SDK-side local data filters, enabled by default
213
+ * @param dataFilters local blocklist filter rules. Supported categories include `logging` and `rum`. Any data that matches a rule will be discarded.
212
214
  * @param globalContext custom global parameters
213
215
  * @param groupIdentifiers iOS side sets the AppGroups Identifier array corresponding to the collected Widget Extension
214
216
  * @param enableLimitWithDbSize set whether to enable using db to limit data size, after enabling, `FTLogConfig.logCacheLimitCount` and `FTRUMConfig.rumCacheLimitCount` will no longer take effect
@@ -237,6 +239,8 @@ export interface FTMobileConfig {
237
239
  syncSleepTime?: number;
238
240
  enableDataIntegerCompatible?: boolean;
239
241
  compressIntakeRequests?: boolean;
242
+ enableDataFilter?: boolean;
243
+ dataFilters?: Record<string, Array<string>>;
240
244
  globalContext?: object;
241
245
  groupIdentifiers?: Array<string>;
242
246
  enableLimitWithDbSize?: boolean;
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '0.4.1';
2
+ export const version = '0.4.2';