@multiplayer-app/session-recorder-react-native 1.0.0 → 1.0.1-beta.10
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 +35 -14
- package/android/build.gradle +65 -22
- package/android/gradle.properties +5 -0
- 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/SessionRecorderNative.d.ts → lib/typescript/src/SessionRecorderNativeSpec.d.ts} +23 -15
- 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 +157 -39
- package/react-native.config.js +8 -6
- package/src/SessionRecorderNativeSpec.ts +52 -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/SessionRecorderNative.js +0 -1
- package/dist/native/SessionRecorderNative.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/{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,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const OTEL_MP_SAMPLE_TRACE_RATIO = 0.15;
|
|
4
|
+
export const SESSION_ID_PROP_NAME = 'multiplayer-session-id';
|
|
5
|
+
export const SESSION_SHORT_ID_PROP_NAME = 'multiplayer-session-short-id';
|
|
6
|
+
export const SESSION_CONTINUOUS_DEBUGGING_PROP_NAME = 'multiplayer-session-continuous-debugging';
|
|
7
|
+
export const SESSION_STATE_PROP_NAME = 'multiplayer-session-state';
|
|
8
|
+
export const SESSION_TYPE_PROP_NAME = 'multiplayer-session-type';
|
|
9
|
+
export const SESSION_PROP_NAME = 'multiplayer-session-data';
|
|
10
|
+
export const SESSION_STARTED_EVENT = 'debug-session:started';
|
|
11
|
+
export const SESSION_STOPPED_EVENT = 'debug-session:stopped';
|
|
12
|
+
export const SESSION_SUBSCRIBE_EVENT = 'debug-session:subscribe';
|
|
13
|
+
export const SESSION_UNSUBSCRIBE_EVENT = 'debug-session:unsubscribe';
|
|
14
|
+
export const SESSION_AUTO_CREATED = 'debug-session:auto-created';
|
|
15
|
+
export const SESSION_ADD_EVENT = 'debug-session:rrweb:add-event';
|
|
16
|
+
export const DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE = 100000;
|
|
17
|
+
export const SESSION_RESPONSE = 'multiplayer-debug-session-response';
|
|
18
|
+
export const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
|
|
19
|
+
|
|
20
|
+
export const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
|
|
21
|
+
|
|
22
|
+
// // Package version - injected by webpack during build
|
|
23
|
+
// declare const PACKAGE_VERSION: string
|
|
24
|
+
// export const PACKAGE_VERSION_EXPORT = PACKAGE_VERSION || '1.0.0'
|
|
25
|
+
|
|
26
|
+
// Regex patterns for OpenTelemetry ignore URLs
|
|
27
|
+
export const OTEL_IGNORE_URLS = [
|
|
28
|
+
// Traces endpoint
|
|
29
|
+
/.*\/v1\/traces/,
|
|
30
|
+
// Debug sessions endpoints
|
|
31
|
+
/.*\/v0\/radar\/debug-sessions\/start\/?$/, /.*\/v0\/radar\/debug-sessions\/[^/]+\/stop\/?$/, /.*\/v0\/radar\/debug-sessions\/[^/]+\/cancel\/?$/,
|
|
32
|
+
// Continuous debug sessions endpoints
|
|
33
|
+
/.*\/v0\/radar\/continuous-debug-sessions\/start\/?$/, /.*\/v0\/radar\/continuous-debug-sessions\/[^/]+\/save\/?$/, /.*\/v0\/radar\/continuous-debug-sessions\/[^/]+\/cancel\/?$/,
|
|
34
|
+
// Remote debug session endpoint
|
|
35
|
+
/.*\/v0\/radar\/remote-debug-session\/check\/?$/,
|
|
36
|
+
// Connectivity probe endpoints (avoid noisy spans)
|
|
37
|
+
/https:\/\/clients3\.google\.com\/generate_204/, /http:\/\/clients3\.google\.com\/generate_204/, /http(s)?:\/\/www\.google\.com\/generate_204/, /http(s)?:\/\/connectivitycheck\.android\.com\/generate_204/, /http(s)?:\/\/connectivitycheck\.gstatic\.com\/generate_204/, /http(s)?:\/\/captive\.apple\.com/
|
|
38
|
+
|
|
39
|
+
// Or use a more general pattern to catch all radar API endpoints
|
|
40
|
+
// /.*\/v0\/radar\/.*/
|
|
41
|
+
];
|
|
42
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OTEL_MP_SAMPLE_TRACE_RATIO","SESSION_ID_PROP_NAME","SESSION_SHORT_ID_PROP_NAME","SESSION_CONTINUOUS_DEBUGGING_PROP_NAME","SESSION_STATE_PROP_NAME","SESSION_TYPE_PROP_NAME","SESSION_PROP_NAME","SESSION_STARTED_EVENT","SESSION_STOPPED_EVENT","SESSION_SUBSCRIBE_EVENT","SESSION_UNSUBSCRIBE_EVENT","SESSION_AUTO_CREATED","SESSION_ADD_EVENT","DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE","SESSION_RESPONSE","CONTINUOUS_DEBUGGING_TIMEOUT","DEBUG_SESSION_MAX_DURATION_SECONDS","OTEL_IGNORE_URLS"],"sourceRoot":"../../../src","sources":["config/constants.ts"],"mappings":";;AAAA,OAAO,MAAMA,0BAA0B,GAAG,IAAI;AAE9C,OAAO,MAAMC,oBAAoB,GAAG,wBAAwB;AAE5D,OAAO,MAAMC,0BAA0B,GAAG,8BAA8B;AAExE,OAAO,MAAMC,sCAAsC,GACjD,0CAA0C;AAE5C,OAAO,MAAMC,uBAAuB,GAAG,2BAA2B;AAElE,OAAO,MAAMC,sBAAsB,GAAG,0BAA0B;AAEhE,OAAO,MAAMC,iBAAiB,GAAG,0BAA0B;AAE3D,OAAO,MAAMC,qBAAqB,GAAG,uBAAuB;AAE5D,OAAO,MAAMC,qBAAqB,GAAG,uBAAuB;AAE5D,OAAO,MAAMC,uBAAuB,GAAG,yBAAyB;AAEhE,OAAO,MAAMC,yBAAyB,GAAG,2BAA2B;AAEpE,OAAO,MAAMC,oBAAoB,GAAG,4BAA4B;AAEhE,OAAO,MAAMC,iBAAiB,GAAG,+BAA+B;AAEhE,OAAO,MAAMC,uCAAuC,GAAG,MAAM;AAE7D,OAAO,MAAMC,gBAAgB,GAAG,oCAAoC;AAEpE,OAAO,MAAMC,4BAA4B,GAAG,KAAK,CAAC,CAAC;;AAEnD,OAAO,MAAMC,kCAAkC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;;AAEhE;AACA;AACA;;AAEA;AACA,OAAO,MAAMC,gBAAgB,GAAG;AAC9B;AACA,gBAAgB;AAChB;AACA,0CAA0C,EAC1C,gDAAgD,EAChD,kDAAkD;AAElD;AACA,qDAAqD,EACrD,2DAA2D,EAC3D,6DAA6D;AAE7D;AACA,gDAAgD;AAEhD;AACA,+CAA+C,EAC/C,8CAA8C,EAC9C,6CAA6C,EAC7C,4DAA4D,EAC5D,4DAA4D,EAC5D;;AAEA;AACA;AAAA,CACD","ignoreList":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { SessionRecorderSdk, MULTIPLAYER_BASE_API_URL, MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL } from '@multiplayer-app/session-recorder-common';
|
|
4
|
+
import { LogLevel, WidgetButtonPlacement } from "../types/index.js";
|
|
5
|
+
import { OTEL_MP_SAMPLE_TRACE_RATIO, DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE } from "./constants.js";
|
|
6
|
+
const {
|
|
7
|
+
mask,
|
|
8
|
+
sensitiveFields,
|
|
9
|
+
sensitiveHeaders
|
|
10
|
+
} = SessionRecorderSdk;
|
|
11
|
+
export const DEFAULT_MASKING_CONFIG = {
|
|
12
|
+
isContentMaskingEnabled: true,
|
|
13
|
+
maskBody: mask(sensitiveFields),
|
|
14
|
+
maskHeaders: mask(sensitiveHeaders),
|
|
15
|
+
maskBodyFieldsList: sensitiveFields,
|
|
16
|
+
maskHeadersList: sensitiveHeaders,
|
|
17
|
+
headersToInclude: [],
|
|
18
|
+
headersToExclude: [],
|
|
19
|
+
// Screen masking options
|
|
20
|
+
maskImages: false,
|
|
21
|
+
maskLabels: false,
|
|
22
|
+
maskButtons: false,
|
|
23
|
+
maskWebViews: false,
|
|
24
|
+
maskTextInputs: true,
|
|
25
|
+
maskSandboxedViews: false
|
|
26
|
+
};
|
|
27
|
+
export const DEFAULT_WIDGET_TEXT_CONFIG = {
|
|
28
|
+
initialTitleWithContinuous: 'Encountered an issue?',
|
|
29
|
+
initialTitleWithoutContinuous: 'Encountered an issue?',
|
|
30
|
+
initialDescriptionWithContinuous: 'Record your session so we can see the problem and fix it faster.',
|
|
31
|
+
initialDescriptionWithoutContinuous: 'Record your session so we can see the problem and fix it faster.',
|
|
32
|
+
continuousRecordingLabel: 'Continuous recording',
|
|
33
|
+
startRecordingButtonText: 'Start recording',
|
|
34
|
+
finalTitle: 'Done recording?',
|
|
35
|
+
finalDescription: 'You can also add a quick note with extra context, expectations, or questions. Thank you!',
|
|
36
|
+
commentPlaceholder: 'Add a message...',
|
|
37
|
+
saveButtonText: 'Submit recording',
|
|
38
|
+
cancelButtonText: 'Cancel recording',
|
|
39
|
+
continuousOverlayTitle: 'Save time, skip the reproductions',
|
|
40
|
+
continuousOverlayDescription: 'We keep a rolling record of your recent activity. If something doesn’t work as expected, just save the recording and continue working. No need to worry about exceptions and errors - we automatically save recordings for those!',
|
|
41
|
+
saveLastSnapshotButtonText: 'Save recording',
|
|
42
|
+
submitDialogTitle: 'Save recording',
|
|
43
|
+
submitDialogSubtitle: 'This full-stack session recording will be saved directly to your selected Multiplayer project. All data is automatically correlated end-to-end.',
|
|
44
|
+
submitDialogCommentLabel: 'You can also add context, comments, or notes.',
|
|
45
|
+
submitDialogCommentPlaceholder: 'Add a message...',
|
|
46
|
+
submitDialogSubmitText: 'Save',
|
|
47
|
+
submitDialogCancelText: 'Cancel'
|
|
48
|
+
};
|
|
49
|
+
export const BASE_CONFIG = {
|
|
50
|
+
apiKey: '',
|
|
51
|
+
version: '',
|
|
52
|
+
application: '',
|
|
53
|
+
environment: '',
|
|
54
|
+
showContinuousRecording: true,
|
|
55
|
+
widget: {
|
|
56
|
+
enabled: true,
|
|
57
|
+
button: {
|
|
58
|
+
visible: true,
|
|
59
|
+
placement: WidgetButtonPlacement.bottomRight
|
|
60
|
+
},
|
|
61
|
+
textOverrides: DEFAULT_WIDGET_TEXT_CONFIG
|
|
62
|
+
},
|
|
63
|
+
apiBaseUrl: MULTIPLAYER_BASE_API_URL,
|
|
64
|
+
exporterEndpoint: MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL,
|
|
65
|
+
schemifyDocSpanPayload: true,
|
|
66
|
+
ignoreUrls: [],
|
|
67
|
+
propagateTraceHeaderCorsUrls: [],
|
|
68
|
+
sampleTraceRatio: OTEL_MP_SAMPLE_TRACE_RATIO,
|
|
69
|
+
maxCapturingHttpPayloadSize: DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE,
|
|
70
|
+
captureBody: true,
|
|
71
|
+
captureHeaders: true,
|
|
72
|
+
masking: DEFAULT_MASKING_CONFIG,
|
|
73
|
+
recordScreen: true,
|
|
74
|
+
recordGestures: true,
|
|
75
|
+
recordNavigation: true,
|
|
76
|
+
logger: {
|
|
77
|
+
enabled: false,
|
|
78
|
+
level: LogLevel.INFO
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SessionRecorderSdk","MULTIPLAYER_BASE_API_URL","MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL","LogLevel","WidgetButtonPlacement","OTEL_MP_SAMPLE_TRACE_RATIO","DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE","mask","sensitiveFields","sensitiveHeaders","DEFAULT_MASKING_CONFIG","isContentMaskingEnabled","maskBody","maskHeaders","maskBodyFieldsList","maskHeadersList","headersToInclude","headersToExclude","maskImages","maskLabels","maskButtons","maskWebViews","maskTextInputs","maskSandboxedViews","DEFAULT_WIDGET_TEXT_CONFIG","initialTitleWithContinuous","initialTitleWithoutContinuous","initialDescriptionWithContinuous","initialDescriptionWithoutContinuous","continuousRecordingLabel","startRecordingButtonText","finalTitle","finalDescription","commentPlaceholder","saveButtonText","cancelButtonText","continuousOverlayTitle","continuousOverlayDescription","saveLastSnapshotButtonText","submitDialogTitle","submitDialogSubtitle","submitDialogCommentLabel","submitDialogCommentPlaceholder","submitDialogSubmitText","submitDialogCancelText","BASE_CONFIG","apiKey","version","application","environment","showContinuousRecording","widget","enabled","button","visible","placement","bottomRight","textOverrides","apiBaseUrl","exporterEndpoint","schemifyDocSpanPayload","ignoreUrls","propagateTraceHeaderCorsUrls","sampleTraceRatio","maxCapturingHttpPayloadSize","captureBody","captureHeaders","masking","recordScreen","recordGestures","recordNavigation","logger","level","INFO"],"sourceRoot":"../../../src","sources":["config/defaults.ts"],"mappings":";;AAAA,SACEA,kBAAkB,EAClBC,wBAAwB,EACxBC,iDAAiD,QAC5C,0CAA0C;AACjD,SACEC,QAAQ,EACRC,qBAAqB,QAEhB,mBAAU;AACjB,SACEC,0BAA0B,EAC1BC,uCAAuC,QAClC,gBAAa;AAEpB,MAAM;EAAEC,IAAI;EAAEC,eAAe;EAAEC;AAAiB,CAAC,GAAGT,kBAAkB;AAEtE,OAAO,MAAMU,sBAAyD,GAAG;EACvEC,uBAAuB,EAAE,IAAI;EAC7BC,QAAQ,EAAEL,IAAI,CAACC,eAAe,CAAC;EAC/BK,WAAW,EAAEN,IAAI,CAACE,gBAAgB,CAAC;EACnCK,kBAAkB,EAAEN,eAAe;EACnCO,eAAe,EAAEN,gBAAgB;EACjCO,gBAAgB,EAAE,EAAE;EACpBC,gBAAgB,EAAE,EAAE;EACpB;EACAC,UAAU,EAAE,KAAK;EACjBC,UAAU,EAAE,KAAK;EACjBC,WAAW,EAAE,KAAK;EAClBC,YAAY,EAAE,KAAK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D,uCAAuC;EAEpE2D,WAAW,EAAE,IAAI;EACjBC,cAAc,EAAE,IAAI;EACpBC,OAAO,EAAEzD,sBAAsB;EAE/B0D,YAAY,EAAE,IAAI;EAClBC,cAAc,EAAE,IAAI;EACpBC,gBAAgB,EAAE,IAAI;EAEtBC,MAAM,EAAE;IACNnB,OAAO,EAAE,KAAK;IACdoB,KAAK,EAAErE,QAAQ,CAACsE;EAClB;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Export all config-related functions and constants
|
|
4
|
+
export * from "./constants.js";
|
|
5
|
+
export * from "./defaults.js";
|
|
6
|
+
export * from "./validators.js";
|
|
7
|
+
export * from "./masking.js";
|
|
8
|
+
export * from "./session-recorder.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["config/index.ts"],"mappings":";;AAAA;AACA,cAAc,gBAAa;AAC3B,cAAc,eAAY;AAC1B,cAAc,iBAAc;AAC5B,cAAc,cAAW;AACzB,cAAc,uBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_MASKING_CONFIG } from "./defaults.js";
|
|
4
|
+
import { isValidArray, isValidBoolean, isValidFunction } from "./validators.js";
|
|
5
|
+
import { SessionRecorderSdk } from '@multiplayer-app/session-recorder-common';
|
|
6
|
+
const {
|
|
7
|
+
mask,
|
|
8
|
+
sensitiveFields,
|
|
9
|
+
sensitiveHeaders
|
|
10
|
+
} = SessionRecorderSdk;
|
|
11
|
+
export const getMaskingConfig = masking => {
|
|
12
|
+
const baseMasking = DEFAULT_MASKING_CONFIG;
|
|
13
|
+
if (typeof masking !== 'object') {
|
|
14
|
+
return baseMasking;
|
|
15
|
+
}
|
|
16
|
+
const maskHeadersList = isValidArray(masking.maskHeadersList, sensitiveHeaders);
|
|
17
|
+
const maskBodyFieldsList = isValidArray(masking.maskBodyFieldsList, sensitiveFields);
|
|
18
|
+
return {
|
|
19
|
+
maskHeadersList,
|
|
20
|
+
maskBodyFieldsList,
|
|
21
|
+
headersToInclude: isValidArray(masking.headersToInclude, baseMasking.headersToInclude),
|
|
22
|
+
headersToExclude: isValidArray(masking.headersToExclude, baseMasking.headersToExclude),
|
|
23
|
+
isContentMaskingEnabled: isValidBoolean(masking.isContentMaskingEnabled, baseMasking.isContentMaskingEnabled),
|
|
24
|
+
maskBody: isValidFunction(masking.maskBody, mask(maskBodyFieldsList)),
|
|
25
|
+
maskHeaders: isValidFunction(masking.maskHeaders, mask(maskHeadersList)),
|
|
26
|
+
// Screen masking options
|
|
27
|
+
maskTextInputs: isValidBoolean(masking.maskTextInputs, baseMasking.maskTextInputs),
|
|
28
|
+
maskImages: isValidBoolean(masking.maskImages, baseMasking.maskImages),
|
|
29
|
+
maskButtons: isValidBoolean(masking.maskButtons, baseMasking.maskButtons),
|
|
30
|
+
maskLabels: isValidBoolean(masking.maskLabels, baseMasking.maskLabels),
|
|
31
|
+
maskWebViews: isValidBoolean(masking.maskWebViews, baseMasking.maskWebViews),
|
|
32
|
+
maskSandboxedViews: isValidBoolean(masking.maskSandboxedViews, baseMasking.maskSandboxedViews)
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=masking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_MASKING_CONFIG","isValidArray","isValidBoolean","isValidFunction","SessionRecorderSdk","mask","sensitiveFields","sensitiveHeaders","getMaskingConfig","masking","baseMasking","maskHeadersList","maskBodyFieldsList","headersToInclude","headersToExclude","isContentMaskingEnabled","maskBody","maskHeaders","maskTextInputs","maskImages","maskButtons","maskLabels","maskWebViews","maskSandboxedViews"],"sourceRoot":"../../../src","sources":["config/masking.ts"],"mappings":";;AACA,SAASA,sBAAsB,QAAQ,eAA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;IACzEC,UAAU,EAAEnB,cAAc,CAACO,OAAO,CAACY,UAAU,EAAEX,WAAW,CAACW,UAAU,CAAC;IACtEC,YAAY,EAAEpB,cAAc,CAC1BO,OAAO,CAACa,YAAY,EACpBZ,WAAW,CAACY,YACd,CAAC;IACDC,kBAAkB,EAAErB,cAAc,CAChCO,OAAO,CAACc,kBAAkB,EAC1Bb,WAAW,CAACa,kBACd;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { LogLevel } from "../types/index.js";
|
|
4
|
+
import { BASE_CONFIG } from "./defaults.js";
|
|
5
|
+
import { getMaskingConfig } from "./masking.js";
|
|
6
|
+
import { isValidString, isValidNumber, isValidBoolean, isValidArray } from "./validators.js";
|
|
7
|
+
import { getWidgetConfig } from "./widget.js";
|
|
8
|
+
const getLoggerConfig = config => {
|
|
9
|
+
if (!config || typeof config !== 'object') {
|
|
10
|
+
return BASE_CONFIG.logger;
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
level: isValidNumber(config.level, LogLevel.INFO),
|
|
14
|
+
enabled: isValidBoolean(config.enabled, false)
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export const getSessionRecorderConfig = c => {
|
|
18
|
+
if (!c) {
|
|
19
|
+
return BASE_CONFIG;
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
apiKey: isValidString(c.apiKey, BASE_CONFIG.apiKey),
|
|
23
|
+
version: isValidString(c.version, BASE_CONFIG.version),
|
|
24
|
+
application: isValidString(c.application, BASE_CONFIG.application),
|
|
25
|
+
environment: isValidString(c.environment, BASE_CONFIG.environment),
|
|
26
|
+
exporterEndpoint: isValidString(c.exporterEndpoint, BASE_CONFIG.exporterEndpoint),
|
|
27
|
+
apiBaseUrl: isValidString(c.apiBaseUrl, BASE_CONFIG.apiBaseUrl),
|
|
28
|
+
showContinuousRecording: isValidBoolean(c.showContinuousRecording, BASE_CONFIG.showContinuousRecording),
|
|
29
|
+
ignoreUrls: isValidArray(c.ignoreUrls, BASE_CONFIG.ignoreUrls),
|
|
30
|
+
sampleTraceRatio: isValidNumber(c.sampleTraceRatio, BASE_CONFIG.sampleTraceRatio),
|
|
31
|
+
propagateTraceHeaderCorsUrls: c.propagateTraceHeaderCorsUrls || BASE_CONFIG.propagateTraceHeaderCorsUrls,
|
|
32
|
+
schemifyDocSpanPayload: isValidBoolean(c.schemifyDocSpanPayload, BASE_CONFIG.schemifyDocSpanPayload),
|
|
33
|
+
maxCapturingHttpPayloadSize: isValidNumber(c.maxCapturingHttpPayloadSize, BASE_CONFIG.maxCapturingHttpPayloadSize),
|
|
34
|
+
captureBody: isValidBoolean(c.captureBody, BASE_CONFIG.captureBody),
|
|
35
|
+
captureHeaders: isValidBoolean(c.captureHeaders, BASE_CONFIG.captureHeaders),
|
|
36
|
+
recordScreen: isValidBoolean(c.recordScreen, BASE_CONFIG.recordScreen),
|
|
37
|
+
recordGestures: isValidBoolean(c.recordGestures, BASE_CONFIG.recordGestures),
|
|
38
|
+
recordNavigation: isValidBoolean(c.recordNavigation, BASE_CONFIG.recordNavigation),
|
|
39
|
+
masking: getMaskingConfig(c.masking),
|
|
40
|
+
widget: getWidgetConfig(c.widget),
|
|
41
|
+
logger: getLoggerConfig(c.logger)
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=session-recorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LogLevel","BASE_CONFIG","getMaskingConfig","isValidString","isValidNumber","isValidBoolean","isValidArray","getWidgetConfig","getLoggerConfig","config","logger","level","INFO","enabled","getSessionRecorderConfig","c","apiKey","version","application","environment","exporterEndpoint","apiBaseUrl","showContinuousRecording","ignoreUrls","sampleTraceRatio","propagateTraceHeaderCorsUrls","schemifyDocSpanPayload","maxCapturingHttpPayloadSize","captureBody","captureHeaders","recordScreen","recordGestures","recordNavigation","masking","widget"],"sourceRoot":"../../../src","sources":["config/session-recorder.ts"],"mappings":";;AAAA,SACEA,QAAQ,QAGH,mBAAU;AAEjB,SAASC,WAAW,QAAQ,eAAY;AACxC,SAASC,gBAAgB,QAAQ,cAAW;AAC5C,SACEC,aAAa,EACbC,aAAa,EACbC,cAAc,EACdC,YAAY,QACP,iBAAc;AACrB,SAASC,eAAe,QAAQ,aAAU;AAE1C,MAAMC,eAAe,GAAIC,MAAW,IAAK;EACvC,IAAI,CAACA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACzC,OAAOR,WAAW,CAACS,MAAM;EAC3B;EACA,OAAO;IACLC,KAAK,EAAEP,aAAa,CAACK,MAAM,CAACE,KAAK,EAAEX,QAAQ,CAACY,IAAI,CAAC;IACjDC,OAAO,EAAER,cAAc,CAACI,MAAM,CAACI,OAAO,EAAE,KAAK;EAC/C,CAAC;AACH,CAAC;AAED,OAAO,MAAMC,wBAAwB,GACnCC,CAAyB,IACE;EAC3B,IAAI,CAACA,CAAC,EAAE;IACN,OAAOd,WAAW;EACpB;EAEA,OAAO;IACLe,MAAM,EAAEb,aAAa,CAACY,CAAC,CAACC,MAAM,EAAEf,WAAW,CAACe,MAAM,CAAC;IACnDC,OAAO,EAAEd,aAAa,CAACY,CAAC,CAACE,OAAO,EAAEhB,WAAW,CAACgB,OAAO,CAAC;IACtDC,WAAW,EAAEf,aAAa,CAACY,CAAC,CAACG,WAAW,EAAEjB,WAAW,CAACiB,WAAW,CAAC;IAClEC,WAAW,EAAEhB,aAAa,CAACY,CAAC,CAACI,WAAW,EAAElB,WAAW,CAACkB,WAAW,CAAC;IAElEC,gBAAgB,EAAEjB,aAAa,CAC7BY,CAAC,CAACK,gBAAgB,EAClBnB,WAAW,CAACmB,gBACd,CAAC;IACDC,UAAU,EAAElB,aAAa,CAACY,CAAC,CAACM,UAAU,EAAEpB,WAAW,CAACoB,UAAU,CAAC;IAE/DC,uBAAuB,EAAEjB,cAAc,CACrCU,CAAC,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for configuration objects
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const isValidStringOrRegExp = (value, defaultValue) => {
|
|
8
|
+
return typeof value === 'string' || value instanceof RegExp ? value : defaultValue;
|
|
9
|
+
};
|
|
10
|
+
export const isValidString = (value, defaultValue) => {
|
|
11
|
+
return typeof value === 'string' ? value.trim() : defaultValue;
|
|
12
|
+
};
|
|
13
|
+
export const isValidNumber = (value, defaultValue) => {
|
|
14
|
+
return typeof value === 'number' ? value : defaultValue;
|
|
15
|
+
};
|
|
16
|
+
export const isValidBoolean = (value, defaultValue) => {
|
|
17
|
+
return typeof value === 'boolean' ? value : defaultValue;
|
|
18
|
+
};
|
|
19
|
+
export const isValidArray = (value, defaultValue) => {
|
|
20
|
+
return Array.isArray(value) ? [...value] : [...defaultValue];
|
|
21
|
+
};
|
|
22
|
+
export const isValidEnum = (value, defaultValue, enumValues) => {
|
|
23
|
+
return enumValues.includes(value) ? value : defaultValue;
|
|
24
|
+
};
|
|
25
|
+
export const isValidFunction = (value, defaultValue) => {
|
|
26
|
+
return typeof value === 'function' ? value : defaultValue;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isValidStringOrRegExp","value","defaultValue","RegExp","isValidString","trim","isValidNumber","isValidBoolean","isValidArray","Array","isArray","isValidEnum","enumValues","includes","isValidFunction"],"sourceRoot":"../../../src","sources":["config/validators.ts"],"mappings":";;AAAA;AACA;AACA;;AAEA,OAAO,MAAMA,qBAAqB,GAAGA,CACnCC,KAAkC,EAClCC,YAA6B,KAC1B;EACH,OAAO,OAAOD,KAAK,KAAK,QAAQ,IAAIA,KAAK,YAAYE,MAAM,GACvDF,KAAK,GACLC,YAAY;AAClB,CAAC;AAED,OAAO,MAAME,aAAa,GAAGA,CAC3BH,KAA6B,EAC7BC,YAAoB,KACjB;EACH,OAAO,OAAOD,KAAK,KAAK,QAAQ,GAAGA,KAAK,CAACI,IAAI,CAAC,CAAC,GAAGH,YAAY;AAChE,CAAC;AAED,OAAO,MAAMI,aAAa,GAAGA,CAC3BL,KAAyB,EACzBC,YAAoB,KACjB;EACH,OAAO,OAAOD,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGC,YAAY;AACzD,CAAC;AAED,OAAO,MAAMK,cAAc,GAAGA,CAC5BN,KAA0B,EAC1BC,YAAqB,KAClB;EACH,OAAO,OAAOD,KAAK,KAAK,SAAS,GAAGA,KAAK,GAAGC,YAAY;AAC1D,CAAC;AAED,OAAO,MAAMM,YAAY,GAAGA,CAC1BP,KAAmC,EACnCC,YAA8B,KACtB;EACR,OAAOO,KAAK,CAACC,OAAO,CAACT,KAAK,CAAC,GACtB,CAAC,GAAGA,KAAK,CAAC,GACV,CAAC,GAAGC,YAAY,CAAS;AAChC,CAAC;AAED,OAAO,MAAMS,WAAW,GAAGA,CACzBV,KAAc,EACdC,YAAe,EACfU,UAAe,KACT;EACN,OAAOA,UAAU,CAACC,QAAQ,CAACZ,KAAU,CAAC,GAAIA,KAAK,GAASC,YAAY;AACtE,CAAC;AAED,OAAO,MAAMY,eAAe,GAAGA,CAACb,KAAU,EAAEC,YAAiB,KAAK;EAChE,OAAO,OAAOD,KAAK,KAAK,UAAU,GAAGA,KAAK,GAAGC,YAAY;AAC3D,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { WidgetButtonPlacement } from "../types/index.js";
|
|
4
|
+
import { BASE_CONFIG } from "./defaults.js";
|
|
5
|
+
import { isValidBoolean, isValidEnum, isValidString } from "./validators.js";
|
|
6
|
+
export const getWidgetConfig = config => {
|
|
7
|
+
const textOverrides = getTextOverridesConfig(config?.textOverrides, BASE_CONFIG.widget.textOverrides);
|
|
8
|
+
const def = {
|
|
9
|
+
enabled: true,
|
|
10
|
+
button: {
|
|
11
|
+
visible: true,
|
|
12
|
+
placement: WidgetButtonPlacement.bottomRight
|
|
13
|
+
},
|
|
14
|
+
textOverrides
|
|
15
|
+
};
|
|
16
|
+
const placementCandidate = config?.button?.placement || def.button.placement;
|
|
17
|
+
return {
|
|
18
|
+
textOverrides,
|
|
19
|
+
enabled: isValidBoolean(config && config.enabled, def.enabled),
|
|
20
|
+
button: {
|
|
21
|
+
visible: isValidBoolean(config && config.button && config.button.visible, def.button.visible),
|
|
22
|
+
placement: isValidEnum(placementCandidate, def.button.placement, Object.values(WidgetButtonPlacement))
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const getTextOverridesConfig = (config, defaultConfig) => {
|
|
27
|
+
if (!config || typeof config !== 'object') {
|
|
28
|
+
return defaultConfig;
|
|
29
|
+
}
|
|
30
|
+
return Object.keys(defaultConfig).reduce((acc, key) => {
|
|
31
|
+
acc[key] = isValidString(config[key], defaultConfig[key]);
|
|
32
|
+
return acc;
|
|
33
|
+
}, {});
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WidgetButtonPlacement","BASE_CONFIG","isValidBoolean","isValidEnum","isValidString","getWidgetConfig","config","textOverrides","getTextOverridesConfig","widget","def","enabled","button","visible","placement","bottomRight","placementCandidate","Object","values","defaultConfig","keys","reduce","acc","key"],"sourceRoot":"../../../src","sources":["config/widget.ts"],"mappings":";;AAAA,SAAsCA,qBAAqB,QAAQ,mBAAU;AAC7E,SAASC,WAAW,QAAQ,eAAY;AACxC,SAASC,cAAc,EAAEC,WAAW,EAAEC,aAAa,QAAQ,iBAAc;AAEzE,OAAO,MAAMC,eAAe,GAAIC,MAAwC,IAAK;EAC3E,MAAMC,aAAa,GAAGC,sBAAsB,CAC1CF,MAAM,EAAEC,aAAa,EACrBN,WAAW,CAACQ,MAAM,CAACF,aACrB,CAAC;EAED,MAAMG,GAAG,GAAG;IACVC,OAAO,EAAE,IAAI;IACbC,MAAM,EAAE;MAAEC,OAAO,EAAE,IAAI;MAAEC,SAAS,EAAEd,qBAAqB,CAACe;IAAY,CAAC;IACvER;EACF,CAAC;EAED,MAAMS,kBAAkB,GAAGV,MAAM,EAAEM,MAAM,EAAEE,SAAS,IAAIJ,GAAG,CAACE,MAAM,CAACE,SAAS;EAE5E,OAAO;IACLP,aAAa;IACbI,OAAO,EAAET,cAAc,CAACI,MAAM,IAAIA,MAAM,CAACK,OAAO,EAAED,GAAG,CAACC,OAAO,CAAC;IAC9DC,MAAM,EAAE;MACNC,OAAO,EAAEX,cAAc,CACrBI,MAAM,IAAIA,MAAM,CAACM,MAAM,IAAIN,MAAM,CAACM,MAAM,CAACC,OAAO,EAChDH,GAAG,CAACE,MAAM,CAACC,OACb,CAAC;MACDC,SAAS,EAAEX,WAAW,CACpBa,kBAAkB,EAClBN,GAAG,CAACE,MAAM,CAACE,SAAS,EACpBG,MAAM,CAACC,MAAM,CAAClB,qBAAqB,CACrC;IACF;EACF,CAAC;AACH,CAAC;AAED,MAAMQ,sBAAsB,GAAGA,CAACF,MAAW,EAAEa,aAAkB,KAAK;EAClE,IAAI,CAACb,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACzC,OAAOa,aAAa;EACtB;EACA,OAAOF,MAAM,CAACG,IAAI,CAACD,aAAa,CAAC,CAACE,MAAM,CACtC,CAACC,GAAG,EAAEC,GAAG,KAAK;IACZD,GAAG,CAACC,GAAG,CAAC,GAAGnB,aAAa,CAACE,MAAM,CAACiB,GAAG,CAAC,EAAEJ,aAAa,CAACI,GAAG,CAAC,CAAC;IACzD,OAAOD,GAAG;EACZ,CAAC,EACD,CAAC,CACH,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { createContext, useContext, useEffect, useCallback } from 'react';
|
|
4
|
+
import sessionRecorder from "../session-recorder.js";
|
|
5
|
+
import { ScreenRecorderView } from "../components/ScreenRecorderView/index.js";
|
|
6
|
+
import SessionRecorderWidget from "../components/SessionRecorderWidget/index.js";
|
|
7
|
+
import { SessionType } from '@multiplayer-app/session-recorder-common';
|
|
8
|
+
import { sessionRecorderStore } from "./SessionRecorderStore.js";
|
|
9
|
+
import { useStoreSelector } from "./useStoreSelector.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const SessionRecorderContext = /*#__PURE__*/createContext(null);
|
|
12
|
+
export const SessionRecorderProvider = ({
|
|
13
|
+
children,
|
|
14
|
+
options
|
|
15
|
+
}) => {
|
|
16
|
+
const isInitialized = useStoreSelector(sessionRecorderStore, s => s.isInitialized);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (options) {
|
|
19
|
+
sessionRecorder.init(options);
|
|
20
|
+
}
|
|
21
|
+
sessionRecorderStore.setState({
|
|
22
|
+
isInitialized: sessionRecorder.isInitialized
|
|
23
|
+
});
|
|
24
|
+
}, []);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
sessionRecorderStore.setState({
|
|
27
|
+
sessionState: sessionRecorder.sessionState,
|
|
28
|
+
sessionType: sessionRecorder.sessionType
|
|
29
|
+
});
|
|
30
|
+
const onStateChange = (sessionState, sessionType) => {
|
|
31
|
+
sessionRecorderStore.setState({
|
|
32
|
+
sessionState,
|
|
33
|
+
sessionType
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
sessionRecorder.on('state-change', onStateChange);
|
|
37
|
+
return () => {
|
|
38
|
+
sessionRecorder.off('state-change', onStateChange);
|
|
39
|
+
};
|
|
40
|
+
}, []);
|
|
41
|
+
const startSession = useCallback((sessionType = SessionType.PLAIN) => {
|
|
42
|
+
return sessionRecorder.start(sessionType);
|
|
43
|
+
}, []);
|
|
44
|
+
const stopSession = useCallback(comment => {
|
|
45
|
+
return sessionRecorder.stop(comment);
|
|
46
|
+
}, []);
|
|
47
|
+
const pauseSession = useCallback(() => {
|
|
48
|
+
return sessionRecorder.pause();
|
|
49
|
+
}, []);
|
|
50
|
+
const resumeSession = useCallback(() => {
|
|
51
|
+
return sessionRecorder.resume();
|
|
52
|
+
}, []);
|
|
53
|
+
const cancelSession = useCallback(() => {
|
|
54
|
+
return sessionRecorder.cancel();
|
|
55
|
+
}, []);
|
|
56
|
+
const saveSession = useCallback(() => {
|
|
57
|
+
return sessionRecorder.save();
|
|
58
|
+
}, []);
|
|
59
|
+
const openWidgetModal = useCallback(() => {
|
|
60
|
+
sessionRecorderStore.setState({
|
|
61
|
+
isWidgetModalVisible: true
|
|
62
|
+
});
|
|
63
|
+
}, []);
|
|
64
|
+
const closeWidgetModal = useCallback(() => {
|
|
65
|
+
sessionRecorderStore.setState({
|
|
66
|
+
isWidgetModalVisible: false
|
|
67
|
+
});
|
|
68
|
+
}, []);
|
|
69
|
+
return /*#__PURE__*/_jsxs(SessionRecorderContext.Provider, {
|
|
70
|
+
value: {
|
|
71
|
+
instance: sessionRecorder,
|
|
72
|
+
openWidgetModal,
|
|
73
|
+
closeWidgetModal,
|
|
74
|
+
startSession,
|
|
75
|
+
stopSession,
|
|
76
|
+
pauseSession,
|
|
77
|
+
resumeSession,
|
|
78
|
+
cancelSession,
|
|
79
|
+
saveSession
|
|
80
|
+
},
|
|
81
|
+
children: [/*#__PURE__*/_jsx(ScreenRecorderView, {
|
|
82
|
+
children: children
|
|
83
|
+
}), isInitialized && !!sessionRecorder.config.widget.enabled && /*#__PURE__*/_jsx(SessionRecorderWidget, {})]
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
export const useSessionRecorder = () => {
|
|
87
|
+
const context = useContext(SessionRecorderContext);
|
|
88
|
+
if (!context) {
|
|
89
|
+
throw new Error('useSessionRecorder must be used within a SessionRecorderProvider');
|
|
90
|
+
}
|
|
91
|
+
return context;
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=SessionRecorderContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","useEffect","useCallback","sessionRecorder","ScreenRecorderView","SessionRecorderWidget","SessionType","sessionRecorderStore","useStoreSelector","jsx","_jsx","jsxs","_jsxs","SessionRecorderContext","SessionRecorderProvider","children","options","isInitialized","s","init","setState","sessionState","sessionType","onStateChange","on","off","startSession","PLAIN","start","stopSession","comment","stop","pauseSession","pause","resumeSession","resume","cancelSession","cancel","saveSession","save","openWidgetModal","isWidgetModalVisible","closeWidgetModal","Provider","value","instance","config","widget","enabled","useSessionRecorder","context","Error"],"sourceRoot":"../../../src","sources":["context/SessionRecorderContext.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,WAAW,QAEN,OAAO;AAEd,OAAOC,eAAe,MAAM,wBAAqB;AACjD,SAASC,kBAAkB,QAAQ,2CAAkC;AACrE,OAAOC,qBAAqB,MAAM,8CAAqC;AACvE,SAASC,WAAW,QAAQ,0CAA0C;AACtE,SACEC,oBAAoB,QAEf,2BAAwB;AAC/B,SAASC,gBAAgB,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AActD,MAAMC,sBAAsB,gBAAGd,aAAa,CAC1C,IACF,CAAC;AAMD,OAAO,MAAMe,uBAEZ,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAQ,CAAC,KAAK;EAC7B,MAAMC,aAAa,GAAGT,gBAAgB,CACpCD,oBAAoB,EACnBW,CAAC,IAAKA,CAAC,CAACD,aACX,CAAC;EAEDhB,SAAS,CAAC,MAAM;IACd,IAAIe,OAAO,EAAE;MACXb,eAAe,CAACgB,IAAI,CAACH,OAAO,CAAC;IAC/B;IACAT,oBAAoB,CAACa,QAAQ,CAAC;MAC5BH,aAAa,EAAEd,eAAe,CAACc;IACjC,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAENhB,SAAS,CAAC,MAAM;IACdM,oBAAoB,CAACa,QAAQ,CAAC;MAC5BC,YAAY,EAAElB,eAAe,CA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AoB,CAACa,QAAQ,CAAC;MAAEqB,oBAAoB,EAAE;IAAK,CAAC,CAAC;EAC/D,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,gBAAgB,GAAGxC,WAAW,CAAC,MAAM;IACzCK,oBAAoB,CAACa,QAAQ,CAAC;MAAEqB,oBAAoB,EAAE;IAAM,CAAC,CAAC;EAChE,CAAC,EAAE,EAAE,CAAC;EAEN,oBACE7B,KAAA,CAACC,sBAAsB,CAAC8B,QAAQ;IAC9BC,KAAK,EAAE;MACLC,QAAQ,EAAE1C,eAAe;MACzBqC,eAAe;MACfE,gBAAgB;MAChBhB,YAAY;MACZG,WAAW;MACXG,YAAY;MACZE,aAAa;MACbE,aAAa;MACbE;IACF,CAAE;IAAAvB,QAAA,gBAEFL,IAAA,CAACN,kBAAkB;MAAAW,QAAA,EAAEA;IAAQ,CAAqB,CAAC,EAClDE,aAAa,IAAI,CAAC,CAACd,eAAe,CAAC2C,MAAM,CAACC,MAAM,CAACC,OAAO,iBACvDtC,IAAA,CAACL,qBAAqB,IAAE,CACzB;EAAA,CAC8B,CAAC;AAEtC,CAAC;AAED,OAAO,MAAM4C,kBAAkB,GAAGA,CAAA,KAAkC;EAClE,MAAMC,OAAO,GAAGlD,UAAU,CAACa,sBAAsB,CAAC;EAClD,IAAI,CAACqC,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CACb,kEACF,CAAC;EACH;EACA,OAAOD,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createStore } from "../utils/createStore.js";
|
|
4
|
+
export const sessionRecorderStore = createStore({
|
|
5
|
+
isInitialized: false,
|
|
6
|
+
sessionType: null,
|
|
7
|
+
sessionState: null,
|
|
8
|
+
isWidgetModalVisible: false,
|
|
9
|
+
isOnline: true,
|
|
10
|
+
error: null
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=SessionRecorderStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createStore","sessionRecorderStore","isInitialized","sessionType","sessionState","isWidgetModalVisible","isOnline","error"],"sourceRoot":"../../../src","sources":["context/SessionRecorderStore.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAoB,yBAAsB;AAa9D,OAAO,MAAMC,oBAAiD,GAC5DD,WAAW,CAAuB;EAChCE,aAAa,EAAE,KAAK;EACpBC,WAAW,EAAE,IAAI;EACjBC,YAAY,EAAE,IAAI;EAClBC,oBAAoB,EAAE,KAAK;EAC3BC,QAAQ,EAAE,IAAI;EACdC,KAAK,EAAE;AACT,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useStoreSelector } from "./useStoreSelector.js";
|
|
4
|
+
import { sessionRecorderStore } from "./SessionRecorderStore.js";
|
|
5
|
+
export function useSessionRecorderStore(selector, equalityFn) {
|
|
6
|
+
return useStoreSelector(sessionRecorderStore, selector, equalityFn);
|
|
7
|
+
}
|
|
8
|
+
export function useSessionRecordingState() {
|
|
9
|
+
return useSessionRecorderStore(s => s.sessionState);
|
|
10
|
+
}
|
|
11
|
+
export function useSessionType() {
|
|
12
|
+
return useSessionRecorderStore(s => s.sessionType);
|
|
13
|
+
}
|
|
14
|
+
export function useIsInitialized() {
|
|
15
|
+
return useSessionRecorderStore(s => s.isInitialized);
|
|
16
|
+
}
|
|
17
|
+
export function useWidgetModalVisible() {
|
|
18
|
+
return useSessionRecorderStore(s => s.isWidgetModalVisible);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=useSessionRecorderStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useStoreSelector","sessionRecorderStore","useSessionRecorderStore","selector","equalityFn","useSessionRecordingState","s","sessionState","useSessionType","sessionType","useIsInitialized","isInitialized","useWidgetModalVisible","isWidgetModalVisible"],"sourceRoot":"../../../src","sources":["context/useSessionRecorderStore.ts"],"mappings":";;AAEA,SAASA,gBAAgB,QAAQ,uBAAoB;AACrD,SAEEC,oBAAoB,QACf,2BAAwB;AAE/B,OAAO,SAASC,uBAAuBA,CACrCC,QAA6C,EAC7CC,UAA8C,EACtC;EACR,OAAOJ,gBAAgB,CACrBC,oBAAoB,EACpBE,QAAQ,EACRC,UACF,CAAC;AACH;AAEA,OAAO,SAASC,wBAAwBA,CAAA,EAAG;EACzC,OAAOH,uBAAuB,CAAuBI,CAAC,IAAKA,CAAC,CAACC,YAAY,CAAC;AAC5E;AAEA,OAAO,SAASC,cAAcA,CAAA,EAAG;EAC/B,OAAON,uBAAuB,CAAsBI,CAAC,IAAKA,CAAC,CAACG,WAAW,CAAC;AAC1E;AAEA,OAAO,SAASC,gBAAgBA,CAAA,EAAG;EACjC,OAAOR,uBAAuB,CAAWI,CAAC,IAAKA,CAAC,CAACK,aAAa,CAAC;AACjE;AAEA,OAAO,SAASC,qBAAqBA,CAAA,EAAG;EACtC,OAAOV,uBAAuB,CAAWI,CAAC,IAAKA,CAAC,CAACO,oBAAoB,CAAC;AACxE","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { shallowEqual } from "../utils/shallowEqual.js";
|
|
5
|
+
export function useStoreSelector(store, selector, equalityFn = Object.is) {
|
|
6
|
+
const latestSelectorRef = useRef(selector);
|
|
7
|
+
const latestEqualityRef = useRef(equalityFn);
|
|
8
|
+
latestSelectorRef.current = selector;
|
|
9
|
+
latestEqualityRef.current = equalityFn;
|
|
10
|
+
const [slice, setSlice] = useState(() => latestSelectorRef.current(store.getState()));
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
function handleChange(nextState, prevState) {
|
|
13
|
+
const nextSlice = latestSelectorRef.current(nextState);
|
|
14
|
+
const prevSlice = latestSelectorRef.current(prevState);
|
|
15
|
+
if (!latestEqualityRef.current(nextSlice, prevSlice)) {
|
|
16
|
+
setSlice(nextSlice);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const unsubscribe = store.subscribe(handleChange);
|
|
20
|
+
// Sync once in case changed between render and effect
|
|
21
|
+
handleChange(store.getState(), store.getState());
|
|
22
|
+
return unsubscribe;
|
|
23
|
+
}, [store]);
|
|
24
|
+
return slice;
|
|
25
|
+
}
|
|
26
|
+
export const shallow = shallowEqual;
|
|
27
|
+
//# sourceMappingURL=useStoreSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useState","shallowEqual","useStoreSelector","store","selector","equalityFn","Object","is","latestSelectorRef","latestEqualityRef","current","slice","setSlice","getState","handleChange","nextState","prevState","nextSlice","prevSlice","unsubscribe","subscribe","shallow"],"sourceRoot":"../../../src","sources":["context/useStoreSelector.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAEnD,SAASC,YAAY,QAAQ,0BAAuB;AAEpD,OAAO,SAASC,gBAAgBA,CAC9BC,KAAoB,EACpBC,QAAmC,EACnCC,UAA6C,GAAGC,MAAM,CAACC,EAAE,EACjD;EACR,MAAMC,iBAAiB,GAAGT,MAAM,CAACK,QAAQ,CAAC;EAC1C,MAAMK,iBAAiB,GAAGV,MAAM,CAACM,UAAU,CAAC;EAC5CG,iBAAiB,CAACE,OAAO,GAAGN,QAAQ;EACpCK,iBAAiB,CAACC,OAAO,GAAGL,UAAU;EAEtC,MAAM,CAACM,KAAK,EAAEC,QAAQ,CAAC,GAAGZ,QAAQ,CAAS,MACzCQ,iBAAiB,CAACE,OAAO,CAACP,KAAK,CAACU,QAAQ,CAAC,CAAC,CAC5C,CAAC;EAEDf,SAAS,CAAC,MAAM;IACd,SAASgB,YAAYA,CAACC,SAAiB,EAAEC,SAAiB,EAAE;MAC1D,MAAMC,SAAS,GAAGT,iBAAiB,CAACE,OAAO,CAACK,SAAS,CAAC;MACtD,MAAMG,SAAS,GAAGV,iBAAiB,CAACE,OAAO,CAACM,SAAS,CAAC;MACtD,IAAI,CAACP,iBAAiB,CAACC,OAAO,CAACO,SAAS,EAAEC,SAAS,CAAC,EAAE;QACpDN,QAAQ,CAACK,SAAS,CAAC;MACrB;IACF;IACA,MAAME,WAAW,GAAGhB,KAAK,CAACiB,SAAS,CAACN,YAAY,CAAC;IACjD;IACAA,YAAY,CAACX,KAAK,CAACU,QAAQ,CAAC,CAAC,EAAEV,KAAK,CAACU,QAAQ,CAAC,CAAC,CAAC;IAChD,OAAOM,WAAW;EACpB,CAAC,EAAE,CAAChB,KAAK,CAAC,CAAC;EAEX,OAAOQ,KAAK;AACd;AAEA,OAAO,MAAMU,OAAO,GAAGpB,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import "./patch/index.js";
|
|
4
|
+
import SessionRecorder from "./session-recorder.js";
|
|
5
|
+
export * from '@multiplayer-app/session-recorder-common';
|
|
6
|
+
export * from "./context/SessionRecorderContext.js";
|
|
7
|
+
export * from "./context/useSessionRecorderStore.js";
|
|
8
|
+
|
|
9
|
+
// Export TurboModule spec for codegen
|
|
10
|
+
export * from "./SessionRecorderNativeSpec.js";
|
|
11
|
+
|
|
12
|
+
// Export the class for type checking
|
|
13
|
+
export { SessionRecorder };
|
|
14
|
+
// Export the instance as default
|
|
15
|
+
export default SessionRecorder;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SessionRecorder"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,OAAO,kBAAS;AAChB,OAAOA,eAAe,MAAM,uBAAoB;AAChD,cAAc,0CAA0C;AACxD,cAAc,qCAAkC;AAChD,cAAc,sCAAmC;;AAEjD;AACA,cAAc,gCAA6B;;AAE3C;AACA,SAASA,eAAe;AACxB;AACA,eAAeA,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform, NativeEventEmitter } from 'react-native';
|
|
4
|
+
import SessionRecorderNative from "../SessionRecorderNativeSpec.js";
|
|
5
|
+
|
|
6
|
+
// Check if we're on web platform
|
|
7
|
+
const isWeb = Platform.OS === 'web';
|
|
8
|
+
|
|
9
|
+
// Get the Turbo Module
|
|
10
|
+
let eventEmitter = new NativeEventEmitter(SessionRecorderNative);
|
|
11
|
+
|
|
12
|
+
// Validate that the native module is available
|
|
13
|
+
if (!SessionRecorderNative && !isWeb) {
|
|
14
|
+
console.warn('SessionRecorderNative Turbo Module is not available. Auto-linking may not have completed yet.');
|
|
15
|
+
} else if (isWeb) {
|
|
16
|
+
console.info('SessionRecorderNative: Running on web platform, native module disabled');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Create a safe wrapper that handles web platform
|
|
20
|
+
const SafeSessionRecorderNative = {
|
|
21
|
+
async captureAndMask() {
|
|
22
|
+
if (isWeb || !SessionRecorderNative) {
|
|
23
|
+
throw new Error('SessionRecorderNative is not available on web platform');
|
|
24
|
+
}
|
|
25
|
+
return SessionRecorderNative.captureAndMask();
|
|
26
|
+
},
|
|
27
|
+
async captureAndMaskWithOptions(options) {
|
|
28
|
+
if (isWeb || !SessionRecorderNative) {
|
|
29
|
+
throw new Error('SessionRecorderNative is not available on web platform');
|
|
30
|
+
}
|
|
31
|
+
return SessionRecorderNative.captureAndMaskWithOptions(options);
|
|
32
|
+
},
|
|
33
|
+
async startGestureRecording() {
|
|
34
|
+
if (isWeb || !SessionRecorderNative) {
|
|
35
|
+
throw new Error('SessionRecorderNative is not available on web platform');
|
|
36
|
+
}
|
|
37
|
+
return SessionRecorderNative.startGestureRecording();
|
|
38
|
+
},
|
|
39
|
+
async stopGestureRecording() {
|
|
40
|
+
if (isWeb || !SessionRecorderNative) {
|
|
41
|
+
throw new Error('SessionRecorderNative is not available on web platform');
|
|
42
|
+
}
|
|
43
|
+
return SessionRecorderNative.stopGestureRecording();
|
|
44
|
+
},
|
|
45
|
+
async isGestureRecordingActive() {
|
|
46
|
+
if (isWeb || !SessionRecorderNative) {
|
|
47
|
+
throw new Error('SessionRecorderNative is not available on web platform');
|
|
48
|
+
}
|
|
49
|
+
return SessionRecorderNative.isGestureRecordingActive();
|
|
50
|
+
},
|
|
51
|
+
setGestureCallback(callback) {
|
|
52
|
+
if (isWeb || !SessionRecorderNative) {
|
|
53
|
+
throw new Error('SessionRecorderNative is not available on web platform');
|
|
54
|
+
}
|
|
55
|
+
// Native side will also invoke callback if provided; also subscribe to events here
|
|
56
|
+
try {
|
|
57
|
+
SessionRecorderNative.setGestureCallback(callback);
|
|
58
|
+
} catch {}
|
|
59
|
+
eventEmitter?.removeAllListeners('onGestureDetected');
|
|
60
|
+
eventEmitter?.addListener('onGestureDetected', callback);
|
|
61
|
+
},
|
|
62
|
+
recordGesture(gestureType, x, y, target, metadata) {
|
|
63
|
+
if (isWeb || !SessionRecorderNative) {
|
|
64
|
+
throw new Error('SessionRecorderNative is not available on web platform');
|
|
65
|
+
}
|
|
66
|
+
SessionRecorderNative.recordGesture(gestureType, x, y, target, metadata);
|
|
67
|
+
},
|
|
68
|
+
addListener(_eventName) {
|
|
69
|
+
// Required for RN event emitter contracts
|
|
70
|
+
},
|
|
71
|
+
removeListeners(_count) {
|
|
72
|
+
// Required for RN event emitter contracts
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
export default SafeSessionRecorderNative;
|
|
76
|
+
|
|
77
|
+
// Export event emitter for gesture events to maintain previous API
|
|
78
|
+
export const gestureEventEmitter = eventEmitter;
|
|
79
|
+
//# sourceMappingURL=SessionRecorderNative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","NativeEventEmitter","SessionRecorderNative","isWeb","OS","eventEmitter","console","warn","info","SafeSessionRecorderNative","captureAndMask","Error","captureAndMaskWithOptions","options","startGestureRecording","stopGestureRecording","isGestureRecordingActive","setGestureCallback","callback","removeAllListeners","addListener","recordGesture","gestureType","x","y","target","metadata","_eventName","removeListeners","_count","gestureEventEmitter"],"sourceRoot":"../../../src","sources":["native/SessionRecorderNative.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,kBAAkB,QAAQ,cAAc;AAC3D,OAAOC,qBAAqB,MAA0C,iCAA8B;;AAGpG;AACA,MAAMC,KAAK,GAAGH,QAAQ,CAACI,EAAE,KAAK,KAAK;;AAEnC;AACA,IAAIC,YAAY,GAAG,IAAIJ,kBAAkB,CAACC,qBAA4B,CAAC;;AAGvE;AACA,IAAI,CAACA,qBAAqB,IAAI,CAACC,KAAK,EAAE;EACpCG,OAAO,CAACC,IAAI,CACV,+FACF,CAAC;AACH,CAAC,MAAM,IAAIJ,KAAK,EAAE;EAChBG,OAAO,CAACE,IAAI,CACV,wEACF,CAAC;AACH;;AAEA;AACA,MAAMC,yBAA+B,GAAG;EACtC,MAAMC,cAAcA,CAAA,EAAoB;IACtC,IAAIP,KAAK,IAAI,CAACD,qBAAqB,EAAE;MACnC,MAAM,IAAIS,KAAK,CAAC,wDAAwD,CAAC;IAC3E;IACA,OAAOT,qBAAqB,CAACQ,cAAc,CAAC,CAAC;EAC/C,CAAC;EAED,MAAME,yBAAyBA,CAACC,OAAuB,EAAmB;IACxE,IAAIV,KAAK,IAAI,CAACD,qBAAqB,EAAE;MACnC,MAAM,IAAIS,KAAK,CAAC,wDAAwD,CAAC;IAC3E;IACA,OAAOT,qBAAqB,CAACU,yBAAyB,CAACC,OAAO,CAAC;EACjE,CAAC;EAED,MAAMC,qBAAqBA,CAAA,EAAkB;IAC3C,IAAIX,KAAK,IAAI,CAACD,qBAAqB,EAAE;MACnC,MAAM,IAAIS,KAAK,CAAC,wDAAwD,CAAC;IAC3E;IACA,OAAOT,qBAAqB,CAACY,qBAAqB,CAAC,CAAC;EACtD,CAAC;EAED,MAAMC,oBAAoBA,CAAA,EAAkB;IAC1C,IAAIZ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names":["default","SessionRecorderNative","gestureEventEmitter"],"sourceRoot":"../../../src","sources":["native/index.ts"],"mappings":";;AAAA,SACEA,OAAO,IAAIC,qBAAqB,EAChCC,mBAAmB,QAEd,4BAAyB","ignoreList":[]}
|