@cloudcare/browser-rum 3.0.27 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (386) hide show
  1. package/bundle/dataflux-rum.js +1 -1
  2. package/cjs/boot/buildEnv.js +3 -2
  3. package/cjs/boot/buildEnv.js.map +1 -0
  4. package/cjs/boot/recorderApi.js +5 -25
  5. package/cjs/boot/recorderApi.js.map +1 -0
  6. package/cjs/boot/rum.entry.js +2 -7
  7. package/cjs/boot/rum.entry.js.map +1 -0
  8. package/cjs/boot/rum.js +40 -43
  9. package/cjs/boot/rum.js.map +1 -0
  10. package/cjs/boot/rumPublicApi.js +40 -87
  11. package/cjs/boot/rumPublicApi.js.map +1 -0
  12. package/cjs/boot/startRecording.js +2 -9
  13. package/cjs/boot/startRecording.js.map +1 -0
  14. package/cjs/constants.js +8 -6
  15. package/cjs/constants.js.map +1 -0
  16. package/cjs/domain/assembly.js +12 -26
  17. package/cjs/domain/assembly.js.map +1 -0
  18. package/cjs/domain/configuration.js +15 -52
  19. package/cjs/domain/configuration.js.map +1 -0
  20. package/cjs/domain/contexts/commonContext.js +2 -2
  21. package/cjs/domain/contexts/commonContext.js.map +1 -0
  22. package/cjs/domain/contexts/displayContext.js +28 -0
  23. package/cjs/domain/contexts/displayContext.js.map +1 -0
  24. package/cjs/domain/contexts/foregroundContexts.js +4 -29
  25. package/cjs/domain/contexts/foregroundContexts.js.map +1 -0
  26. package/cjs/domain/contexts/internalContext.js +5 -4
  27. package/cjs/domain/contexts/internalContext.js.map +1 -0
  28. package/cjs/domain/contexts/pageStateHistory.js +106 -0
  29. package/cjs/domain/contexts/pageStateHistory.js.map +1 -0
  30. package/cjs/domain/contexts/urlContexts.js +3 -9
  31. package/cjs/domain/contexts/urlContexts.js.map +1 -0
  32. package/cjs/domain/contexts/viewContexts.js +2 -6
  33. package/cjs/domain/contexts/viewContexts.js.map +1 -0
  34. package/cjs/domain/domMutationCollection.js +8 -12
  35. package/cjs/domain/domMutationCollection.js.map +1 -0
  36. package/cjs/domain/initViewportObservable.js +4 -11
  37. package/cjs/domain/initViewportObservable.js.map +1 -0
  38. package/cjs/domain/locationChangeObservable.js +2 -11
  39. package/cjs/domain/locationChangeObservable.js.map +1 -0
  40. package/cjs/domain/performanceCollection.js +13 -42
  41. package/cjs/domain/performanceCollection.js.map +1 -0
  42. package/cjs/domain/replay/record/elementsScrollPositions.js +2 -3
  43. package/cjs/domain/replay/record/elementsScrollPositions.js.map +1 -0
  44. package/cjs/domain/replay/record/index.js +2 -4
  45. package/cjs/domain/replay/record/index.js.map +1 -0
  46. package/cjs/domain/replay/record/mutationBatch.js +22 -24
  47. package/cjs/domain/replay/record/mutationBatch.js.map +1 -0
  48. package/cjs/domain/replay/record/mutationObserver.js +28 -87
  49. package/cjs/domain/replay/record/mutationObserver.js.map +1 -0
  50. package/cjs/domain/replay/record/observers.js +16 -90
  51. package/cjs/domain/replay/record/observers.js.map +1 -0
  52. package/cjs/domain/replay/record/privacy.js +58 -61
  53. package/cjs/domain/replay/record/privacy.js.map +1 -0
  54. package/cjs/domain/replay/record/record.js +6 -29
  55. package/cjs/domain/replay/record/record.js.map +1 -0
  56. package/cjs/domain/replay/record/serializationUtils.js +65 -52
  57. package/cjs/domain/replay/record/serializationUtils.js.map +1 -0
  58. package/cjs/domain/replay/record/serialize.js +47 -189
  59. package/cjs/domain/replay/record/serialize.js.map +1 -0
  60. package/cjs/domain/replay/record/shadowRootsController.js +4 -11
  61. package/cjs/domain/replay/record/shadowRootsController.js.map +1 -0
  62. package/cjs/domain/replay/record/utils.js +4 -12
  63. package/cjs/domain/replay/record/utils.js.map +1 -0
  64. package/cjs/domain/replay/record/viewports.js +4 -42
  65. package/cjs/domain/replay/record/viewports.js.map +1 -0
  66. package/cjs/domain/replay/replayStats.js +2 -14
  67. package/cjs/domain/replay/replayStats.js.map +1 -0
  68. package/cjs/domain/replay/segmentCollection/buildReplayPayload.js +3 -8
  69. package/cjs/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -0
  70. package/cjs/domain/replay/segmentCollection/index.js +2 -3
  71. package/cjs/domain/replay/segmentCollection/index.js.map +1 -0
  72. package/cjs/domain/replay/segmentCollection/segment.js +7 -23
  73. package/cjs/domain/replay/segmentCollection/segment.js.map +1 -0
  74. package/cjs/domain/replay/segmentCollection/segmentCollection.js +5 -24
  75. package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -0
  76. package/cjs/domain/replay/segmentCollection/startDeflateWorker.js +5 -24
  77. package/cjs/domain/replay/segmentCollection/startDeflateWorker.js.map +1 -0
  78. package/cjs/domain/requestCollection.js +2 -17
  79. package/cjs/domain/requestCollection.js.map +1 -0
  80. package/cjs/domain/rumEventsCollection/actions/actionCollection.js +12 -22
  81. package/cjs/domain/rumEventsCollection/actions/actionCollection.js.map +1 -0
  82. package/cjs/domain/rumEventsCollection/actions/clickChain.js +3 -14
  83. package/cjs/domain/rumEventsCollection/actions/clickChain.js.map +1 -0
  84. package/cjs/domain/rumEventsCollection/actions/computeFrustration.js +12 -20
  85. package/cjs/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -0
  86. package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js +22 -53
  87. package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -0
  88. package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js +16 -48
  89. package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -0
  90. package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js +4 -6
  91. package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -0
  92. package/cjs/domain/rumEventsCollection/actions/trackClickActions.js +15 -45
  93. package/cjs/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -0
  94. package/cjs/domain/rumEventsCollection/error/errorCollection.js +13 -23
  95. package/cjs/domain/rumEventsCollection/error/errorCollection.js.map +1 -0
  96. package/cjs/domain/rumEventsCollection/error/trackConsoleError.js +2 -3
  97. package/cjs/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -0
  98. package/cjs/domain/rumEventsCollection/error/trackReportError.js +4 -5
  99. package/cjs/domain/rumEventsCollection/error/trackReportError.js.map +1 -0
  100. package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js +2 -7
  101. package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -0
  102. package/cjs/domain/rumEventsCollection/resource/matchRequestTiming.js +2 -13
  103. package/cjs/domain/rumEventsCollection/resource/matchRequestTiming.js.map +1 -0
  104. package/cjs/domain/rumEventsCollection/resource/resourceCollection.js +2 -18
  105. package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -0
  106. package/cjs/domain/rumEventsCollection/resource/resourceUtils.js +59 -69
  107. package/cjs/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -0
  108. package/cjs/domain/rumEventsCollection/view/interactionCountPolyfill.js +55 -0
  109. package/cjs/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -0
  110. package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js +62 -0
  111. package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -0
  112. package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +74 -0
  113. package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -0
  114. package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +26 -0
  115. package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -0
  116. package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js +2 -8
  117. package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -0
  118. package/cjs/domain/rumEventsCollection/view/trackFirstInputTimings.js +38 -0
  119. package/cjs/domain/rumEventsCollection/view/trackFirstInputTimings.js.map +1 -0
  120. package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js +26 -179
  121. package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -0
  122. package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +120 -0
  123. package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -0
  124. package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +49 -0
  125. package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -0
  126. package/cjs/domain/rumEventsCollection/view/trackLoadingTime.js +39 -0
  127. package/cjs/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -0
  128. package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js +37 -0
  129. package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -0
  130. package/cjs/domain/rumEventsCollection/view/trackScrollMetrics.js +61 -0
  131. package/cjs/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -0
  132. package/cjs/domain/rumEventsCollection/view/trackViewEventCounts.js +3 -6
  133. package/cjs/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -0
  134. package/cjs/domain/rumEventsCollection/view/trackViews.js +26 -58
  135. package/cjs/domain/rumEventsCollection/view/trackViews.js.map +1 -0
  136. package/cjs/domain/rumEventsCollection/view/viewCollection.js +43 -48
  137. package/cjs/domain/rumEventsCollection/view/viewCollection.js.map +1 -0
  138. package/cjs/domain/rumSessionManager.js +3 -13
  139. package/cjs/domain/rumSessionManager.js.map +1 -0
  140. package/cjs/domain/tracing/ddtraceTracer.js +2 -4
  141. package/cjs/domain/tracing/ddtraceTracer.js.map +1 -0
  142. package/cjs/domain/tracing/getDocumentTraceId.js +5 -22
  143. package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -0
  144. package/cjs/domain/tracing/jaegerTracer.js +2 -4
  145. package/cjs/domain/tracing/jaegerTracer.js.map +1 -0
  146. package/cjs/domain/tracing/skywalkingTracer.js +6 -13
  147. package/cjs/domain/tracing/skywalkingTracer.js.map +1 -0
  148. package/cjs/domain/tracing/traceIdentifier.js +2 -7
  149. package/cjs/domain/tracing/traceIdentifier.js.map +1 -0
  150. package/cjs/domain/tracing/tracer.js +5 -30
  151. package/cjs/domain/tracing/tracer.js.map +1 -0
  152. package/cjs/domain/tracing/w3cTraceParentTracer.js +2 -11
  153. package/cjs/domain/tracing/w3cTraceParentTracer.js.map +1 -0
  154. package/cjs/domain/tracing/zipkinMultiTracer.js +4 -6
  155. package/cjs/domain/tracing/zipkinMultiTracer.js.map +1 -0
  156. package/cjs/domain/tracing/zipkinSingleTracer.js +2 -4
  157. package/cjs/domain/tracing/zipkinSingleTracer.js.map +1 -0
  158. package/cjs/domain/trackEventCounts.js +2 -10
  159. package/cjs/domain/trackEventCounts.js.map +1 -0
  160. package/cjs/domain/usr/index.js +2 -7
  161. package/cjs/domain/usr/index.js.map +1 -0
  162. package/cjs/domain/waitPageActivityEnd.js +7 -23
  163. package/cjs/domain/waitPageActivityEnd.js.map +1 -0
  164. package/cjs/index.js +2 -2
  165. package/cjs/index.js.map +1 -0
  166. package/cjs/transport/startRumBatch.js +7 -8
  167. package/cjs/transport/startRumBatch.js.map +1 -0
  168. package/cjs/transport/startRumEventBridge.js +2 -3
  169. package/cjs/transport/startRumEventBridge.js.map +1 -0
  170. package/cjs/types/index.js +2 -3
  171. package/cjs/types/index.js.map +1 -0
  172. package/cjs/types/sessionReplayConstants.js +4 -3
  173. package/cjs/types/sessionReplayConstants.js.map +1 -0
  174. package/esm/boot/buildEnv.js +3 -2
  175. package/esm/boot/buildEnv.js.map +1 -0
  176. package/esm/boot/recorderApi.js +5 -19
  177. package/esm/boot/recorderApi.js.map +1 -0
  178. package/esm/boot/rum.entry.js +2 -1
  179. package/esm/boot/rum.entry.js.map +1 -0
  180. package/esm/boot/rum.js +41 -23
  181. package/esm/boot/rum.js.map +1 -0
  182. package/esm/boot/rumPublicApi.js +41 -82
  183. package/esm/boot/rumPublicApi.js.map +1 -0
  184. package/esm/boot/startRecording.js +2 -4
  185. package/esm/boot/startRecording.js.map +1 -0
  186. package/esm/constants.js +8 -4
  187. package/esm/constants.js.map +1 -0
  188. package/esm/domain/assembly.js +12 -23
  189. package/esm/domain/assembly.js.map +1 -0
  190. package/esm/domain/configuration.js +15 -38
  191. package/esm/domain/configuration.js.map +1 -0
  192. package/esm/domain/contexts/commonContext.js +2 -1
  193. package/esm/domain/contexts/commonContext.js.map +1 -0
  194. package/esm/domain/contexts/displayContext.js +21 -0
  195. package/esm/domain/contexts/displayContext.js.map +1 -0
  196. package/esm/domain/contexts/foregroundContexts.js +6 -25
  197. package/esm/domain/contexts/foregroundContexts.js.map +1 -0
  198. package/esm/domain/contexts/internalContext.js +5 -3
  199. package/esm/domain/contexts/internalContext.js.map +1 -0
  200. package/esm/domain/contexts/pageStateHistory.js +96 -0
  201. package/esm/domain/contexts/pageStateHistory.js.map +1 -0
  202. package/esm/domain/contexts/urlContexts.js +3 -6
  203. package/esm/domain/contexts/urlContexts.js.map +1 -0
  204. package/esm/domain/contexts/viewContexts.js +2 -3
  205. package/esm/domain/contexts/viewContexts.js.map +1 -0
  206. package/esm/domain/domMutationCollection.js +9 -10
  207. package/esm/domain/domMutationCollection.js.map +1 -0
  208. package/esm/domain/initViewportObservable.js +4 -6
  209. package/esm/domain/initViewportObservable.js.map +1 -0
  210. package/esm/domain/locationChangeObservable.js +2 -9
  211. package/esm/domain/locationChangeObservable.js.map +1 -0
  212. package/esm/domain/performanceCollection.js +14 -39
  213. package/esm/domain/performanceCollection.js.map +1 -0
  214. package/esm/domain/replay/record/elementsScrollPositions.js +2 -2
  215. package/esm/domain/replay/record/elementsScrollPositions.js.map +1 -0
  216. package/esm/domain/replay/record/index.js +2 -1
  217. package/esm/domain/replay/record/index.js.map +1 -0
  218. package/esm/domain/replay/record/mutationBatch.js +22 -21
  219. package/esm/domain/replay/record/mutationBatch.js.map +1 -0
  220. package/esm/domain/replay/record/mutationObserver.js +30 -81
  221. package/esm/domain/replay/record/mutationObserver.js.map +1 -0
  222. package/esm/domain/replay/record/observers.js +16 -73
  223. package/esm/domain/replay/record/observers.js.map +1 -0
  224. package/esm/domain/replay/record/privacy.js +58 -52
  225. package/esm/domain/replay/record/privacy.js.map +1 -0
  226. package/esm/domain/replay/record/record.js +6 -19
  227. package/esm/domain/replay/record/record.js.map +1 -0
  228. package/esm/domain/replay/record/serializationUtils.js +59 -36
  229. package/esm/domain/replay/record/serializationUtils.js.map +1 -0
  230. package/esm/domain/replay/record/serialize.js +46 -175
  231. package/esm/domain/replay/record/serialize.js.map +1 -0
  232. package/esm/domain/replay/record/shadowRootsController.js +4 -6
  233. package/esm/domain/replay/record/shadowRootsController.js.map +1 -0
  234. package/esm/domain/replay/record/utils.js +4 -6
  235. package/esm/domain/replay/record/utils.js.map +1 -0
  236. package/esm/domain/replay/record/viewports.js +3 -32
  237. package/esm/domain/replay/record/viewports.js.map +1 -0
  238. package/esm/domain/replay/replayStats.js +2 -8
  239. package/esm/domain/replay/replayStats.js.map +1 -0
  240. package/esm/domain/replay/segmentCollection/buildReplayPayload.js +3 -5
  241. package/esm/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -0
  242. package/esm/domain/replay/segmentCollection/index.js +2 -1
  243. package/esm/domain/replay/segmentCollection/index.js.map +1 -0
  244. package/esm/domain/replay/segmentCollection/segment.js +4 -12
  245. package/esm/domain/replay/segmentCollection/segment.js.map +1 -0
  246. package/esm/domain/replay/segmentCollection/segmentCollection.js +4 -13
  247. package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -0
  248. package/esm/domain/replay/segmentCollection/startDeflateWorker.js +5 -16
  249. package/esm/domain/replay/segmentCollection/startDeflateWorker.js.map +1 -0
  250. package/esm/domain/requestCollection.js +2 -10
  251. package/esm/domain/requestCollection.js.map +1 -0
  252. package/esm/domain/rumEventsCollection/actions/actionCollection.js +12 -19
  253. package/esm/domain/rumEventsCollection/actions/actionCollection.js.map +1 -0
  254. package/esm/domain/rumEventsCollection/actions/clickChain.js +3 -10
  255. package/esm/domain/rumEventsCollection/actions/clickChain.js.map +1 -0
  256. package/esm/domain/rumEventsCollection/actions/computeFrustration.js +12 -14
  257. package/esm/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -0
  258. package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js +22 -50
  259. package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -0
  260. package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js +15 -43
  261. package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -0
  262. package/esm/domain/rumEventsCollection/actions/listenActionEvents.js +4 -4
  263. package/esm/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -0
  264. package/esm/domain/rumEventsCollection/actions/trackClickActions.js +18 -37
  265. package/esm/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -0
  266. package/esm/domain/rumEventsCollection/error/errorCollection.js +14 -19
  267. package/esm/domain/rumEventsCollection/error/errorCollection.js.map +1 -0
  268. package/esm/domain/rumEventsCollection/error/trackConsoleError.js +2 -1
  269. package/esm/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -0
  270. package/esm/domain/rumEventsCollection/error/trackReportError.js +4 -3
  271. package/esm/domain/rumEventsCollection/error/trackReportError.js.map +1 -0
  272. package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js +2 -5
  273. package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -0
  274. package/esm/domain/rumEventsCollection/resource/matchRequestTiming.js +3 -11
  275. package/esm/domain/rumEventsCollection/resource/matchRequestTiming.js.map +1 -0
  276. package/esm/domain/rumEventsCollection/resource/resourceCollection.js +2 -13
  277. package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -0
  278. package/esm/domain/rumEventsCollection/resource/resourceUtils.js +59 -57
  279. package/esm/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -0
  280. package/esm/domain/rumEventsCollection/view/interactionCountPolyfill.js +47 -0
  281. package/esm/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -0
  282. package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js +56 -0
  283. package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -0
  284. package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +67 -0
  285. package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -0
  286. package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +18 -0
  287. package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -0
  288. package/esm/domain/rumEventsCollection/view/trackFirstHidden.js +2 -4
  289. package/esm/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -0
  290. package/esm/domain/rumEventsCollection/view/trackFirstInputTimings.js +32 -0
  291. package/esm/domain/rumEventsCollection/view/trackFirstInputTimings.js.map +1 -0
  292. package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js +25 -164
  293. package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -0
  294. package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +113 -0
  295. package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -0
  296. package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +41 -0
  297. package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -0
  298. package/esm/domain/rumEventsCollection/view/trackLoadingTime.js +33 -0
  299. package/esm/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -0
  300. package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js +31 -0
  301. package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -0
  302. package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js +53 -0
  303. package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -0
  304. package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js +5 -3
  305. package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -0
  306. package/esm/domain/rumEventsCollection/view/trackViews.js +28 -54
  307. package/esm/domain/rumEventsCollection/view/trackViews.js.map +1 -0
  308. package/esm/domain/rumEventsCollection/view/viewCollection.js +43 -44
  309. package/esm/domain/rumEventsCollection/view/viewCollection.js.map +1 -0
  310. package/esm/domain/rumSessionManager.js +3 -9
  311. package/esm/domain/rumSessionManager.js.map +1 -0
  312. package/esm/domain/tracing/ddtraceTracer.js +2 -2
  313. package/esm/domain/tracing/ddtraceTracer.js.map +1 -0
  314. package/esm/domain/tracing/getDocumentTraceId.js +5 -15
  315. package/esm/domain/tracing/getDocumentTraceId.js.map +1 -0
  316. package/esm/domain/tracing/jaegerTracer.js +3 -2
  317. package/esm/domain/tracing/jaegerTracer.js.map +1 -0
  318. package/esm/domain/tracing/skywalkingTracer.js +8 -12
  319. package/esm/domain/tracing/skywalkingTracer.js.map +1 -0
  320. package/esm/domain/tracing/traceIdentifier.js +2 -4
  321. package/esm/domain/tracing/traceIdentifier.js.map +1 -0
  322. package/esm/domain/tracing/tracer.js +5 -19
  323. package/esm/domain/tracing/tracer.js.map +1 -0
  324. package/esm/domain/tracing/w3cTraceParentTracer.js +4 -8
  325. package/esm/domain/tracing/w3cTraceParentTracer.js.map +1 -0
  326. package/esm/domain/tracing/zipkinMultiTracer.js +5 -4
  327. package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -0
  328. package/esm/domain/tracing/zipkinSingleTracer.js +3 -2
  329. package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -0
  330. package/esm/domain/trackEventCounts.js +2 -8
  331. package/esm/domain/trackEventCounts.js.map +1 -0
  332. package/esm/domain/usr/index.js +2 -3
  333. package/esm/domain/usr/index.js.map +1 -0
  334. package/esm/domain/waitPageActivityEnd.js +9 -19
  335. package/esm/domain/waitPageActivityEnd.js.map +1 -0
  336. package/esm/index.js +2 -1
  337. package/esm/index.js.map +1 -0
  338. package/esm/transport/startRumBatch.js +7 -6
  339. package/esm/transport/startRumBatch.js.map +1 -0
  340. package/esm/transport/startRumEventBridge.js +2 -1
  341. package/esm/transport/startRumEventBridge.js.map +1 -0
  342. package/esm/types/index.js.map +1 -0
  343. package/esm/types/sessionReplayConstants.js +5 -3
  344. package/esm/types/sessionReplayConstants.js.map +1 -0
  345. package/package.json +6 -5
  346. package/src/boot/rum.js +45 -10
  347. package/src/boot/rumPublicApi.js +41 -38
  348. package/src/domain/assembly.js +9 -8
  349. package/src/domain/configuration.js +0 -1
  350. package/src/domain/contexts/displayContext.js +29 -0
  351. package/src/domain/contexts/internalContext.js +3 -1
  352. package/src/domain/contexts/pageStateHistory.js +139 -0
  353. package/src/domain/domMutationCollection.js +20 -17
  354. package/src/domain/performanceCollection.js +4 -3
  355. package/src/domain/replay/record/mutationBatch.js +21 -3
  356. package/src/domain/replay/record/mutationObserver.js +4 -2
  357. package/src/domain/replay/record/observers.js +7 -4
  358. package/src/domain/replay/record/privacy.js +25 -6
  359. package/src/domain/replay/record/record.js +2 -2
  360. package/src/domain/replay/record/serializationUtils.js +67 -3
  361. package/src/domain/replay/record/serialize.js +16 -82
  362. package/src/domain/replay/record/shadowRootsController.js +0 -1
  363. package/src/domain/replay/record/viewports.js +0 -26
  364. package/src/domain/rumEventsCollection/actions/actionCollection.js +12 -12
  365. package/src/domain/rumEventsCollection/actions/getSelectorsFromElement.js +4 -4
  366. package/src/domain/rumEventsCollection/actions/trackClickActions.js +8 -6
  367. package/src/domain/rumEventsCollection/error/errorCollection.js +20 -15
  368. package/src/domain/rumEventsCollection/error/trackReportError.js +22 -16
  369. package/src/domain/rumEventsCollection/resource/resourceUtils.js +4 -1
  370. package/src/domain/rumEventsCollection/view/interactionCountPolyfill.js +59 -0
  371. package/src/domain/rumEventsCollection/view/trackCommonViewMetrics.js +87 -0
  372. package/src/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +73 -0
  373. package/src/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +23 -0
  374. package/src/domain/rumEventsCollection/view/trackFirstInputTimings.js +40 -0
  375. package/src/domain/rumEventsCollection/view/trackInitialViewTimings.js +29 -199
  376. package/src/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +144 -0
  377. package/src/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +57 -0
  378. package/src/domain/rumEventsCollection/view/trackLoadingTime.js +50 -0
  379. package/src/domain/rumEventsCollection/view/trackNavigationTimings.js +35 -0
  380. package/src/domain/rumEventsCollection/view/trackScrollMetrics.js +74 -0
  381. package/src/domain/rumEventsCollection/view/trackViews.js +32 -37
  382. package/src/domain/rumEventsCollection/view/viewCollection.js +51 -22
  383. package/src/transport/startRumBatch.js +5 -1
  384. package/cjs/domain/rumEventsCollection/view/trackViewMetrics.js +0 -156
  385. package/esm/domain/rumEventsCollection/view/trackViewMetrics.js +0 -146
  386. package/src/domain/rumEventsCollection/view/trackViewMetrics.js +0 -176
