@multiplayer-app/session-recorder-react-native 1.0.1-beta.1 → 1.0.1-beta.11
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 +296 -156
- package/SessionRecorderNative.podspec +35 -14
- package/android/build.gradle +50 -54
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativeConfig.kt +52 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativeModule.kt +861 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativePackage.kt +33 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativeSpec.kt +79 -0
- package/android/src/main/java/com/sessionrecordernative/model/TargetInfo.kt +9 -0
- package/android/src/main/java/com/sessionrecordernative/util/ViewUtils.kt +72 -0
- package/ios/GestureTargetFinder.swift +50 -0
- package/ios/SessionRecorderNative-Bridging-Header.h +2 -0
- package/ios/{GestureRecorderNative.m → SessionRecorderNative.mm} +17 -6
- package/ios/SessionRecorderNative.swift +256 -4
- package/lib/module/SessionRecorderNativeSpec.js +5 -0
- package/lib/module/SessionRecorderNativeSpec.js.map +1 -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 +16 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native/SessionRecorderNative.js +79 -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 +185 -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/{dist/native/SessionRecorderNativeTurboSpec.d.ts → lib/typescript/src/SessionRecorderNativeSpec.d.ts} +14 -6
- package/lib/typescript/src/SessionRecorderNativeSpec.d.ts.map +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/lib/typescript/src/components/index.d.ts +3 -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 +4 -3
- 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 +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/native/SessionRecorderNative.d.ts +27 -0
- package/lib/typescript/src/native/SessionRecorderNative.d.ts.map +1 -0
- package/lib/typescript/src/native/index.d.ts +2 -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 +7 -6
- 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/lib/typescript/src/utils/index.d.ts +8 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/logger.d.ts +2 -1
- 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 +154 -37
- package/react-native.config.js +14 -0
- package/src/SessionRecorderNativeSpec.ts +33 -0
- package/src/components/ScreenRecorderView/ScreenRecorderView.tsx +20 -0
- package/src/components/ScreenRecorderView/index.ts +1 -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 +26 -0
- package/src/components/SessionRecorderWidget/SessionRecorderWidget.tsx +150 -0
- package/src/components/SessionRecorderWidget/icons.tsx +80 -0
- package/src/components/SessionRecorderWidget/index.ts +3 -0
- package/src/components/SessionRecorderWidget/styles.ts +168 -0
- package/src/config/constants.ts +67 -0
- package/src/config/defaults.ts +105 -0
- package/src/config/index.ts +6 -0
- package/src/config/masking.ts +60 -0
- package/src/config/session-recorder.ts +87 -0
- package/src/config/validators.ts +54 -0
- package/src/config/widget.ts +47 -0
- package/src/context/SessionRecorderContext.tsx +138 -0
- package/src/context/SessionRecorderStore.ts +22 -0
- package/src/context/useSessionRecorderStore.ts +34 -0
- package/src/context/useStoreSelector.ts +36 -0
- package/src/index.ts +13 -0
- package/src/native/SessionRecorderNative.ts +120 -0
- package/src/native/index.ts +5 -0
- package/src/otel/helpers.ts +290 -0
- package/src/otel/index.ts +132 -0
- package/src/otel/instrumentations/index.ts +118 -0
- package/src/patch/xhr.ts +148 -0
- package/src/recorder/eventExporter.ts +150 -0
- package/src/recorder/gestureRecorder.ts +828 -0
- package/src/recorder/index.ts +203 -0
- package/src/recorder/navigationTracker.ts +268 -0
- package/src/recorder/screenRecorder.ts +600 -0
- package/src/services/api.service.ts +216 -0
- package/src/services/network.service.ts +191 -0
- package/src/services/screenMaskingService.ts +153 -0
- package/src/services/storage.service.ts +248 -0
- package/src/session-recorder.ts +647 -0
- package/src/types/configs.ts +118 -0
- package/src/types/expo-constants.d.ts +7 -0
- package/src/types/index.ts +27 -0
- package/src/types/session-recorder.ts +381 -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 +18 -0
- package/src/utils/createStore.ts +32 -0
- package/{dist/utils/index.d.ts → src/utils/index.ts} +1 -0
- package/src/utils/logger.ts +245 -0
- package/src/utils/platform.ts +401 -0
- package/src/utils/request-utils.ts +61 -0
- package/src/utils/rrweb-events.ts +329 -0
- package/src/utils/session.ts +22 -0
- package/src/utils/shallowEqual.ts +20 -0
- package/src/utils/time.ts +20 -0
- package/src/utils/type-utils.ts +75 -0
- package/src/version.ts +1 -0
- 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.d.ts +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.d.ts +0 -2
- 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.d.ts +0 -33
- package/dist/native/SessionRecorderNative.js +0 -1
- package/dist/native/SessionRecorderNative.js.map +0 -1
- package/dist/native/SessionRecorderNativeTurboSpec.js +0 -1
- package/dist/native/SessionRecorderNativeTurboSpec.js.map +0 -1
- package/dist/native/index.d.ts +0 -2
- 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.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/ios/GestureRecorderNative.swift +0 -316
- package/ios/SessionRecorderNative.m +0 -17
- package/ios/SessionRecorderNative.podspec +0 -26
- package/turbo.json +0 -41
- /package/{dist/components/index.d.ts → src/components/index.ts} +0 -0
- /package/{dist/patch/index.d.ts → src/patch/index.ts} +0 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type IResourceAttributes,
|
|
3
|
+
type ISessionAttributes,
|
|
4
|
+
type ApiServiceConfig,
|
|
5
|
+
} from '../types';
|
|
6
|
+
|
|
7
|
+
export interface StartSessionRequest {
|
|
8
|
+
name?: string;
|
|
9
|
+
stoppedAt?: string | number;
|
|
10
|
+
sessionAttributes?: ISessionAttributes;
|
|
11
|
+
resourceAttributes?: IResourceAttributes;
|
|
12
|
+
debugSessionData?: Record<string, any>;
|
|
13
|
+
tags?: { key?: string; value: string }[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface StopSessionRequest {
|
|
17
|
+
sessionAttributes?: ISessionAttributes;
|
|
18
|
+
stoppedAt: string | number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class ApiService {
|
|
22
|
+
private config?: ApiServiceConfig;
|
|
23
|
+
private baseUrl: string = 'https://api.multiplayer.app';
|
|
24
|
+
|
|
25
|
+
constructor() {
|
|
26
|
+
this.config = {
|
|
27
|
+
apiKey: '',
|
|
28
|
+
apiBaseUrl: '',
|
|
29
|
+
exporterEndpoint: '',
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
init(config: ApiServiceConfig): void {
|
|
34
|
+
this.config = {
|
|
35
|
+
...this.config,
|
|
36
|
+
...config,
|
|
37
|
+
};
|
|
38
|
+
if (config.apiBaseUrl) {
|
|
39
|
+
this.baseUrl = config.apiBaseUrl;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Update the API service configuration
|
|
45
|
+
* @param config - Partial configuration to update
|
|
46
|
+
*/
|
|
47
|
+
public updateConfigs(config: Partial<ApiServiceConfig>) {
|
|
48
|
+
if (this.config) {
|
|
49
|
+
this.config = { ...this.config, ...config };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Set the API key
|
|
55
|
+
* @param apiKey - The API key to set
|
|
56
|
+
*/
|
|
57
|
+
setApiKey(apiKey: string): void {
|
|
58
|
+
if (this.config) {
|
|
59
|
+
this.config.apiKey = apiKey;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Make a request to the session debugger API
|
|
65
|
+
* @param path - API endpoint path (relative to the base URL)
|
|
66
|
+
* @param method - HTTP method (GET, POST, PATCH, etc.)
|
|
67
|
+
* @param body - request payload
|
|
68
|
+
* @param signal - AbortSignal to set request's signal
|
|
69
|
+
*/
|
|
70
|
+
private async makeRequest(
|
|
71
|
+
path: string,
|
|
72
|
+
method: string,
|
|
73
|
+
body?: any,
|
|
74
|
+
signal?: AbortSignal
|
|
75
|
+
): Promise<any> {
|
|
76
|
+
const url = `${this.baseUrl}/v0/radar${path}`;
|
|
77
|
+
const params = {
|
|
78
|
+
method,
|
|
79
|
+
body: body ? JSON.stringify(body) : null,
|
|
80
|
+
headers: {
|
|
81
|
+
'Content-Type': 'application/json',
|
|
82
|
+
...(this.config?.apiKey && { 'X-Api-Key': this.config.apiKey }),
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
const response = await fetch(url, {
|
|
88
|
+
...params,
|
|
89
|
+
signal,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
if (!response.ok) {
|
|
93
|
+
throw new Error('Network response was not ok: ' + response.statusText);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (response.status === 204) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return await response.json();
|
|
101
|
+
} catch (error: any) {
|
|
102
|
+
if (error?.name === 'AbortError') {
|
|
103
|
+
throw new Error('Request aborted');
|
|
104
|
+
}
|
|
105
|
+
throw new Error('Error making request: ' + error.message);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Start a new debug session
|
|
111
|
+
* @param request - Session start request data
|
|
112
|
+
* @param signal - Optional AbortSignal for request cancellation
|
|
113
|
+
*/
|
|
114
|
+
async startSession(
|
|
115
|
+
request: StartSessionRequest,
|
|
116
|
+
signal?: AbortSignal
|
|
117
|
+
): Promise<any> {
|
|
118
|
+
try {
|
|
119
|
+
const res = await this.makeRequest(
|
|
120
|
+
'/debug-sessions/start',
|
|
121
|
+
'POST',
|
|
122
|
+
request,
|
|
123
|
+
signal
|
|
124
|
+
);
|
|
125
|
+
return res;
|
|
126
|
+
} catch (error: any) {
|
|
127
|
+
throw error;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Stop an active debug session
|
|
133
|
+
* @param sessionId - ID of the session to stop
|
|
134
|
+
* @param request - Session stop request data
|
|
135
|
+
*/
|
|
136
|
+
async stopSession(
|
|
137
|
+
sessionId: string,
|
|
138
|
+
request: StopSessionRequest
|
|
139
|
+
): Promise<any> {
|
|
140
|
+
return this.makeRequest(
|
|
141
|
+
`/debug-sessions/${sessionId}/stop`,
|
|
142
|
+
'PATCH',
|
|
143
|
+
request
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Cancel an active debug session
|
|
149
|
+
* @param sessionId - ID of the session to cancel
|
|
150
|
+
*/
|
|
151
|
+
async cancelSession(sessionId: string): Promise<any> {
|
|
152
|
+
return this.makeRequest(`/debug-sessions/${sessionId}/cancel`, 'DELETE');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Start a new continuous debug session
|
|
157
|
+
* @param request - Session start request data
|
|
158
|
+
* @param signal - Optional AbortSignal for request cancellation
|
|
159
|
+
*/
|
|
160
|
+
async startContinuousDebugSession(
|
|
161
|
+
request: StartSessionRequest,
|
|
162
|
+
signal?: AbortSignal
|
|
163
|
+
): Promise<any> {
|
|
164
|
+
return this.makeRequest(
|
|
165
|
+
'/continuous-debug-sessions/start',
|
|
166
|
+
'POST',
|
|
167
|
+
request,
|
|
168
|
+
signal
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Save a continuous debug session
|
|
174
|
+
* @param sessionId - ID of the session to save
|
|
175
|
+
* @param request - Session save request data
|
|
176
|
+
* @param signal - Optional AbortSignal for request cancellation
|
|
177
|
+
*/
|
|
178
|
+
async saveContinuousDebugSession(
|
|
179
|
+
sessionId: string,
|
|
180
|
+
request: StartSessionRequest,
|
|
181
|
+
signal?: AbortSignal
|
|
182
|
+
): Promise<any> {
|
|
183
|
+
return this.makeRequest(
|
|
184
|
+
`/continuous-debug-sessions/${sessionId}/save`,
|
|
185
|
+
'POST',
|
|
186
|
+
request,
|
|
187
|
+
signal
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Stop an active continuous debug session
|
|
193
|
+
* @param sessionId - ID of the session to stop
|
|
194
|
+
*/
|
|
195
|
+
async stopContinuousDebugSession(sessionId: string): Promise<any> {
|
|
196
|
+
return this.makeRequest(
|
|
197
|
+
`/continuous-debug-sessions/${sessionId}/cancel`,
|
|
198
|
+
'DELETE'
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Check debug session should be started remotely
|
|
204
|
+
*/
|
|
205
|
+
async checkRemoteSession(
|
|
206
|
+
requestBody: StartSessionRequest,
|
|
207
|
+
signal?: AbortSignal
|
|
208
|
+
): Promise<{ state: 'START' | 'STOP' }> {
|
|
209
|
+
return this.makeRequest(
|
|
210
|
+
'/remote-debug-session/check',
|
|
211
|
+
'POST',
|
|
212
|
+
requestBody,
|
|
213
|
+
signal
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { logger } from '../utils';
|
|
3
|
+
import { sessionRecorderStore } from '../context/SessionRecorderStore';
|
|
4
|
+
|
|
5
|
+
// Safe import for NetInfo with web fallback
|
|
6
|
+
let NetInfo: any = null;
|
|
7
|
+
const isWeb = Platform.OS === 'web';
|
|
8
|
+
|
|
9
|
+
if (!isWeb) {
|
|
10
|
+
try {
|
|
11
|
+
NetInfo = require('@react-native-community/netinfo').default;
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.warn('NetInfo not available:', error);
|
|
14
|
+
}
|
|
15
|
+
} else {
|
|
16
|
+
// Web fallback using navigator.onLine
|
|
17
|
+
NetInfo = {
|
|
18
|
+
fetch: () =>
|
|
19
|
+
Promise.resolve({
|
|
20
|
+
isConnected: true, // Default to connected for web
|
|
21
|
+
type: 'unknown',
|
|
22
|
+
isInternetReachable: true,
|
|
23
|
+
}),
|
|
24
|
+
addEventListener: (_callback: (state: any) => void) => {
|
|
25
|
+
// Return a no-op function for web
|
|
26
|
+
return () => {};
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface NetworkState {
|
|
32
|
+
isConnected: boolean;
|
|
33
|
+
type: string | null;
|
|
34
|
+
isInternetReachable: boolean | null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type NetworkStateChangeCallback = (state: NetworkState) => void;
|
|
38
|
+
|
|
39
|
+
export class NetworkService {
|
|
40
|
+
private static instance: NetworkService | null = null;
|
|
41
|
+
private _isOnline = true;
|
|
42
|
+
private unsubscribe: (() => void) | null = null;
|
|
43
|
+
private callbacks: NetworkStateChangeCallback[] = [];
|
|
44
|
+
|
|
45
|
+
private constructor() {
|
|
46
|
+
// Private constructor for singleton
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static getInstance(): NetworkService {
|
|
50
|
+
if (!NetworkService.instance) {
|
|
51
|
+
NetworkService.instance = new NetworkService();
|
|
52
|
+
}
|
|
53
|
+
return NetworkService.instance;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Initialize network monitoring
|
|
58
|
+
*/
|
|
59
|
+
async init(): Promise<void> {
|
|
60
|
+
try {
|
|
61
|
+
// Get initial network state
|
|
62
|
+
const initialState = await NetInfo.fetch();
|
|
63
|
+
this._isOnline = initialState.isConnected ?? true;
|
|
64
|
+
|
|
65
|
+
// Update store with initial state
|
|
66
|
+
sessionRecorderStore.setState({ isOnline: this._isOnline });
|
|
67
|
+
|
|
68
|
+
// Notify callbacks
|
|
69
|
+
this.notifyCallbacks({
|
|
70
|
+
isConnected: this._isOnline,
|
|
71
|
+
type: initialState.type,
|
|
72
|
+
isInternetReachable: initialState.isInternetReachable,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// Listen for network state changes
|
|
76
|
+
this.unsubscribe = NetInfo.addEventListener((state: any) => {
|
|
77
|
+
const wasOnline = this._isOnline;
|
|
78
|
+
this._isOnline = state.isConnected ?? true;
|
|
79
|
+
|
|
80
|
+
// Update store
|
|
81
|
+
sessionRecorderStore.setState({ isOnline: this._isOnline });
|
|
82
|
+
|
|
83
|
+
// Notify callbacks
|
|
84
|
+
this.notifyCallbacks({
|
|
85
|
+
isConnected: this._isOnline,
|
|
86
|
+
type: state.type,
|
|
87
|
+
isInternetReachable: state.isInternetReachable,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Log state changes
|
|
91
|
+
if (wasOnline && !this._isOnline) {
|
|
92
|
+
logger.info('NetworkService', 'Network went offline');
|
|
93
|
+
} else if (!wasOnline && this._isOnline) {
|
|
94
|
+
logger.info('NetworkService', 'Network came back online');
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
logger.info('NetworkService', 'Network monitoring initialized');
|
|
99
|
+
} catch (error) {
|
|
100
|
+
logger.error(
|
|
101
|
+
'NetworkService',
|
|
102
|
+
'Failed to initialize network monitoring',
|
|
103
|
+
error
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Get current network state
|
|
110
|
+
*/
|
|
111
|
+
getCurrentState(): NetworkState {
|
|
112
|
+
return {
|
|
113
|
+
isConnected: this._isOnline,
|
|
114
|
+
type: null, // We don't store this in the service
|
|
115
|
+
isInternetReachable: null, // We don't store this in the service
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Check if device is online
|
|
121
|
+
*/
|
|
122
|
+
isOnline(): boolean {
|
|
123
|
+
return this._isOnline;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Add callback for network state changes
|
|
128
|
+
*/
|
|
129
|
+
addCallback(callback: NetworkStateChangeCallback): void {
|
|
130
|
+
this.callbacks.push(callback);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Remove callback for network state changes
|
|
135
|
+
*/
|
|
136
|
+
removeCallback(callback: NetworkStateChangeCallback): void {
|
|
137
|
+
this.callbacks = this.callbacks.filter((cb) => cb !== callback);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Notify all callbacks of network state change
|
|
142
|
+
*/
|
|
143
|
+
private notifyCallbacks(state: NetworkState): void {
|
|
144
|
+
this.callbacks.forEach((callback) => {
|
|
145
|
+
try {
|
|
146
|
+
callback(state);
|
|
147
|
+
} catch (error) {
|
|
148
|
+
logger.error(
|
|
149
|
+
'NetworkService',
|
|
150
|
+
'Error in network state callback',
|
|
151
|
+
error
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Cleanup network monitoring
|
|
159
|
+
*/
|
|
160
|
+
cleanup(): void {
|
|
161
|
+
if (this.unsubscribe) {
|
|
162
|
+
this.unsubscribe();
|
|
163
|
+
this.unsubscribe = null;
|
|
164
|
+
}
|
|
165
|
+
this.callbacks = [];
|
|
166
|
+
logger.info('NetworkService', 'Network monitoring cleaned up');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Force refresh network state
|
|
171
|
+
*/
|
|
172
|
+
async refresh(): Promise<NetworkState> {
|
|
173
|
+
try {
|
|
174
|
+
const state = await NetInfo.fetch();
|
|
175
|
+
this._isOnline = state.isConnected ?? true;
|
|
176
|
+
sessionRecorderStore.setState({ isOnline: this._isOnline });
|
|
177
|
+
|
|
178
|
+
const networkState: NetworkState = {
|
|
179
|
+
isConnected: this._isOnline,
|
|
180
|
+
type: state.type,
|
|
181
|
+
isInternetReachable: state.isInternetReachable,
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
this.notifyCallbacks(networkState);
|
|
185
|
+
return networkState;
|
|
186
|
+
} catch (error) {
|
|
187
|
+
logger.error('NetworkService', 'Failed to refresh network state', error);
|
|
188
|
+
throw error;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import SessionRecorderNative, {
|
|
2
|
+
type MaskingOptions,
|
|
3
|
+
} from '../SessionRecorderNativeSpec';
|
|
4
|
+
import { logger } from '../utils';
|
|
5
|
+
|
|
6
|
+
export interface ScreenMaskingConfig {
|
|
7
|
+
/** Whether screen masking is enabled */
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
/** Whether to mask text inputs (UITextField, UITextView, React Native text components) */
|
|
10
|
+
maskTextInputs?: boolean;
|
|
11
|
+
/** Whether to mask images (UIImageView, React Native Image components) */
|
|
12
|
+
maskImages?: boolean;
|
|
13
|
+
/** Whether to mask buttons (UIButton) */
|
|
14
|
+
maskButtons?: boolean;
|
|
15
|
+
/** Whether to mask labels (UILabel) */
|
|
16
|
+
maskLabels?: boolean;
|
|
17
|
+
/** Whether to mask web views (WKWebView) */
|
|
18
|
+
maskWebViews?: boolean;
|
|
19
|
+
/** Whether to mask sandboxed views (system views that don't belong to current process) */
|
|
20
|
+
maskSandboxedViews?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class ScreenMaskingService {
|
|
24
|
+
private config: ScreenMaskingConfig;
|
|
25
|
+
private isAvailable: boolean = false;
|
|
26
|
+
|
|
27
|
+
constructor(
|
|
28
|
+
config: ScreenMaskingConfig = {
|
|
29
|
+
enabled: true,
|
|
30
|
+
maskTextInputs: true,
|
|
31
|
+
maskImages: false,
|
|
32
|
+
maskButtons: false,
|
|
33
|
+
maskLabels: false,
|
|
34
|
+
maskWebViews: false,
|
|
35
|
+
maskSandboxedViews: false,
|
|
36
|
+
}
|
|
37
|
+
) {
|
|
38
|
+
this.config = config;
|
|
39
|
+
this.checkAvailability();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check if the native masking module is available
|
|
44
|
+
*/
|
|
45
|
+
private checkAvailability(): void {
|
|
46
|
+
try {
|
|
47
|
+
// Try to access the native module to check if it's available
|
|
48
|
+
if (
|
|
49
|
+
SessionRecorderNative &&
|
|
50
|
+
typeof SessionRecorderNative.captureAndMask === 'function'
|
|
51
|
+
) {
|
|
52
|
+
this.isAvailable = true;
|
|
53
|
+
logger.info(
|
|
54
|
+
'ScreenMaskingService',
|
|
55
|
+
'Screen masking native module is available'
|
|
56
|
+
);
|
|
57
|
+
} else {
|
|
58
|
+
this.isAvailable = false;
|
|
59
|
+
logger.warn(
|
|
60
|
+
'ScreenMaskingService',
|
|
61
|
+
'Screen masking native module is not available - auto-linking may still be in progress'
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
} catch (error) {
|
|
65
|
+
this.isAvailable = false;
|
|
66
|
+
logger.error(
|
|
67
|
+
'ScreenMaskingService',
|
|
68
|
+
'Error checking screen masking availability:',
|
|
69
|
+
error
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Capture screen with masking applied
|
|
76
|
+
*/
|
|
77
|
+
async captureMaskedScreen(options: MaskingOptions): Promise<string | null> {
|
|
78
|
+
if (!this.isAvailable || !this.config.enabled) {
|
|
79
|
+
logger.warn(
|
|
80
|
+
'ScreenMaskingService',
|
|
81
|
+
'Screen masking is not available or disabled'
|
|
82
|
+
);
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
const maskingOptions: MaskingOptions = {
|
|
88
|
+
...this.config,
|
|
89
|
+
...options,
|
|
90
|
+
};
|
|
91
|
+
const maskedImageBase64 =
|
|
92
|
+
await SessionRecorderNative.captureAndMaskWithOptions(maskingOptions);
|
|
93
|
+
return maskedImageBase64;
|
|
94
|
+
} catch (error) {
|
|
95
|
+
logger.error(
|
|
96
|
+
'ScreenMaskingService',
|
|
97
|
+
'Failed to capture masked screen:',
|
|
98
|
+
error
|
|
99
|
+
);
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Capture screen with basic masking (no custom options)
|
|
106
|
+
*/
|
|
107
|
+
async captureMaskedScreenBasic(): Promise<string | null> {
|
|
108
|
+
if (!this.isAvailable || !this.config.enabled) {
|
|
109
|
+
logger.warn(
|
|
110
|
+
'ScreenMaskingService',
|
|
111
|
+
'Screen masking is not available or disabled'
|
|
112
|
+
);
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
const maskedImageBase64 = await SessionRecorderNative.captureAndMask();
|
|
118
|
+
return maskedImageBase64;
|
|
119
|
+
} catch (error) {
|
|
120
|
+
logger.error(
|
|
121
|
+
'ScreenMaskingService',
|
|
122
|
+
'Failed to capture masked screen (basic):',
|
|
123
|
+
error
|
|
124
|
+
);
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Update the masking configuration
|
|
131
|
+
*/
|
|
132
|
+
updateConfig(config: Partial<ScreenMaskingConfig>): void {
|
|
133
|
+
this.config = { ...this.config, ...config };
|
|
134
|
+
logger.info('ScreenMaskingService', 'Screen masking configuration updated');
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Check if screen masking is available
|
|
139
|
+
*/
|
|
140
|
+
isScreenMaskingAvailable(): boolean {
|
|
141
|
+
return this.isAvailable && this.config.enabled;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Get the current configuration
|
|
146
|
+
*/
|
|
147
|
+
getConfig(): ScreenMaskingConfig {
|
|
148
|
+
return { ...this.config };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Create a singleton instance
|
|
153
|
+
export const screenMaskingService = new ScreenMaskingService();
|