@datadog/mobile-react-native 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +1 -1
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdk.kt +31 -1
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +222 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/GenericAssert.kt +6 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/ActionEventForgeryFactory.kt +106 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/BaseConfigurator.kt +2 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/forge/ResourceEventForgeryFactory.kt +116 -0
- package/datadog-sourcemaps.gradle +7 -7
- package/ios/Sources/Attributes.swift +14 -0
- package/ios/Sources/DdSdk.swift +18 -0
- package/jest/mock.js +103 -0
- package/lib/commonjs/DdSdkReactNative.js +40 -8
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +42 -2
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/commonjs/foundation.js +2 -139
- package/lib/commonjs/foundation.js.map +1 -1
- package/lib/commonjs/index.js +18 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/logs/DdLogs.js +71 -0
- package/lib/commonjs/logs/DdLogs.js.map +1 -0
- package/lib/commonjs/logs/eventMapper.js +39 -0
- package/lib/commonjs/logs/eventMapper.js.map +1 -0
- package/lib/commonjs/logs/types.js +2 -0
- package/lib/commonjs/{rum/instrumentation/EventsInterceptor.js.map → logs/types.js.map} +0 -0
- package/lib/commonjs/nativeModulesTypes.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +234 -0
- package/lib/commonjs/rum/DdRum.js.map +1 -0
- package/lib/commonjs/rum/eventMappers/actionEventMapper.js +36 -0
- package/lib/commonjs/rum/eventMappers/actionEventMapper.js.map +1 -0
- package/lib/commonjs/rum/eventMappers/errorEventMapper.js +32 -0
- package/lib/commonjs/rum/eventMappers/errorEventMapper.js.map +1 -0
- package/lib/commonjs/rum/eventMappers/resourceEventMapper.js +38 -0
- package/lib/commonjs/rum/eventMappers/resourceEventMapper.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js +4 -4
- package/lib/commonjs/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/{DdEventsInterceptor.js → interactionTracking/DdEventsInterceptor.js} +6 -6
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/{DdRumUserInteractionTracking.js → interactionTracking/DdRumUserInteractionTracking.js} +4 -4
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/{EventsInterceptor.js → interactionTracking/EventsInterceptor.js} +0 -0
- package/lib/{module/rum/instrumentation → commonjs/rum/instrumentation/interactionTracking}/EventsInterceptor.js.map +0 -0
- package/lib/commonjs/rum/instrumentation/{NoOpEventsInterceptor.js → interactionTracking/NoOpEventsInterceptor.js} +0 -0
- package/lib/commonjs/rum/instrumentation/{NoOpEventsInterceptor.js.map → interactionTracking/NoOpEventsInterceptor.js.map} +0 -0
- package/lib/commonjs/rum/instrumentation/{ShallowObjectEqualityChecker.js → interactionTracking/ShallowObjectEqualityChecker.js} +0 -0
- package/lib/commonjs/rum/instrumentation/{ShallowObjectEqualityChecker.js.map → interactionTracking/ShallowObjectEqualityChecker.js.map} +0 -0
- package/lib/commonjs/rum/instrumentation/{getJsxRuntime.js → interactionTracking/getJsxRuntime.js} +0 -0
- package/lib/commonjs/rum/instrumentation/{getJsxRuntime.js.map → interactionTracking/getJsxRuntime.js.map} +0 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js +3 -3
- package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/XHRProxy.js +2 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/implementation/XHRProxy.js.map +1 -1
- package/lib/commonjs/rum/types.js +42 -0
- package/lib/commonjs/rum/types.js.map +1 -0
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js +45 -0
- package/lib/commonjs/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -0
- package/lib/commonjs/sdk/AttributesSingleton/types.js +2 -0
- package/lib/commonjs/sdk/AttributesSingleton/types.js.map +1 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.js +4 -4
- package/lib/commonjs/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js.map +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js.map +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js.map +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js.map +0 -0
- package/lib/commonjs/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.js +4 -4
- package/lib/commonjs/sdk/DatadogProvider/DatadogProvider.js.map +1 -0
- package/lib/commonjs/sdk/EventMappers/EventMapper.js +85 -0
- package/lib/commonjs/sdk/EventMappers/EventMapper.js.map +1 -0
- package/lib/commonjs/sdk/EventMappers/utils/deepClone.js +98 -0
- package/lib/commonjs/sdk/EventMappers/utils/deepClone.js.map +1 -0
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js +43 -0
- package/lib/commonjs/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -0
- package/lib/commonjs/sdk/UserInfoSingleton/types.js +2 -0
- package/lib/commonjs/sdk/UserInfoSingleton/types.js.map +1 -0
- package/lib/commonjs/types.js +1 -26
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/DdSdkReactNative.js +33 -7
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +42 -2
- package/lib/module/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/module/foundation.js +2 -124
- package/lib/module/foundation.js.map +1 -1
- package/lib/module/index.js +5 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/logs/DdLogs.js +64 -0
- package/lib/module/logs/DdLogs.js.map +1 -0
- package/lib/module/logs/eventMapper.js +20 -0
- package/lib/module/logs/eventMapper.js.map +1 -0
- package/lib/module/logs/types.js +2 -0
- package/lib/module/logs/types.js.map +1 -0
- package/lib/module/nativeModulesTypes.js.map +1 -1
- package/lib/module/rum/DdRum.js +212 -0
- package/lib/module/rum/DdRum.js.map +1 -0
- package/lib/module/rum/eventMappers/actionEventMapper.js +26 -0
- package/lib/module/rum/eventMappers/actionEventMapper.js.map +1 -0
- package/lib/module/rum/eventMappers/errorEventMapper.js +22 -0
- package/lib/module/rum/eventMappers/errorEventMapper.js.map +1 -0
- package/lib/module/rum/eventMappers/resourceEventMapper.js +28 -0
- package/lib/module/rum/eventMappers/resourceEventMapper.js.map +1 -0
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js +2 -2
- package/lib/module/rum/instrumentation/DdRumErrorTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/{DdEventsInterceptor.js → interactionTracking/DdEventsInterceptor.js} +6 -6
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -0
- package/lib/module/rum/instrumentation/{DdRumUserInteractionTracking.js → interactionTracking/DdRumUserInteractionTracking.js} +4 -4
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -0
- package/lib/module/rum/instrumentation/{EventsInterceptor.js → interactionTracking/EventsInterceptor.js} +0 -0
- package/lib/module/rum/instrumentation/interactionTracking/EventsInterceptor.js.map +1 -0
- package/lib/module/rum/instrumentation/{NoOpEventsInterceptor.js → interactionTracking/NoOpEventsInterceptor.js} +0 -0
- package/lib/module/rum/instrumentation/{NoOpEventsInterceptor.js.map → interactionTracking/NoOpEventsInterceptor.js.map} +0 -0
- package/lib/module/rum/instrumentation/{ShallowObjectEqualityChecker.js → interactionTracking/ShallowObjectEqualityChecker.js} +0 -0
- package/lib/module/rum/instrumentation/{ShallowObjectEqualityChecker.js.map → interactionTracking/ShallowObjectEqualityChecker.js.map} +0 -0
- package/lib/module/rum/instrumentation/{getJsxRuntime.js → interactionTracking/getJsxRuntime.js} +0 -0
- package/lib/module/rum/instrumentation/{getJsxRuntime.js.map → interactionTracking/getJsxRuntime.js.map} +0 -0
- package/lib/module/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js +2 -2
- package/lib/module/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/implementation/XHRProxy.js +2 -1
- package/lib/module/rum/instrumentation/resourceTracking/implementation/XHRProxy.js.map +1 -1
- package/lib/module/rum/types.js +33 -0
- package/lib/module/rum/types.js.map +1 -0
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js +36 -0
- package/lib/module/sdk/AttributesSingleton/AttributesSingleton.js.map +1 -0
- package/lib/module/sdk/AttributesSingleton/types.js +2 -0
- package/lib/module/sdk/AttributesSingleton/types.js.map +1 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.js +4 -4
- package/lib/module/sdk/DatadogProvider/Buffer/BoundedBuffer.js.map +1 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.js.map +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.js.map +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.js.map +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.js.map +0 -0
- package/lib/module/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.js +4 -4
- package/lib/module/sdk/DatadogProvider/DatadogProvider.js.map +1 -0
- package/lib/module/sdk/EventMappers/EventMapper.js +72 -0
- package/lib/module/sdk/EventMappers/EventMapper.js.map +1 -0
- package/lib/module/sdk/EventMappers/utils/deepClone.js +89 -0
- package/lib/module/sdk/EventMappers/utils/deepClone.js.map +1 -0
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js +34 -0
- package/lib/module/sdk/UserInfoSingleton/UserInfoSingleton.js.map +1 -0
- package/lib/module/sdk/UserInfoSingleton/types.js +2 -0
- package/lib/module/sdk/UserInfoSingleton/types.js.map +1 -0
- package/lib/module/types.js +0 -23
- package/lib/module/types.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/DdSdkReactNative.d.ts +7 -3
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +22 -0
- package/lib/typescript/foundation.d.ts +2 -4
- package/lib/typescript/index.d.ts +5 -3
- package/lib/typescript/logs/DdLogs.d.ts +14 -0
- package/lib/typescript/logs/eventMapper.d.ts +11 -0
- package/lib/typescript/logs/types.d.ts +54 -0
- package/lib/typescript/nativeModulesTypes.d.ts +1 -1
- package/lib/typescript/rum/DdRum.d.ts +36 -0
- package/lib/typescript/rum/eventMappers/actionEventMapper.d.ts +21 -0
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +21 -0
- package/lib/typescript/rum/eventMappers/resourceEventMapper.d.ts +25 -0
- package/lib/typescript/rum/instrumentation/{DdEventsInterceptor.d.ts → interactionTracking/DdEventsInterceptor.d.ts} +0 -0
- package/lib/typescript/rum/instrumentation/{DdRumUserInteractionTracking.d.ts → interactionTracking/DdRumUserInteractionTracking.d.ts} +0 -0
- package/lib/typescript/rum/instrumentation/{EventsInterceptor.d.ts → interactionTracking/EventsInterceptor.d.ts} +0 -0
- package/lib/typescript/rum/instrumentation/{NoOpEventsInterceptor.d.ts → interactionTracking/NoOpEventsInterceptor.d.ts} +0 -0
- package/lib/typescript/rum/instrumentation/{ShallowObjectEqualityChecker.d.ts → interactionTracking/ShallowObjectEqualityChecker.d.ts} +0 -0
- package/lib/typescript/rum/instrumentation/{getJsxRuntime.d.ts → interactionTracking/getJsxRuntime.d.ts} +0 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/domain/interfaces/RumResource.d.ts +3 -1
- package/lib/typescript/rum/types.d.ts +110 -0
- package/lib/typescript/sdk/AttributesSingleton/AttributesSingleton.d.ts +12 -0
- package/lib/typescript/sdk/AttributesSingleton/types.d.ts +3 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.d.ts +0 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.d.ts +0 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.d.ts +0 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.d.ts +0 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.d.ts +0 -0
- package/lib/typescript/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.d.ts +2 -2
- package/lib/typescript/sdk/EventMappers/EventMapper.d.ts +24 -0
- package/lib/typescript/sdk/EventMappers/utils/deepClone.d.ts +10 -0
- package/lib/typescript/sdk/UserInfoSingleton/UserInfoSingleton.d.ts +12 -0
- package/lib/typescript/sdk/UserInfoSingleton/types.d.ts +6 -0
- package/lib/typescript/types.d.ts +0 -139
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +3 -2
- package/scripts/replace-react-require.js +3 -2
- package/src/DdSdkReactNative.tsx +41 -7
- package/src/DdSdkReactNativeConfiguration.tsx +83 -3
- package/src/__tests__/DdSdkReactNative.test.tsx +244 -13
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +22 -1
- package/src/__tests__/{longTasksUtils.ts → longTasksUtils.test.ts} +0 -0
- package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +4 -3
- package/src/__tests__/rum/instrumentation/DdRumErrorTracking.test.tsx +1 -1
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +5 -3
- package/src/__tests__/rum/instrumentation/ShallowObjectEqualityChecker.test.ts +1 -1
- package/src/foundation.tsx +4 -114
- package/src/index.tsx +5 -3
- package/src/logs/DdLogs.ts +67 -0
- package/src/logs/__tests__/DdLogs.test.ts +51 -0
- package/src/logs/__tests__/eventMapper.test.ts +53 -0
- package/src/logs/eventMapper.ts +43 -0
- package/src/logs/types.ts +70 -0
- package/src/nativeModulesTypes.ts +1 -1
- package/src/rum/DdRum.ts +387 -0
- package/src/rum/__tests__/DdRum.test.ts +386 -0
- package/src/rum/eventMappers/actionEventMapper.ts +66 -0
- package/src/rum/eventMappers/errorEventMapper.ts +57 -0
- package/src/rum/eventMappers/resourceEventMapper.ts +74 -0
- package/src/rum/instrumentation/DdRumErrorTracking.tsx +2 -2
- package/src/rum/instrumentation/{DdEventsInterceptor.tsx → interactionTracking/DdEventsInterceptor.tsx} +14 -6
- package/src/rum/instrumentation/{DdRumUserInteractionTracking.tsx → interactionTracking/DdRumUserInteractionTracking.tsx} +4 -4
- package/src/rum/instrumentation/{EventsInterceptor.tsx → interactionTracking/EventsInterceptor.tsx} +0 -0
- package/src/rum/instrumentation/{NoOpEventsInterceptor.tsx → interactionTracking/NoOpEventsInterceptor.tsx} +0 -0
- package/src/rum/instrumentation/{ShallowObjectEqualityChecker.ts → interactionTracking/ShallowObjectEqualityChecker.ts} +0 -0
- package/src/rum/instrumentation/{getJsxRuntime.ts → interactionTracking/getJsxRuntime.ts} +0 -0
- package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/domain/interfaces/RumResource.ts +2 -1
- package/src/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/ResourceReporter.ts +3 -2
- package/src/rum/instrumentation/resourceTracking/implementation/DatadogRumResource/__tests__/ResourceReporter.test.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/implementation/XHRProxy.ts +2 -1
- package/src/rum/instrumentation/resourceTracking/implementation/__tests__/XHRProxy.test.ts +83 -39
- package/src/rum/types.ts +182 -0
- package/src/sdk/AttributesSingleton/AttributesSingleton.ts +34 -0
- package/src/sdk/AttributesSingleton/__tests__/AttributesSingleton.test.ts +44 -0
- package/src/sdk/AttributesSingleton/types.ts +9 -0
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/BoundedBuffer.ts +4 -4
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/BufferSingleton.ts +0 -0
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/DatadogBuffer.ts +0 -0
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/PassThroughBuffer.ts +0 -0
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/__tests__/BoundedBuffer.test.ts +2 -2
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/__tests__/BufferSingleton.test.ts +0 -0
- package/src/{DatadogProvider → sdk/DatadogProvider}/Buffer/bufferNativeCall.ts +0 -0
- package/src/{DatadogProvider → sdk/DatadogProvider}/DatadogProvider.tsx +5 -5
- package/src/{DatadogProvider → sdk/DatadogProvider}/__tests__/__utils__/renderWithProvider.tsx +2 -2
- package/src/{DatadogProvider → sdk/DatadogProvider}/__tests__/initialization.test.tsx +8 -6
- package/src/{DatadogProvider → sdk/DatadogProvider}/__tests__/initializationModes.test.tsx +5 -5
- package/src/sdk/EventMappers/EventMapper.ts +94 -0
- package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +50 -0
- package/src/sdk/EventMappers/utils/__tests__/deepClone.test.ts +79 -0
- package/src/sdk/EventMappers/utils/deepClone.ts +86 -0
- package/src/sdk/UserInfoSingleton/UserInfoSingleton.ts +31 -0
- package/src/sdk/UserInfoSingleton/__tests__/UserInfoSingleton.test.ts +29 -0
- package/src/sdk/UserInfoSingleton/types.ts +12 -0
- package/src/types.tsx +0 -210
- package/src/version.ts +1 -1
- package/lib/commonjs/DatadogProvider/Buffer/BoundedBuffer.js.map +0 -1
- package/lib/commonjs/DatadogProvider/DatadogProvider.js.map +0 -1
- package/lib/commonjs/rum/instrumentation/DdEventsInterceptor.js.map +0 -1
- package/lib/commonjs/rum/instrumentation/DdRumUserInteractionTracking.js.map +0 -1
- package/lib/module/DatadogProvider/Buffer/BoundedBuffer.js.map +0 -1
- package/lib/module/DatadogProvider/DatadogProvider.js.map +0 -1
- package/lib/module/rum/instrumentation/DdEventsInterceptor.js.map +0 -1
- package/lib/module/rum/instrumentation/DdRumUserInteractionTracking.js.map +0 -1
- package/src/__tests__/DdRumWrapper.test.tsx +0 -74
- package/src/__tests__/foundation.test.ts +0 -88
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["deepClone.ts"],"names":["isDate","object","type","toString","call","slice","isArray","isObject","isSet","isMap","deepClone","originalObject","depth","Date","getTime","Set","map","value","Map","kv","result","key"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AAEA,MAAMA,MAAM,GAAIC,MAAD,IAAqC;AAChD,QAAMC,IAAI,GAAG,GAAGC,QAAH,CAAYC,IAAZ,CAAiBH,MAAjB,EAAyBI,KAAzB,CAA+B,CAA/B,EAAkC,CAAC,CAAnC,CAAb;AACA,SAAOH,IAAI,KAAK,MAAhB;AACH,CAHD;;AAKA,MAAMI,OAAO,GAAIL,MAAD,IAA0C;AACtD,QAAMC,IAAI,GAAG,GAAGC,QAAH,CAAYC,IAAZ,CAAiBH,MAAjB,EAAyBI,KAAzB,CAA+B,CAA/B,EAAkC,CAAC,CAAnC,CAAb;AACA,SAAOH,IAAI,KAAK,OAAhB;AACH,CAHD;;AAKA,MAAMK,QAAQ,GAAIN,MAAD,IAAwD;AACrE,QAAMC,IAAI,GAAG,GAAGC,QAAH,CAAYC,IAAZ,CAAiBH,MAAjB,EAAyBI,KAAzB,CAA+B,CAA/B,EAAkC,CAAC,CAAnC,CAAb;AACA,SAAOH,IAAI,KAAK,QAAhB;AACH,CAHD;;AAKA,MAAMM,KAAK,GAAIP,MAAD,IAA6C;AACvD,QAAMC,IAAI,GAAG,GAAGC,QAAH,CAAYC,IAAZ,CAAiBH,MAAjB,EAAyBI,KAAzB,CAA+B,CAA/B,EAAkC,CAAC,CAAnC,CAAb;AACA,SAAOH,IAAI,KAAK,KAAhB;AACH,CAHD;;AAKA,MAAMO,KAAK,GAAIR,MAAD,IAAqD;AAC/D,QAAMC,IAAI,GAAG,GAAGC,QAAH,CAAYC,IAAZ,CAAiBH,MAAjB,EAAyBI,KAAzB,CAA+B,CAA/B,EAAkC,CAAC,CAAnC,CAAb;AACA,SAAOH,IAAI,KAAK,KAAhB;AACH,CAHD;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,MAAMQ,SAAS,GAAG,CAAIC,cAAJ,EAAuBC,KAAa,GAAG,CAAvC,KAAgD;AACrE,MAAIZ,MAAM,CAACW,cAAD,CAAV,EAA4B;AACxB,WAAQ,IAAIE,IAAJ,CAASF,cAAc,CAACG,OAAf,EAAT,CAAR;AACH;;AACD,MAAIN,KAAK,CAACG,cAAD,CAAT,EAA2B;AACvB,WAAQ,IAAII,GAAJ,CACJ,CAAC,GAAGJ,cAAJ,EAAoBK,GAApB,CAAwBC,KAAK,IAAIP,SAAS,CAACO,KAAD,CAA1C,CADI,CAAR;AAGH;;AACD,MAAIR,KAAK,CAACE,cAAD,CAAT,EAA2B;AACvB,WAAQ,IAAIO,GAAJ,CACJ,CAAC,GAAGP,cAAJ,EAAoBK,GAApB,CAAwBG,EAAE,IAAI,CAACT,SAAS,CAACS,EAAE,CAAC,CAAD,CAAH,CAAV,EAAmBT,SAAS,CAACS,EAAE,CAAC,CAAD,CAAH,CAA5B,CAA9B,CADI,CAAR;AAGH;;AACD,MAAIb,OAAO,CAACK,cAAD,CAAX,EAA6B;AACzB,QAAIC,KAAK,IAAI,CAAb,EAAgB;AACZ;AACA,aAAOD,cAAP;AACH;;AACD,UAAMS,MAAiB,GAAG,EAA1B,CALyB,CAMzB;;AACA,SAAK,MAAMC,GAAX,IAAkBV,cAAlB,EAAkC;AAC9B;AACAS,MAAAA,MAAM,CAACC,GAAD,CAAN,GAAcX,SAAS,CAACC,cAAc,CAACU,GAAD,CAAf,EAAsBT,KAAK,GAAG,CAA9B,CAAvB;AACH;;AAED,WAAQQ,MAAR;AACH;;AACD,MAAIb,QAAQ,CAACI,cAAD,CAAZ,EAA8B;AAC1B,QAAIC,KAAK,IAAI,CAAb,EAAgB;AACZ;AACA,aAAOD,cAAP;AACH;;AACD,UAAMS,MAA+B,GAAG,EAAxC,CAL0B,CAM1B;;AACA,SAAK,MAAMC,GAAX,IAAkBV,cAAlB,EAAkC;AAC9B;AACAS,MAAAA,MAAM,CAACC,GAAD,CAAN,GAAcX,SAAS,CAACC,cAAc,CAACU,GAAD,CAAf,EAAsBT,KAAK,GAAG,CAA9B,CAAvB;AACH;;AAED,WAAQQ,MAAR;AACH,GAzCoE,CA2CrE;;;AACA,SAAOT,cAAP;AACH,CA7CM","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\nconst isDate = (object: unknown): object is Date => {\n const type = {}.toString.call(object).slice(8, -1);\n return type === 'Date';\n};\n\nconst isArray = (object: unknown): object is unknown[] => {\n const type = {}.toString.call(object).slice(8, -1);\n return type === 'Array';\n};\n\nconst isObject = (object: unknown): object is Record<string, unknown> => {\n const type = {}.toString.call(object).slice(8, -1);\n return type === 'Object';\n};\n\nconst isSet = (object: unknown): object is Set<unknown> => {\n const type = {}.toString.call(object).slice(8, -1);\n return type === 'Set';\n};\n\nconst isMap = (object: unknown): object is Map<string, unknown> => {\n const type = {}.toString.call(object).slice(8, -1);\n return type === 'Map';\n};\n\n/**\n * Simple deep clone inspired from https://github.com/angus-c/just/blob/master/packages/collection-clone/index.cjs\n * Functions and RegExp will be returned as they are.\n * Maps and Sets are cloned even though they won't be accepted by React Native, just in case they are mutated by the user to avoid side effects.\n *\n * We added support for circular references by limiting the number of depth levels to 8.\n * @param originalObject\n * @returns\n */\nexport const deepClone = <T>(originalObject: T, depth: number = 0): T => {\n if (isDate(originalObject)) {\n return (new Date(originalObject.getTime()) as unknown) as T;\n }\n if (isSet(originalObject)) {\n return (new Set(\n [...originalObject].map(value => deepClone(value))\n ) as unknown) as T;\n }\n if (isMap(originalObject)) {\n return (new Map(\n [...originalObject].map(kv => [deepClone(kv[0]), deepClone(kv[1])])\n ) as unknown) as T;\n }\n if (isArray(originalObject)) {\n if (depth >= 7) {\n // Break the circular reference here\n return originalObject;\n }\n const result: unknown[] = [];\n // eslint-disable-next-line guard-for-in\n for (const key in originalObject) {\n // include prototype properties\n result[key] = deepClone(originalObject[key], depth + 1);\n }\n\n return (result as unknown) as T;\n }\n if (isObject(originalObject)) {\n if (depth >= 7) {\n // Break the circular reference here\n return originalObject;\n }\n const result: Record<string, unknown> = {};\n // eslint-disable-next-line guard-for-in\n for (const key in originalObject) {\n // include prototype properties\n result[key] = deepClone(originalObject[key], depth + 1);\n }\n\n return (result as unknown) as T;\n }\n\n // primitives and non-supported objects (e.g. functions) land here\n return originalObject;\n};\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
5
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
6
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
7
|
+
*/
|
|
8
|
+
class UserInfoProvider {
|
|
9
|
+
constructor() {
|
|
10
|
+
_defineProperty(this, "userInfo", {});
|
|
11
|
+
|
|
12
|
+
_defineProperty(this, "setUserInfo", userInfo => {
|
|
13
|
+
this.userInfo = userInfo;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
_defineProperty(this, "getUserInfo", () => {
|
|
17
|
+
return this.userInfo;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class UserInfoSingleton {}
|
|
24
|
+
|
|
25
|
+
_defineProperty(UserInfoSingleton, "userInfoProvider", new UserInfoProvider());
|
|
26
|
+
|
|
27
|
+
_defineProperty(UserInfoSingleton, "getInstance", () => {
|
|
28
|
+
return UserInfoSingleton.userInfoProvider;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
_defineProperty(UserInfoSingleton, "reset", () => {
|
|
32
|
+
UserInfoSingleton.userInfoProvider = new UserInfoProvider();
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=UserInfoSingleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["UserInfoSingleton.ts"],"names":["UserInfoProvider","userInfo","UserInfoSingleton","userInfoProvider"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AAIA,MAAMA,gBAAN,CAAuB;AAAA;AAAA,sCACU,EADV;;AAAA,yCAGJC,QAAD,IAAwB;AAClC,WAAKA,QAAL,GAAgBA,QAAhB;AACH,KALkB;;AAAA,yCAOL,MAAgB;AAC1B,aAAO,KAAKA,QAAZ;AACH,KATkB;AAAA;;AAAA;;AAYvB,OAAO,MAAMC,iBAAN,CAAwB;;gBAAlBA,iB,sBACyB,IAAIF,gBAAJ,E;;gBADzBE,iB,iBAGY,MAAwB;AACzC,SAAOA,iBAAiB,CAACC,gBAAzB;AACH,C;;gBALQD,iB,WAOM,MAAM;AACjBA,EAAAA,iBAAiB,CAACC,gBAAlB,GAAqC,IAAIH,gBAAJ,EAArC;AACH,C","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\nimport type { UserInfo } from './types';\n\nclass UserInfoProvider {\n private userInfo: UserInfo = {};\n\n setUserInfo = (userInfo: UserInfo) => {\n this.userInfo = userInfo;\n };\n\n getUserInfo = (): UserInfo => {\n return this.userInfo;\n };\n}\n\nexport class UserInfoSingleton {\n private static userInfoProvider = new UserInfoProvider();\n\n static getInstance = (): UserInfoProvider => {\n return UserInfoSingleton.userInfoProvider;\n };\n\n static reset = () => {\n UserInfoSingleton.userInfoProvider = new UserInfoProvider();\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
package/lib/module/types.js
CHANGED
|
@@ -28,27 +28,4 @@ export class DdSdkConfiguration {
|
|
|
28
28
|
/**
|
|
29
29
|
* The entry point to initialize Datadog's features.
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Describe the type of a RUM Action.
|
|
34
|
-
*/
|
|
35
|
-
export let RumActionType;
|
|
36
|
-
|
|
37
|
-
(function (RumActionType) {
|
|
38
|
-
RumActionType["TAP"] = "TAP";
|
|
39
|
-
RumActionType["SCROLL"] = "SCROLL";
|
|
40
|
-
RumActionType["SWIPE"] = "SWIPE";
|
|
41
|
-
RumActionType["BACK"] = "BACK";
|
|
42
|
-
RumActionType["CUSTOM"] = "CUSTOM";
|
|
43
|
-
})(RumActionType || (RumActionType = {}));
|
|
44
|
-
|
|
45
|
-
export let ErrorSource;
|
|
46
|
-
|
|
47
|
-
(function (ErrorSource) {
|
|
48
|
-
ErrorSource["NETWORK"] = "NETWORK";
|
|
49
|
-
ErrorSource["SOURCE"] = "SOURCE";
|
|
50
|
-
ErrorSource["CONSOLE"] = "CONSOLE";
|
|
51
|
-
ErrorSource["WEBVIEW"] = "WEBVIEW";
|
|
52
|
-
ErrorSource["CUSTOM"] = "CUSTOM";
|
|
53
|
-
})(ErrorSource || (ErrorSource = {}));
|
|
54
31
|
//# sourceMappingURL=types.js.map
|
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["types.tsx"],"names":["DdSdkConfiguration","constructor","clientToken","env","applicationId","nativeCrashReportEnabled","nativeLongTaskThresholdMs","longTaskThresholdMs","sampleRate","site","trackingConsent","additionalConfig","telemetrySampleRate","vitalsUpdateFrequency","configurationForTelemetry","RumActionType","ErrorSource"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,MAAMA,kBAAN,CAAyB;AAC5BC,EAAAA,WAAW,CACEC,WADF,EAEEC,GAFF,EAGEC,aAHF,EAIEC,wBAJF,EAKEC,yBALF,EAMEC,mBANF,EAOEC,UAPF,EAQEC,IARF,EASEC,eATF,EAUEC,gBAVF,EAWEC,mBAXF,EAYEC,qBAZF,EAaEC,yBAbF,EAmBT;AAAA,SAlBWZ,WAkBX,GAlBWA,WAkBX;AAAA,SAjBWC,GAiBX,GAjBWA,GAiBX;AAAA,SAhBWC,aAgBX,GAhBWA,aAgBX;AAAA,SAfWC,wBAeX,GAfWA,wBAeX;AAAA,SAdWC,yBAcX,GAdWA,yBAcX;AAAA,SAbWC,mBAaX,GAbWA,mBAaX;AAAA,SAZWC,UAYX,GAZWA,UAYX;AAAA,SAXWC,IAWX,GAXWA,IAWX;AAAA,SAVWC,eAUX,GAVWA,eAUX;AAAA,SATWC,gBASX,GATWA,gBASX;AAAA,SARWC,mBAQX,GARWA,mBAQX;AAAA,SAPWC,qBAOX,GAPWA,qBAOX;AAAA,SANWC,yBAMX,GANWA,yBAMX;AAAE;;AApBwB;AAuBhC;AACA;AACA;;AAqOA;AACA;AACA;AACA,WAAYC,aAAZ;;WAAYA,a;AAAAA,EAAAA,a;AAAAA,EAAAA,a;AAAAA,EAAAA,a;AAAAA,EAAAA,a;AAAAA,EAAAA,a;GAAAA,a,KAAAA,a;;AA0BZ,WAAYC,WAAZ;;WAAYA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,KAAAA,W","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/**\n * A configuration object to initialize Datadog's features.\n */\nexport class DdSdkConfiguration {\n constructor(\n readonly clientToken: string,\n readonly env: string,\n readonly applicationId: string,\n readonly nativeCrashReportEnabled: boolean,\n readonly nativeLongTaskThresholdMs: number,\n readonly longTaskThresholdMs: number,\n readonly sampleRate: number,\n readonly site: string,\n readonly trackingConsent: string,\n readonly additionalConfig: object,\n readonly telemetrySampleRate: number,\n readonly vitalsUpdateFrequency: string,\n readonly configurationForTelemetry: {\n initializationType: string;\n trackErrors: boolean;\n trackInteractions: boolean;\n trackNetworkRequests: boolean;\n }\n ) {}\n}\n\n/**\n * The entry point to initialize Datadog's features.\n */\nexport type DdSdkType = {\n /**\n * Initializes Datadog's features.\n * @param configuration: The configuration to use.\n */\n initialize(configuration: DdSdkConfiguration): Promise<void>;\n\n /**\n * Sets the global context (set of attributes) attached with all future Logs, Spans and RUM events.\n * @param attributes: The global context attributes.\n */\n setAttributes(attributes: object): Promise<void>;\n\n /**\n * Set the user information.\n * @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).\n */\n setUser(user: object): Promise<void>;\n\n /**\n * Set the tracking consent regarding the data collection.\n * @param trackingConsent: Consent, which can take one of the following values: 'pending', 'granted', 'not_granted'.\n */\n setTrackingConsent(trackingConsent: string): Promise<void>;\n};\n\n/**\n * The entry point to use Datadog's Logs feature.\n */\nexport type DdLogsType = {\n /**\n * Send a log with level debug.\n * @param message: The message to send.\n * @param context: The additional context to send.\n */\n debug(message: string, context?: object): Promise<void>;\n\n /**\n * Send a log with level info.\n * @param message: The message to send.\n * @param context: The additional context to send.\n */\n info(message: string, context?: object): Promise<void>;\n\n /**\n * Send a log with level warn.\n * @param message: The message to send.\n * @param context: The additional context to send.\n */\n warn(message: string, context?: object): Promise<void>;\n\n /**\n * Send a log with level error.\n * @param message: The message to send.\n * @param context: The additional context to send.\n */\n error(message: string, context?: object): Promise<void>;\n};\n\n/**\n * The entry point to use Datadog's Trace feature.\n */\nexport type DdTraceType = {\n /**\n * Start a span, and returns a unique identifier for the span.\n * @param operation: The operation name of the span.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the operation started (in milliseconds). If not provided, current timestamp will be used.\n */\n startSpan(\n operation: string,\n context?: object,\n timestampMs?: number\n ): Promise<string>;\n\n /**\n * Finish a started span.\n * @param spanId: The unique identifier of the span.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the operation stopped (in milliseconds). If not provided, current timestamp will be used.\n */\n finishSpan(\n spanId: string,\n context?: object,\n timestampMs?: number\n ): Promise<void>;\n};\n\n/**\n * The entry point to use Datadog's RUM feature.\n */\nexport type DdRumType = {\n /**\n * Start tracking a RUM View.\n * @param key: The view unique key identifier.\n * @param name: The view name.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.\n */\n startView(\n key: string,\n name: string,\n context?: object,\n timestampMs?: number\n ): Promise<void>;\n\n /**\n * Stop tracking a RUM View.\n * @param key: The view unique key identifier.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.\n */\n stopView(\n key: string,\n context?: object,\n timestampMs?: number\n ): Promise<void>;\n\n /**\n * Start tracking a RUM Action.\n * @param type: The action type (tap, scroll, swipe, back, custom).\n * @param name: The action name.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.\n */\n startAction(\n type: RumActionType,\n name: string,\n context?: object,\n timestampMs?: number\n ): Promise<void>;\n\n /**\n * Stop tracking the ongoing RUM Action.\n * @param type: The action type (tap, scroll, swipe, back, custom).\n * @param name: The action name.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.\n */\n stopAction(\n type: RumActionType,\n name: string,\n context?: object,\n timestampMs?: number\n ): Promise<void>;\n\n /**\n * Stop tracking the ongoing RUM Action.\n *\n * Warning: using this function signature can lead to inconsistent behaviors on iOS and Android when multiple actions are started in parallel.\n *\n * @deprecated add the `type` and `name` of the action as first two arguments.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.\n */\n stopAction(context?: object, timestampMs?: number): Promise<void>;\n\n /**\n * Add a RUM Action.\n * @param type: The action type (tap, scroll, swipe, back, custom).\n * @param name: The action name.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.\n */\n addAction(\n type: RumActionType,\n name: string,\n context?: object,\n timestampMs?: number\n ): Promise<void>;\n\n /**\n * Start tracking a RUM Resource.\n * @param key: The resource unique key identifier.\n * @param method: The resource method (GET, POST, …).\n * @param url: The resource url.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.\n */\n startResource(\n key: string,\n method: string,\n url: string,\n context?: object,\n timestampMs?: number\n ): Promise<void>;\n\n /**\n * Stop tracking a RUM Resource.\n * @param key: The resource unique key identifier.\n * @param statusCode: The resource status code.\n * @param kind: The resource's kind (xhr, document, image, css, font, …).\n * @param size: The resource size in bytes. If size is unknown, use -1.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.\n */\n stopResource(\n key: string,\n statusCode: number,\n kind: ResourceKind,\n size?: number,\n context?: object,\n timestampMs?: number\n ): Promise<void>;\n\n /**\n * Add a RUM Error.\n * @param message: The error message.\n * @param source: The error source (network, source, console, webview, custom).\n * @param stacktrace: The error stacktrace.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.\n */\n addError(\n message: string,\n source: ErrorSource,\n stacktrace: string,\n context?: object,\n timestampMs?: number\n ): Promise<void>;\n\n /**\n * Adds a specific timing in the active View. The timing duration will be computed as the difference between the time the View was started and the time this function was called.\n * @param name: The name of the new custom timing attribute. Timings can be nested up to 8 levels deep. Names using more than 8 levels will be sanitized by SDK.\n */\n addTiming(name: string): Promise<void>;\n};\n\n/**\n * Describe the type of a RUM Action.\n */\nexport enum RumActionType {\n /** User tapped on a widget. */\n TAP = 'TAP',\n /** User scrolled a view. */\n SCROLL = 'SCROLL',\n /** User swiped on a view. */\n SWIPE = 'SWIPE',\n /** User pressed hardware back button (Android only). */\n BACK = 'BACK',\n /** A custom action. */\n CUSTOM = 'CUSTOM'\n}\n\nexport type ResourceKind =\n | 'image'\n | 'xhr'\n | 'beacon'\n | 'css'\n | 'document'\n | 'fetch'\n | 'font'\n | 'js'\n | 'media'\n | 'other'\n | 'native';\n\nexport enum ErrorSource {\n NETWORK = 'NETWORK',\n SOURCE = 'SOURCE',\n CONSOLE = 'CONSOLE',\n WEBVIEW = 'WEBVIEW',\n CUSTOM = 'CUSTOM'\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["types.tsx"],"names":["DdSdkConfiguration","constructor","clientToken","env","applicationId","nativeCrashReportEnabled","nativeLongTaskThresholdMs","longTaskThresholdMs","sampleRate","site","trackingConsent","additionalConfig","telemetrySampleRate","vitalsUpdateFrequency","configurationForTelemetry"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,MAAMA,kBAAN,CAAyB;AAC5BC,EAAAA,WAAW,CACEC,WADF,EAEEC,GAFF,EAGEC,aAHF,EAIEC,wBAJF,EAKEC,yBALF,EAMEC,mBANF,EAOEC,UAPF,EAQEC,IARF,EASEC,eATF,EAUEC,gBAVF,EAWEC,mBAXF,EAYEC,qBAZF,EAaEC,yBAbF,EAmBT;AAAA,SAlBWZ,WAkBX,GAlBWA,WAkBX;AAAA,SAjBWC,GAiBX,GAjBWA,GAiBX;AAAA,SAhBWC,aAgBX,GAhBWA,aAgBX;AAAA,SAfWC,wBAeX,GAfWA,wBAeX;AAAA,SAdWC,yBAcX,GAdWA,yBAcX;AAAA,SAbWC,mBAaX,GAbWA,mBAaX;AAAA,SAZWC,UAYX,GAZWA,UAYX;AAAA,SAXWC,IAWX,GAXWA,IAWX;AAAA,SAVWC,eAUX,GAVWA,eAUX;AAAA,SATWC,gBASX,GATWA,gBASX;AAAA,SARWC,mBAQX,GARWA,mBAQX;AAAA,SAPWC,qBAOX,GAPWA,qBAOX;AAAA,SANWC,yBAMX,GANWA,yBAMX;AAAE;;AApBwB;AAuBhC;AACA;AACA","sourcesContent":["/*\n * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n * This product includes software developed at Datadog (https://www.datadoghq.com/).\n * Copyright 2016-Present Datadog, Inc.\n */\n\n/**\n * A configuration object to initialize Datadog's features.\n */\nexport class DdSdkConfiguration {\n constructor(\n readonly clientToken: string,\n readonly env: string,\n readonly applicationId: string,\n readonly nativeCrashReportEnabled: boolean,\n readonly nativeLongTaskThresholdMs: number,\n readonly longTaskThresholdMs: number,\n readonly sampleRate: number,\n readonly site: string,\n readonly trackingConsent: string,\n readonly additionalConfig: object,\n readonly telemetrySampleRate: number,\n readonly vitalsUpdateFrequency: string,\n readonly configurationForTelemetry: {\n initializationType: string;\n trackErrors: boolean;\n trackInteractions: boolean;\n trackNetworkRequests: boolean;\n }\n ) {}\n}\n\n/**\n * The entry point to initialize Datadog's features.\n */\nexport type DdSdkType = {\n /**\n * Initializes Datadog's features.\n * @param configuration: The configuration to use.\n */\n initialize(configuration: DdSdkConfiguration): Promise<void>;\n\n /**\n * Sets the global context (set of attributes) attached with all future Logs, Spans and RUM events.\n * @param attributes: The global context attributes.\n */\n setAttributes(attributes: object): Promise<void>;\n\n /**\n * Set the user information.\n * @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).\n */\n setUser(user: object): Promise<void>;\n\n /**\n * Set the tracking consent regarding the data collection.\n * @param trackingConsent: Consent, which can take one of the following values: 'pending', 'granted', 'not_granted'.\n */\n setTrackingConsent(trackingConsent: string): Promise<void>;\n};\n\n/**\n * The entry point to use Datadog's Trace feature.\n */\nexport type DdTraceType = {\n /**\n * Start a span, and returns a unique identifier for the span.\n * @param operation: The operation name of the span.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the operation started (in milliseconds). If not provided, current timestamp will be used.\n */\n startSpan(\n operation: string,\n context?: object,\n timestampMs?: number\n ): Promise<string>;\n\n /**\n * Finish a started span.\n * @param spanId: The unique identifier of the span.\n * @param context: The additional context to send.\n * @param timestampMs: The timestamp when the operation stopped (in milliseconds). If not provided, current timestamp will be used.\n */\n finishSpan(\n spanId: string,\n context?: object,\n timestampMs?: number\n ): Promise<void>;\n};\n"]}
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '1.
|
|
1
|
+
{"version":3,"sources":["version.ts"],"names":["version"],"mappings":"AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,OAAhB","sourcesContent":["// generated by genversion\nexport const version = '1.3.0';\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { DdSdkReactNativeConfiguration } from './DdSdkReactNativeConfiguration';
|
|
2
2
|
import type { DatadogProviderConfiguration, PartialInitializationConfiguration, AutoInstrumentationConfiguration } from './DdSdkReactNativeConfiguration';
|
|
3
3
|
import type { TrackingConsent } from './TrackingConsent';
|
|
4
|
+
import type { Attributes } from './sdk/AttributesSingleton/types';
|
|
5
|
+
import type { UserInfo } from './sdk/UserInfoSingleton/types';
|
|
4
6
|
/**
|
|
5
7
|
* This class initializes the Datadog SDK, and sets up communication with the server.
|
|
6
8
|
*/
|
|
@@ -10,6 +12,7 @@ export declare class DdSdkReactNative {
|
|
|
10
12
|
private static readonly DD_SERVICE_NAME;
|
|
11
13
|
private static readonly DD_SDK_VERBOSITY_KEY;
|
|
12
14
|
private static readonly DD_NATIVE_VIEW_TRACKING_KEY;
|
|
15
|
+
private static readonly DD_NATIVE_INTERACTION_TRACKING_KEY;
|
|
13
16
|
private static readonly DD_VERSION;
|
|
14
17
|
private static readonly DD_VERSION_SUFFIX;
|
|
15
18
|
private static readonly DD_PROXY_TYPE_KEY;
|
|
@@ -40,17 +43,18 @@ export declare class DdSdkReactNative {
|
|
|
40
43
|
*/
|
|
41
44
|
static _initializeFromDatadogProviderWithConfigurationAsync: (configuration: PartialInitializationConfiguration) => Promise<void>;
|
|
42
45
|
/**
|
|
43
|
-
*
|
|
46
|
+
* Adds a set of attributes to the global context attached with all future Logs, Spans and RUM events.
|
|
47
|
+
* To remove an attribute, set it to `undefined` in a call to `setAttributes`.
|
|
44
48
|
* @param attributes: The global context attributes.
|
|
45
49
|
* @returns a Promise.
|
|
46
50
|
*/
|
|
47
|
-
static setAttributes(attributes:
|
|
51
|
+
static setAttributes(attributes: Attributes): Promise<void>;
|
|
48
52
|
/**
|
|
49
53
|
* Set the user information.
|
|
50
54
|
* @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).
|
|
51
55
|
* @returns a Promise.
|
|
52
56
|
*/
|
|
53
|
-
static setUser(user:
|
|
57
|
+
static setUser(user: UserInfo): Promise<void>;
|
|
54
58
|
/**
|
|
55
59
|
* Set the tracking consent regarding the data collection.
|
|
56
60
|
* @param trackingConsent: One of TrackingConsent values.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ProxyConfiguration } from './ProxyConfiguration';
|
|
2
2
|
import type { SdkVerbosity } from './SdkVerbosity';
|
|
3
3
|
import { TrackingConsent } from './TrackingConsent';
|
|
4
|
+
import type { LogEventMapper } from './logs/types';
|
|
5
|
+
import type { ActionEventMapper } from './rum/eventMappers/actionEventMapper';
|
|
6
|
+
import type { ErrorEventMapper } from './rum/eventMappers/errorEventMapper';
|
|
7
|
+
import type { ResourceEventMapper } from './rum/eventMappers/resourceEventMapper';
|
|
4
8
|
export declare enum VitalsUpdateFrequency {
|
|
5
9
|
FREQUENT = "FREQUENT",
|
|
6
10
|
AVERAGE = "AVERAGE",
|
|
@@ -46,6 +50,11 @@ export declare class DdSdkReactNativeConfiguration {
|
|
|
46
50
|
* Set to `true` if you use a custom navigation system relying on native views.
|
|
47
51
|
*/
|
|
48
52
|
nativeViewTracking: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Enables native interaction tracking.
|
|
55
|
+
* Set to `true` if you want to track interactions on native screens.
|
|
56
|
+
*/
|
|
57
|
+
nativeInteractionTracking: boolean;
|
|
49
58
|
proxyConfig?: ProxyConfiguration;
|
|
50
59
|
serviceName?: string;
|
|
51
60
|
/**
|
|
@@ -109,6 +118,10 @@ export declare class DdSdkReactNativeConfiguration {
|
|
|
109
118
|
* Sets the preferred frequency for collecting mobile vitals.
|
|
110
119
|
*/
|
|
111
120
|
vitalsUpdateFrequency: VitalsUpdateFrequency;
|
|
121
|
+
logEventMapper: LogEventMapper | null;
|
|
122
|
+
errorEventMapper: ErrorEventMapper | null;
|
|
123
|
+
resourceEventMapper: ResourceEventMapper | null;
|
|
124
|
+
actionEventMapper: ActionEventMapper | null;
|
|
112
125
|
additionalConfig: {
|
|
113
126
|
[k: string]: any;
|
|
114
127
|
};
|
|
@@ -124,6 +137,10 @@ export declare type AutoInstrumentationConfiguration = {
|
|
|
124
137
|
readonly firstPartyHosts?: string[];
|
|
125
138
|
readonly resourceTracingSamplingRate?: number;
|
|
126
139
|
readonly trackErrors: boolean;
|
|
140
|
+
readonly logEventMapper?: LogEventMapper | null;
|
|
141
|
+
readonly errorEventMapper?: ErrorEventMapper | null;
|
|
142
|
+
readonly resourceEventMapper?: ResourceEventMapper | null;
|
|
143
|
+
readonly actionEventMapper?: ActionEventMapper | null;
|
|
127
144
|
};
|
|
128
145
|
/**
|
|
129
146
|
* Parameters needed to start auto instrumentation. Includes default values.
|
|
@@ -134,6 +151,10 @@ export declare type AutoInstrumentationParameters = {
|
|
|
134
151
|
readonly firstPartyHosts: string[];
|
|
135
152
|
readonly resourceTracingSamplingRate: number;
|
|
136
153
|
readonly trackErrors: boolean;
|
|
154
|
+
readonly logEventMapper: LogEventMapper | null;
|
|
155
|
+
readonly errorEventMapper: ErrorEventMapper | null;
|
|
156
|
+
readonly resourceEventMapper: ResourceEventMapper | null;
|
|
157
|
+
readonly actionEventMapper: ActionEventMapper | null;
|
|
137
158
|
};
|
|
138
159
|
/**
|
|
139
160
|
* We could use `Proxy` instead of this function, but `Proxy` is not available on
|
|
@@ -148,6 +169,7 @@ export declare type PartialInitializationConfiguration = {
|
|
|
148
169
|
readonly site?: string;
|
|
149
170
|
readonly verbosity?: SdkVerbosity | undefined;
|
|
150
171
|
readonly nativeViewTracking?: boolean;
|
|
172
|
+
readonly nativeInteractionTracking?: boolean;
|
|
151
173
|
readonly proxyConfig?: ProxyConfiguration;
|
|
152
174
|
readonly serviceName?: string;
|
|
153
175
|
readonly version?: string;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { DdSdkConfiguration,
|
|
1
|
+
import { DdSdkConfiguration, DdTraceType } from './types';
|
|
2
2
|
import type { DdNativeSdkType } from './nativeModulesTypes';
|
|
3
3
|
declare const DdSdk: DdNativeSdkType;
|
|
4
|
-
declare const DdLogs: DdLogsType;
|
|
5
4
|
declare const DdTrace: DdTraceType;
|
|
6
|
-
|
|
7
|
-
export { DdSdkConfiguration, DdSdk, DdLogs, DdTrace, DdRum };
|
|
5
|
+
export { DdSdkConfiguration, DdSdk, DdTrace };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { DatadogProvider } from './DatadogProvider/DatadogProvider';
|
|
2
1
|
import { DatadogProviderConfiguration, DdSdkReactNativeConfiguration, InitializationMode } from './DdSdkReactNativeConfiguration';
|
|
3
2
|
import { DdSdkReactNative } from './DdSdkReactNative';
|
|
4
3
|
import { InternalLog } from './InternalLog';
|
|
5
4
|
import { ProxyConfiguration, ProxyType } from './ProxyConfiguration';
|
|
6
5
|
import { SdkVerbosity } from './SdkVerbosity';
|
|
7
6
|
import { TrackingConsent } from './TrackingConsent';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { DdTrace } from './foundation';
|
|
8
|
+
import { DdLogs } from './logs/DdLogs';
|
|
9
|
+
import { DdRum } from './rum/DdRum';
|
|
10
|
+
import { RumActionType, ErrorSource } from './rum/types';
|
|
11
|
+
import { DatadogProvider } from './sdk/DatadogProvider/DatadogProvider';
|
|
10
12
|
export { DatadogProvider, DatadogProviderConfiguration, InitializationMode, DdLogs, DdTrace, DdRum, RumActionType, ErrorSource, DdSdkReactNativeConfiguration, DdSdkReactNative, InternalLog, ProxyConfiguration, ProxyType, TrackingConsent, SdkVerbosity };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DdLogsType, LogEventMapper } from './types';
|
|
2
|
+
declare class DdLogsWrapper implements DdLogsType {
|
|
3
|
+
private nativeLogs;
|
|
4
|
+
private logEventMapper;
|
|
5
|
+
debug(message: string, context?: object): Promise<void>;
|
|
6
|
+
info(message: string, context?: object): Promise<void>;
|
|
7
|
+
warn(message: string, context?: object): Promise<void>;
|
|
8
|
+
error(message: string, context?: object): Promise<void>;
|
|
9
|
+
private log;
|
|
10
|
+
registerLogEventMapper(logEventMapper: LogEventMapper): void;
|
|
11
|
+
unregisterLogEventMapper(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const DdLogs: DdLogsWrapper;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Attributes } from '../sdk/AttributesSingleton/types';
|
|
2
|
+
import { EventMapper } from '../sdk/EventMappers/EventMapper';
|
|
3
|
+
import type { UserInfo } from '../sdk/UserInfoSingleton/types';
|
|
4
|
+
import type { LogEvent, LogEventMapper, NativeLog, RawLog } from './types';
|
|
5
|
+
export declare const formatLogEventToNativeLog: (logEvent: LogEvent) => NativeLog;
|
|
6
|
+
export declare const formatRawLogToNativeEvent: (rawLog: RawLog) => NativeLog;
|
|
7
|
+
export declare const formatRawLogToLogEvent: (rawLog: RawLog, additionalInformation: {
|
|
8
|
+
userInfo: UserInfo;
|
|
9
|
+
attributes: Attributes;
|
|
10
|
+
}) => LogEvent;
|
|
11
|
+
export declare const generateEventMapper: (logEventMapper: LogEventMapper | undefined) => EventMapper<RawLog, LogEvent, NativeLog>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { UserInfo } from '../sdk/UserInfoSingleton/types';
|
|
2
|
+
/**
|
|
3
|
+
* The entry point to use Datadog's Logs feature.
|
|
4
|
+
*/
|
|
5
|
+
export declare type DdLogsType = {
|
|
6
|
+
/**
|
|
7
|
+
* Send a log with level debug.
|
|
8
|
+
* @param message: The message to send.
|
|
9
|
+
* @param context: The additional context to send.
|
|
10
|
+
*/
|
|
11
|
+
debug(message: string, context?: object): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Send a log with level info.
|
|
14
|
+
* @param message: The message to send.
|
|
15
|
+
* @param context: The additional context to send.
|
|
16
|
+
*/
|
|
17
|
+
info(message: string, context?: object): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Send a log with level warn.
|
|
20
|
+
* @param message: The message to send.
|
|
21
|
+
* @param context: The additional context to send.
|
|
22
|
+
*/
|
|
23
|
+
warn(message: string, context?: object): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Send a log with level error.
|
|
26
|
+
* @param message: The message to send.
|
|
27
|
+
* @param context: The additional context to send.
|
|
28
|
+
*/
|
|
29
|
+
error(message: string, context?: object): Promise<void>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Log input from developers
|
|
33
|
+
*/
|
|
34
|
+
export declare type RawLog = {
|
|
35
|
+
message: string;
|
|
36
|
+
context: object;
|
|
37
|
+
status: LogStatus;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Log input for native SDKs
|
|
41
|
+
*/
|
|
42
|
+
export declare type NativeLog = {
|
|
43
|
+
message: string;
|
|
44
|
+
context: object;
|
|
45
|
+
};
|
|
46
|
+
export declare type LogStatus = 'debug' | 'info' | 'warn' | 'error';
|
|
47
|
+
export declare type LogEvent = {
|
|
48
|
+
message: string;
|
|
49
|
+
context: object;
|
|
50
|
+
readonly status: LogStatus;
|
|
51
|
+
readonly userInfo: UserInfo;
|
|
52
|
+
readonly attributes?: object;
|
|
53
|
+
};
|
|
54
|
+
export declare type LogEventMapper = (logEvent: LogEvent) => LogEvent | null;
|
|
@@ -30,7 +30,7 @@ export declare type DdNativeSdkType = {
|
|
|
30
30
|
* Set the user information.
|
|
31
31
|
* @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).
|
|
32
32
|
*/
|
|
33
|
-
setUser(user: object): Promise<
|
|
33
|
+
setUser(user: object): Promise<object>;
|
|
34
34
|
/**
|
|
35
35
|
* Set the tracking consent regarding the data collection.
|
|
36
36
|
* @param trackingConsent: Consent, which can take one of the following values: 'pending', 'granted', 'not_granted'.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { GestureResponderEvent } from 'react-native';
|
|
2
|
+
import type { ActionEventMapper } from './eventMappers/actionEventMapper';
|
|
3
|
+
import type { ErrorEventMapper } from './eventMappers/errorEventMapper';
|
|
4
|
+
import type { ResourceEventMapper } from './eventMappers/resourceEventMapper';
|
|
5
|
+
import type { DdRumType, RumActionType, ResourceKind, ErrorSource } from './types';
|
|
6
|
+
declare class DdRumWrapper implements DdRumType {
|
|
7
|
+
private nativeRum;
|
|
8
|
+
private lastActionData?;
|
|
9
|
+
private errorEventMapper;
|
|
10
|
+
private resourceEventMapper;
|
|
11
|
+
private actionEventMapper;
|
|
12
|
+
startView(key: string, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
13
|
+
stopView(key: string, context?: object, timestampMs?: number): Promise<void>;
|
|
14
|
+
startAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
15
|
+
stopAction(...args: [
|
|
16
|
+
type: RumActionType,
|
|
17
|
+
name: string,
|
|
18
|
+
context?: object,
|
|
19
|
+
timestampMs?: number
|
|
20
|
+
] | [context?: object, timestampMs?: number]): Promise<void>;
|
|
21
|
+
private callNativeStopAction;
|
|
22
|
+
private getStopActionNativeCallArgs;
|
|
23
|
+
addAction(type: RumActionType, name: string, context?: object, timestampMs?: number, actionContext?: GestureResponderEvent): Promise<void>;
|
|
24
|
+
startResource(key: string, method: string, url: string, context?: object, timestampMs?: number): Promise<void>;
|
|
25
|
+
stopResource(key: string, statusCode: number, kind: ResourceKind, size?: number, context?: object, timestampMs?: number, resourceContext?: XMLHttpRequest): Promise<void>;
|
|
26
|
+
addError(message: string, source: ErrorSource, stacktrace: string, context?: object, timestampMs?: number): Promise<void>;
|
|
27
|
+
addTiming(name: string): Promise<void>;
|
|
28
|
+
registerErrorEventMapper(errorEventMapper: ErrorEventMapper): void;
|
|
29
|
+
unregisterErrorEventMapper(): void;
|
|
30
|
+
registerResourceEventMapper(resourceEventMapper: ResourceEventMapper): void;
|
|
31
|
+
unregisterResourceEventMapper(): void;
|
|
32
|
+
registerActionEventMapper(actionEventMapper: ActionEventMapper): void;
|
|
33
|
+
unregisterActionEventMapper(): void;
|
|
34
|
+
}
|
|
35
|
+
export declare const DdRum: DdRumWrapper;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { GestureResponderEvent } from 'react-native';
|
|
2
|
+
import type { AdditionalEventDataForMapper } from '../../sdk/EventMappers/EventMapper';
|
|
3
|
+
import { EventMapper } from '../../sdk/EventMappers/EventMapper';
|
|
4
|
+
import type { RumActionType } from '../types';
|
|
5
|
+
declare type RawAction = {
|
|
6
|
+
readonly type: RumActionType;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
context: object;
|
|
9
|
+
readonly timestampMs: number;
|
|
10
|
+
actionContext?: GestureResponderEvent;
|
|
11
|
+
};
|
|
12
|
+
declare type ActionEvent = RawAction & AdditionalEventDataForMapper;
|
|
13
|
+
declare type NativeAction = {
|
|
14
|
+
type: RumActionType;
|
|
15
|
+
name: string;
|
|
16
|
+
context: object;
|
|
17
|
+
timestampMs: number;
|
|
18
|
+
};
|
|
19
|
+
export declare type ActionEventMapper = (event: ActionEvent) => ActionEvent | null;
|
|
20
|
+
export declare const generateActionEventMapper: (eventMapper: ActionEventMapper | undefined) => EventMapper<RawAction, ActionEvent, NativeAction>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AdditionalEventDataForMapper } from '../../sdk/EventMappers/EventMapper';
|
|
2
|
+
import { EventMapper } from '../../sdk/EventMappers/EventMapper';
|
|
3
|
+
import type { ErrorSource } from '../types';
|
|
4
|
+
declare type RawError = {
|
|
5
|
+
message: string;
|
|
6
|
+
source: ErrorSource;
|
|
7
|
+
stacktrace: string;
|
|
8
|
+
context?: object;
|
|
9
|
+
timestampMs?: number;
|
|
10
|
+
};
|
|
11
|
+
declare type ErrorEvent = RawError & AdditionalEventDataForMapper;
|
|
12
|
+
declare type NativeError = {
|
|
13
|
+
message: string;
|
|
14
|
+
source: ErrorSource;
|
|
15
|
+
stacktrace: string;
|
|
16
|
+
context?: object;
|
|
17
|
+
timestampMs?: number;
|
|
18
|
+
};
|
|
19
|
+
export declare type ErrorEventMapper = (event: ErrorEvent) => ErrorEvent | null;
|
|
20
|
+
export declare const generateErrorEventMapper: (eventMapper: ErrorEventMapper | undefined) => EventMapper<RawError, ErrorEvent, NativeError>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react-native" />
|
|
2
|
+
import type { AdditionalEventDataForMapper } from '../../sdk/EventMappers/EventMapper';
|
|
3
|
+
import { EventMapper } from '../../sdk/EventMappers/EventMapper';
|
|
4
|
+
import type { ResourceKind } from '../types';
|
|
5
|
+
declare type RawResource = {
|
|
6
|
+
readonly key: string;
|
|
7
|
+
readonly statusCode: number;
|
|
8
|
+
readonly kind: ResourceKind;
|
|
9
|
+
readonly size: number;
|
|
10
|
+
context: object;
|
|
11
|
+
readonly timestampMs: number;
|
|
12
|
+
resourceContext: XMLHttpRequest | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare type ResourceEvent = RawResource & AdditionalEventDataForMapper;
|
|
15
|
+
declare type NativeResource = {
|
|
16
|
+
key: string;
|
|
17
|
+
statusCode: number;
|
|
18
|
+
kind: ResourceKind;
|
|
19
|
+
size: number;
|
|
20
|
+
context: object;
|
|
21
|
+
timestampMs: number;
|
|
22
|
+
};
|
|
23
|
+
export declare type ResourceEventMapper = (event: ResourceEvent) => ResourceEvent | null;
|
|
24
|
+
export declare const generateResourceEventMapper: (eventMapper: ResourceEventMapper | undefined) => EventMapper<RawResource, ResourceEvent, NativeResource>;
|
|
25
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/typescript/rum/instrumentation/resourceTracking/domain/interfaces/RumResource.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react-native" />
|
|
2
|
+
import type { ResourceKind } from '../../../../types';
|
|
2
3
|
import type { DdRumResourceTracingAttributes } from '../distributedTracing';
|
|
3
4
|
export interface RUMResource {
|
|
4
5
|
key: string;
|
|
@@ -17,4 +18,5 @@ export interface RUMResource {
|
|
|
17
18
|
stopTime: number;
|
|
18
19
|
responseStartTime?: number;
|
|
19
20
|
};
|
|
21
|
+
resourceContext?: XMLHttpRequest;
|
|
20
22
|
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The entry point to use Datadog's RUM feature.
|
|
3
|
+
*/
|
|
4
|
+
export declare type DdRumType = {
|
|
5
|
+
/**
|
|
6
|
+
* Start tracking a RUM View.
|
|
7
|
+
* @param key: The view unique key identifier.
|
|
8
|
+
* @param name: The view name.
|
|
9
|
+
* @param context: The additional context to send.
|
|
10
|
+
* @param timestampMs: The timestamp when the view started (in milliseconds). If not provided, current timestamp will be used.
|
|
11
|
+
*/
|
|
12
|
+
startView(key: string, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Stop tracking a RUM View.
|
|
15
|
+
* @param key: The view unique key identifier.
|
|
16
|
+
* @param context: The additional context to send.
|
|
17
|
+
* @param timestampMs: The timestamp when the view stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
18
|
+
*/
|
|
19
|
+
stopView(key: string, context?: object, timestampMs?: number): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Start tracking a RUM Action.
|
|
22
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
23
|
+
* @param name: The action name.
|
|
24
|
+
* @param context: The additional context to send.
|
|
25
|
+
* @param timestampMs: The timestamp when the action started (in milliseconds). If not provided, current timestamp will be used.
|
|
26
|
+
*/
|
|
27
|
+
startAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Stop tracking the ongoing RUM Action.
|
|
30
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
31
|
+
* @param name: The action name.
|
|
32
|
+
* @param context: The additional context to send.
|
|
33
|
+
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
34
|
+
*/
|
|
35
|
+
stopAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Stop tracking the ongoing RUM Action.
|
|
38
|
+
*
|
|
39
|
+
* Warning: using this function signature can lead to inconsistent behaviors on iOS and Android when multiple actions are started in parallel.
|
|
40
|
+
*
|
|
41
|
+
* @deprecated add the `type` and `name` of the action as first two arguments.
|
|
42
|
+
* @param context: The additional context to send.
|
|
43
|
+
* @param timestampMs: The timestamp when the action stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
44
|
+
*/
|
|
45
|
+
stopAction(context?: object, timestampMs?: number): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Add a RUM Action.
|
|
48
|
+
* @param type: The action type (tap, scroll, swipe, back, custom).
|
|
49
|
+
* @param name: The action name.
|
|
50
|
+
* @param context: The additional context to send.
|
|
51
|
+
* @param timestampMs: The timestamp when the action occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
52
|
+
*/
|
|
53
|
+
addAction(type: RumActionType, name: string, context?: object, timestampMs?: number): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Start tracking a RUM Resource.
|
|
56
|
+
* @param key: The resource unique key identifier.
|
|
57
|
+
* @param method: The resource method (GET, POST, …).
|
|
58
|
+
* @param url: The resource url.
|
|
59
|
+
* @param context: The additional context to send.
|
|
60
|
+
* @param timestampMs: The timestamp when the resource started (in milliseconds). If not provided, current timestamp will be used.
|
|
61
|
+
*/
|
|
62
|
+
startResource(key: string, method: string, url: string, context?: object, timestampMs?: number): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Stop tracking a RUM Resource.
|
|
65
|
+
* @param key: The resource unique key identifier.
|
|
66
|
+
* @param statusCode: The resource status code.
|
|
67
|
+
* @param kind: The resource's kind (xhr, document, image, css, font, …).
|
|
68
|
+
* @param size: The resource size in bytes. If size is unknown, use -1.
|
|
69
|
+
* @param context: The additional context to send.
|
|
70
|
+
* @param timestampMs: The timestamp when the resource stopped (in milliseconds). If not provided, current timestamp will be used.
|
|
71
|
+
*/
|
|
72
|
+
stopResource(key: string, statusCode: number, kind: ResourceKind, size?: number, context?: object, timestampMs?: number): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Add a RUM Error.
|
|
75
|
+
* @param message: The error message.
|
|
76
|
+
* @param source: The error source (network, source, console, webview, custom).
|
|
77
|
+
* @param stacktrace: The error stacktrace.
|
|
78
|
+
* @param context: The additional context to send.
|
|
79
|
+
* @param timestampMs: The timestamp when the error occurred (in milliseconds). If not provided, current timestamp will be used.
|
|
80
|
+
*/
|
|
81
|
+
addError(message: string, source: ErrorSource, stacktrace: string, context?: object, timestampMs?: number): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Adds a specific timing in the active View. The timing duration will be computed as the difference between the time the View was started and the time this function was called.
|
|
84
|
+
* @param name: The name of the new custom timing attribute. Timings can be nested up to 8 levels deep. Names using more than 8 levels will be sanitized by SDK.
|
|
85
|
+
*/
|
|
86
|
+
addTiming(name: string): Promise<void>;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Describe the type of a RUM Action.
|
|
90
|
+
*/
|
|
91
|
+
export declare enum RumActionType {
|
|
92
|
+
/** User tapped on a widget. */
|
|
93
|
+
TAP = "TAP",
|
|
94
|
+
/** User scrolled a view. */
|
|
95
|
+
SCROLL = "SCROLL",
|
|
96
|
+
/** User swiped on a view. */
|
|
97
|
+
SWIPE = "SWIPE",
|
|
98
|
+
/** User pressed hardware back button (Android only). */
|
|
99
|
+
BACK = "BACK",
|
|
100
|
+
/** A custom action. */
|
|
101
|
+
CUSTOM = "CUSTOM"
|
|
102
|
+
}
|
|
103
|
+
export declare type ResourceKind = 'image' | 'xhr' | 'beacon' | 'css' | 'document' | 'fetch' | 'font' | 'js' | 'media' | 'other' | 'native';
|
|
104
|
+
export declare enum ErrorSource {
|
|
105
|
+
NETWORK = "NETWORK",
|
|
106
|
+
SOURCE = "SOURCE",
|
|
107
|
+
CONSOLE = "CONSOLE",
|
|
108
|
+
WEBVIEW = "WEBVIEW",
|
|
109
|
+
CUSTOM = "CUSTOM"
|
|
110
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Attributes } from './types';
|
|
2
|
+
declare class AttributesProvider {
|
|
3
|
+
private attributes;
|
|
4
|
+
setAttributes: (attributes: Attributes) => void;
|
|
5
|
+
getAttributes: () => Attributes;
|
|
6
|
+
}
|
|
7
|
+
export declare class AttributesSingleton {
|
|
8
|
+
private static attributesProvider;
|
|
9
|
+
static getInstance: () => AttributesProvider;
|
|
10
|
+
static reset: () => void;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
File without changes
|
|
File without changes
|