@@ -4,99 +4,74 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.makeRumPublicApi = makeRumPublicApi;
7
-
8
7
  var _browserCore = require("@cloudcare/browser-core");
9
-
10
8
  var _configuration = require("../domain/configuration");
11
-
12
9
  var _commonContext = require("../domain/contexts/commonContext");
13
-
14
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
15
-
10
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
16
11
  function makeRumPublicApi(startRumImpl, recorderApi) {
17
12
  var isAlreadyInitialized = false;
18
13
  var globalContextManager = (0, _browserCore.createContextManager)(_browserCore.CustomerDataType.GlobalContext);
19
14
  var userContextManager = (0, _browserCore.createContextManager)(_browserCore.CustomerDataType.User);
20
-
21
15
  var getInternalContextStrategy = function getInternalContextStrategy() {
22
16
  return undefined;
23
17
  };
24
-
25
18
  var getInitConfigurationStrategy = function getInitConfigurationStrategy() {
26
19
  return undefined;
27
20
  };
28
-
29
21
  var stopSessionStrategy = function stopSessionStrategy() {
30
22
  return (0, _browserCore.noop)();
31
23
  };
32
-
33
24
  var bufferApiCalls = new _browserCore.BoundedBuffer();
34
-
35
25
  var _addTimingStrategy = function addTimingStrategy(name, time) {
36
26
  if (typeof time === 'undefined') {
37
27
  time = (0, _browserCore.timeStampNow)();
38
28
  }
39
-
40
29
  bufferApiCalls.add(function () {
41
30
  return _addTimingStrategy(name, time);
42
31
  });
43
32
  };
44
-
45
33
  var _startViewStrategy = function startViewStrategy(options, startClocks) {
46
34
  if (typeof startClocks === 'undefined') {
47
35
  startClocks = (0, _browserCore.clocksNow)();
48
36
  }
49
-
50
37
  bufferApiCalls.add(function () {
51
38
  return _startViewStrategy(options, startClocks);
52
39
  });
53
40
  };
54
-
55
41
  var _addActionStrategy = function addActionStrategy(action, commonContext) {
56
42
  if (typeof commonContext == 'undefined') {
57
43
  commonContext = (0, _commonContext.buildCommonContext)(globalContextManager, userContextManager, recorderApi);
58
44
  }
59
-
60
45
  bufferApiCalls.add(function () {
61
46
  return _addActionStrategy(action, commonContext);
62
47
  });
63
48
  };
64
-
65
49
  var _addErrorStrategy = function addErrorStrategy(providedError, commonContext) {
66
50
  if (typeof commonContext == 'undefined') {
67
51
  commonContext = (0, _commonContext.buildCommonContext)(globalContextManager, userContextManager, recorderApi);
68
52
  }
69
-
70
53
  bufferApiCalls.add(function () {
71
54
  return _addErrorStrategy(providedError, commonContext);
72
55
  });
73
56
  };
74
-
75
57
  function initRum(initConfiguration) {
76
58
  getInitConfigurationStrategy = function getInitConfigurationStrategy() {
77
59
  return (0, _browserCore.deepClone)(initConfiguration);
78
60
  };
79
-
80
61
  var eventBridgeAvailable = (0, _browserCore.canUseEventBridge)();
81
-
82
62
  if (eventBridgeAvailable) {
83
63
  initConfiguration = overrideInitConfigurationForBridge(initConfiguration);
84
64
  }
85
-
86
65
  if (!canHandleSession(initConfiguration)) {
87
66
  return;
88
67
  }
89
-
90
68
  if (!canInitRum(initConfiguration)) {
91
69
  return;
92
70
  }
93
-
94
71
  var configuration = (0, _configuration.validateAndBuildRumConfiguration)(initConfiguration);
95
-
96
72
  if (!configuration) {
97
73
  return;
98
74
  }
99
-
100
75
  if (!configuration.trackViewsManually) {
101
76
  doStartRum(configuration);
102
77
  } else {
@@ -105,17 +80,13 @@ function makeRumPublicApi(startRumImpl, recorderApi) {
105
80
  // in order to ensure that calls are processed in order
106
81
  var beforeInitCalls = bufferApiCalls;
107
82
  bufferApiCalls = new _browserCore.BoundedBuffer();
108
-
109
83
  _startViewStrategy = function _startViewStrategy(options) {
110
84
  doStartRum(configuration, options);
111
85
  };
112
-
113
86
  beforeInitCalls.drain();
114
87
  }
115
-
116
88
  isAlreadyInitialized = true;
117
89
  }
118
-
119
90
  function doStartRum(configuration, initialViewOptions) {
120
91
  var startRumResults = startRumImpl(configuration, recorderApi, globalContextManager, userContextManager, initialViewOptions);
121
92
  _startViewStrategy = startRumResults.startView;
@@ -127,126 +98,108 @@ function makeRumPublicApi(startRumImpl, recorderApi) {
127
98
  bufferApiCalls.drain();
128
99
  recorderApi.onRumStart(startRumResults.lifeCycle, configuration, startRumResults.session, startRumResults.viewContexts);
129
100
  }
130
-
131
- var startView = function startView(options) {
101
+ var startView = (0, _browserCore.monitor)(function (options) {
132
102
  var sanitizedOptions = _typeof(options) === 'object' ? options : {
133
103
  name: options
134
104
  };
135
-
136
105
  _startViewStrategy(sanitizedOptions);
137
- };
138
-
106
+ });
139
107
  var rumPublicApi = (0, _browserCore.makePublicApi)({
140
- init: initRum,
141
-
108
+ init: (0, _browserCore.monitor)(initRum),
142
109
  /** @deprecated: use setGlobalContextProperty instead */
143
- addRumGlobalContext: globalContextManager.add,
144
- setGlobalContextProperty: globalContextManager.setContextProperty,
145
-
110
+ addRumGlobalContext: (0, _browserCore.monitor)(globalContextManager.add),
111
+ setGlobalContextProperty: (0, _browserCore.monitor)(globalContextManager.setContextProperty),
146
112
  /** @deprecated: use removeGlobalContextProperty instead */
147
- removeRumGlobalContext: globalContextManager.remove,
148
- removeGlobalContextProperty: globalContextManager.removeContextProperty,
149
-
113
+ removeRumGlobalContext: (0, _browserCore.monitor)(globalContextManager.remove),
114
+ removeGlobalContextProperty: (0, _browserCore.monitor)(globalContextManager.removeContextProperty),
150
115
  /** @deprecated: use getGlobalContext instead */
151
- getRumGlobalContext: globalContextManager.get,
152
- getGlobalContext: globalContextManager.getContext,
153
-
116
+ getRumGlobalContext: (0, _browserCore.monitor)(globalContextManager.get),
117
+ getGlobalContext: (0, _browserCore.monitor)(globalContextManager.getContext),
154
118
  /** @deprecated: use setGlobalContext instead */
155
- setRumGlobalContext: globalContextManager.set,
156
- setGlobalContext: globalContextManager.setContext,
157
- clearGlobalContext: globalContextManager.clearContext,
158
- getInitConfiguration: function getInitConfiguration() {
119
+ setRumGlobalContext: (0, _browserCore.monitor)(globalContextManager.set),
120
+ setGlobalContext: (0, _browserCore.monitor)(globalContextManager.setContext),
121
+ clearGlobalContext: (0, _browserCore.monitor)(globalContextManager.clearContext),
122
+ getInitConfiguration: (0, _browserCore.monitor)(function () {
159
123
  return getInitConfigurationStrategy();
160
- },
161
- getInternalContext: function getInternalContext(startTime) {
124
+ }),
125
+ getInternalContext: (0, _browserCore.monitor)(function (startTime) {
162
126
  return getInternalContextStrategy(startTime);
163
- },
164
- addDebugSession: function addDebugSession(id) {},
165
- clearDebugSession: function clearDebugSession() {},
166
- getDebugSession: function getDebugSession() {},
167
- addAction: function addAction(name, context) {
127
+ }),
128
+ addDebugSession: (0, _browserCore.monitor)(function (id) {}),
129
+ clearDebugSession: (0, _browserCore.monitor)(function () {}),
130
+ getDebugSession: (0, _browserCore.monitor)(function () {}),
131
+ addAction: (0, _browserCore.monitor)(function (name, context) {
168
132
  _addActionStrategy({
169
133
  name: name,
170
134
  context: (0, _browserCore.deepClone)(context),
171
135
  startClocks: (0, _browserCore.clocksNow)(),
172
136
  type: _browserCore.ActionType.CUSTOM
173
137
  });
174
- },
175
- addError: function addError(error, context) {
138
+ }),
139
+ addError: (0, _browserCore.monitor)(function (error, context) {
176
140
  var handlingStack = (0, _browserCore.createHandlingStack)();
177
-
178
141
  _addErrorStrategy({
179
142
  error: error,
180
143
  handlingStack: handlingStack,
181
144
  context: (0, _browserCore.deepClone)(context),
182
145
  startClocks: (0, _browserCore.clocksNow)()
183
146
  });
184
- },
185
- addTiming: function addTiming(name, time) {
147
+ }),
148
+ addTiming: (0, _browserCore.monitor)(function (name, time) {
186
149
  _addTimingStrategy(name, time);
187
- },
188
- setUser: function setUser(newUser) {
150
+ }),
151
+ setUser: (0, _browserCore.monitor)(function (newUser) {
189
152
  if ((0, _browserCore.checkUser)(newUser)) {
190
153
  userContextManager.setContext((0, _browserCore.sanitizeUser)(newUser));
191
154
  }
192
- },
193
- getUser: userContextManager.getContext,
194
- setUserProperty: function setUserProperty(key, property) {
155
+ }),
156
+ getUser: (0, _browserCore.monitor)(userContextManager.getContext),
157
+ setUserProperty: (0, _browserCore.monitor)(function (key, property) {
195
158
  var newUser = {};
196
159
  newUser[key] = property;
197
160
  var sanitizedProperty = (0, _browserCore.sanitizeUser)(newUser)[key];
198
161
  userContextManager.setContextProperty(key, sanitizedProperty);
199
- },
200
- removeUserProperty: userContextManager.removeContextProperty,
201
-
162
+ }),
163
+ removeUserProperty: (0, _browserCore.monitor)(userContextManager.removeContextProperty),
202
164
  /** @deprecated: renamed to clearUser */
203
- removeUser: userContextManager.clearContext,
204
- clearUser: userContextManager.clearContext,
165
+ removeUser: (0, _browserCore.monitor)(userContextManager.clearContext),
166
+ clearUser: (0, _browserCore.monitor)(userContextManager.clearContext),
205
167
  startView: startView,
206
- stopSession: function stopSession() {
168
+ stopSession: (0, _browserCore.monitor)(function () {
207
169
  stopSessionStrategy();
208
- },
209
- startSessionReplayRecording: recorderApi.start,
210
- stopSessionReplayRecording: recorderApi.stop
170
+ }),
171
+ startSessionReplayRecording: (0, _browserCore.monitor)(recorderApi.start),
172
+ stopSessionReplayRecording: (0, _browserCore.monitor)(recorderApi.stop)
211
173
  });
212
174
  return rumPublicApi;
213
-
214
175
  function canHandleSession(initConfiguration) {
215
176
  if (!(0, _browserCore.areCookiesAuthorized)((0, _browserCore.buildCookieOptions)(initConfiguration))) {
216
177
  _browserCore.display.warn('Cookies are not authorized, we will not send any data.');
217
-
218
178
  return false;
219
179
  }
220
-
221
180
  if (isLocalFile()) {
222
181
  _browserCore.display.error('Execution is not allowed in the current context.');
223
-
224
182
  return false;
225
183
  }
226
-
227
184
  return true;
228
185
  }
229
-
230
186
  function canInitRum(initConfiguration) {
231
187
  if (isAlreadyInitialized) {
232
188
  if (!initConfiguration.silentMultipleInit) {
233
189
  _browserCore.display.error('DATAFLUX_RUM is already initialized.');
234
190
  }
235
-
236
191
  return false;
237
192
  }
238
-
239
193
  return true;
240
194
  }
241
-
242
195
  function isLocalFile() {
243
196
  return window.location.protocol === 'file:';
244
197
  }
245
-
246
198
  function overrideInitConfigurationForBridge(initConfiguration) {
247
199
  return (0, _browserCore.assign)({}, initConfiguration, {
248
200
  applicationId: '00000000-aaaa-0000-aaaa-000000000000',
249
201
  sessionSampleRate: 100
250
202
  });
251
203
  }
252
- }
204
+ }
205
+ //# sourceMappingURL=rumPublicApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rumPublicApi.js","names":["_browserCore","require","_configuration","_commonContext","_typeof","obj","Symbol","iterator","constructor","prototype","makeRumPublicApi","startRumImpl","recorderApi","isAlreadyInitialized","globalContextManager","createContextManager","CustomerDataType","GlobalContext","userContextManager","User","getInternalContextStrategy","undefined","getInitConfigurationStrategy","stopSessionStrategy","noop","bufferApiCalls","BoundedBuffer","addTimingStrategy","name","time","timeStampNow","add","startViewStrategy","options","startClocks","clocksNow","addActionStrategy","action","commonContext","buildCommonContext","addErrorStrategy","providedError","initRum","initConfiguration","deepClone","eventBridgeAvailable","canUseEventBridge","overrideInitConfigurationForBridge","canHandleSession","canInitRum","configuration","validateAndBuildRumConfiguration","trackViewsManually","doStartRum","beforeInitCalls","_startViewStrategy","drain","initialViewOptions","startRumResults","startView","addAction","addError","addTiming","getInternalContext","stopSession","onRumStart","lifeCycle","session","viewContexts","monitor","sanitizedOptions","rumPublicApi","makePublicApi","init","addRumGlobalContext","setGlobalContextProperty","setContextProperty","removeRumGlobalContext","remove","removeGlobalContextProperty","removeContextProperty","getRumGlobalContext","get","getGlobalContext","getContext","setRumGlobalContext","set","setGlobalContext","setContext","clearGlobalContext","clearContext","getInitConfiguration","startTime","addDebugSession","id","clearDebugSession","getDebugSession","context","type","ActionType","CUSTOM","error","handlingStack","createHandlingStack","setUser","newUser","checkUser","sanitizeUser","getUser","setUserProperty","key","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","startSessionReplayRecording","start","stopSessionReplayRecording","stop","areCookiesAuthorized","buildCookieOptions","display","warn","isLocalFile","silentMultipleInit","window","location","protocol","assign","applicationId","sessionSampleRate"],"sources":["../../src/boot/rumPublicApi.js"],"sourcesContent":["import {\n makePublicApi,\n areCookiesAuthorized,\n BoundedBuffer,\n display,\n buildCookieOptions,\n createContextManager,\n CustomerDataType,\n clocksNow,\n timeStampNow,\n ActionType,\n deepClone,\n createHandlingStack,\n sanitizeUser,\n checkUser,\n noop,\n assign,\n canUseEventBridge,\n monitor\n} from '@cloudcare/browser-core'\nimport { validateAndBuildRumConfiguration } from '../domain/configuration'\nimport { buildCommonContext } from '../domain/contexts/commonContext'\nexport function makeRumPublicApi(startRumImpl, recorderApi) {\n var isAlreadyInitialized = false\n\n var globalContextManager = createContextManager(\n CustomerDataType.GlobalContext\n )\n var userContextManager = createContextManager(CustomerDataType.User)\n\n var getInternalContextStrategy = function () {\n return undefined\n }\n var getInitConfigurationStrategy = function () {\n return undefined\n }\n var stopSessionStrategy = function () {\n return noop()\n }\n var bufferApiCalls = new BoundedBuffer()\n var addTimingStrategy = function (name, time) {\n if (typeof time === 'undefined') {\n time = timeStampNow()\n }\n bufferApiCalls.add(function () {\n return addTimingStrategy(name, time)\n })\n }\n var startViewStrategy = function (options, startClocks) {\n if (typeof startClocks === 'undefined') {\n startClocks = clocksNow()\n }\n bufferApiCalls.add(function () {\n return startViewStrategy(options, startClocks)\n })\n }\n var addActionStrategy = function (action, commonContext) {\n if (typeof commonContext == 'undefined') {\n commonContext = buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n bufferApiCalls.add(function () {\n return addActionStrategy(action, commonContext)\n })\n }\n var addErrorStrategy = function (providedError, commonContext) {\n if (typeof commonContext == 'undefined') {\n commonContext = buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n bufferApiCalls.add(function () {\n return addErrorStrategy(providedError, commonContext)\n })\n }\n\n function initRum(initConfiguration) {\n getInitConfigurationStrategy = function () {\n return deepClone(initConfiguration)\n }\n var eventBridgeAvailable = canUseEventBridge()\n if (eventBridgeAvailable) {\n initConfiguration = overrideInitConfigurationForBridge(initConfiguration)\n }\n if (!canHandleSession(initConfiguration)) {\n return\n }\n\n if (!canInitRum(initConfiguration)) {\n return\n }\n\n var configuration = validateAndBuildRumConfiguration(initConfiguration)\n if (!configuration) {\n return\n }\n\n if (!configuration.trackViewsManually) {\n doStartRum(configuration)\n } else {\n // drain beforeInitCalls by buffering them until we start RUM\n // if we get a startView, drain re-buffered calls before continuing to drain beforeInitCalls\n // in order to ensure that calls are processed in order\n var beforeInitCalls = bufferApiCalls\n bufferApiCalls = new BoundedBuffer()\n\n startViewStrategy = function (options) {\n doStartRum(configuration, options)\n }\n beforeInitCalls.drain()\n }\n\n isAlreadyInitialized = true\n }\n function doStartRum(configuration, initialViewOptions) {\n var startRumResults = startRumImpl(\n configuration,\n recorderApi,\n globalContextManager,\n userContextManager,\n initialViewOptions\n )\n startViewStrategy = startRumResults.startView\n addActionStrategy = startRumResults.addAction\n addErrorStrategy = startRumResults.addError\n addTimingStrategy = startRumResults.addTiming\n getInternalContextStrategy = startRumResults.getInternalContext\n stopSessionStrategy = startRumResults.stopSession\n bufferApiCalls.drain()\n recorderApi.onRumStart(\n startRumResults.lifeCycle,\n configuration,\n startRumResults.session,\n startRumResults.viewContexts\n )\n }\n var startView = monitor(function (options) {\n var sanitizedOptions =\n typeof options === 'object' ? options : { name: options }\n startViewStrategy(sanitizedOptions)\n })\n var rumPublicApi = makePublicApi({\n init: monitor(initRum),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(globalContextManager.add),\n setGlobalContextProperty: monitor(globalContextManager.setContextProperty),\n\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(globalContextManager.remove),\n removeGlobalContextProperty: monitor(\n globalContextManager.removeContextProperty\n ),\n\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(globalContextManager.get),\n getGlobalContext: monitor(globalContextManager.getContext),\n\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(globalContextManager.set),\n setGlobalContext: monitor(globalContextManager.setContext),\n\n clearGlobalContext: monitor(globalContextManager.clearContext),\n\n getInitConfiguration: monitor(function () {\n return getInitConfigurationStrategy()\n }),\n getInternalContext: monitor(function (startTime) {\n return getInternalContextStrategy(startTime)\n }),\n addDebugSession: monitor(function (id) {}),\n clearDebugSession: monitor(function () {}),\n getDebugSession: monitor(function () {}),\n addAction: monitor(function (name, context) {\n addActionStrategy({\n name: name,\n context: deepClone(context),\n startClocks: clocksNow(),\n type: ActionType.CUSTOM\n })\n }),\n addError: monitor(function (error, context) {\n var handlingStack = createHandlingStack()\n addErrorStrategy({\n error: error,\n handlingStack: handlingStack,\n context: deepClone(context),\n startClocks: clocksNow()\n })\n }),\n addTiming: monitor(function (name, time) {\n addTimingStrategy(name, time)\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser))\n }\n }),\n getUser: monitor(userContextManager.getContext),\n setUserProperty: monitor(function (key, property) {\n var newUser = {}\n newUser[key] = property\n var sanitizedProperty = sanitizeUser(newUser)[key]\n userContextManager.setContextProperty(key, sanitizedProperty)\n }),\n removeUserProperty: monitor(userContextManager.removeContextProperty),\n\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(userContextManager.clearContext),\n clearUser: monitor(userContextManager.clearContext),\n startView: startView,\n stopSession: monitor(function () {\n stopSessionStrategy()\n }),\n startSessionReplayRecording: monitor(recorderApi.start),\n stopSessionReplayRecording: monitor(recorderApi.stop)\n })\n return rumPublicApi\n function canHandleSession(initConfiguration) {\n if (!areCookiesAuthorized(buildCookieOptions(initConfiguration))) {\n display.warn('Cookies are not authorized, we will not send any data.')\n return false\n }\n\n if (isLocalFile()) {\n display.error('Execution is not allowed in the current context.')\n return false\n }\n return true\n }\n function canInitRum(initConfiguration) {\n if (isAlreadyInitialized) {\n if (!initConfiguration.silentMultipleInit) {\n display.error('DATAFLUX_RUM is already initialized.')\n }\n return false\n }\n return true\n }\n function isLocalFile() {\n return window.location.protocol === 'file:'\n }\n function overrideInitConfigurationForBridge(initConfiguration) {\n return assign({}, initConfiguration, {\n applicationId: '00000000-aaaa-0000-aaaa-000000000000',\n sessionSampleRate: 100\n })\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAoBA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAAqE,SAAAG,QAAAC,GAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,GAAA,kBAAAA,GAAA,gBAAAA,GAAA,WAAAA,GAAA,yBAAAC,MAAA,IAAAD,GAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,GAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,GAAA,KAAAD,OAAA,CAAAC,GAAA;AAC9D,SAASK,gBAAgBA,CAACC,YAAY,EAAEC,WAAW,EAAE;E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J;AACF"}
@@ -4,33 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.startRecording = startRecording;
7
-
8
7
  var _browserCore = require("@cloudcare/browser-core");
9
-
10
8
  var _record2 = require("../domain/replay/record");
11
-
12
9
  var _segmentCollection = require("../domain/replay/segmentCollection");
13
-
14
10
  var _types = require("../types");
15
-
16
11
  function startRecording(lifeCycle, configuration, sessionManager, viewContexts, worker, httpRequest) {
17
12
  var reportError = function reportError(error) {
18
13
  lifeCycle.notify(_browserCore.LifeCycleEventType.RAW_ERROR_COLLECTED, {
19
14
  error: error
20
15
  });
21
16
  };
22
-
23
17
  var replayRequest = httpRequest || (0, _browserCore.createHttpRequest)(configuration.sessionReplayEndPoint, _segmentCollection.SEGMENT_BYTES_LIMIT, reportError);
24
18
  var segmentCollection = (0, _segmentCollection.startSegmentCollection)(lifeCycle, configuration, sessionManager, viewContexts, replayRequest, worker);
25
19
  var addRecord = segmentCollection.addRecord;
26
20
  var stopSegmentCollection = segmentCollection.stop;
27
-
28
21
  var _record = (0, _record2.record)({
29
22
  emit: addRecord,
30
23
  configuration: configuration,
31
24
  lifeCycle: lifeCycle
32
25
  });
33
-
34
26
  var stopRecording = _record.stop;
35
27
  var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot;
36
28
  var flushMutations = _record.flushMutations;
@@ -52,4 +44,5 @@ function startRecording(lifeCycle, configuration, sessionManager, viewContexts,
52
44
  stopSegmentCollection();
53
45
  }
54
46
  };
55
- }
47
+ }
48
+ //# sourceMappingURL=startRecording.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startRecording.js","names":["_browserCore","require","_record2","_segmentCollection","_types","startRecording","lifeCycle","configuration","sessionManager","viewContexts","worker","httpRequest","reportError","error","notify","LifeCycleEventType","RAW_ERROR_COLLECTED","replayRequest","createHttpRequest","sessionReplayEndPoint","SEGMENT_BYTES_LIMIT","segmentCollection","startSegmentCollection","addRecord","stopSegmentCollection","stop","_record","record","emit","stopRecording","takeSubsequentFullSnapshot","flushMutations","subscribeViewEnded","subscribe","VIEW_ENDED","timestamp","timeStampNow","type","RecordType","ViewEnd","scribeViewCreated","VIEW_CREATED","view","startClocks","timeStamp","unsubscribe"],"sources":["../../src/boot/startRecording.js"],"sourcesContent":["import {\n timeStampNow,\n createHttpRequest,\n LifeCycleEventType\n} from '@cloudcare/browser-core'\nimport { record } from '../domain/replay/record'\nimport {\n startSegmentCollection,\n SEGMENT_BYTES_LIMIT\n} from '../domain/replay/segmentCollection'\nimport { RecordType } from '../types'\n\nexport function startRecording(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n worker,\n httpRequest\n) {\n var reportError = function (error) {\n lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, { error: error })\n }\n\n var replayRequest =\n httpRequest ||\n createHttpRequest(\n configuration.sessionReplayEndPoint,\n SEGMENT_BYTES_LIMIT,\n reportError\n )\n\n var segmentCollection = startSegmentCollection(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n replayRequest,\n worker\n )\n var addRecord = segmentCollection.addRecord\n var stopSegmentCollection = segmentCollection.stop\n\n var _record = record({\n emit: addRecord,\n configuration: configuration,\n lifeCycle: lifeCycle\n })\n var stopRecording = _record.stop\n var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot\n var flushMutations = _record.flushMutations\n var subscribeViewEnded = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_ENDED,\n function () {\n flushMutations()\n addRecord({\n timestamp: timeStampNow(),\n type: RecordType.ViewEnd\n })\n }\n )\n var scribeViewCreated = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_CREATED,\n function (view) {\n takeSubsequentFullSnapshot(view.startClocks.timeStamp)\n }\n )\n\n return {\n stop: function () {\n subscribeViewEnded.unsubscribe()\n scribeViewCreated.unsubscribe()\n stopRecording()\n stopSegmentCollection()\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAK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C,iBAAiB,GAAGlC,SAAS,CAAC2B,SAAS,CACzClB,+BAAkB,CAAC0B,YAAY,EAC/B,UAAUC,IAAI,EAAE;IACdZ,0BAA0B,CAACY,IAAI,CAACC,WAAW,CAACC,SAAS,CAAC;EACxD,CACF,CAAC;EAED,OAAO;IACLnB,IAAI,EAAE,SAAAA,KAAA,EAAY;MAChBO,kBAAkB,CAACa,WAAW,CAAC,CAAC;MAChCL,iBAAiB,CAACK,WAAW,CAAC,CAAC;MAC/BhB,aAAa,CAAC,CAAC;MACfL,qBAAqB,CAAC,CAAC;IACzB;EACF,CAAC;AACH"}
package/cjs/constants.js CHANGED
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PRIVACY_CLASS_MASK_USER_INPUT = exports.PRIVACY_CLASS_MASK = exports.PRIVACY_CLASS_HIDDEN = exports.PRIVACY_CLASS_ALLOW = exports.PRIVACY_ATTR_VALUE_MASK_USER_INPUT = exports.PRIVACY_ATTR_VALUE_MASK = exports.PRIVACY_ATTR_VALUE_HIDDEN = exports.PRIVACY_ATTR_VALUE_ALLOW = exports.PRIVACY_ATTR_NAME = exports.NodePrivacyLevel = exports.FORM_PRIVATE_TAG_NAMES = exports.CENSORED_STRING_MARK = exports.CENSORED_IMG_MARK = void 0;
7
-
8
7
  var _browserCore = require("@cloudcare/browser-core");
