@multiplayer-app/session-recorder-react-native 1.0.1-beta.2 → 1.0.1-beta.4
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/LICENSE +1 -2
- package/README.md +216 -155
- package/SessionRecorderNative.podspec +9 -14
- package/android/build.gradle +21 -41
- package/android/gradle.properties +4 -4
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativeConfig.kt +52 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativeModule.kt +860 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativeModuleSpec.kt +51 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativePackage.kt +33 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/model/TargetInfo.kt +9 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/util/ViewUtils.kt +72 -0
- package/android/src/main/java/com/xxx/XxxModule.kt +23 -0
- package/ios/GestureTargetFinder.swift +50 -0
- package/ios/SessionRecorderNative.podspec +4 -2
- package/ios/SessionRecorderNative.swift +10 -1
- package/ios/SessionRecorderNativeSpec.swift +55 -0
- package/ios/Xxx.h +5 -0
- package/ios/Xxx.mm +21 -0
- package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js +23 -0
- package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js.map +1 -0
- package/lib/module/components/ScreenRecorderView/index.js +4 -0
- package/lib/module/components/ScreenRecorderView/index.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ErrorBanner.js +64 -0
- package/lib/module/components/SessionRecorderWidget/ErrorBanner.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/FinalPopover.js +74 -0
- package/lib/module/components/SessionRecorderWidget/FinalPopover.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/FloatingButton.js +191 -0
- package/lib/module/components/SessionRecorderWidget/FloatingButton.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/InitialPopover.js +138 -0
- package/lib/module/components/SessionRecorderWidget/InitialPopover.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ModalContainer.js +177 -0
- package/lib/module/components/SessionRecorderWidget/ModalContainer.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ModalHeader.js +27 -0
- package/lib/module/components/SessionRecorderWidget/ModalHeader.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js +133 -0
- package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/icons.js +93 -0
- package/lib/module/components/SessionRecorderWidget/icons.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/index.js +5 -0
- package/lib/module/components/SessionRecorderWidget/index.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/styles.js +173 -0
- package/lib/module/components/SessionRecorderWidget/styles.js.map +1 -0
- package/lib/module/components/index.js +5 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/config/constants.js +42 -0
- package/lib/module/config/constants.js.map +1 -0
- package/lib/module/config/defaults.js +81 -0
- package/lib/module/config/defaults.js.map +1 -0
- package/lib/module/config/index.js +9 -0
- package/lib/module/config/index.js.map +1 -0
- package/lib/module/config/masking.js +35 -0
- package/lib/module/config/masking.js.map +1 -0
- package/lib/module/config/session-recorder.js +44 -0
- package/lib/module/config/session-recorder.js.map +1 -0
- package/lib/module/config/validators.js +28 -0
- package/lib/module/config/validators.js.map +1 -0
- package/lib/module/config/widget.js +35 -0
- package/lib/module/config/widget.js.map +1 -0
- package/lib/module/context/SessionRecorderContext.js +93 -0
- package/lib/module/context/SessionRecorderContext.js.map +1 -0
- package/lib/module/context/SessionRecorderStore.js +12 -0
- package/lib/module/context/SessionRecorderStore.js.map +1 -0
- package/lib/module/context/useSessionRecorderStore.js +20 -0
- package/lib/module/context/useSessionRecorderStore.js.map +1 -0
- package/lib/module/context/useStoreSelector.js +27 -0
- package/lib/module/context/useStoreSelector.js.map +1 -0
- package/lib/module/index.js +13 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native/SessionRecorderNative.js +74 -0
- package/lib/module/native/SessionRecorderNative.js.map +1 -0
- package/lib/module/native/index.js +4 -0
- package/lib/module/native/index.js.map +1 -0
- package/lib/module/otel/helpers.js +218 -0
- package/lib/module/otel/helpers.js.map +1 -0
- package/lib/module/otel/index.js +95 -0
- package/lib/module/otel/index.js.map +1 -0
- package/lib/module/otel/instrumentations/index.js +102 -0
- package/lib/module/otel/instrumentations/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/patch/index.js +4 -0
- package/lib/module/patch/index.js.map +1 -0
- package/lib/module/patch/xhr.js +116 -0
- package/lib/module/patch/xhr.js.map +1 -0
- package/lib/module/recorder/eventExporter.js +130 -0
- package/lib/module/recorder/eventExporter.js.map +1 -0
- package/lib/module/recorder/gestureRecorder.js +641 -0
- package/lib/module/recorder/gestureRecorder.js.map +1 -0
- package/lib/module/recorder/index.js +168 -0
- package/lib/module/recorder/index.js.map +1 -0
- package/lib/module/recorder/navigationTracker.js +228 -0
- package/lib/module/recorder/navigationTracker.js.map +1 -0
- package/lib/module/recorder/screenRecorder.js +495 -0
- package/lib/module/recorder/screenRecorder.js.map +1 -0
- package/lib/module/services/api.service.js +149 -0
- package/lib/module/services/api.service.js.map +1 -0
- package/lib/module/services/network.service.js +178 -0
- package/lib/module/services/network.service.js.map +1 -0
- package/lib/module/services/screenMaskingService.js +107 -0
- package/lib/module/services/screenMaskingService.js.map +1 -0
- package/lib/module/services/storage.service.js +179 -0
- package/lib/module/services/storage.service.js.map +1 -0
- package/lib/module/session-recorder.js +541 -0
- package/lib/module/session-recorder.js.map +1 -0
- package/lib/module/types/configs.js +4 -0
- package/lib/module/types/configs.js.map +1 -0
- package/lib/module/types/expo-constants.d.js +2 -0
- package/lib/module/types/expo-constants.d.js.map +1 -0
- package/lib/module/types/index.js +11 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/session-recorder.js +68 -0
- package/lib/module/types/session-recorder.js.map +1 -0
- package/lib/module/types/session.js +9 -0
- package/lib/module/types/session.js.map +1 -0
- package/lib/module/utils/app-metadata.js +28 -0
- package/lib/module/utils/app-metadata.js.map +1 -0
- package/lib/module/utils/constants.optional.expo.js +6 -0
- package/lib/module/utils/constants.optional.expo.js.map +1 -0
- package/lib/module/utils/constants.optional.js +8 -0
- package/lib/module/utils/constants.optional.js.map +1 -0
- package/lib/module/utils/createStore.js +27 -0
- package/lib/module/utils/createStore.js.map +1 -0
- package/lib/module/utils/index.js +11 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/utils/logger.js +193 -0
- package/lib/module/utils/logger.js.map +1 -0
- package/lib/module/utils/platform.js +340 -0
- package/lib/module/utils/platform.js.map +1 -0
- package/lib/module/utils/request-utils.js +58 -0
- package/lib/module/utils/request-utils.js.map +1 -0
- package/lib/module/utils/rrweb-events.js +276 -0
- package/lib/module/utils/rrweb-events.js.map +1 -0
- package/lib/module/utils/session.js +21 -0
- package/lib/module/utils/session.js.map +1 -0
- package/lib/module/utils/shallowEqual.js +17 -0
- package/lib/module/utils/shallowEqual.js.map +1 -0
- package/lib/module/utils/time.js +17 -0
- package/lib/module/utils/time.js.map +1 -0
- package/lib/module/utils/type-utils.js +69 -0
- package/lib/module/utils/type-utils.js.map +1 -0
- package/lib/module/version.js +4 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts +6 -0
- package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts.map +1 -0
- package/lib/typescript/src/components/ScreenRecorderView/index.d.ts +2 -0
- package/lib/typescript/src/components/ScreenRecorderView/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ErrorBanner.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ErrorBanner.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/FinalPopover.d.ts +2 -1
- package/lib/typescript/src/components/SessionRecorderWidget/FinalPopover.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/FloatingButton.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/FloatingButton.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/InitialPopover.d.ts +2 -1
- package/lib/typescript/src/components/SessionRecorderWidget/InitialPopover.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ModalContainer.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ModalContainer.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ModalHeader.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ModalHeader.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/SessionRecorderWidget.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/SessionRecorderWidget.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/icons.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/icons.d.ts.map +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts +3 -0
- package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/styles.d.ts +4 -3
- package/lib/typescript/src/components/SessionRecorderWidget/styles.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/index.d.ts +1 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/constants.d.ts +1 -0
- package/lib/typescript/src/config/constants.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/defaults.d.ts +2 -1
- package/lib/typescript/src/config/defaults.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/index.d.ts +1 -0
- package/lib/typescript/src/config/index.d.ts.map +1 -0
- package/lib/typescript/src/config/masking.d.ts +3 -0
- package/lib/typescript/src/config/masking.d.ts.map +1 -0
- package/lib/typescript/src/config/session-recorder.d.ts +3 -0
- package/lib/typescript/src/config/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/validators.d.ts +1 -0
- package/lib/typescript/src/config/validators.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/widget.d.ts +2 -1
- package/lib/typescript/src/config/widget.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/SessionRecorderContext.d.ts +3 -2
- package/lib/typescript/src/context/SessionRecorderContext.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/SessionRecorderStore.d.ts +2 -1
- package/lib/typescript/src/context/SessionRecorderStore.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/useSessionRecorderStore.d.ts +2 -1
- package/lib/typescript/src/context/useSessionRecorderStore.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/useStoreSelector.d.ts +2 -1
- package/lib/typescript/src/context/useStoreSelector.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/native/SessionRecorderNative.d.ts +21 -3
- package/lib/typescript/src/native/SessionRecorderNative.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/native/index.d.ts +1 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/helpers.d.ts +3 -2
- package/lib/typescript/src/otel/helpers.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/index.d.ts +2 -2
- package/lib/typescript/src/otel/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/instrumentations/index.d.ts +2 -1
- package/lib/typescript/src/otel/instrumentations/index.d.ts.map +1 -0
- package/lib/typescript/src/patch/index.d.ts +2 -0
- package/lib/typescript/src/patch/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/patch/xhr.d.ts +1 -0
- package/lib/typescript/src/patch/xhr.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/eventExporter.d.ts +2 -1
- package/lib/typescript/src/recorder/eventExporter.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/gestureRecorder.d.ts +3 -2
- package/lib/typescript/src/recorder/gestureRecorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/index.d.ts +3 -2
- package/lib/typescript/src/recorder/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/navigationTracker.d.ts +2 -1
- package/lib/typescript/src/recorder/navigationTracker.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/screenRecorder.d.ts +4 -4
- package/lib/typescript/src/recorder/screenRecorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/api.service.d.ts +2 -1
- package/lib/typescript/src/services/api.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/network.service.d.ts +1 -0
- package/lib/typescript/src/services/network.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/screenMaskingService.d.ts +2 -1
- package/lib/typescript/src/services/screenMaskingService.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/storage.service.d.ts +2 -1
- package/lib/typescript/src/services/storage.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/session-recorder.d.ts +3 -2
- package/lib/typescript/src/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/configs.d.ts +3 -2
- package/lib/typescript/src/types/configs.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/index.d.ts +1 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/session-recorder.d.ts +3 -2
- package/lib/typescript/src/types/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/session.d.ts +1 -0
- package/lib/typescript/src/types/session.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/app-metadata.d.ts +1 -0
- package/lib/typescript/src/utils/app-metadata.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/constants.optional.d.ts +1 -0
- package/lib/typescript/src/utils/constants.optional.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/constants.optional.expo.d.ts +1 -0
- package/lib/typescript/src/utils/constants.optional.expo.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/createStore.d.ts +1 -0
- package/lib/typescript/src/utils/createStore.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/index.d.ts +1 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/logger.d.ts +1 -0
- package/lib/typescript/src/utils/logger.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/platform.d.ts +2 -1
- package/lib/typescript/src/utils/platform.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/request-utils.d.ts +1 -0
- package/lib/typescript/src/utils/request-utils.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/rrweb-events.d.ts +2 -1
- package/lib/typescript/src/utils/rrweb-events.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/session.d.ts +1 -0
- package/lib/typescript/src/utils/session.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/shallowEqual.d.ts +1 -0
- package/lib/typescript/src/utils/shallowEqual.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/time.d.ts +1 -0
- package/lib/typescript/src/utils/time.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/type-utils.d.ts +1 -0
- package/lib/typescript/src/utils/type-utils.d.ts.map +1 -0
- package/lib/typescript/src/version.d.ts +2 -0
- package/lib/typescript/src/version.d.ts.map +1 -0
- package/package.json +140 -39
- package/src/components/ScreenRecorderView/ScreenRecorderView.tsx +20 -0
- package/src/components/SessionRecorderWidget/ErrorBanner.tsx +58 -0
- package/src/components/SessionRecorderWidget/FinalPopover.tsx +96 -0
- package/src/components/SessionRecorderWidget/FloatingButton.tsx +176 -0
- package/src/components/SessionRecorderWidget/InitialPopover.tsx +167 -0
- package/src/components/SessionRecorderWidget/ModalContainer.tsx +189 -0
- package/src/components/SessionRecorderWidget/ModalHeader.tsx +24 -0
- package/src/components/SessionRecorderWidget/SessionRecorderWidget.tsx +136 -0
- package/src/components/SessionRecorderWidget/icons.tsx +52 -0
- package/{dist/components/SessionRecorderWidget/index.d.ts → src/components/SessionRecorderWidget/index.ts} +1 -0
- package/src/components/SessionRecorderWidget/styles.ts +169 -0
- package/src/components/index.ts +2 -0
- package/src/config/constants.ts +68 -0
- package/src/config/defaults.ts +101 -0
- package/src/config/index.ts +6 -0
- package/src/config/masking.ts +34 -0
- package/src/config/session-recorder.ts +59 -0
- package/src/config/validators.ts +31 -0
- package/src/config/widget.ts +38 -0
- package/src/context/SessionRecorderContext.tsx +138 -0
- package/src/context/SessionRecorderStore.ts +21 -0
- package/src/context/useSessionRecorderStore.ts +27 -0
- package/src/context/useStoreSelector.ts +34 -0
- package/src/index.ts +10 -0
- package/src/native/SessionRecorderNative.ts +164 -0
- package/src/native/index.ts +1 -0
- package/src/otel/helpers.ts +274 -0
- package/src/otel/index.ts +135 -0
- package/src/otel/instrumentations/index.ts +115 -0
- package/src/patch/index.ts +1 -0
- package/src/patch/xhr.ts +149 -0
- package/src/recorder/eventExporter.ts +155 -0
- package/src/recorder/gestureRecorder.ts +681 -0
- package/src/recorder/index.ts +190 -0
- package/src/recorder/navigationTracker.ts +245 -0
- package/src/recorder/screenRecorder.ts +549 -0
- package/src/services/api.service.ts +215 -0
- package/src/services/network.service.ts +182 -0
- package/src/services/screenMaskingService.ts +122 -0
- package/src/services/storage.service.ts +219 -0
- package/src/session-recorder.ts +591 -0
- package/src/types/configs.ts +96 -0
- package/src/types/expo-constants.d.ts +7 -0
- package/src/types/index.ts +29 -0
- package/src/types/session-recorder.ts +386 -0
- package/src/types/session.ts +65 -0
- package/src/utils/app-metadata.ts +31 -0
- package/src/utils/constants.optional.expo.ts +5 -0
- package/src/utils/constants.optional.ts +16 -0
- package/src/utils/createStore.ts +29 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/logger.ts +216 -0
- package/src/utils/platform.ts +370 -0
- package/src/utils/request-utils.ts +61 -0
- package/src/utils/rrweb-events.ts +316 -0
- package/src/utils/session.ts +19 -0
- package/src/utils/shallowEqual.ts +14 -0
- package/src/utils/time.ts +17 -0
- package/src/utils/type-utils.ts +75 -0
- package/src/version.ts +1 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/android/gradlew +0 -249
- package/android/gradlew.bat +0 -92
- package/copy-react-native-dist.sh +0 -56
- package/dist/components/ScreenRecorderView/ScreenRecorderView.d.ts +0 -5
- package/dist/components/ScreenRecorderView/ScreenRecorderView.js +0 -1
- package/dist/components/ScreenRecorderView/ScreenRecorderView.js.map +0 -1
- package/dist/components/ScreenRecorderView/index.js +0 -1
- package/dist/components/ScreenRecorderView/index.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ErrorBanner.js +0 -1
- package/dist/components/SessionRecorderWidget/ErrorBanner.js.map +0 -1
- package/dist/components/SessionRecorderWidget/FinalPopover.js +0 -1
- package/dist/components/SessionRecorderWidget/FinalPopover.js.map +0 -1
- package/dist/components/SessionRecorderWidget/FloatingButton.js +0 -1
- package/dist/components/SessionRecorderWidget/FloatingButton.js.map +0 -1
- package/dist/components/SessionRecorderWidget/InitialPopover.js +0 -1
- package/dist/components/SessionRecorderWidget/InitialPopover.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ModalContainer.js +0 -1
- package/dist/components/SessionRecorderWidget/ModalContainer.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ModalHeader.js +0 -1
- package/dist/components/SessionRecorderWidget/ModalHeader.js.map +0 -1
- package/dist/components/SessionRecorderWidget/SessionRecorderWidget.js +0 -1
- package/dist/components/SessionRecorderWidget/SessionRecorderWidget.js.map +0 -1
- package/dist/components/SessionRecorderWidget/icons.js +0 -1
- package/dist/components/SessionRecorderWidget/icons.js.map +0 -1
- package/dist/components/SessionRecorderWidget/index.js +0 -1
- package/dist/components/SessionRecorderWidget/index.js.map +0 -1
- package/dist/components/SessionRecorderWidget/styles.js +0 -1
- package/dist/components/SessionRecorderWidget/styles.js.map +0 -1
- package/dist/components/index.js +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/config/constants.js +0 -1
- package/dist/config/constants.js.map +0 -1
- package/dist/config/defaults.js +0 -1
- package/dist/config/defaults.js.map +0 -1
- package/dist/config/index.js +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/masking.d.ts +0 -2
- package/dist/config/masking.js +0 -1
- package/dist/config/masking.js.map +0 -1
- package/dist/config/session-recorder.d.ts +0 -2
- package/dist/config/session-recorder.js +0 -1
- package/dist/config/session-recorder.js.map +0 -1
- package/dist/config/validators.js +0 -1
- package/dist/config/validators.js.map +0 -1
- package/dist/config/widget.js +0 -1
- package/dist/config/widget.js.map +0 -1
- package/dist/context/SessionRecorderContext.js +0 -1
- package/dist/context/SessionRecorderContext.js.map +0 -1
- package/dist/context/SessionRecorderStore.js +0 -1
- package/dist/context/SessionRecorderStore.js.map +0 -1
- package/dist/context/useSessionRecorderStore.js +0 -1
- package/dist/context/useSessionRecorderStore.js.map +0 -1
- package/dist/context/useStoreSelector.js +0 -1
- package/dist/context/useStoreSelector.js.map +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +0 -1
- package/dist/native/GestureRecorderNative.d.ts +0 -57
- package/dist/native/GestureRecorderNative.js +0 -1
- package/dist/native/GestureRecorderNative.js.map +0 -1
- package/dist/native/GestureRecorderNativeTurboSpec.d.ts +0 -31
- package/dist/native/GestureRecorderNativeTurboSpec.js +0 -1
- package/dist/native/GestureRecorderNativeTurboSpec.js.map +0 -1
- package/dist/native/SessionRecorderNative.js +0 -1
- package/dist/native/SessionRecorderNative.js.map +0 -1
- package/dist/native/SessionRecorderNativeTurboSpec.d.ts +0 -17
- package/dist/native/SessionRecorderNativeTurboSpec.js +0 -1
- package/dist/native/SessionRecorderNativeTurboSpec.js.map +0 -1
- package/dist/native/index.js +0 -1
- package/dist/native/index.js.map +0 -1
- package/dist/otel/helpers.js +0 -1
- package/dist/otel/helpers.js.map +0 -1
- package/dist/otel/index.js +0 -1
- package/dist/otel/index.js.map +0 -1
- package/dist/otel/instrumentations/index.js +0 -1
- package/dist/otel/instrumentations/index.js.map +0 -1
- package/dist/patch/index.d.ts +0 -1
- package/dist/patch/index.js +0 -1
- package/dist/patch/index.js.map +0 -1
- package/dist/patch/xhr.js +0 -1
- package/dist/patch/xhr.js.map +0 -1
- package/dist/recorder/eventExporter.js +0 -1
- package/dist/recorder/eventExporter.js.map +0 -1
- package/dist/recorder/gestureRecorder.js +0 -1
- package/dist/recorder/gestureRecorder.js.map +0 -1
- package/dist/recorder/index.js +0 -1
- package/dist/recorder/index.js.map +0 -1
- package/dist/recorder/navigationTracker.js +0 -1
- package/dist/recorder/navigationTracker.js.map +0 -1
- package/dist/recorder/screenRecorder.js +0 -1
- package/dist/recorder/screenRecorder.js.map +0 -1
- package/dist/services/api.service.js +0 -1
- package/dist/services/api.service.js.map +0 -1
- package/dist/services/network.service.js +0 -1
- package/dist/services/network.service.js.map +0 -1
- package/dist/services/screenMaskingService.js +0 -1
- package/dist/services/screenMaskingService.js.map +0 -1
- package/dist/services/storage.service.js +0 -1
- package/dist/services/storage.service.js.map +0 -1
- package/dist/session-recorder.js +0 -1
- package/dist/session-recorder.js.map +0 -1
- package/dist/types/configs.js +0 -1
- package/dist/types/configs.js.map +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/session-recorder.js +0 -1
- package/dist/types/session-recorder.js.map +0 -1
- package/dist/types/session.js +0 -1
- package/dist/types/session.js.map +0 -1
- package/dist/utils/app-metadata.js +0 -1
- package/dist/utils/app-metadata.js.map +0 -1
- package/dist/utils/constants.optional.expo.js +0 -1
- package/dist/utils/constants.optional.expo.js.map +0 -1
- package/dist/utils/constants.optional.js +0 -1
- package/dist/utils/constants.optional.js.map +0 -1
- package/dist/utils/createStore.js +0 -1
- package/dist/utils/createStore.js.map +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.js +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/platform.js +0 -1
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/request-utils.js +0 -1
- package/dist/utils/request-utils.js.map +0 -1
- package/dist/utils/rrweb-events.js +0 -1
- package/dist/utils/rrweb-events.js.map +0 -1
- package/dist/utils/session.js +0 -1
- package/dist/utils/session.js.map +0 -1
- package/dist/utils/shallowEqual.js +0 -1
- package/dist/utils/shallowEqual.js.map +0 -1
- package/dist/utils/time.js +0 -1
- package/dist/utils/time.js.map +0 -1
- package/dist/utils/type-utils.js +0 -1
- package/dist/utils/type-utils.js.map +0 -1
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -1
- package/dist/version.js.map +0 -1
- package/docs/AUTO_METADATA_DETECTION.md +0 -108
- /package/{dist/components/ScreenRecorderView/index.d.ts → src/components/ScreenRecorderView/index.ts} +0 -0
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { SessionType } from '@multiplayer-app/session-recorder-common';
|
|
4
|
+
import { Observable } from 'lib0/observable';
|
|
5
|
+
import { TracerReactNativeSDK } from "./otel/index.js";
|
|
6
|
+
import { RecorderReactNativeSDK } from "./recorder/index.js";
|
|
7
|
+
import { logger } from "./utils/index.js";
|
|
8
|
+
import { SessionState } from "./types/index.js";
|
|
9
|
+
import { getFormattedDate, isSessionActive, getNavigatorInfo } from "./utils/index.js";
|
|
10
|
+
import { setMaxCapturingHttpPayloadSize, setShouldRecordHttpData } from "./patch/xhr.js";
|
|
11
|
+
import { BASE_CONFIG, getSessionRecorderConfig } from "./config/index.js";
|
|
12
|
+
import { StorageService } from "./services/storage.service.js";
|
|
13
|
+
import { NetworkService } from "./services/network.service.js";
|
|
14
|
+
import { ApiService } from "./services/api.service.js";
|
|
15
|
+
class SessionRecorder extends Observable {
|
|
16
|
+
_apiService = new ApiService();
|
|
17
|
+
_tracer = new TracerReactNativeSDK();
|
|
18
|
+
_recorder = new RecorderReactNativeSDK();
|
|
19
|
+
_storageService = StorageService.getInstance();
|
|
20
|
+
_networkService = NetworkService.getInstance();
|
|
21
|
+
_startRequestController = null;
|
|
22
|
+
|
|
23
|
+
// Whether the session recorder is initialized
|
|
24
|
+
_isInitialized = false;
|
|
25
|
+
get isInitialized() {
|
|
26
|
+
return this._isInitialized;
|
|
27
|
+
}
|
|
28
|
+
set isInitialized(isInitialized) {
|
|
29
|
+
this._isInitialized = isInitialized;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Session ID and state are stored in AsyncStorage
|
|
33
|
+
_sessionId = null;
|
|
34
|
+
get sessionId() {
|
|
35
|
+
return this._sessionId;
|
|
36
|
+
}
|
|
37
|
+
set sessionId(sessionId) {
|
|
38
|
+
this._sessionId = sessionId;
|
|
39
|
+
if (sessionId) {
|
|
40
|
+
this._storageService.saveSessionId(sessionId);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
_sessionType = SessionType.PLAIN;
|
|
44
|
+
get sessionType() {
|
|
45
|
+
return this._sessionType;
|
|
46
|
+
}
|
|
47
|
+
set sessionType(sessionType) {
|
|
48
|
+
this._sessionType = sessionType;
|
|
49
|
+
this._storageService.saveSessionType(sessionType);
|
|
50
|
+
}
|
|
51
|
+
get continuousRecording() {
|
|
52
|
+
return this.sessionType === SessionType.CONTINUOUS;
|
|
53
|
+
}
|
|
54
|
+
_sessionState = null;
|
|
55
|
+
get sessionState() {
|
|
56
|
+
return this._sessionState || SessionState.stopped;
|
|
57
|
+
}
|
|
58
|
+
set sessionState(state) {
|
|
59
|
+
this._sessionState = state;
|
|
60
|
+
this.emit('state-change', [state || SessionState.stopped, this.sessionType]);
|
|
61
|
+
if (state) {
|
|
62
|
+
this._storageService.saveSessionState(state);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
_session = null;
|
|
66
|
+
get session() {
|
|
67
|
+
return this._session;
|
|
68
|
+
}
|
|
69
|
+
set session(session) {
|
|
70
|
+
this._session = session;
|
|
71
|
+
if (session) {
|
|
72
|
+
this._storageService.saveSessionObject(session);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
_sessionAttributes = null;
|
|
76
|
+
get sessionAttributes() {
|
|
77
|
+
return this._sessionAttributes || {};
|
|
78
|
+
}
|
|
79
|
+
set sessionAttributes(attributes) {
|
|
80
|
+
this._sessionAttributes = attributes;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Error message getter and setter
|
|
85
|
+
*/
|
|
86
|
+
get error() {
|
|
87
|
+
return this._error || '';
|
|
88
|
+
}
|
|
89
|
+
set error(v) {
|
|
90
|
+
this._error = v;
|
|
91
|
+
}
|
|
92
|
+
_error = '';
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* React Native doesn't have HTML elements, so we return null
|
|
96
|
+
*/
|
|
97
|
+
get sessionWidgetButtonElement() {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
get config() {
|
|
101
|
+
return this._configs;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Initialize debugger with default or custom configurations
|
|
105
|
+
*/
|
|
106
|
+
constructor() {
|
|
107
|
+
super();
|
|
108
|
+
this._configs = BASE_CONFIG;
|
|
109
|
+
// Initialize with stored session data if available
|
|
110
|
+
StorageService.initialize();
|
|
111
|
+
}
|
|
112
|
+
async _loadStoredSessionData() {
|
|
113
|
+
try {
|
|
114
|
+
await StorageService.initialize();
|
|
115
|
+
const storedData = await this._storageService.getAllSessionData();
|
|
116
|
+
if (isSessionActive(storedData.sessionObject, storedData.sessionType)) {
|
|
117
|
+
this.session = storedData.sessionObject;
|
|
118
|
+
this.sessionId = storedData.sessionId;
|
|
119
|
+
this.sessionType = storedData.sessionType || SessionType.PLAIN;
|
|
120
|
+
this.sessionState = storedData.sessionState;
|
|
121
|
+
} else {
|
|
122
|
+
this.session = null;
|
|
123
|
+
this.sessionId = null;
|
|
124
|
+
this.sessionState = null;
|
|
125
|
+
this.sessionType = SessionType.PLAIN;
|
|
126
|
+
}
|
|
127
|
+
} catch (error) {
|
|
128
|
+
logger.error('SessionRecorder', 'Failed to load stored session data', error);
|
|
129
|
+
this.session = null;
|
|
130
|
+
this.sessionId = null;
|
|
131
|
+
this.sessionState = null;
|
|
132
|
+
this.sessionType = SessionType.PLAIN;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Initialize the session debugger
|
|
138
|
+
* @param configs - custom configurations for session debugger
|
|
139
|
+
*/
|
|
140
|
+
async init(configs) {
|
|
141
|
+
if (this._isInitialized) return;
|
|
142
|
+
this._isInitialized = true;
|
|
143
|
+
this._configs = getSessionRecorderConfig({
|
|
144
|
+
...this._configs,
|
|
145
|
+
...configs
|
|
146
|
+
});
|
|
147
|
+
logger.configure(this._configs.logger);
|
|
148
|
+
await this._loadStoredSessionData();
|
|
149
|
+
setMaxCapturingHttpPayloadSize(this._configs.maxCapturingHttpPayloadSize);
|
|
150
|
+
setShouldRecordHttpData(!this._configs.captureBody, this._configs.captureHeaders);
|
|
151
|
+
this._tracer.init(this._configs);
|
|
152
|
+
this._recorder.init(this._configs);
|
|
153
|
+
this._apiService.init(this._configs);
|
|
154
|
+
await this._networkService.init();
|
|
155
|
+
this._setupNetworkCallbacks();
|
|
156
|
+
if (this.sessionId && (this.sessionState === SessionState.started || this.sessionState === SessionState.paused)) {
|
|
157
|
+
this._start();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Setup network state change callbacks
|
|
163
|
+
*/
|
|
164
|
+
_setupNetworkCallbacks() {
|
|
165
|
+
this._networkService.addCallback(state => {
|
|
166
|
+
if (!state.isConnected && this.sessionState === SessionState.started) {
|
|
167
|
+
logger.info('SessionRecorder', 'Network went offline - pausing session recording');
|
|
168
|
+
this.pause();
|
|
169
|
+
} else if (state.isConnected && this.sessionState === SessionState.paused) {
|
|
170
|
+
logger.info('SessionRecorder', 'Network came back online - resuming session recording');
|
|
171
|
+
this.resume();
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Start a new session
|
|
178
|
+
* @param type - the type of session to start
|
|
179
|
+
* @param session - the session to start
|
|
180
|
+
*/
|
|
181
|
+
async start(type = SessionType.PLAIN, session) {
|
|
182
|
+
this._checkOperation('start');
|
|
183
|
+
|
|
184
|
+
// Check if offline - don't start recording if offline
|
|
185
|
+
if (!this._networkService.isOnline()) {
|
|
186
|
+
logger.warn('SessionRecorder', 'Cannot start session recording - device is offline');
|
|
187
|
+
throw new Error('Cannot start session recording while offline');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// If continuous recording is disabled, force plain mode
|
|
191
|
+
if (type === SessionType.CONTINUOUS && !this._configs?.showContinuousRecording) {
|
|
192
|
+
type = SessionType.PLAIN;
|
|
193
|
+
}
|
|
194
|
+
logger.info('SessionRecorder', 'Starting session with type:', type);
|
|
195
|
+
this.sessionType = type;
|
|
196
|
+
this._startRequestController = new AbortController();
|
|
197
|
+
if (session) {
|
|
198
|
+
this._setupSessionAndStart(session, true);
|
|
199
|
+
} else {
|
|
200
|
+
await this._createSessionAndStart();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Stop the current session with an optional comment
|
|
206
|
+
* @param comment - user-provided comment to include in session session attributes
|
|
207
|
+
*/
|
|
208
|
+
async stop(comment) {
|
|
209
|
+
try {
|
|
210
|
+
this._checkOperation('stop');
|
|
211
|
+
this._stop();
|
|
212
|
+
if (this.continuousRecording) {
|
|
213
|
+
await this._apiService.stopContinuousDebugSession(this.sessionId);
|
|
214
|
+
this.sessionType = SessionType.PLAIN;
|
|
215
|
+
} else {
|
|
216
|
+
const request = {
|
|
217
|
+
sessionAttributes: {
|
|
218
|
+
comment
|
|
219
|
+
},
|
|
220
|
+
stoppedAt: Date.now()
|
|
221
|
+
};
|
|
222
|
+
await this._apiService.stopSession(this.sessionId, request);
|
|
223
|
+
}
|
|
224
|
+
this._clearSession();
|
|
225
|
+
} catch (error) {
|
|
226
|
+
this.error = error.message;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Pause the current session
|
|
232
|
+
*/
|
|
233
|
+
async pause() {
|
|
234
|
+
try {
|
|
235
|
+
this._checkOperation('pause');
|
|
236
|
+
this._pause();
|
|
237
|
+
} catch (error) {
|
|
238
|
+
this.error = error.message;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Resume the current session
|
|
244
|
+
*/
|
|
245
|
+
async resume() {
|
|
246
|
+
try {
|
|
247
|
+
this._checkOperation('resume');
|
|
248
|
+
this._resume();
|
|
249
|
+
} catch (error) {
|
|
250
|
+
this.error = error.message;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Cancel the current session
|
|
256
|
+
*/
|
|
257
|
+
async cancel() {
|
|
258
|
+
try {
|
|
259
|
+
this._checkOperation('cancel');
|
|
260
|
+
this._stop();
|
|
261
|
+
if (this.continuousRecording) {
|
|
262
|
+
await this._apiService.stopContinuousDebugSession(this.sessionId);
|
|
263
|
+
this.sessionType = SessionType.PLAIN;
|
|
264
|
+
} else {
|
|
265
|
+
await this._apiService.cancelSession(this.sessionId);
|
|
266
|
+
}
|
|
267
|
+
this._clearSession();
|
|
268
|
+
} catch (error) {
|
|
269
|
+
this.error = error.message;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Save the continuous recording session
|
|
275
|
+
*/
|
|
276
|
+
async save() {
|
|
277
|
+
try {
|
|
278
|
+
this._checkOperation('save');
|
|
279
|
+
if (!this.continuousRecording || !this._configs?.showContinuousRecording) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const res = await this._apiService.saveContinuousDebugSession(this.sessionId, {
|
|
283
|
+
sessionAttributes: this.sessionAttributes,
|
|
284
|
+
resourceAttributes: getNavigatorInfo(),
|
|
285
|
+
stoppedAt: Date.now(),
|
|
286
|
+
name: this.sessionAttributes.userName ? `${this.sessionAttributes.userName}'s session on ${getFormattedDate(Date.now(), {
|
|
287
|
+
month: 'short',
|
|
288
|
+
day: 'numeric'
|
|
289
|
+
})}` : `Session on ${getFormattedDate(Date.now())}`
|
|
290
|
+
});
|
|
291
|
+
return res;
|
|
292
|
+
} catch (error) {
|
|
293
|
+
this.error = error.message;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Set the session attributes
|
|
299
|
+
* @param attributes - the attributes to set
|
|
300
|
+
*/
|
|
301
|
+
setSessionAttributes(attributes) {
|
|
302
|
+
this._sessionAttributes = attributes;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @description Check if session should be started/stopped automatically
|
|
307
|
+
* @param {ISession} [sessionPayload]
|
|
308
|
+
* @returns {Promise<void>}
|
|
309
|
+
*/
|
|
310
|
+
async checkRemoteContinuousSession(sessionPayload) {
|
|
311
|
+
this._checkOperation('autoStartRemoteContinuousSession');
|
|
312
|
+
if (!this._configs?.showContinuousRecording) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
const payload = {
|
|
316
|
+
sessionAttributes: {
|
|
317
|
+
...this.sessionAttributes,
|
|
318
|
+
...(sessionPayload?.sessionAttributes || {})
|
|
319
|
+
},
|
|
320
|
+
resourceAttributes: {
|
|
321
|
+
...getNavigatorInfo(),
|
|
322
|
+
...(sessionPayload?.resourceAttributes || {})
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
const {
|
|
326
|
+
state
|
|
327
|
+
} = await this._apiService.checkRemoteSession(payload);
|
|
328
|
+
if (state == 'START') {
|
|
329
|
+
if (this.sessionState !== SessionState.started) {
|
|
330
|
+
await this.start(SessionType.CONTINUOUS);
|
|
331
|
+
}
|
|
332
|
+
} else if (state == 'STOP') {
|
|
333
|
+
if (this.sessionState !== SessionState.stopped) {
|
|
334
|
+
await this.stop();
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Create a new session and start it
|
|
341
|
+
*/
|
|
342
|
+
async _createSessionAndStart() {
|
|
343
|
+
const signal = this._startRequestController?.signal;
|
|
344
|
+
try {
|
|
345
|
+
const payload = {
|
|
346
|
+
sessionAttributes: this.sessionAttributes,
|
|
347
|
+
resourceAttributes: getNavigatorInfo(),
|
|
348
|
+
name: this.sessionAttributes.userName ? `${this.sessionAttributes.userName}'s session on ${getFormattedDate(Date.now(), {
|
|
349
|
+
month: 'short',
|
|
350
|
+
day: 'numeric'
|
|
351
|
+
})}` : `Session on ${getFormattedDate(Date.now())}`
|
|
352
|
+
};
|
|
353
|
+
const request = !this.continuousRecording ? payload : {
|
|
354
|
+
debugSessionData: payload
|
|
355
|
+
};
|
|
356
|
+
const session = this.continuousRecording ? await this._apiService.startContinuousDebugSession(request, signal) : await this._apiService.startSession(request, signal);
|
|
357
|
+
if (session) {
|
|
358
|
+
session.sessionType = this.continuousRecording ? SessionType.CONTINUOUS : SessionType.PLAIN;
|
|
359
|
+
this._setupSessionAndStart(session, false);
|
|
360
|
+
}
|
|
361
|
+
} catch (error) {
|
|
362
|
+
this.error = error.message;
|
|
363
|
+
logger.error('SessionRecorder', 'Error creating session:', error.message);
|
|
364
|
+
if (this.continuousRecording) {
|
|
365
|
+
this.sessionType = SessionType.PLAIN;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Start tracing and recording for the session
|
|
372
|
+
*/
|
|
373
|
+
_start() {
|
|
374
|
+
this.sessionState = SessionState.started;
|
|
375
|
+
this.sessionType = this.sessionType;
|
|
376
|
+
if (this.sessionId) {
|
|
377
|
+
this._tracer.start(this.sessionId, this.sessionType);
|
|
378
|
+
this._recorder.start(this.sessionId, this.sessionType);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Stop tracing and recording for the session
|
|
384
|
+
*/
|
|
385
|
+
_stop() {
|
|
386
|
+
this.sessionState = SessionState.stopped;
|
|
387
|
+
this._tracer.shutdown();
|
|
388
|
+
this._recorder.stop();
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Pause the session tracing and recording
|
|
393
|
+
*/
|
|
394
|
+
_pause() {
|
|
395
|
+
this._tracer.shutdown();
|
|
396
|
+
this._recorder.stop();
|
|
397
|
+
this.sessionState = SessionState.paused;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Resume the session tracing and recording
|
|
402
|
+
*/
|
|
403
|
+
_resume() {
|
|
404
|
+
if (this.sessionId) {
|
|
405
|
+
this._tracer.setSessionId(this.sessionId, this.sessionType);
|
|
406
|
+
this._recorder.start(this.sessionId, this.sessionType);
|
|
407
|
+
}
|
|
408
|
+
this.sessionState = SessionState.started;
|
|
409
|
+
}
|
|
410
|
+
_setupSessionAndStart(session, configureExporters = true) {
|
|
411
|
+
if (configureExporters && session.tempApiKey) {
|
|
412
|
+
this._configs.apiKey = session.tempApiKey;
|
|
413
|
+
this._tracer.setApiKey(session.tempApiKey);
|
|
414
|
+
this._recorder.setApiKey(session.tempApiKey);
|
|
415
|
+
this._apiService.setApiKey(session.tempApiKey);
|
|
416
|
+
}
|
|
417
|
+
this._setSession(session);
|
|
418
|
+
this._start();
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Set the session ID in storage
|
|
423
|
+
* @param sessionId - the session ID to set or clear
|
|
424
|
+
*/
|
|
425
|
+
_setSession(session) {
|
|
426
|
+
this.session = {
|
|
427
|
+
...session,
|
|
428
|
+
createdAt: session.createdAt || new Date().toISOString()
|
|
429
|
+
};
|
|
430
|
+
this.sessionId = session?.shortId || session?._id;
|
|
431
|
+
}
|
|
432
|
+
_clearSession() {
|
|
433
|
+
this.session = null;
|
|
434
|
+
this.sessionId = null;
|
|
435
|
+
this.sessionState = SessionState.stopped;
|
|
436
|
+
this._storageService.clearSessionData();
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Check the operation validity based on the session state and action
|
|
441
|
+
* @param action - action being checked ('init', 'start', 'stop', 'cancel', 'pause', 'resume')
|
|
442
|
+
*/
|
|
443
|
+
_checkOperation(action, _payload) {
|
|
444
|
+
if (!this._isInitialized) {
|
|
445
|
+
throw new Error('Configuration not initialized. Call init() before performing any actions.');
|
|
446
|
+
}
|
|
447
|
+
switch (action) {
|
|
448
|
+
case 'start':
|
|
449
|
+
if (this.sessionState === SessionState.started) {
|
|
450
|
+
throw new Error('Session is already started.');
|
|
451
|
+
}
|
|
452
|
+
break;
|
|
453
|
+
case 'stop':
|
|
454
|
+
if (this.sessionState !== SessionState.paused && this.sessionState !== SessionState.started) {
|
|
455
|
+
throw new Error('Cannot stop. Session is not currently started.');
|
|
456
|
+
}
|
|
457
|
+
break;
|
|
458
|
+
case 'cancel':
|
|
459
|
+
if (this.sessionState === SessionState.stopped) {
|
|
460
|
+
throw new Error('Cannot cancel. Session has already been stopped.');
|
|
461
|
+
}
|
|
462
|
+
break;
|
|
463
|
+
case 'pause':
|
|
464
|
+
if (this.sessionState !== SessionState.started) {
|
|
465
|
+
throw new Error('Cannot pause. Session is not running.');
|
|
466
|
+
}
|
|
467
|
+
break;
|
|
468
|
+
case 'resume':
|
|
469
|
+
if (this.sessionState !== SessionState.paused) {
|
|
470
|
+
throw new Error('Cannot resume. Session is not paused.');
|
|
471
|
+
}
|
|
472
|
+
break;
|
|
473
|
+
case 'save':
|
|
474
|
+
if (!this.continuousRecording) {
|
|
475
|
+
throw new Error('Cannot save continuous recording session. Continuous recording is not enabled.');
|
|
476
|
+
}
|
|
477
|
+
if (this.sessionState !== SessionState.started) {
|
|
478
|
+
throw new Error('Cannot save continuous recording session. Session is not started.');
|
|
479
|
+
}
|
|
480
|
+
break;
|
|
481
|
+
case 'autoStartRemoteContinuousSession':
|
|
482
|
+
if (this.sessionState !== SessionState.stopped) {
|
|
483
|
+
throw new Error('Cannot start remote continuous session. Session is not stopped.');
|
|
484
|
+
}
|
|
485
|
+
break;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
// Session attributes
|
|
489
|
+
setSessionAttribute(key, value) {
|
|
490
|
+
if (this._session) {
|
|
491
|
+
if (!this._session.sessionAttributes) {
|
|
492
|
+
this._session.sessionAttributes = {};
|
|
493
|
+
}
|
|
494
|
+
this._session.sessionAttributes[key] = value;
|
|
495
|
+
this._session.updatedAt = new Date().toISOString();
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Record a custom rrweb event
|
|
501
|
+
* Note: Screen capture and touch events are recorded automatically when session is started
|
|
502
|
+
* @param event - The rrweb event to record
|
|
503
|
+
*/
|
|
504
|
+
recordEvent(event) {
|
|
505
|
+
if (!this._isInitialized || this.sessionState !== SessionState.started) {
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
// Forward the event to the recorder SDK
|
|
510
|
+
this._recorder.recordEvent(event);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Set the viewshot ref for screen capture
|
|
515
|
+
* @param ref - React Native View ref for screen capture
|
|
516
|
+
*/
|
|
517
|
+
setViewShotRef(ref) {
|
|
518
|
+
if (this._recorder) {
|
|
519
|
+
this._recorder.setViewShotRef(ref);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Set the navigation ref for navigation tracking
|
|
525
|
+
* @param ref - React Native Navigation ref for navigation tracking
|
|
526
|
+
*/
|
|
527
|
+
setNavigationRef(ref) {
|
|
528
|
+
if (this._recorder) {
|
|
529
|
+
this._recorder.setNavigationRef(ref);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Cleanup resources and unsubscribe from network monitoring
|
|
535
|
+
*/
|
|
536
|
+
cleanup() {
|
|
537
|
+
this._networkService.cleanup();
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
export default new SessionRecorder();
|
|
541
|
+
//# sourceMappingURL=session-recorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SessionType","Observable","TracerReactNativeSDK","RecorderReactNativeSDK","logger","SessionState","getFormattedDate","isSessionActive","getNavigatorInfo","setMaxCapturingHttpPayloadSize","setShouldRecordHttpData","BASE_CONFIG","getSessionRecorderConfig","StorageService","NetworkService","ApiService","SessionRecorder","_apiService","_tracer","_recorder","_storageService","getInstance","_networkService","_startRequestController","_isInitialized","isInitialized","_sessionId","sessionId","saveSessionId","_sessionType","PLAIN","sessionType","saveSessionType","continuousRecording","CONTINUOUS","_sessionState","sessionState","stopped","state","emit","saveSessionState","_session","session","saveSessionObject","_sessionAttributes","sessionAttributes","attributes","error","_error","v","sessionWidgetButtonElement","config","_configs","constructor","initialize","_loadStoredSessionData","storedData","getAllSessionData","sessionObject","init","configs","configure","maxCapturingHttpPayloadSize","captureBody","captureHeaders","_setupNetworkCallbacks","started","paused","_start","addCallback","isConnected","info","pause","resume","start","type","_checkOperation","isOnline","warn","Error","showContinuousRecording","AbortController","_setupSessionAndStart","_createSessionAndStart","stop","comment","_stop","stopContinuousDebugSession","request","stoppedAt","Date","now","stopSession","_clearSession","message","_pause","_resume","cancel","cancelSession","save","res","saveContinuousDebugSession","resourceAttributes","name","userName","month","day","setSessionAttributes","checkRemoteContinuousSession","sessionPayload","payload","checkRemoteSession","signal","debugSessionData","startContinuousDebugSession","startSession","shutdown","setSessionId","configureExporters","tempApiKey","apiKey","setApiKey","_setSession","createdAt","toISOString","shortId","_id","clearSessionData","action","_payload","setSessionAttribute","key","value","updatedAt","recordEvent","event","setViewShotRef","ref","setNavigationRef","cleanup"],"sourceRoot":"../../src","sources":["session-recorder.ts"],"mappings":";;AACA,SAASA,WAAW,QAAQ,0CAA0C;AACtE,SAASC,UAAU,QAAQ,iBAAiB;AAG5C,SAASC,oBAAoB,QAAQ,iBAAQ;AAC7C,SAASC,sBAAsB,QAAQ,qBAAY;AACnD,SAASC,MAAM,QAAQ,kBAAS;AAEhC,SACEC,YAAY,QAMP,kBAAS;AAChB,SAASC,gBAAgB,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,kBAAS;AAC7E,SAASC,8BAA8B,EAAEC,uBAAuB,QAAQ,gBAAa;AACrF,SAASC,WAAW,EAAEC,wBAAwB,QAAQ,mBAAU;AAEhE,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,UAAU,QAA2D,2BAAwB;AAKtG,MAAMC,eAAe,SAASf,UAAU,CAAmE;EAGjGgB,WAAW,GAAG,IAAIF,UAAU,CAAC,CAAC;EAC9BG,OAAO,GAAG,IAAIhB,oBAAoB,CAAC,CAAC;EACpCiB,SAAS,GAAG,IAAIhB,sBAAsB,CAAC,CAAC;EACxCiB,eAAe,GAAGP,cAAc,CAACQ,WAAW,CAAC,CAAC;EAC9CC,eAAe,GAAGR,cAAc,CAACO,WAAW,CAAC,CAAC;EAC9CE,uBAAuB,GAA2B,IAAI;;EAE9D;EACQC,cAAc,GAAG,KAAK;EAC9B,IAAIC,aAAaA,CAAA,EAAY;IAC3B,OAAO,IAAI,CAACD,cAAc;EAC5B;EACA,IAAIC,aAAaA,CAACA,aAAsB,EAAE;IACxC,IAAI,CAACD,cAAc,GAAGC,aAAa;EACrC;;EAEA;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;IAC/B,IAAI,IAAI,CAACtH,SAAS,EAAE;MAClB,IAAI,CAACA,SAAS,CAACuH,gBAAgB,CAACD,GAAG,CAAC;IACtC;EACF;;EAEA;AACF;AACA;EACEE,OAAOA,CAAA,EAAS;IACd,IAAI,CAACrH,eAAe,CAACqH,OAAO,CAAC,CAAC;EAChC;AACF;AAEA,eAAe,IAAI3H,eAAe,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/configs.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/expo-constants.d.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;AAAA,cAAc,uBAAoB;AAClC,cAAc,cAAW;AACzB,cAAc,cAAW;;AAEzB;;AAqBA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// WidgetButtonPlacement moved to configs.ts
|
|
4
|
+
|
|
5
|
+
export let SessionState = /*#__PURE__*/function (SessionState) {
|
|
6
|
+
SessionState["started"] = "2";
|
|
7
|
+
SessionState["paused"] = "1";
|
|
8
|
+
SessionState["stopped"] = "0";
|
|
9
|
+
return SessionState;
|
|
10
|
+
}({});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Enumeration for widget button placement positions
|
|
14
|
+
*/
|
|
15
|
+
export let WidgetButtonPlacement = /*#__PURE__*/function (WidgetButtonPlacement) {
|
|
16
|
+
WidgetButtonPlacement["topLeft"] = "top-left";
|
|
17
|
+
WidgetButtonPlacement["topRight"] = "top-right";
|
|
18
|
+
WidgetButtonPlacement["bottomLeft"] = "bottom-left";
|
|
19
|
+
WidgetButtonPlacement["bottomRight"] = "bottom-right";
|
|
20
|
+
return WidgetButtonPlacement;
|
|
21
|
+
}({});
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Enumeration for log levels
|
|
25
|
+
*/
|
|
26
|
+
export let LogLevel = /*#__PURE__*/function (LogLevel) {
|
|
27
|
+
LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
|
|
28
|
+
LogLevel[LogLevel["INFO"] = 1] = "INFO";
|
|
29
|
+
LogLevel[LogLevel["WARN"] = 2] = "WARN";
|
|
30
|
+
LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
|
|
31
|
+
return LogLevel;
|
|
32
|
+
}({});
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Main configuration interface for the Session Recorder
|
|
36
|
+
* Contains all configurable options for session recording, tracing, and UI
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Interface for customizable widget text configuration
|
|
41
|
+
* Allows overriding default text labels and messages in the UI
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Interface for masking configuration options
|
|
46
|
+
* Controls what data is masked in both traces and screen recordings
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Main interface for the Session Recorder
|
|
51
|
+
* Defines the public API for session recording functionality
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Interface representing screen capture events
|
|
56
|
+
* Contains metadata about screen recordings
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Interface representing gesture/touch events
|
|
61
|
+
* Contains information about user interactions with the screen
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Interface representing navigation events
|
|
66
|
+
* Contains information about screen/route changes
|
|
67
|
+
*/
|
|
68
|
+
//# sourceMappingURL=session-recorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SessionState","WidgetButtonPlacement","LogLevel"],"sourceRoot":"../../../src","sources":["types/session-recorder.ts"],"mappings":";;AAMA;;AAEA,WAAYA,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;;AAMxB;AACA;AACA;AACA,WAAYC,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;;AAOjC;AACA;AACA;AACA,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;;AAOpB;AACA;AACA;AACA;;AA4HA;AACA;AACA;AACA;;AA4CA;AACA;AACA;AACA;;AAkCA;AACA;AACA;AACA;;AA4FA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export let DebugSessionDataType = /*#__PURE__*/function (DebugSessionDataType) {
|
|
4
|
+
DebugSessionDataType["OTLP_TRACES"] = "OTLP_TRACES";
|
|
5
|
+
DebugSessionDataType["OTLP_LOGS"] = "OTLP_LOGS";
|
|
6
|
+
DebugSessionDataType["RRWEB_EVENTS"] = "RRWEB_EVENTS";
|
|
7
|
+
return DebugSessionDataType;
|
|
8
|
+
}({});
|
|
9
|
+
//# sourceMappingURL=session.js.map
|