@truewatchtech/react-native-mobile 0.4.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.
- package/FTMobileReactNativeSDK.podspec +7 -5
- package/android/build.gradle +10 -3
- package/android/src/main/java/com/ft/sdk/reactnative/FTLogImpl.java +10 -2
- package/android/src/main/java/com/ft/sdk/reactnative/FTMobileImpl.java +45 -10
- package/android/src/main/java/com/ft/sdk/reactnative/FTRUMImpl.java +131 -6
- package/android/src/main/java/com/ft/sdk/reactnative/FTTraceImpl.java +10 -3
- package/android/src/main/java/com/ft/sdk/reactnative/JsLongTaskMonitor.java +281 -0
- package/android/src/main/java/com/ft/sdk/reactnative/ViewTiming.java +17 -0
- package/android/src/main/java/com/ft/sdk/reactnative/VisitorIdConfigMapper.java +50 -0
- package/android/src/main/java/com/ft/sdk/reactnative/utils/ReactNativeUtils.java +5 -12
- package/android/src/newarch/java/com/ft/sdk/reactnative/FTMobileModule.java +14 -5
- package/android/src/newarch/java/com/ft/sdk/reactnative/FTRUMModule.java +44 -1
- package/android/src/newarch/java/com/ft/sdk/reactnative/FTTraceModule.java +14 -0
- package/android/src/oldarch/java/com/ft/sdk/reactnative/FTMobileModule.java +7 -2
- package/android/src/oldarch/java/com/ft/sdk/reactnative/FTRUMModule.java +39 -1
- package/android/src/oldarch/java/com/ft/sdk/reactnative/FTTraceModule.java +12 -0
- package/android/src/rnpost70/java/com/ft/sdk/reactnative/ReactJsThreadExecutor.java +21 -0
- package/android/src/rnpre70/java/com/ft/sdk/reactnative/ReactJsThreadExecutor.java +37 -0
- package/android/src/test/java/com/ft/sdk/reactnative/FTMobileImplTest.java +53 -0
- package/android/src/test/java/com/ft/sdk/reactnative/FTRUMModuleTest.java +117 -0
- package/android/src/test/java/com/ft/sdk/reactnative/JsLongTaskMonitorTest.java +446 -0
- package/android/src/test/java/com/ft/sdk/reactnative/utils/ReactNativeUtilsTest.java +33 -0
- package/ios/FTJSLongTaskMonitor.h +51 -0
- package/ios/FTJSLongTaskMonitor.m +250 -0
- package/ios/FTMobileReactNative.mm +54 -18
- package/ios/FTReactNativeLog.mm +9 -5
- package/ios/FTReactNativeRUM.mm +196 -31
- package/ios/FTReactNativeResource.h +4 -0
- package/ios/FTReactNativeResource.m +64 -0
- package/ios/FTReactNativeTrace.mm +59 -14
- package/ios/FTReactNativeUtils.m +10 -15
- package/ios/FTReactNativeViewTiming.h +18 -0
- package/ios/FTReactNativeWebSocket.h +10 -0
- package/ios/FTReactNativeWebSocket.mm +201 -0
- package/ios/FTWebSocketMetadataStore.h +25 -0
- package/ios/FTWebSocketMetadataStore.m +622 -0
- package/ios/FTWebSocketResourceData.h +20 -0
- package/ios/FTWebSocketResourceData.m +106 -0
- package/lib/commonjs/ft_logger.js +3 -1
- package/lib/commonjs/ft_logger.js.map +1 -1
- package/lib/commonjs/ft_mobile_agent.js +47 -4
- package/lib/commonjs/ft_mobile_agent.js.map +1 -1
- package/lib/commonjs/ft_rum.js +65 -5
- package/lib/commonjs/ft_rum.js.map +1 -1
- package/lib/commonjs/ft_tracing.js +14 -4
- package/lib/commonjs/ft_tracing.js.map +1 -1
- package/lib/commonjs/index.js +21 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/rum/FTBabelInteractionTracking.js +72 -0
- package/lib/commonjs/rum/FTBabelInteractionTracking.js.map +1 -0
- package/lib/commonjs/rum/FTBabelUtils.js +87 -0
- package/lib/commonjs/rum/FTBabelUtils.js.map +1 -0
- package/lib/commonjs/rum/FTRumActionTracking.js +10 -39
- package/lib/commonjs/rum/FTRumActionTracking.js.map +1 -1
- package/lib/commonjs/rum/FTRumActionTrackingContext.js +50 -0
- package/lib/commonjs/rum/FTRumActionTrackingContext.js.map +1 -0
- package/lib/commonjs/rum/FTRumViewTracking.js +147 -0
- package/lib/commonjs/rum/FTRumViewTracking.js.map +1 -0
- package/lib/commonjs/rum/FTRumWebSocketNative.js +73 -0
- package/lib/commonjs/rum/FTRumWebSocketNative.js.map +1 -0
- package/lib/commonjs/rum/FTRumWebSocketTiming.js +73 -0
- package/lib/commonjs/rum/FTRumWebSocketTiming.js.map +1 -0
- package/lib/commonjs/rum/FTRumWebSocketTracking.js +506 -0
- package/lib/commonjs/rum/FTRumWebSocketTracking.js.map +1 -0
- package/lib/commonjs/rum/longTasksUtils.js +25 -0
- package/lib/commonjs/rum/longTasksUtils.js.map +1 -0
- package/lib/commonjs/specs/NativeFTMobileReactNative.js.map +1 -1
- package/lib/commonjs/specs/NativeFTReactNativeRUM.js.map +1 -1
- package/lib/commonjs/specs/NativeFTReactNativeTrace.js.map +1 -1
- package/lib/commonjs/specs/NativeFTReactNativeWebSocket.js +11 -0
- package/lib/commonjs/specs/NativeFTReactNativeWebSocket.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/commonjs/visitorIdConfig.js +37 -0
- package/lib/commonjs/visitorIdConfig.js.map +1 -0
- package/lib/module/ft_logger.js +3 -1
- package/lib/module/ft_logger.js.map +1 -1
- package/lib/module/ft_mobile_agent.js +47 -4
- package/lib/module/ft_mobile_agent.js.map +1 -1
- package/lib/module/ft_rum.js +65 -5
- package/lib/module/ft_rum.js.map +1 -1
- package/lib/module/ft_tracing.js +14 -2
- package/lib/module/ft_tracing.js.map +1 -1
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/rum/FTBabelInteractionTracking.js +66 -0
- package/lib/module/rum/FTBabelInteractionTracking.js.map +1 -0
- package/lib/module/rum/FTBabelUtils.js +80 -0
- package/lib/module/rum/FTBabelUtils.js.map +1 -0
- package/lib/module/rum/FTRumActionTracking.js +10 -39
- package/lib/module/rum/FTRumActionTracking.js.map +1 -1
- package/lib/module/rum/FTRumActionTrackingContext.js +43 -0
- package/lib/module/rum/FTRumActionTrackingContext.js.map +1 -0
- package/lib/module/rum/FTRumViewTracking.js +140 -0
- package/lib/module/rum/FTRumViewTracking.js.map +1 -0
- package/lib/module/rum/FTRumWebSocketNative.js +62 -0
- package/lib/module/rum/FTRumWebSocketNative.js.map +1 -0
- package/lib/module/rum/FTRumWebSocketTiming.js +67 -0
- package/lib/module/rum/FTRumWebSocketTiming.js.map +1 -0
- package/lib/module/rum/FTRumWebSocketTracking.js +499 -0
- package/lib/module/rum/FTRumWebSocketTracking.js.map +1 -0
- package/lib/module/rum/longTasksUtils.js +18 -0
- package/lib/module/rum/longTasksUtils.js.map +1 -0
- package/lib/module/specs/NativeFTMobileReactNative.js.map +1 -1
- package/lib/module/specs/NativeFTReactNativeRUM.js.map +1 -1
- package/lib/module/specs/NativeFTReactNativeTrace.js.map +1 -1
- package/lib/module/specs/NativeFTReactNativeWebSocket.js +8 -0
- package/lib/module/specs/NativeFTReactNativeWebSocket.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/module/visitorIdConfig.js +31 -0
- package/lib/module/visitorIdConfig.js.map +1 -0
- package/lib/typescript/ft_logger.d.ts +11 -1
- package/lib/typescript/ft_mobile_agent.d.ts +28 -0
- package/lib/typescript/ft_rum.d.ts +42 -5
- package/lib/typescript/ft_tracing.d.ts +9 -1
- package/lib/typescript/index.d.ts +5 -1
- package/lib/typescript/rum/FTBabelInteractionTracking.d.ts +30 -0
- package/lib/typescript/rum/FTBabelUtils.d.ts +1 -0
- package/lib/typescript/rum/FTRumActionTracking.d.ts +0 -2
- package/lib/typescript/rum/FTRumActionTrackingContext.d.ts +11 -0
- package/lib/typescript/rum/FTRumViewTracking.d.ts +32 -0
- package/lib/typescript/rum/FTRumWebSocketNative.d.ts +22 -0
- package/lib/typescript/rum/FTRumWebSocketTiming.d.ts +7 -0
- package/lib/typescript/rum/FTRumWebSocketTracking.d.ts +54 -0
- package/lib/typescript/rum/longTasksUtils.d.ts +8 -0
- package/lib/typescript/specs/NativeFTMobileReactNative.d.ts +15 -0
- package/lib/typescript/specs/NativeFTReactNativeRUM.d.ts +11 -1
- package/lib/typescript/specs/NativeFTReactNativeTrace.d.ts +12 -0
- package/lib/typescript/specs/NativeFTReactNativeWebSocket.d.ts +13 -0
- package/lib/typescript/version.d.ts +1 -1
- package/lib/typescript/visitorIdConfig.d.ts +11 -0
- package/package.json +6 -4
- package/src/ft_logger.tsx +11 -1
- package/src/ft_mobile_agent.tsx +79 -7
- package/src/ft_rum.tsx +111 -7
- package/src/ft_tracing.tsx +24 -2
- package/src/index.tsx +8 -0
- package/src/rum/FTBabelInteractionTracking.ts +124 -0
- package/src/rum/FTBabelUtils.tsx +99 -0
- package/src/rum/FTRumActionTracking.tsx +14 -43
- package/src/rum/FTRumActionTrackingContext.ts +68 -0
- package/src/rum/FTRumViewTracking.ts +179 -0
- package/src/rum/FTRumWebSocketNative.ts +107 -0
- package/src/rum/FTRumWebSocketTiming.ts +82 -0
- package/src/rum/FTRumWebSocketTracking.ts +722 -0
- package/src/rum/longTasksUtils.ts +17 -0
- package/src/specs/NativeFTMobileReactNative.ts +18 -0
- package/src/specs/NativeFTReactNativeRUM.ts +19 -1
- package/src/specs/NativeFTReactNativeTrace.ts +12 -0
- package/src/specs/NativeFTReactNativeWebSocket.ts +33 -0
- package/src/version.ts +1 -1
- package/src/visitorIdConfig.ts +123 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeFTReactNativeRUM.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\nexport interface Spec extends TurboModule {\n /**\n * Set RUM tracking conditions and enable RUM collection.\n * @param config rum configuration parameters.\n * @returns a Promise.\n */\n setConfig(config: Object): Promise<void>;\n /**\n * Start RUM Action.\n * RUM will bind Resource, Error, LongTask events that may be triggered by this Action.\n * Avoid adding multiple times within 0.1s, only one Action will be associated with the same View at the same time, and new Actions will be discarded if the previous one has not ended.\n * Adding Action with `addAction` method does not affect each other.\n * @param actionName action name\n * @param actionType action type\n * @param property event context (optional)\n * @returns a Promise.\n */\n startAction(\n actionName: string,\n actionType: string,\n property?: Object\n ): Promise<void>;\n /**\n * Add Action event. This type of data cannot be associated with Error, Resource, LongTask data, and has no discard logic.\n * @param actionName action name\n * @param actionType action type\n * @param property event context (optional)\n * @returns a Promise.\n */\n addAction(\n actionName: string,\n actionType: string,\n property?: Object\n ): Promise<void>;\n /**\n * view load duration.\n * @param viewName view name\n * @param loadTime view load duration\n * @returns a Promise.\n */\n onCreateView(viewName: string, loadTime: number): Promise<void>;\n /**\n * view start.\n * @param viewName page name\n * @param property event context (optional)\n * @returns a Promise.\n */\n startView(viewName: string, property?: Object): Promise<void>;\n /**\n * view end.\n * @param property event context (optional)\n * @returns a Promise.\n */\n stopView(property?: Object): Promise<void>;\n /**\n * Exception capture and log collection.\n * @param stack stack log\n * @param message error message\n * @param property event context (optional)\n * @returns a Promise.\n */\n addError(stack: string, message: string, property?: Object): Promise<void>;\n /**\n * Exception capture and log collection.\n * @param type error type\n * @param stack stack log\n * @param message error message\n * @param property event context (optional)\n * @returns a Promise.\n */\n addErrorWithType(\n type: string,\n stack: string,\n message: string,\n property?: Object\n ): Promise<void>;\n /**\n * Start resource request.\n * @param key unique id\n * @param property event context (optional)\n * @returns a Promise.\n */\n startResource(key: string, property?: Object): Promise<void>;\n /**\n * End resource request.\n * @param key unique id\n * @param property event context (optional)\n * @returns a Promise.\n */\n stopResource(key: string, property?: Object): Promise<void>;\n /**\n * Send resource data metrics.\n * @param key unique id\n * @param resource resource data\n * @param metrics resource performance data\n * @returns a Promise.\n */\n addResource(key: string, resource: Object, metrics?: Object): Promise<void>;\n}\nexport default TurboModuleRegistry.get<Spec>('FTReactNativeRUM');\n"],"mappings":"AAAA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeFTReactNativeRUM.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\nexport interface Spec extends TurboModule {\n /**\n * Set RUM tracking conditions and enable RUM collection.\n * @param config rum configuration parameters.\n * @returns a Promise.\n */\n setConfig(config: Object): Promise<void>;\n /** Internal synchronous snapshot used only by native JS long task reporting. */\n setLongTaskContext(context: Object): boolean;\n /** Stops the internal JavaScript long task monitor before SDK shutdown. */\n stopLongTaskTracking(): Promise<void>;\n /**\n * Start RUM Action.\n * RUM will bind Resource, Error, LongTask events that may be triggered by this Action.\n * Avoid adding multiple times within 0.1s, only one Action will be associated with the same View at the same time, and new Actions will be discarded if the previous one has not ended.\n * Adding Action with `addAction` method does not affect each other.\n * @param actionName action name\n * @param actionType action type\n * @param property event context (optional)\n * @returns a Promise.\n */\n startAction(\n actionName: string,\n actionType: string,\n property?: Object\n ): Promise<void>;\n /**\n * Add Action event. This type of data cannot be associated with Error, Resource, LongTask data, and has no discard logic.\n * @param actionName action name\n * @param actionType action type\n * @param property event context (optional)\n * @returns a Promise.\n */\n addAction(\n actionName: string,\n actionType: string,\n property?: Object\n ): Promise<void>;\n /**\n * view load duration.\n * @param viewName view name\n * @param loadTime monotonic view load duration in nanoseconds\n * @returns a Promise.\n */\n onCreateView(viewName: string, loadTime: number): Promise<void>;\n /** Replace the current View's loading duration; non-negative safe integer nanoseconds. */\n updateViewLoadingTime(duration: number): Promise<void>;\n /** Framework integration: duration in ns; epoch start in ms, converted natively. */\n onCreateViewWithLoadStart(\n viewName: string,\n loadTime: number,\n loadStartEpochMs: number\n ): Promise<void>;\n /** Framework integration: Manual = 0, Automatic = 1. */\n startViewWithTrackingType(\n viewName: string,\n property: Object | undefined,\n trackingType: number\n ): Promise<void>;\n /**\n * view start.\n * @param viewName page name\n * @param property event context (optional)\n * @returns a Promise.\n */\n startView(viewName: string, property?: Object): Promise<void>;\n /**\n * view end.\n * @param property event context (optional)\n * @returns a Promise.\n */\n stopView(property?: Object): Promise<void>;\n /**\n * Exception capture and log collection.\n * @param stack stack log\n * @param message error message\n * @param property event context (optional)\n * @returns a Promise.\n */\n addError(stack: string, message: string, property?: Object): Promise<void>;\n /**\n * Exception capture and log collection.\n * @param type error type\n * @param stack stack log\n * @param message error message\n * @param property event context (optional)\n * @returns a Promise.\n */\n addErrorWithType(\n type: string,\n stack: string,\n message: string,\n property?: Object\n ): Promise<void>;\n /**\n * Start resource request.\n * @param key unique id\n * @param property event context (optional)\n * @returns a Promise.\n */\n startResource(key: string, property?: Object): Promise<void>;\n /**\n * End resource request.\n * @param key unique id\n * @param property event context (optional)\n * @returns a Promise.\n */\n stopResource(key: string, property?: Object): Promise<void>;\n /**\n * Send resource data metrics.\n * @param key unique id\n * @param resource resource data\n * @param metrics resource performance data\n * @returns a Promise.\n */\n addResource(key: string, resource: Object, metrics?: Object): Promise<void>;\n}\nexport default TurboModuleRegistry.get<Spec>('FTReactNativeRUM');\n"],"mappings":"AAAA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;AAuHlD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeFTReactNativeTrace.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\nexport interface Spec extends TurboModule {\n /**\n * Configure trace to enable distributed tracing.\n * @param config trace configuration parameters.\n * @returns a Promise.\n */\n setConfig(config: Object): Promise<void>;\n /**\n * Get trace HTTP request header data.\n * @param url request URL\n * @returns trace request header parameters\n * @deprecated use getTraceHeaderFields() replace.\n */\n getTraceHeader(key: string, url: string): Promise<Object>;\n /**\n * Get trace HTTP request header data.\n * @param url request URL\n * @returns trace request header parameters\n */\n getTraceHeaderFields(url: string, key?: string): Promise<Object>;\n}\nexport default TurboModuleRegistry.get<Spec>('FTReactNativeTrace');\n"],"mappings":"AAAA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeFTReactNativeTrace.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\nexport interface Spec extends TurboModule {\n /**\n * Configure trace to enable distributed tracing.\n * @param config trace configuration parameters.\n * @returns a Promise.\n */\n setConfig(config: Object): Promise<void>;\n /**\n * Get trace HTTP request header data.\n * @param url request URL\n * @returns trace request header parameters\n * @deprecated use getTraceHeaderFields() replace.\n */\n getTraceHeader(key: string, url: string): Promise<Object>;\n /**\n * Get trace HTTP request header data.\n * @param url request URL\n * @returns trace request header parameters\n */\n getTraceHeaderFields(url: string, key?: string): Promise<Object>;\n /**\n * Get trace HTTP request headers synchronously for APIs whose construction\n * cannot wait for a Promise, such as React Native WebSocket.\n * @internal\n */\n getTraceHeaderFieldsSync(url: string, key: string): Object | null;\n /**\n * Discard iOS Trace correlation when WebSocket observation is abandoned\n * before Resource reporting starts. Android uses native collection.\n * @internal\n */\n cancelWebSocketTrace(key: string): Promise<void>;\n}\nexport default TurboModuleRegistry.get<Spec>('FTReactNativeTrace');\n"],"mappings":"AAAA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;AAmClD,eAAeA,mBAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
2
|
+
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/** Internal iOS handshake reporting bridge; absent on Android and older binaries. */
|
|
6
|
+
|
|
7
|
+
export default TurboModuleRegistry.get('FTReactNativeWebSocket');
|
|
8
|
+
//# sourceMappingURL=NativeFTReactNativeWebSocket.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sources":["NativeFTReactNativeWebSocket.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\n/** Internal iOS handshake reporting bridge; absent on Android and older binaries. */\nexport interface Spec extends TurboModule {\n startCapture(session: string): Promise<void>;\n stopCapture(session: string): Promise<void>;\n clear(): Promise<void>;\n startResource(\n key: string,\n socketID: number,\n url: string,\n session: string,\n sequence: number,\n property: Object\n ): Promise<void>;\n stopResource(\n key: string,\n event: string,\n session: string,\n property: Object\n ): Promise<void>;\n addResource(\n key: string,\n content: Object,\n metrics: Object,\n session: string\n ): Promise<void>;\n releaseResource(key: string, session: string): Promise<void>;\n}\n\nexport default TurboModuleRegistry.get<Spec>('FTReactNativeWebSocket');\n"],"mappings":"AAAA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;;AA4BA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,wBAAwB,CAAC","ignoreList":[]}
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["version"],"sources":["version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '0.4.
|
|
1
|
+
{"version":3,"names":["version"],"sources":["version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '0.4.3';\n"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Anonymous Visitor ID header configuration for HTTP(S), excluding WebSockets. */
|
|
2
|
+
|
|
3
|
+
// These restrictions are shared by the target iOS and Android native SDKs.
|
|
4
|
+
const reservedHeaders = new Set(['accept-charset', 'accept-encoding', 'access-control-request-headers', 'access-control-request-method', 'connection', 'content-length', 'cookie', 'cookie2', 'date', 'dnt', 'expect', 'host', 'keep-alive', 'origin', 'permissions-policy', 'referer', 'te', 'trailer', 'transfer-encoding', 'upgrade', 'via', 'b3', 'traceparent', 'tracestate', 'uber-trace-id', 'sw8', 'x-gc-trace-id', 'x-gc-span-id', 'x-rum-resource-id']);
|
|
5
|
+
const reservedFragments = ['authorization', 'authentication', 'api-key', 'api_key', 'apikey', 'auth-token', 'auth_token', 'access-token', 'access_token', 'session-token', 'session_token', 'refresh-token', 'refresh_token', 'id-token', 'id_token', 'security-token', 'security_token', 'csrf', 'xsrf', 'jwt', 'signature'];
|
|
6
|
+
export function validateVisitorIdConfig(config) {
|
|
7
|
+
if (!config || typeof config !== 'object' || Array.isArray(config)) {
|
|
8
|
+
throw new Error('visitorIdConfig must be an object');
|
|
9
|
+
}
|
|
10
|
+
const {
|
|
11
|
+
header,
|
|
12
|
+
ttlHours = 24,
|
|
13
|
+
urlPrefixes = [],
|
|
14
|
+
regularExpressions = []
|
|
15
|
+
} = config;
|
|
16
|
+
if (typeof header !== 'string' || /[\r\n]/.test(header) || !/^[!#$%&'*+.^_`|~0-9a-z-]+$/.test(header) || reservedHeaders.has(header) || reservedFragments.some(part => header.includes(part)) || ['proxy-', 'sec-', 'x-datadog-', 'x-b3-'].some(prefix => header.startsWith(prefix))) {
|
|
17
|
+
throw new Error('visitorIdConfig.header must be a lowercase custom HTTP header');
|
|
18
|
+
}
|
|
19
|
+
// Android stores TTL as a signed long number of milliseconds.
|
|
20
|
+
const milliseconds = ttlHours * 3600000;
|
|
21
|
+
if (typeof ttlHours !== 'number' || !Number.isFinite(ttlHours) || milliseconds < 1 || milliseconds >= 2 ** 63) {
|
|
22
|
+
throw new Error('visitorIdConfig.ttlHours must represent at least 1 millisecond and fit a signed 64-bit integer');
|
|
23
|
+
}
|
|
24
|
+
if (!Array.isArray(urlPrefixes) || !Array.isArray(regularExpressions) || urlPrefixes.length + regularExpressions.length === 0) {
|
|
25
|
+
throw new Error('visitorIdConfig requires at least one URL matching rule');
|
|
26
|
+
}
|
|
27
|
+
if (urlPrefixes.some(prefix => typeof prefix !== 'string' || !/^https?:\/\/[^/?#\s]+(?:[/?#]|$)/i.test(prefix)) || regularExpressions.some(pattern => typeof pattern !== 'string' || pattern.length === 0)) {
|
|
28
|
+
throw new Error('visitorIdConfig contains an invalid URL matching rule');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=visitorIdConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["reservedHeaders","Set","reservedFragments","validateVisitorIdConfig","config","Array","isArray","Error","header","ttlHours","urlPrefixes","regularExpressions","test","has","some","part","includes","prefix","startsWith","milliseconds","Number","isFinite","length","pattern"],"sources":["visitorIdConfig.ts"],"sourcesContent":["/** Anonymous Visitor ID header configuration for HTTP(S), excluding WebSockets. */\nexport interface FTVisitorIdConfig {\n header: string;\n /** Fixed lifetime in hours; defaults to 24. Access does not renew it. */\n ttlHours?: number;\n /** Complete HTTP(S) prefixes constrained to the same scheme, host and port. */\n urlPrefixes?: string[];\n /** Native regular expressions searched against the complete URL; rules use OR. */\n regularExpressions?: string[];\n}\n\n// These restrictions are shared by the target iOS and Android native SDKs.\nconst reservedHeaders = new Set([\n 'accept-charset',\n 'accept-encoding',\n 'access-control-request-headers',\n 'access-control-request-method',\n 'connection',\n 'content-length',\n 'cookie',\n 'cookie2',\n 'date',\n 'dnt',\n 'expect',\n 'host',\n 'keep-alive',\n 'origin',\n 'permissions-policy',\n 'referer',\n 'te',\n 'trailer',\n 'transfer-encoding',\n 'upgrade',\n 'via',\n 'b3',\n 'traceparent',\n 'tracestate',\n 'uber-trace-id',\n 'sw8',\n 'x-gc-trace-id',\n 'x-gc-span-id',\n 'x-rum-resource-id',\n]);\nconst reservedFragments = [\n 'authorization',\n 'authentication',\n 'api-key',\n 'api_key',\n 'apikey',\n 'auth-token',\n 'auth_token',\n 'access-token',\n 'access_token',\n 'session-token',\n 'session_token',\n 'refresh-token',\n 'refresh_token',\n 'id-token',\n 'id_token',\n 'security-token',\n 'security_token',\n 'csrf',\n 'xsrf',\n 'jwt',\n 'signature',\n];\n\nexport function validateVisitorIdConfig(config: FTVisitorIdConfig): void {\n if (!config || typeof config !== 'object' || Array.isArray(config)) {\n throw new Error('visitorIdConfig must be an object');\n }\n const {\n header,\n ttlHours = 24,\n urlPrefixes = [],\n regularExpressions = [],\n } = config;\n if (\n typeof header !== 'string' ||\n /[\\r\\n]/.test(header) ||\n !/^[!#$%&'*+.^_`|~0-9a-z-]+$/.test(header) ||\n reservedHeaders.has(header) ||\n reservedFragments.some((part) => header.includes(part)) ||\n ['proxy-', 'sec-', 'x-datadog-', 'x-b3-'].some((prefix) =>\n header.startsWith(prefix)\n )\n ) {\n throw new Error(\n 'visitorIdConfig.header must be a lowercase custom HTTP header'\n );\n }\n // Android stores TTL as a signed long number of milliseconds.\n const milliseconds = ttlHours * 3600000;\n if (\n typeof ttlHours !== 'number' ||\n !Number.isFinite(ttlHours) ||\n milliseconds < 1 ||\n milliseconds >= 2 ** 63\n ) {\n throw new Error(\n 'visitorIdConfig.ttlHours must represent at least 1 millisecond and fit a signed 64-bit integer'\n );\n }\n if (\n !Array.isArray(urlPrefixes) ||\n !Array.isArray(regularExpressions) ||\n urlPrefixes.length + regularExpressions.length === 0\n ) {\n throw new Error('visitorIdConfig requires at least one URL matching rule');\n }\n if (\n urlPrefixes.some(\n (prefix) =>\n typeof prefix !== 'string' ||\n !/^https?:\\/\\/[^/?#\\s]+(?:[/?#]|$)/i.test(prefix)\n ) ||\n regularExpressions.some(\n (pattern) => typeof pattern !== 'string' || pattern.length === 0\n )\n ) {\n throw new Error('visitorIdConfig contains an invalid URL matching rule');\n }\n}\n"],"mappings":"AAAA;;AAWA;AACA,MAAMA,eAAe,GAAG,IAAIC,GAAG,CAAC,CAC9B,gBAAgB,EAChB,iBAAiB,EACjB,gCAAgC,EAChC,+BAA+B,EAC/B,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,oBAAoB,EACpB,SAAS,EACT,IAAI,EACJ,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,KAAK,EACL,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,eAAe,EACf,KAAK,EACL,eAAe,EACf,cAAc,EACd,mBAAmB,CACpB,CAAC;AACF,MAAMC,iBAAiB,GAAG,CACxB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,EACN,MAAM,EACN,KAAK,EACL,WAAW,CACZ;AAED,OAAO,SAASC,uBAAuBA,CAACC,MAAyB,EAAQ;EACvE,IAAI,CAACA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAIC,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,EAAE;IAClE,MAAM,IAAIG,KAAK,CAAC,mCAAmC,CAAC;EACtD;EACA,MAAM;IACJC,MAAM;IACNC,QAAQ,GAAG,EAAE;IACbC,WAAW,GAAG,EAAE;IAChBC,kBAAkB,GAAG;EACvB,CAAC,GAAGP,MAAM;EACV,IACE,OAAOI,MAAM,KAAK,QAAQ,IAC1B,QAAQ,CAACI,IAAI,CAACJ,MAAM,CAAC,IACrB,CAAC,4BAA4B,CAACI,IAAI,CAACJ,MAAM,CAAC,IAC1CR,eAAe,CAACa,GAAG,CAACL,MAAM,CAAC,IAC3BN,iBAAiB,CAACY,IAAI,CAAEC,IAAI,IAAKP,MAAM,CAACQ,QAAQ,CAACD,IAAI,CAAC,CAAC,IACvD,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAACD,IAAI,CAAEG,MAAM,IACpDT,MAAM,CAACU,UAAU,CAACD,MAAM,CAC1B,CAAC,EACD;IACA,MAAM,IAAIV,KAAK,CACb,+DACF,CAAC;EACH;EACA;EACA,MAAMY,YAAY,GAAGV,QAAQ,GAAG,OAAO;EACvC,IACE,OAAOA,QAAQ,KAAK,QAAQ,IAC5B,CAACW,MAAM,CAACC,QAAQ,CAACZ,QAAQ,CAAC,IAC1BU,YAAY,GAAG,CAAC,IAChBA,YAAY,IAAI,CAAC,IAAI,EAAE,EACvB;IACA,MAAM,IAAIZ,KAAK,CACb,gGACF,CAAC;EACH;EACA,IACE,CAACF,KAAK,CAACC,OAAO,CAACI,WAAW,CAAC,IAC3B,CAACL,KAAK,CAACC,OAAO,CAACK,kBAAkB,CAAC,IAClCD,WAAW,CAACY,MAAM,GAAGX,kBAAkB,CAACW,MAAM,KAAK,CAAC,EACpD;IACA,MAAM,IAAIf,KAAK,CAAC,yDAAyD,CAAC;EAC5E;EACA,IACEG,WAAW,CAACI,IAAI,CACbG,MAAM,IACL,OAAOA,MAAM,KAAK,QAAQ,IAC1B,CAAC,mCAAmC,CAACL,IAAI,CAACK,MAAM,CACpD,CAAC,IACDN,kBAAkB,CAACG,IAAI,CACpBS,OAAO,IAAK,OAAOA,OAAO,KAAK,QAAQ,IAAIA,OAAO,CAACD,MAAM,KAAK,CACjE,CAAC,EACD;IACA,MAAM,IAAIf,KAAK,CAAC,uDAAuD,CAAC;EAC1E;AACF","ignoreList":[]}
|
|
@@ -17,8 +17,10 @@ export declare enum FTLogCacheDiscard {
|
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Configure log output configuration.
|
|
20
|
-
* @param
|
|
20
|
+
* @param logSamplingRate Log sampling percentage in [0, 100], default 100. Supports fractional percentages and takes precedence over sampleRate.
|
|
21
|
+
* @param sampleRate Deprecated log sampling probability in [0, 1], default 1. Used only when logSamplingRate is omitted; multiplied by 100 before passing to Native.
|
|
21
22
|
* @param enableLinkRumData whether to link with RUM
|
|
23
|
+
* @param enableWebViewLog Collect Browser Logs SDK events from WebViews, default false
|
|
22
24
|
* @param enableCustomLog whether to enable custom logs
|
|
23
25
|
* @param discardStrategy log discard strategy
|
|
24
26
|
* @param logLevelFilters log level filter
|
|
@@ -26,9 +28,17 @@ export declare enum FTLogCacheDiscard {
|
|
|
26
28
|
* @param logCacheLimitCount get maximum log entry count limit [1000,), default 5000
|
|
27
29
|
*/
|
|
28
30
|
export interface FTLogConfig {
|
|
31
|
+
/**
|
|
32
|
+
* Log sampling percentage in [0, 100], default 100.
|
|
33
|
+
* Supports fractional percentages: 12.5 means 12.5%, not 0.125.
|
|
34
|
+
* Takes precedence over sampleRate when both are supplied, including 0.
|
|
35
|
+
*/
|
|
36
|
+
logSamplingRate?: number;
|
|
37
|
+
/** @deprecated Use logSamplingRate. Probability in [0, 1], default 1; 0.125 maps to 12.5%. Ignored when logSamplingRate is supplied. */
|
|
29
38
|
sampleRate?: number;
|
|
30
39
|
enableLinkRumData?: boolean;
|
|
31
40
|
enableCustomLog?: boolean;
|
|
41
|
+
enableWebViewLog?: boolean;
|
|
32
42
|
discardStrategy?: FTLogCacheDiscard;
|
|
33
43
|
logLevelFilters?: Array<FTLogStatus>;
|
|
34
44
|
globalContext?: object;
|
|
@@ -7,6 +7,7 @@ import { EmitterSubscription } from 'react-native';
|
|
|
7
7
|
declare class BridgeContextManager {
|
|
8
8
|
private static instance;
|
|
9
9
|
private properties;
|
|
10
|
+
private longTaskContextEnabled;
|
|
10
11
|
private constructor();
|
|
11
12
|
/**
|
|
12
13
|
* Initialize SDK information properties
|
|
@@ -23,6 +24,8 @@ declare class BridgeContextManager {
|
|
|
23
24
|
* @param properties Object containing key-value pairs
|
|
24
25
|
*/
|
|
25
26
|
appendBridgeContext(properties: Record<string, any>): void;
|
|
27
|
+
configureLongTaskContext(enabled: boolean): void;
|
|
28
|
+
private syncLongTaskContext;
|
|
26
29
|
/**
|
|
27
30
|
* Merge bridge context properties with local properties
|
|
28
31
|
* Bridge context properties take precedence over local properties
|
|
@@ -64,6 +67,8 @@ export type FTRemoteConfigOverrideMatch = {
|
|
|
64
67
|
/**
|
|
65
68
|
* Values that can be modified by remote config override rules.
|
|
66
69
|
* These values will adjust the fetched remote configuration before it is applied.
|
|
70
|
+
* Omitted fields are not changed by this rule. Sampling percentages use [0, 100]
|
|
71
|
+
* and support fractions (12.5 means 12.5%); legacy probabilities use [0, 1].
|
|
67
72
|
*/
|
|
68
73
|
export type FTRemoteConfigOverrideValues = {
|
|
69
74
|
env?: string;
|
|
@@ -72,7 +77,21 @@ export type FTRemoteConfigOverrideValues = {
|
|
|
72
77
|
compressIntakeRequests?: boolean;
|
|
73
78
|
syncPageSize?: number;
|
|
74
79
|
syncSleepTime?: number;
|
|
80
|
+
/** RUM session sampling percentage override in [0, 100]; takes precedence over rumSampleRate, including 0. */
|
|
81
|
+
sessionSamplingRate?: number;
|
|
82
|
+
/** Error session sampling percentage override in [0, 100]; takes precedence over rumSessionOnErrorSampleRate, including 0. */
|
|
83
|
+
sessionOnErrorSamplingRate?: number;
|
|
84
|
+
/** Trace sampling percentage override in [0, 100]; takes precedence over traceSampleRate, including 0. */
|
|
85
|
+
traceSamplingRate?: number;
|
|
86
|
+
/** Log sampling percentage override in [0, 100]; takes precedence over logSampleRate, including 0. */
|
|
87
|
+
logSamplingRate?: number;
|
|
88
|
+
/** Session Replay sampling percentage override in [0, 100]; fractional percentages are supported. */
|
|
89
|
+
sessionReplaySamplingRate?: number;
|
|
90
|
+
/** Error replay sampling percentage override in [0, 100]; fractional percentages are supported. */
|
|
91
|
+
sessionReplayOnErrorSamplingRate?: number;
|
|
92
|
+
/** @deprecated Use sessionSamplingRate. Legacy RUM probability override in [0, 1]; 0.125 maps to 12.5%. */
|
|
75
93
|
rumSampleRate?: number;
|
|
94
|
+
/** @deprecated Use sessionOnErrorSamplingRate. Legacy error session probability override in [0, 1]. */
|
|
76
95
|
rumSessionOnErrorSampleRate?: number;
|
|
77
96
|
rumEnableTraceUserAction?: boolean;
|
|
78
97
|
rumEnableTraceUserView?: boolean;
|
|
@@ -84,12 +103,15 @@ export type FTRemoteConfigOverrideValues = {
|
|
|
84
103
|
rumEnableTrackAppANR?: boolean;
|
|
85
104
|
rumEnableTraceWebView?: boolean;
|
|
86
105
|
rumAllowWebViewHost?: Array<string>;
|
|
106
|
+
/** @deprecated Use traceSamplingRate. Legacy Trace probability override in [0, 1]. */
|
|
87
107
|
traceSampleRate?: number;
|
|
88
108
|
traceEnableAutoTrace?: boolean;
|
|
89
109
|
traceType?: string;
|
|
110
|
+
/** @deprecated Use logSamplingRate. Legacy log probability override in [0, 1]. */
|
|
90
111
|
logSampleRate?: number;
|
|
91
112
|
logLevelFilters?: Array<string>;
|
|
92
113
|
logEnableCustomLog?: boolean;
|
|
114
|
+
logEnableWebViewLog?: boolean;
|
|
93
115
|
logEnableConsoleLog?: boolean;
|
|
94
116
|
};
|
|
95
117
|
/**
|
|
@@ -169,6 +191,10 @@ export interface FTMobileConfig {
|
|
|
169
191
|
compressIntakeRequests?: boolean;
|
|
170
192
|
enableDataFilter?: boolean;
|
|
171
193
|
dataFilters?: Record<string, Array<string>>;
|
|
194
|
+
/** Shared WebView host allowlist for RUM and Log. Omitted uses the legacy RUM
|
|
195
|
+
* config; null allows every host; [] disables bridge access. Remote config wins.
|
|
196
|
+
*/
|
|
197
|
+
allowWebViewHost?: Array<string> | null;
|
|
172
198
|
globalContext?: object;
|
|
173
199
|
groupIdentifiers?: Array<string>;
|
|
174
200
|
enableLimitWithDbSize?: boolean;
|
|
@@ -214,6 +240,8 @@ type FTMobileReactNativeType = {
|
|
|
214
240
|
* @returns a Promise.
|
|
215
241
|
*/
|
|
216
242
|
unbindRUMUserData(): Promise<void>;
|
|
243
|
+
/** Rotate the native anonymous Visitor ID for subsequent requests. */
|
|
244
|
+
resetVisitorId(): Promise<void>;
|
|
217
245
|
/**
|
|
218
246
|
* Add custom global parameters. Applies to RUM and Log data
|
|
219
247
|
* @param context custom global parameters.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FTVisitorIdConfig } from './visitorIdConfig';
|
|
1
2
|
/**
|
|
2
3
|
* Error monitoring type.
|
|
3
4
|
*/
|
|
@@ -51,17 +52,25 @@ export declare enum IOSCrashMonitoringType {
|
|
|
51
52
|
* Set RUM tracking conditions.
|
|
52
53
|
* @param androidAppId appId, apply during monitoring
|
|
53
54
|
* @param iOSAppId appId, apply during monitoring
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
55
|
+
* @param sessionSamplingRate RUM session sampling percentage in [0, 100], default 100. Supports fractional percentages and takes precedence over sampleRate.
|
|
56
|
+
* @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.
|
|
57
|
+
* @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.
|
|
58
|
+
* @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.
|
|
56
59
|
* @param enableAutoTrackUserAction whether to automatically collect react-native control click events, can set actionName with accessibilityLabel when enabled
|
|
57
60
|
* @param enableTrackError whether to automatically collect react-native Error
|
|
58
61
|
* @param enableTrackNativeCrash whether to collect Native Error
|
|
59
62
|
* @param enableTrackNativeAppANR whether to collect Native ANR
|
|
60
63
|
* @param enableTrackNativeFreeze whether to collect Native Freeze
|
|
61
64
|
* @param nativeFreezeDurationMs set the threshold for collecting Native Freeze, value range [100,), unit ms. iOS default 250ms, Android default 1000ms
|
|
65
|
+
* @param enableLongTask whether to collect React Native JavaScript LongTasks, default false
|
|
66
|
+
* @param longTaskThresholdMs set the threshold for collecting React Native JavaScript LongTasks, unit ms. Defaults to 100 and is clamped to [100, 5000]
|
|
62
67
|
* @param enableNativeUserAction whether to start Native Action tracking, Button click events, recommended to disable for pure react-native apps
|
|
63
68
|
* @param enableNativeUserView whether to start Native View auto tracking, recommended to disable for pure react-native apps
|
|
64
69
|
* @param enableNativeUserResource whether to automatically collect react-native Resource
|
|
70
|
+
* @param enableIOSWebSocketResource whether to collect iOS WebSocket opening handshakes as RUM Resources. Defaults to false.
|
|
71
|
+
* Independent of enableNativeUserResource. Android native WebSocket collection is unaffected.
|
|
72
|
+
* iOS WebSocket Trace header injection requires both this option and enableNativeAutoTrace.
|
|
73
|
+
* When disabled, new iOS WebSocket connections are not instrumented or automatically injected with Trace headers by this SDK.
|
|
65
74
|
* @param enableResourceHostIP whether to collect network request Host IP (only for native http, iOS 13 and above)
|
|
66
75
|
* @param errorMonitorType error monitoring supplement type
|
|
67
76
|
* @param deviceMonitorType page monitoring supplement type
|
|
@@ -70,13 +79,30 @@ export declare enum IOSCrashMonitoringType {
|
|
|
70
79
|
* @param rumCacheLimitCount RUM max cache size, default 100_000
|
|
71
80
|
* @param rumDiscardStrategy RUM data discard strategy
|
|
72
81
|
* @param enableTraceWebView Set whether to enable WebView data collection, default true
|
|
73
|
-
* @param allowWebViewHost
|
|
82
|
+
* @param allowWebViewHost Deprecated; use FTMobileConfig.allowWebViewHost for shared WebView host filtering.
|
|
74
83
|
* @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.
|
|
75
84
|
*/
|
|
76
85
|
export interface FTRUMConfig {
|
|
86
|
+
/** Valid config enables Visitor ID; omitted/null disables it. */
|
|
87
|
+
visitorIdConfig?: FTVisitorIdConfig | null;
|
|
77
88
|
androidAppId: string;
|
|
78
89
|
iOSAppId: string;
|
|
90
|
+
/**
|
|
91
|
+
* RUM session sampling percentage in [0, 100], default 100.
|
|
92
|
+
* Supports fractional percentages: 12.5 means 12.5%, not 0.125.
|
|
93
|
+
* Takes precedence over sampleRate when both are supplied, including 0.
|
|
94
|
+
* Setting 0 disables regular session sampling; error session sampling is separate.
|
|
95
|
+
*/
|
|
96
|
+
sessionSamplingRate?: number;
|
|
97
|
+
/** @deprecated Use sessionSamplingRate. Probability in [0, 1], default 1; 0.125 maps to 12.5%. Ignored when sessionSamplingRate is supplied. */
|
|
79
98
|
sampleRate?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Sampling percentage for otherwise unsampled RUM sessions when an error occurs.
|
|
101
|
+
* Range [0, 100], default 0; fractional percentages are supported.
|
|
102
|
+
* Takes precedence over sessionOnErrorSampleRate when both are supplied, including 0.
|
|
103
|
+
*/
|
|
104
|
+
sessionOnErrorSamplingRate?: number;
|
|
105
|
+
/** @deprecated Use sessionOnErrorSamplingRate. Probability in [0, 1], default 0; multiplied by 100. Ignored when sessionOnErrorSamplingRate is supplied. */
|
|
80
106
|
sessionOnErrorSampleRate?: number;
|
|
81
107
|
enableAutoTrackUserAction?: boolean;
|
|
82
108
|
enableAutoTrackError?: boolean;
|
|
@@ -84,9 +110,12 @@ export interface FTRUMConfig {
|
|
|
84
110
|
enableTrackNativeAppANR?: boolean;
|
|
85
111
|
enableTrackNativeFreeze?: boolean;
|
|
86
112
|
nativeFreezeDurationMs?: number;
|
|
113
|
+
enableLongTask?: boolean;
|
|
114
|
+
longTaskThresholdMs?: number;
|
|
87
115
|
enableNativeUserAction?: boolean;
|
|
88
116
|
enableNativeUserView?: boolean;
|
|
89
117
|
enableNativeUserResource?: boolean;
|
|
118
|
+
enableIOSWebSocketResource?: boolean;
|
|
90
119
|
enableResourceHostIP?: boolean;
|
|
91
120
|
errorMonitorType?: ErrorMonitorType;
|
|
92
121
|
deviceMonitorType?: DeviceMetricsMonitorType;
|
|
@@ -95,7 +124,8 @@ export interface FTRUMConfig {
|
|
|
95
124
|
rumCacheLimitCount?: number;
|
|
96
125
|
rumDiscardStrategy?: FTRUMCacheDiscard;
|
|
97
126
|
enableTraceWebView?: boolean;
|
|
98
|
-
allowWebViewHost
|
|
127
|
+
/** @deprecated Configure the shared host allowlist in FTMobileConfig.allowWebViewHost. */
|
|
128
|
+
allowWebViewHost?: Array<string> | null;
|
|
99
129
|
iosCrashMonitoringType?: IOSCrashMonitoringType;
|
|
100
130
|
}
|
|
101
131
|
/**
|
|
@@ -163,10 +193,17 @@ type FTReactNativeRUMType = {
|
|
|
163
193
|
/**
|
|
164
194
|
* view load duration.
|
|
165
195
|
* @param viewName view name
|
|
166
|
-
* @param loadTime view load duration
|
|
196
|
+
* @param loadTime monotonic view load duration in nanoseconds
|
|
167
197
|
* @returns a Promise.
|
|
168
198
|
*/
|
|
169
199
|
onCreateView(viewName: string, loadTime: number): Promise<void>;
|
|
200
|
+
/**
|
|
201
|
+
* Replace the current active View's loading duration, between startView and stopView.
|
|
202
|
+
* @param duration monotonic elapsed time in nanoseconds; a non-negative safe integer.
|
|
203
|
+
* Zero clears loading time. Late calls can update a newer View; no View ID is supplied.
|
|
204
|
+
* @returns a Promise for the native call, not for data upload.
|
|
205
|
+
*/
|
|
206
|
+
updateViewLoadingTime(duration: number): Promise<void>;
|
|
170
207
|
/**
|
|
171
208
|
* view start.
|
|
172
209
|
* @param viewName page name
|
|
@@ -11,12 +11,20 @@ export declare enum TraceType {
|
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Configure trace.
|
|
14
|
-
* @param
|
|
14
|
+
* @param traceSamplingRate Trace sampling percentage in [0, 100], default 100. Supports fractional percentages and takes precedence over sampleRate.
|
|
15
|
+
* @param sampleRate Deprecated Trace sampling probability in [0, 1], default 1. Used only when traceSamplingRate is omitted; multiplied by 100 before passing to Native.
|
|
15
16
|
* @param traceType trace type
|
|
16
17
|
* @param enableLinkRUMData whether to link with RUM data
|
|
17
18
|
* @param enableNativeAutoTrace whether to enable automatic tracing
|
|
18
19
|
*/
|
|
19
20
|
export interface FTTraceConfig {
|
|
21
|
+
/**
|
|
22
|
+
* Trace sampling percentage in [0, 100], default 100.
|
|
23
|
+
* Supports fractional percentages: 12.5 means 12.5%, not 0.125.
|
|
24
|
+
* Takes precedence over sampleRate when both are supplied, including 0.
|
|
25
|
+
*/
|
|
26
|
+
traceSamplingRate?: number;
|
|
27
|
+
/** @deprecated Use traceSamplingRate. Probability in [0, 1], default 1; 0.125 maps to 12.5%. Ignored when traceSamplingRate is supplied. */
|
|
20
28
|
sampleRate?: number;
|
|
21
29
|
traceType?: TraceType;
|
|
22
30
|
enableLinkRUMData?: boolean;
|
|
@@ -4,4 +4,8 @@ import { FTRUMConfig, FTRUMResource, FTReactNativeRUM, ErrorMonitorType, DeviceM
|
|
|
4
4
|
import { FTTraceConfig, FTReactNativeTrace, TraceType } from './ft_tracing';
|
|
5
5
|
import { FTRumActionTracking } from './rum/FTRumActionTracking';
|
|
6
6
|
import { FTRumErrorTracking } from './rum/FTRumErrorTracking';
|
|
7
|
-
|
|
7
|
+
import { FTBabelInteractionTracking } from './rum/FTBabelInteractionTracking';
|
|
8
|
+
import { __ftExtractText } from './rum/FTBabelUtils';
|
|
9
|
+
export { FTMobileReactNative, FTMobileConfig, EnvType, FTDBCacheDiscard, FTRemoteConfigResult, FTRemoteConfigOverrideRule, FTRemoteConfigOverrideMatch, FTRemoteConfigOverrideValues, FTLogConfig, FTReactNativeLog, FTLogStatus, FTLogCacheDiscard, FTRUMConfig, FTReactNativeRUM, FTRUMResource, ErrorMonitorType, DeviceMetricsMonitorType, DetectFrequency, FTRUMResourceMetrics, FTRUMCacheDiscard, IOSCrashMonitoringType, FTTraceConfig, FTReactNativeTrace, TraceType, FTRumActionTracking, FTRumErrorTracking, FTBabelInteractionTracking, __ftExtractText, };
|
|
10
|
+
export type { FTVisitorIdConfig } from './visitorIdConfig';
|
|
11
|
+
export { FTRumViewTracking } from './rum/FTRumViewTracking';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var __FT_RN_BABEL_PLUGIN_ENABLED__: boolean | undefined;
|
|
3
|
+
}
|
|
4
|
+
export type FTBabelActionTarget = {
|
|
5
|
+
'options': {
|
|
6
|
+
useContent: boolean;
|
|
7
|
+
useNamePrefix: boolean;
|
|
8
|
+
};
|
|
9
|
+
'handlerArgs'?: unknown[];
|
|
10
|
+
'componentName': string;
|
|
11
|
+
'getContent'?: () => string[];
|
|
12
|
+
'ft-action-name'?: string[];
|
|
13
|
+
'customActionName'?: string[];
|
|
14
|
+
'accessibilityLabel'?: string[];
|
|
15
|
+
};
|
|
16
|
+
type ActionReporter = (actionName: string, actionType: string, property?: object) => Promise<void>;
|
|
17
|
+
type BabelTrackingConfig = {
|
|
18
|
+
trackInteractions: boolean;
|
|
19
|
+
actionReporter?: ActionReporter;
|
|
20
|
+
};
|
|
21
|
+
declare class BabelInteractionTracking {
|
|
22
|
+
private trackInteractions;
|
|
23
|
+
private actionReporter;
|
|
24
|
+
getInstance(): BabelInteractionTracking;
|
|
25
|
+
configure(config: BabelTrackingConfig): void;
|
|
26
|
+
getTargetName(target: FTBabelActionTarget): string;
|
|
27
|
+
wrapRumAction(handler: ((...args: any[]) => any) | null | undefined, actionType: string, target: FTBabelActionTarget): (...args: any[]) => any;
|
|
28
|
+
}
|
|
29
|
+
export declare const FTBabelInteractionTracking: BabelInteractionTracking;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function __ftExtractText(node: any, prefer?: any[]): string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type FTRumActionTrackingContext = {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
property?: object;
|
|
4
|
+
};
|
|
5
|
+
type FiberNode = {
|
|
6
|
+
memoizedProps?: Record<string, unknown>;
|
|
7
|
+
return?: FiberNode | null;
|
|
8
|
+
};
|
|
9
|
+
export declare function resolveActionTrackingContextFromTarget(targetNode: FiberNode | null): FTRumActionTrackingContext;
|
|
10
|
+
export declare function resolveActionTrackingContext(handlerArgs: unknown[]): FTRumActionTrackingContext;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
type Route = {
|
|
2
|
+
key: string;
|
|
3
|
+
name: string;
|
|
4
|
+
};
|
|
5
|
+
/** Shared lifecycle coordinator for navigation adapters. Use one per navigator. */
|
|
6
|
+
export declare class FTRumViewTracking {
|
|
7
|
+
private readonly onBackground?;
|
|
8
|
+
private current?;
|
|
9
|
+
private active?;
|
|
10
|
+
private generation;
|
|
11
|
+
private lifecycle;
|
|
12
|
+
private state;
|
|
13
|
+
private subscription?;
|
|
14
|
+
private loading;
|
|
15
|
+
constructor(onBackground?: (() => void) | undefined);
|
|
16
|
+
start(): void;
|
|
17
|
+
/** Capture both clocks at the loading boundary, before any async work. */
|
|
18
|
+
beginLoad(key: string): void;
|
|
19
|
+
/** Remember a transitioning route so foreground recovery uses the current page. */
|
|
20
|
+
setCurrent(route: Route): void;
|
|
21
|
+
show(route: Route, loadingKey?: string): number | undefined;
|
|
22
|
+
/** Apply a completed interval only to the appearance that started it. */
|
|
23
|
+
updateLoadingTime(key: string, generation: number | undefined, durationNs: number): void;
|
|
24
|
+
/** Only the appearance that owns the active generation may close it. */
|
|
25
|
+
hide(key: string, generation: number | undefined): void;
|
|
26
|
+
stop(): void;
|
|
27
|
+
private onAppState;
|
|
28
|
+
private pruneLoading;
|
|
29
|
+
private get nativeRUM();
|
|
30
|
+
private report;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WebSocketTimingMetrics } from './FTRumWebSocketTiming';
|
|
2
|
+
export interface NativeWebSocketResource {
|
|
3
|
+
url: string;
|
|
4
|
+
httpMethod: string;
|
|
5
|
+
requestHeader: Record<string, unknown>;
|
|
6
|
+
webSocketEvent: string;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class NativeWebSocketSession {
|
|
10
|
+
private readonly session;
|
|
11
|
+
private stopped;
|
|
12
|
+
private sequence;
|
|
13
|
+
constructor(session: string);
|
|
14
|
+
startResource(key: string, socketID: number | undefined, url: string): Promise<void>;
|
|
15
|
+
stopResource(key: string, event: string): Promise<void>;
|
|
16
|
+
addResource(key: string, content: NativeWebSocketResource, metrics: Partial<WebSocketTimingMetrics>): Promise<void>;
|
|
17
|
+
release(key: string): void;
|
|
18
|
+
stop(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare function startNativeWebSocketSession(createKey: () => string): NativeWebSocketSession | undefined;
|
|
21
|
+
export declare function clearNativeWebSocketSessions(): void;
|
|
22
|
+
export declare function webSocketNativeID(socket: unknown): number | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface WebSocketTimingMetrics {
|
|
2
|
+
duration: number;
|
|
3
|
+
fetchStartNsTimeInterval?: string;
|
|
4
|
+
fetchEndNsTimeInterval?: string;
|
|
5
|
+
}
|
|
6
|
+
/** Measures only the JS-observed opening handshake; bridge delays are excluded. */
|
|
7
|
+
export declare function startWebSocketTiming(): () => WebSocketTimingMetrics | undefined;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { WebSocketTimingMetrics } from './FTRumWebSocketTiming';
|
|
2
|
+
type WebSocketHandshakeState = 'success' | 'rejected' | 'failed';
|
|
3
|
+
interface FTRUMWebSocketResource {
|
|
4
|
+
url: string;
|
|
5
|
+
httpMethod: string;
|
|
6
|
+
requestHeader: Record<string, unknown>;
|
|
7
|
+
resourceStatus: number;
|
|
8
|
+
responseHeader?: Record<string, string>;
|
|
9
|
+
resourceType: 'websocket';
|
|
10
|
+
webSocketHandshake: true;
|
|
11
|
+
webSocketHandshakeState: WebSocketHandshakeState;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
}
|
|
14
|
+
interface FTRumWebSocketResourceReporter {
|
|
15
|
+
startResource(key: string): Promise<void>;
|
|
16
|
+
stopResource(key: string): Promise<void>;
|
|
17
|
+
addResource(key: string, resource: FTRUMWebSocketResource, metrics?: WebSocketTimingMetrics): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare class FTRumWebSocketTracking {
|
|
20
|
+
private static enabled;
|
|
21
|
+
private static installed;
|
|
22
|
+
private static originalWebSocket;
|
|
23
|
+
private static instrumentedWebSocket;
|
|
24
|
+
private static resourceReporter;
|
|
25
|
+
private static nativeAutoTraceEnabled;
|
|
26
|
+
private static warnedFailures;
|
|
27
|
+
private static lifecycleVersion;
|
|
28
|
+
private static nativeSession;
|
|
29
|
+
private static pendingHandshakes;
|
|
30
|
+
/** Identifies configuration and reporting work started before SDK shutdown. */
|
|
31
|
+
static getLifecycleVersion(): number;
|
|
32
|
+
static shutDown(): void;
|
|
33
|
+
static setNativeAutoTraceEnabled(enabled: boolean): void;
|
|
34
|
+
private static stopNativeSession;
|
|
35
|
+
static startTracking(resourceReporter: FTRumWebSocketResourceReporter): void;
|
|
36
|
+
static stopTracking(): void;
|
|
37
|
+
private static createWebSocket;
|
|
38
|
+
private static createResourceKey;
|
|
39
|
+
private static cancelTrace;
|
|
40
|
+
private static getTraceHeaders;
|
|
41
|
+
private static mergeTraceHeaders;
|
|
42
|
+
private static toOptions;
|
|
43
|
+
private static toHeaderRecord;
|
|
44
|
+
private static eventString;
|
|
45
|
+
private static handshakeErrorFromEvent;
|
|
46
|
+
private static failureMessageFromClose;
|
|
47
|
+
private static statusFromError;
|
|
48
|
+
private static toHandshakeError;
|
|
49
|
+
private static startResource;
|
|
50
|
+
private static completeResource;
|
|
51
|
+
private static completeNativeResource;
|
|
52
|
+
private static warnOnce;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const MIN_LONG_TASK_THRESHOLD_MS = 100;
|
|
2
|
+
export declare const MAX_LONG_TASK_THRESHOLD_MS = 5000;
|
|
3
|
+
export declare const DEFAULT_LONG_TASK_THRESHOLD_MS = 100;
|
|
4
|
+
/**
|
|
5
|
+
* Converts the public JavaScript long task option to the numeric value expected
|
|
6
|
+
* by the native bridge. Enablement is controlled separately.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeLongTaskThreshold(threshold?: number): number;
|
|
@@ -33,6 +33,7 @@ export interface Spec extends TurboModule {
|
|
|
33
33
|
* @returns a Promise.
|
|
34
34
|
*/
|
|
35
35
|
unbindRUMUserData(): Promise<void>;
|
|
36
|
+
resetVisitorId(): Promise<void>;
|
|
36
37
|
/**
|
|
37
38
|
* Add custom global parameters. Applies to RUM and Log data
|
|
38
39
|
* @param context custom global parameters.
|
|
@@ -70,6 +71,20 @@ export interface Spec extends TurboModule {
|
|
|
70
71
|
* Clear all data that has not yet been uploaded to the server.
|
|
71
72
|
*/
|
|
72
73
|
clearAllData(): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Update remote configuration using the configured minimum update interval.
|
|
76
|
+
*/
|
|
77
|
+
updateRemoteConfig(): Promise<Object>;
|
|
78
|
+
/**
|
|
79
|
+
* Update remote configuration using a custom minimum update interval and
|
|
80
|
+
* optional override rules.
|
|
81
|
+
*/
|
|
82
|
+
updateRemoteConfigWithMiniUpdateInterval(interval: number, rules?: Array<Object>): Promise<Object>;
|
|
83
|
+
/**
|
|
84
|
+
* Required by NativeEventEmitter for remote configuration callbacks.
|
|
85
|
+
*/
|
|
86
|
+
addListener(eventName: string): void;
|
|
87
|
+
removeListeners(count: number): void;
|
|
73
88
|
}
|
|
74
89
|
declare const _default: Spec | null;
|
|
75
90
|
export default _default;
|
|
@@ -6,6 +6,10 @@ export interface Spec extends TurboModule {
|
|
|
6
6
|
* @returns a Promise.
|
|
7
7
|
*/
|
|
8
8
|
setConfig(config: Object): Promise<void>;
|
|
9
|
+
/** Internal synchronous snapshot used only by native JS long task reporting. */
|
|
10
|
+
setLongTaskContext(context: Object): boolean;
|
|
11
|
+
/** Stops the internal JavaScript long task monitor before SDK shutdown. */
|
|
12
|
+
stopLongTaskTracking(): Promise<void>;
|
|
9
13
|
/**
|
|
10
14
|
* Start RUM Action.
|
|
11
15
|
* RUM will bind Resource, Error, LongTask events that may be triggered by this Action.
|
|
@@ -28,10 +32,16 @@ export interface Spec extends TurboModule {
|
|
|
28
32
|
/**
|
|
29
33
|
* view load duration.
|
|
30
34
|
* @param viewName view name
|
|
31
|
-
* @param loadTime view load duration
|
|
35
|
+
* @param loadTime monotonic view load duration in nanoseconds
|
|
32
36
|
* @returns a Promise.
|
|
33
37
|
*/
|
|
34
38
|
onCreateView(viewName: string, loadTime: number): Promise<void>;
|
|
39
|
+
/** Replace the current View's loading duration; non-negative safe integer nanoseconds. */
|
|
40
|
+
updateViewLoadingTime(duration: number): Promise<void>;
|
|
41
|
+
/** Framework integration: duration in ns; epoch start in ms, converted natively. */
|
|
42
|
+
onCreateViewWithLoadStart(viewName: string, loadTime: number, loadStartEpochMs: number): Promise<void>;
|
|
43
|
+
/** Framework integration: Manual = 0, Automatic = 1. */
|
|
44
|
+
startViewWithTrackingType(viewName: string, property: Object | undefined, trackingType: number): Promise<void>;
|
|
35
45
|
/**
|
|
36
46
|
* view start.
|
|
37
47
|
* @param viewName page name
|
|
@@ -19,6 +19,18 @@ export interface Spec extends TurboModule {
|
|
|
19
19
|
* @returns trace request header parameters
|
|
20
20
|
*/
|
|
21
21
|
getTraceHeaderFields(url: string, key?: string): Promise<Object>;
|
|
22
|
+
/**
|
|
23
|
+
* Get trace HTTP request headers synchronously for APIs whose construction
|
|
24
|
+
* cannot wait for a Promise, such as React Native WebSocket.
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
getTraceHeaderFieldsSync(url: string, key: string): Object | null;
|
|
28
|
+
/**
|
|
29
|
+
* Discard iOS Trace correlation when WebSocket observation is abandoned
|
|
30
|
+
* before Resource reporting starts. Android uses native collection.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
cancelWebSocketTrace(key: string): Promise<void>;
|
|
22
34
|
}
|
|
23
35
|
declare const _default: Spec | null;
|
|
24
36
|
export default _default;
|