9
-
10
8
  var NodePrivacyLevel = {
11
9
  IGNORE: 'ignore',
12
10
  HIDDEN: 'hidden',
@@ -15,8 +13,9 @@ var NodePrivacyLevel = {
15
13
  MASK_USER_INPUT: _browserCore.DefaultPrivacyLevel.MASK_USER_INPUT
16
14
  };
17
15
  exports.NodePrivacyLevel = NodePrivacyLevel;
18
- var PRIVACY_ATTR_NAME = 'data-gc-privacy'; // Privacy Attrs
16
+ var PRIVACY_ATTR_NAME = 'data-gc-privacy';
19
17
 
18
+ // Privacy Attrs
20
19
  exports.PRIVACY_ATTR_NAME = PRIVACY_ATTR_NAME;
21
20
  var PRIVACY_ATTR_VALUE_ALLOW = 'allow';
22
21
  exports.PRIVACY_ATTR_VALUE_ALLOW = PRIVACY_ATTR_VALUE_ALLOW;
@@ -24,8 +23,9 @@ var PRIVACY_ATTR_VALUE_MASK = 'mask';
24
23
  exports.PRIVACY_ATTR_VALUE_MASK = PRIVACY_ATTR_VALUE_MASK;
25
24
  var PRIVACY_ATTR_VALUE_MASK_USER_INPUT = 'mask-user-input';
26
25
  exports.PRIVACY_ATTR_VALUE_MASK_USER_INPUT = PRIVACY_ATTR_VALUE_MASK_USER_INPUT;
27
- var PRIVACY_ATTR_VALUE_HIDDEN = 'hidden'; // Privacy Classes - not all customers can set plain HTML attributes, so support classes too
26
+ var PRIVACY_ATTR_VALUE_HIDDEN = 'hidden';
28
27
 
28
+ // Privacy Classes - not all customers can set plain HTML attributes, so support classes too
29
29
  exports.PRIVACY_ATTR_VALUE_HIDDEN = PRIVACY_ATTR_VALUE_HIDDEN;
30
30
  var PRIVACY_CLASS_ALLOW = 'gc-privacy-allow';
31
31
  exports.PRIVACY_CLASS_ALLOW = PRIVACY_CLASS_ALLOW;
@@ -33,8 +33,9 @@ var PRIVACY_CLASS_MASK = 'gc-privacy-mask';
33
33
  exports.PRIVACY_CLASS_MASK = PRIVACY_CLASS_MASK;
34
34
  var PRIVACY_CLASS_MASK_USER_INPUT = 'gc-privacy-mask-user-input';
35
35
  exports.PRIVACY_CLASS_MASK_USER_INPUT = PRIVACY_CLASS_MASK_USER_INPUT;
36
- var PRIVACY_CLASS_HIDDEN = 'gc-privacy-hidden'; // Private Replacement Templates
36
+ var PRIVACY_CLASS_HIDDEN = 'gc-privacy-hidden';
37
37
 
38
+ // Private Replacement Templates
38
39
  exports.PRIVACY_CLASS_HIDDEN = PRIVACY_CLASS_HIDDEN;
39
40
  var CENSORED_STRING_MARK = '***';
40
41
  exports.CENSORED_STRING_MARK = CENSORED_STRING_MARK;
@@ -49,4 +50,5 @@ var FORM_PRIVATE_TAG_NAMES = {
49
50
  DATALIST: true,
50
51
  OPTGROUP: true
51
52
  };
52
- exports.FORM_PRIVATE_TAG_NAMES = FORM_PRIVATE_TAG_NAMES;
53
+ exports.FORM_PRIVATE_TAG_NAMES = FORM_PRIVATE_TAG_NAMES;
54
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","names":["_browserCore","require","NodePrivacyLevel","IGNORE","HIDDEN","ALLOW","DefaultPrivacyLevel","MASK","MASK_USER_INPUT","exports","PRIVACY_ATTR_NAME","PRIVACY_ATTR_VALUE_ALLOW","PRIVACY_ATTR_VALUE_MASK","PRIVACY_ATTR_VALUE_MASK_USER_INPUT","PRIVACY_ATTR_VALUE_HIDDEN","PRIVACY_CLASS_ALLOW","PRIVACY_CLASS_MASK","PRIVACY_CLASS_MASK_USER_INPUT","PRIVACY_CLASS_HIDDEN","CENSORED_STRING_MARK","CENSORED_IMG_MARK","FORM_PRIVATE_TAG_NAMES","INPUT","OUTPUT","TEXTAREA","SELECT","OPTION","DATALIST","OPTGROUP"],"sources":["../src/constants.js"],"sourcesContent":["import { DefaultPrivacyLevel } from '@cloudcare/browser-core'\nexport var NodePrivacyLevel = {\n IGNORE: 'ignore',\n HIDDEN: 'hidden',\n ALLOW: DefaultPrivacyLevel.ALLOW,\n MASK: DefaultPrivacyLevel.MASK,\n MASK_USER_INPUT: DefaultPrivacyLevel.MASK_USER_INPUT\n}\n\nexport var PRIVACY_ATTR_NAME = 'data-gc-privacy'\n\n// Privacy Attrs\nexport var PRIVACY_ATTR_VALUE_ALLOW = 'allow'\nexport var PRIVACY_ATTR_VALUE_MASK = 'mask'\nexport var PRIVACY_ATTR_VALUE_MASK_USER_INPUT = 'mask-user-input'\nexport var PRIVACY_ATTR_VALUE_HIDDEN = 'hidden'\n\n// Privacy Classes - not all customers can set plain HTML attributes, so support classes too\nexport var PRIVACY_CLASS_ALLOW = 'gc-privacy-allow'\nexport var PRIVACY_CLASS_MASK = 'gc-privacy-mask'\nexport var PRIVACY_CLASS_MASK_USER_INPUT = 'gc-privacy-mask-user-input'\nexport var PRIVACY_CLASS_HIDDEN = 'gc-privacy-hidden'\n\n// Private Replacement Templates\nexport var CENSORED_STRING_MARK = '***'\nexport var CENSORED_IMG_MARK =\n 'data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=='\n\nexport var FORM_PRIVATE_TAG_NAMES = {\n INPUT: true,\n OUTPUT: true,\n TEXTAREA: true,\n SELECT: true,\n OPTION: true,\n DATALIST: true,\n OPTGROUP: true\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACO,IAAIC,gBAAgB,GAAG;EAC5BC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAEC,gCAAmB,CAACD,KAAK;EAChCE,IAAI,EAAED,gCAAmB,CAACC,IAAI;EAC9BC,eAAe,EAAEF,gCAAmB,CAACE;AACvC,CAAC;AAAAC,OAAA,CAAAP,gBAAA,GAAAA,gBAAA;AAEM,IAAIQ,iBAAiB,GAAG,iBAAiB;;AAEhD;AAAAD,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AACO,IAAIC,wBAAwB,GAAG,OAAO;AAAAF,OAAA,CAAAE,wBAAA,GAAAA,wBAAA;AACtC,IAAIC,uBAAuB,GAAG,MAAM;AAAAH,OAAA,CAAAG,uBAAA,GAAAA,uBAAA;AACpC,IAAIC,kCAAkC,GAAG,iBAAiB;AAAAJ,OAAA,CAAAI,kCAAA,GAAAA,kCAAA;AAC1D,IAAIC,yBAAyB,GAAG,QAAQ;;AAE/C;AAAAL,OAAA,CAAAK,yBAAA,GAAAA,yBAAA;AACO,IAAIC,mBAAmB,GAAG,kBAAkB;AAAAN,OAAA,CAAAM,mBAAA,GAAAA,mBAAA;AAC5C,IAAIC,kBAAkB,GAAG,iBAAiB;AAAAP,OAAA,CAAAO,kBAAA,GAAAA,kBAAA;AAC1C,IAAIC,6BAA6B,GAAG,4BAA4B;AAAAR,OAAA,CAAAQ,6BAAA,GAAAA,6BAAA;AAChE,IAAIC,oBAAoB,GAAG,mBAAmB;;AAErD;AAAAT,OAAA,CAAAS,oBAAA,GAAAA,oBAAA;AACO,IAAIC,oBAAoB,GAAG,KAAK;AAAAV,OAAA,CAAAU,oBAAA,GAAAA,oBAAA;AAChC,IAAIC,iBAAiB,GAC1B,oFAAoF;AAAAX,OAAA,CAAAW,iBAAA,GAAAA,iBAAA;AAE/E,IAAIC,sBAAsB,GAAG;EAClCC,KAAK,EAAE,IAAI;EACXC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAE,IAAI;EACdC,MAAM,EAAE,IAAI;EACZC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAE,IAAI;EACdC,QAAQ,EAAE;AACZ,CAAC;AAAAnB,OAAA,CAAAY,sBAAA,GAAAA,sBAAA"}
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.startRumAssembly = startRumAssembly;
7
-
8
7
  var _browserCore = require("@cloudcare/browser-core");
9
-
8
+ var _displayContext = require("./contexts/displayContext");
10
9
  var SessionType = {
11
10
  SYNTHETICS: 'synthetics',
12
11
  USER: 'user'
@@ -16,12 +15,9 @@ var VIEW_MODIFIABLE_FIELD_PATHS = {
16
15
  'view.referrer': 'string'
17
16
  };
18
17
  var USER_CUSTOMIZABLE_FIELD_PATHS = {
19
- tags: 'object',
20
- '_gc.trace_id': 'string',
21
- '_gc.span_id': 'string'
18
+ context: 'object'
22
19
  };
23
20
  var modifiableFieldPathsByEvent = {};
24
-
25
21
  function startRumAssembly(configuration, lifeCycle, sessionManager, userSessionManager, viewContexts, urlContexts, actionContexts, buildCommonContext, reportError) {
26
22
  modifiableFieldPathsByEvent[_browserCore.RumEventType.VIEW] = VIEW_MODIFIABLE_FIELD_PATHS;
27
23
  modifiableFieldPathsByEvent[_browserCore.RumEventType.ERROR] = (0, _browserCore.assign)({
@@ -48,9 +44,9 @@ function startRumAssembly(configuration, lifeCycle, sessionManager, userSessionM
48
44
  var viewContext = viewContexts.findView(startTime);
49
45
  var urlContext = urlContexts.findUrl(startTime);
50
46
  var session = sessionManager.findTrackedSession(rawRumEvent.type !== _browserCore.RumEventType.VIEW ? startTime : undefined);
51
-
52
47
  if (session && viewContext && urlContext) {
53
48
  var actionId = actionContexts.findActionId(startTime);
49
+ var actionIds = actionContexts.findAllActionId(startTime);
54
50
  var commonContext = savedCommonContext || buildCommonContext();
55
51
  var rumContext = {
56
52
  _gc: {
@@ -91,21 +87,20 @@ function startRumAssembly(configuration, lifeCycle, sessionManager, userSessionM
91
87
  urlQuery: urlContext.urlQuery
92
88
  },
93
89
  action: needToAssembleWithAction(rawRumEvent) && actionId ? {
94
- id: actionId
95
- } : undefined
90
+ id: actionId,
91
+ ids: actionIds
92
+ } : undefined,
93
+ display: (0, _displayContext.getDisplayContext)()
96
94
  };
97
95
  var rumEvent = (0, _browserCore.extend2Lev)(rumContext, viewContext, rawRumEvent);
98
96
  var serverRumEvent = (0, _browserCore.withSnakeCaseKeys)(rumEvent);
99
97
  var context = (0, _browserCore.extend2Lev)({}, commonContext.context, customerContext);
100
-
101
98
  if (!(0, _browserCore.isEmptyObject)(context)) {
102
- serverRumEvent.tags = context;
99
+ serverRumEvent.context = context;
103
100
  }
104
-
105
101
  if (!('has_replay' in serverRumEvent.session)) {
106
102
  serverRumEvent.session.has_replay = commonContext.hasReplay;
107
103
  }
108
-
109
104
  if (!(0, _browserCore.isEmptyObject)(commonContext.user)) {
110
105
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
111
106
  serverRumEvent.user = (0, _browserCore.extend2Lev)({
@@ -113,46 +108,37 @@ function startRumAssembly(configuration, lifeCycle, sessionManager, userSessionM
113
108
  is_signin: 'T'
114
109
  }, commonContext.user);
115
110
  }
116
-
117
111
  if (shouldSend(serverRumEvent, configuration.beforeSend, domainContext, eventRateLimiters)) {
118
- if ((0, _browserCore.isEmptyObject)(serverRumEvent.tags)) {
119
- delete serverRumEvent.tags;
112
+ if ((0, _browserCore.isEmptyObject)(serverRumEvent.context)) {
113
+ delete serverRumEvent.context;
120
114
  }
121
-
122
115
  lifeCycle.notify(_browserCore.LifeCycleEventType.RUM_EVENT_COLLECTED, serverRumEvent);
123
116
  }
124
117
  }
125
118
  });
126
119
  }
127
-
128
120
  function shouldSend(event, beforeSend, domainContext, eventRateLimiters) {
129
121
  if (beforeSend) {
130
122
  var result = (0, _browserCore.limitModification)(event, modifiableFieldPathsByEvent[event.type], function (event) {
131
123
  return beforeSend(event, domainContext);
132
124
  });
133
-
134
125
  if (result === false && event.type !== _browserCore.RumEventType.VIEW) {
135
126
  return false;
136
127
  }
137
-
138
128
  if (result === false) {
139
129
  _browserCore.display.warn("Can't dismiss view events using beforeSend!");
140
130
  }
141
131
  }
142
-
143
132
  var rateLimitReached = false;
144
-
145
133
  if (eventRateLimiters[event.type]) {
146
134
  rateLimitReached = eventRateLimiters[event.type].isLimitReached();
147
135
  }
148
-
149
136
  return !rateLimitReached;
150
137
  }
151
-
152
138
  function needToAssembleWithAction(event) {
153
139
  return [_browserCore.RumEventType.ERROR, _browserCore.RumEventType.RESOURCE, _browserCore.RumEventType.LONG_TASK].indexOf(event.type) !== -1;
154
140
  }
155
-
156
141
  function getSessionType() {
157
142
  return window._DATAFLUX_SYNTHETICS_BROWSER === undefined ? SessionType.USER : SessionType.SYNTHETICS;
158
- }
143
+ }
144
+ //# sourceMappingURL=assembly.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assembly.js","names":["_browserCore","require","_displayContext","SessionType","SYNTHETICS","USER","VIEW_MODIFIABLE_FIELD_PATHS","USER_CUSTOMIZABLE_FIELD_PATHS","context","modifiableFieldPathsByEvent","startRumAssembly","configuration","lifeCycle","sessionManager","userSessionManager","viewContexts","urlContexts","actionContexts","buildCommonContext","reportError","RumEventType","VIEW","ERROR","assign","RESOURCE","ACTION","LONG_TASK","eventRateLimiters","createEventRateLimiter","eventRateLimiterThreshold","subscribe","LifeCycleEventType","RAW_RUM_EVENT_COLLECTED","data","startTime","rawRumEvent","savedCommonContext","customerContext","domainContext","viewContext","findView","urlContext","findUrl","session","findTrackedSession","type","undefined","actionId","findActionId","actionIds","findAllActionId","commonContext","rumContext","_gc","sdkName","sdkVersion","drift","currentDrift","terminal","application","id","applicationId","device","deviceInfo","env","service","version","source","date","timeStampNow","user","getId","is_signin","getSessionType","view","name","url","referrer","host","path","pathGroup","urlQuery","action","needToAssembleWithAction","ids","display","getDisplayContext","rumEvent","extend2Lev","serverRumEvent","withSnakeCaseKeys","isEmptyObject","has_replay","hasReplay","shouldSend","beforeSend","notify","RUM_EVENT_COLLECTED","event","result","limitModification","warn","rateLimitReached","isLimitReached","indexOf","window","_DATAFLUX_SYNTHETICS_BROWSER"],"sources":["../../src/domain/assembly.js"],"sourcesContent":["import {\n extend2Lev,\n withSnakeCaseKeys,\n timeStampNow,\n isEmptyObject,\n LifeCycleEventType,\n RumEventType,\n deviceInfo,\n currentDrift,\n createEventRateLimiter,\n limitModification,\n display,\n assign\n} from '@cloudcare/browser-core'\nimport { getDisplayContext } from './contexts/displayContext'\nvar SessionType = {\n SYNTHETICS: 'synthetics',\n USER: 'user'\n}\n\nvar VIEW_MODIFIABLE_FIELD_PATHS = {\n 'view.url': 'string',\n 'view.referrer': 'string'\n}\n\nvar USER_CUSTOMIZABLE_FIELD_PATHS = {\n context: 'object'\n}\n\nvar modifiableFieldPathsByEvent = {}\nexport function startRumAssembly(\n configuration,\n lifeCycle,\n sessionManager,\n userSessionManager,\n viewContexts,\n urlContexts,\n actionContexts,\n buildCommonContext,\n reportError\n) {\n modifiableFieldPathsByEvent[RumEventType.VIEW] = VIEW_MODIFIABLE_FIELD_PATHS\n modifiableFieldPathsByEvent[RumEventType.ERROR] = assign(\n {\n 'error.message': 'string',\n 'error.stack': 'string',\n 'error.resource.url': 'string'\n },\n USER_CUSTOMIZABLE_FIELD_PATHS,\n VIEW_MODIFIABLE_FIELD_PATHS\n )\n modifiableFieldPathsByEvent[RumEventType.RESOURCE] = assign(\n {\n 'resource.url': 'string'\n },\n USER_CUSTOMIZABLE_FIELD_PATHS,\n VIEW_MODIFIABLE_FIELD_PATHS\n )\n modifiableFieldPathsByEvent[RumEventType.ACTION] = assign(\n {\n 'action.target.name': 'string'\n },\n USER_CUSTOMIZABLE_FIELD_PATHS,\n VIEW_MODIFIABLE_FIELD_PATHS\n )\n modifiableFieldPathsByEvent[RumEventType.LONG_TASK] = assign(\n {},\n USER_CUSTOMIZABLE_FIELD_PATHS,\n VIEW_MODIFIABLE_FIELD_PATHS\n )\n var eventRateLimiters = {}\n eventRateLimiters[RumEventType.ERROR] = createEventRateLimiter(\n RumEventType.ERROR,\n configuration.eventRateLimiterThreshold,\n reportError\n )\n eventRateLimiters[RumEventType.ACTION] = createEventRateLimiter(\n RumEventType.ACTION,\n configuration.eventRateLimiterThreshold,\n reportError\n )\n lifeCycle.subscribe(\n LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,\n function (data) {\n var startTime = data.startTime\n var rawRumEvent = data.rawRumEvent\n var savedCommonContext = data.savedCommonContext\n var customerContext = data.customerContext\n var domainContext = data.domainContext\n var viewContext = viewContexts.findView(startTime)\n var urlContext = urlContexts.findUrl(startTime)\n var session = sessionManager.findTrackedSession(\n rawRumEvent.type !== RumEventType.VIEW ? startTime : undefined\n )\n\n if (session && viewContext && urlContext) {\n var actionId = actionContexts.findActionId(startTime)\n var actionIds = actionContexts.findAllActionId(startTime)\n var commonContext = savedCommonContext || buildCommonContext()\n var rumContext = {\n _gc: {\n sdkName: configuration.sdkName,\n sdkVersion: configuration.sdkVersion,\n drift: currentDrift()\n },\n terminal: {\n type: 'web'\n },\n application: {\n id: configuration.applicationId\n },\n device: deviceInfo,\n env: configuration.env || '',\n service: viewContext.service || configuration.service || 'browser',\n version: viewContext.version || configuration.version || '',\n source: 'browser',\n date: timeStampNow(),\n user: {\n id: userSessionManager.getId(),\n is_signin: 'F'\n },\n session: {\n // must be computed on each event because synthetics instrumentation can be done after sdk execution\n // cf https://github.com/puppeteer/puppeteer/issues/3667\n type: getSessionType(),\n id: session.id\n },\n view: {\n id: viewContext.id,\n name: viewContext.name,\n url: urlContext.url,\n referrer: urlContext.referrer,\n host: urlContext.host,\n path: urlContext.path,\n pathGroup: urlContext.pathGroup,\n urlQuery: urlContext.urlQuery\n },\n action:\n needToAssembleWithAction(rawRumEvent) && actionId\n ? { id: actionId, ids: actionIds }\n : undefined,\n display: getDisplayContext()\n }\n\n var rumEvent = extend2Lev(rumContext, viewContext, rawRumEvent)\n var serverRumEvent = withSnakeCaseKeys(rumEvent)\n var context = extend2Lev({}, commonContext.context, customerContext)\n if (!isEmptyObject(context)) {\n serverRumEvent.context = context\n }\n if (!('has_replay' in serverRumEvent.session)) {\n serverRumEvent.session.has_replay = commonContext.hasReplay\n }\n if (!isEmptyObject(commonContext.user)) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n serverRumEvent.user = extend2Lev(\n {\n // id: session.getAnonymousID(),\n is_signin: 'T'\n },\n commonContext.user\n )\n }\n\n if (\n shouldSend(\n serverRumEvent,\n configuration.beforeSend,\n domainContext,\n eventRateLimiters\n )\n ) {\n if (isEmptyObject(serverRumEvent.context)) {\n delete serverRumEvent.context\n }\n lifeCycle.notify(\n LifeCycleEventType.RUM_EVENT_COLLECTED,\n serverRumEvent\n )\n }\n }\n }\n )\n}\n\nfunction shouldSend(event, beforeSend, domainContext, eventRateLimiters) {\n if (beforeSend) {\n var result = limitModification(\n event,\n modifiableFieldPathsByEvent[event.type],\n function (event) {\n return beforeSend(event, domainContext)\n }\n )\n if (result === false && event.type !== RumEventType.VIEW) {\n return false\n }\n if (result === false) {\n display.warn(\"Can't dismiss view events using beforeSend!\")\n }\n }\n var rateLimitReached = false\n if (eventRateLimiters[event.type]) {\n rateLimitReached = eventRateLimiters[event.type].isLimitReached()\n }\n return !rateLimitReached\n}\nfunction needToAssembleWithAction(event) {\n return (\n [RumEventType.ERROR, RumEventType.RESOURCE, RumEventType.LONG_TASK].indexOf(\n event.type\n ) !== -1\n )\n}\n\nfunction getSessionType() {\n return window._DATAFLUX_SYNTHETICS_BROWSER === undefined\n ? SessionType.USER\n : SessionType.SYNTHETICS\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAcA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAIE,WAAW,GAAG;EAChBC,UAAU,EAAE,YAAY;EACxBC,IAAI,EAAE;AACR,CAAC;AAED,IAAIC,2BAA2B,GAAG;EAChC,UAAU,EAAE,QAAQ;EACpB,eAAe,EAAE;AACnB,CAAC;AAED,IAAIC,6BAA6B,GAAG;EAClCC,OAAO,EAAE;AACX,CAAC;AAED,IAAIC,2BAA2B,GAAG,CAAC,CAAC;AAC7B,SAASC,gBAAgBA,CAC9BC,aAAa,EACbC,SAAS,EACTC,cAAc,EACdC,kBAAkB,EAClBC,YAAY,EACZC,WAAW,EACXC,cAAc,EACdC,kBAAkB,EAClBC,WAAW,EACX;EACAV,2BAA2B,CAACW,yBAAY,CAACC,IAAI,CAAC,GAAGf,2BAA2B;EAC5EG,2BAA2B,CAACW,yBAAY,CAACE,KAAK,CAAC,GAAG,IAAAC,mBAAM,EACtD;IACE,eAAe,EAAE,QAAQ;IACzB,aAAa,EAAE,QAAQ;IACvB,oBAAoB,EAAE;EACxB,CAAC,EACDhB,6BAA6B,EAC7BD,2BACF,CAAC;EACDG,2BAA2B,CAACW,yBAAY,CAACI,QAAQ,CAAC,GAAG,IAAAD,mBAAM,EACzD;IACE,cAAc,EAAE;EAClB,CAAC,EACDhB,6BAA6B,EAC7BD,2BACF,CAAC;EACDG,2BAA2B,CAACW,yBAAY,CAACK,MAAM,CAAC,GAAG,IAAAF,mBAAM,EACvD;IACE,oBAAoB,EAAE;EACxB,CAAC,EACDhB,6BAA6B,EAC7BD,2BACF,CAAC;EACDG,2BAA2B,CAACW,yBAA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