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