@kubesense/kubesense-browser-rum-core 1.0.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 (689) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/cjs/boot/preStartRum.d.ts +7 -0
  4. package/cjs/boot/preStartRum.js +190 -0
  5. package/cjs/boot/preStartRum.js.map +1 -0
  6. package/cjs/boot/rumPublicApi.d.ts +409 -0
  7. package/cjs/boot/rumPublicApi.js +168 -0
  8. package/cjs/boot/rumPublicApi.js.map +1 -0
  9. package/cjs/boot/startRum.d.ts +109 -0
  10. package/cjs/boot/startRum.js +153 -0
  11. package/cjs/boot/startRum.js.map +1 -0
  12. package/cjs/browser/cookieObservable.d.ts +8 -0
  13. package/cjs/browser/cookieObservable.js +39 -0
  14. package/cjs/browser/cookieObservable.js.map +1 -0
  15. package/cjs/browser/domMutationObservable.d.ts +27 -0
  16. package/cjs/browser/domMutationObservable.js +58 -0
  17. package/cjs/browser/domMutationObservable.js.map +1 -0
  18. package/cjs/browser/firstInputPolyfill.d.ts +8 -0
  19. package/cjs/browser/firstInputPolyfill.js +68 -0
  20. package/cjs/browser/firstInputPolyfill.js.map +1 -0
  21. package/cjs/browser/htmlDomUtils.d.ts +13 -0
  22. package/cjs/browser/htmlDomUtils.js +46 -0
  23. package/cjs/browser/htmlDomUtils.js.map +1 -0
  24. package/cjs/browser/locationChangeObservable.d.ts +7 -0
  25. package/cjs/browser/locationChangeObservable.js +51 -0
  26. package/cjs/browser/locationChangeObservable.js.map +1 -0
  27. package/cjs/browser/performanceObservable.d.ts +174 -0
  28. package/cjs/browser/performanceObservable.js +126 -0
  29. package/cjs/browser/performanceObservable.js.map +1 -0
  30. package/cjs/browser/performanceUtils.d.ts +7 -0
  31. package/cjs/browser/performanceUtils.js +42 -0
  32. package/cjs/browser/performanceUtils.js.map +1 -0
  33. package/cjs/browser/scroll.d.ts +2 -0
  34. package/cjs/browser/scroll.js +33 -0
  35. package/cjs/browser/scroll.js.map +1 -0
  36. package/cjs/browser/viewportObservable.d.ts +10 -0
  37. package/cjs/browser/viewportObservable.js +37 -0
  38. package/cjs/browser/viewportObservable.js.map +1 -0
  39. package/cjs/browser/windowOpenObservable.d.ts +5 -0
  40. package/cjs/browser/windowOpenObservable.js +10 -0
  41. package/cjs/browser/windowOpenObservable.js.map +1 -0
  42. package/cjs/domain/action/actionCollection.d.ts +21 -0
  43. package/cjs/domain/action/actionCollection.js +96 -0
  44. package/cjs/domain/action/actionCollection.js.map +1 -0
  45. package/cjs/domain/action/actionNameConstants.d.ts +18 -0
  46. package/cjs/domain/action/actionNameConstants.js +11 -0
  47. package/cjs/domain/action/actionNameConstants.js.map +1 -0
  48. package/cjs/domain/action/clickChain.d.ts +8 -0
  49. package/cjs/domain/action/clickChain.js +61 -0
  50. package/cjs/domain/action/clickChain.js.map +1 -0
  51. package/cjs/domain/action/computeFrustration.d.ts +6 -0
  52. package/cjs/domain/action/computeFrustration.js +70 -0
  53. package/cjs/domain/action/computeFrustration.js.map +1 -0
  54. package/cjs/domain/action/getActionNameFromElement.d.ts +4 -0
  55. package/cjs/domain/action/getActionNameFromElement.js +239 -0
  56. package/cjs/domain/action/getActionNameFromElement.js.map +1 -0
  57. package/cjs/domain/action/interactionSelectorCache.d.ts +5 -0
  58. package/cjs/domain/action/interactionSelectorCache.js +23 -0
  59. package/cjs/domain/action/interactionSelectorCache.js.map +1 -0
  60. package/cjs/domain/action/listenActionEvents.d.ts +19 -0
  61. package/cjs/domain/action/listenActionEvents.js +61 -0
  62. package/cjs/domain/action/listenActionEvents.js.map +1 -0
  63. package/cjs/domain/action/trackClickActions.d.ts +81 -0
  64. package/cjs/domain/action/trackClickActions.js +237 -0
  65. package/cjs/domain/action/trackClickActions.js.map +1 -0
  66. package/cjs/domain/assembly.d.ts +5 -0
  67. package/cjs/domain/assembly.js +102 -0
  68. package/cjs/domain/assembly.js.map +1 -0
  69. package/cjs/domain/configuration/configuration.d.ts +325 -0
  70. package/cjs/domain/configuration/configuration.js +205 -0
  71. package/cjs/domain/configuration/configuration.js.map +1 -0
  72. package/cjs/domain/configuration/index.d.ts +2 -0
  73. package/cjs/domain/configuration/index.js +19 -0
  74. package/cjs/domain/configuration/index.js.map +1 -0
  75. package/cjs/domain/configuration/jsonPathParser.d.ts +28 -0
  76. package/cjs/domain/configuration/jsonPathParser.js +159 -0
  77. package/cjs/domain/configuration/jsonPathParser.js.map +1 -0
  78. package/cjs/domain/configuration/remoteConfiguration.d.ts +39 -0
  79. package/cjs/domain/configuration/remoteConfiguration.js +243 -0
  80. package/cjs/domain/configuration/remoteConfiguration.js.map +1 -0
  81. package/cjs/domain/configuration/remoteConfiguration.types.d.ts +138 -0
  82. package/cjs/domain/configuration/remoteConfiguration.types.js +7 -0
  83. package/cjs/domain/configuration/remoteConfiguration.types.js.map +1 -0
  84. package/cjs/domain/contexts/ciVisibilityContext.d.ts +12 -0
  85. package/cjs/domain/contexts/ciVisibilityContext.js +34 -0
  86. package/cjs/domain/contexts/ciVisibilityContext.js.map +1 -0
  87. package/cjs/domain/contexts/connectivityContext.d.ts +2 -0
  88. package/cjs/domain/contexts/connectivityContext.js +11 -0
  89. package/cjs/domain/contexts/connectivityContext.js.map +1 -0
  90. package/cjs/domain/contexts/defaultContext.d.ts +4 -0
  91. package/cjs/domain/contexts/defaultContext.js +34 -0
  92. package/cjs/domain/contexts/defaultContext.js.map +1 -0
  93. package/cjs/domain/contexts/displayContext.d.ts +6 -0
  94. package/cjs/domain/contexts/displayContext.js +28 -0
  95. package/cjs/domain/contexts/displayContext.js.map +1 -0
  96. package/cjs/domain/contexts/featureFlagContext.d.ts +19 -0
  97. package/cjs/domain/contexts/featureFlagContext.js +53 -0
  98. package/cjs/domain/contexts/featureFlagContext.js.map +1 -0
  99. package/cjs/domain/contexts/internalContext.d.ts +12 -0
  100. package/cjs/domain/contexts/internalContext.js +26 -0
  101. package/cjs/domain/contexts/internalContext.js.map +1 -0
  102. package/cjs/domain/contexts/pageStateHistory.d.ts +23 -0
  103. package/cjs/domain/contexts/pageStateHistory.js +104 -0
  104. package/cjs/domain/contexts/pageStateHistory.js.map +1 -0
  105. package/cjs/domain/contexts/sessionContext.d.ts +5 -0
  106. package/cjs/domain/contexts/sessionContext.js +47 -0
  107. package/cjs/domain/contexts/sessionContext.js.map +1 -0
  108. package/cjs/domain/contexts/syntheticsContext.d.ts +2 -0
  109. package/cjs/domain/contexts/syntheticsContext.js +25 -0
  110. package/cjs/domain/contexts/syntheticsContext.js.map +1 -0
  111. package/cjs/domain/contexts/trackingConsentContext.d.ts +3 -0
  112. package/cjs/domain/contexts/trackingConsentContext.js +14 -0
  113. package/cjs/domain/contexts/trackingConsentContext.js.map +1 -0
  114. package/cjs/domain/contexts/urlContexts.d.ts +22 -0
  115. package/cjs/domain/contexts/urlContexts.js +64 -0
  116. package/cjs/domain/contexts/urlContexts.js.map +1 -0
  117. package/cjs/domain/contexts/userAgentDataContext.d.ts +2 -0
  118. package/cjs/domain/contexts/userAgentDataContext.js +31 -0
  119. package/cjs/domain/contexts/userAgentDataContext.js.map +1 -0
  120. package/cjs/domain/contexts/viewHistory.d.ts +17 -0
  121. package/cjs/domain/contexts/viewHistory.js +48 -0
  122. package/cjs/domain/contexts/viewHistory.js.map +1 -0
  123. package/cjs/domain/discardNegativeDuration.d.ts +2 -0
  124. package/cjs/domain/discardNegativeDuration.js +8 -0
  125. package/cjs/domain/discardNegativeDuration.js.map +1 -0
  126. package/cjs/domain/error/errorCollection.d.ts +17 -0
  127. package/cjs/domain/error/errorCollection.js +74 -0
  128. package/cjs/domain/error/errorCollection.js.map +1 -0
  129. package/cjs/domain/error/trackConsoleError.d.ts +4 -0
  130. package/cjs/domain/error/trackConsoleError.js +13 -0
  131. package/cjs/domain/error/trackConsoleError.js.map +1 -0
  132. package/cjs/domain/error/trackReportError.d.ts +5 -0
  133. package/cjs/domain/error/trackReportError.js +16 -0
  134. package/cjs/domain/error/trackReportError.js.map +1 -0
  135. package/cjs/domain/event/eventCollection.d.ts +10 -0
  136. package/cjs/domain/event/eventCollection.js +27 -0
  137. package/cjs/domain/event/eventCollection.js.map +1 -0
  138. package/cjs/domain/getSelectorFromElement.d.ts +64 -0
  139. package/cjs/domain/getSelectorFromElement.js +218 -0
  140. package/cjs/domain/getSelectorFromElement.js.map +1 -0
  141. package/cjs/domain/getSessionReplayUrl.d.ts +9 -0
  142. package/cjs/domain/getSessionReplayUrl.js +34 -0
  143. package/cjs/domain/getSessionReplayUrl.js.map +1 -0
  144. package/cjs/domain/hooks.d.ts +23 -0
  145. package/cjs/domain/hooks.js +6 -0
  146. package/cjs/domain/hooks.js.map +1 -0
  147. package/cjs/domain/lifeCycle.d.ts +73 -0
  148. package/cjs/domain/lifeCycle.js +6 -0
  149. package/cjs/domain/lifeCycle.js.map +1 -0
  150. package/cjs/domain/limitModification.d.ts +8 -0
  151. package/cjs/domain/limitModification.js +46 -0
  152. package/cjs/domain/limitModification.js.map +1 -0
  153. package/cjs/domain/longTask/longTaskCollection.d.ts +18 -0
  154. package/cjs/domain/longTask/longTaskCollection.js +91 -0
  155. package/cjs/domain/longTask/longTaskCollection.js.map +1 -0
  156. package/cjs/domain/plugins.d.ts +40 -0
  157. package/cjs/domain/plugins.js +15 -0
  158. package/cjs/domain/plugins.js.map +1 -0
  159. package/cjs/domain/privacy.d.ts +44 -0
  160. package/cjs/domain/privacy.js +313 -0
  161. package/cjs/domain/privacy.js.map +1 -0
  162. package/cjs/domain/privacyConstants.d.ts +23 -0
  163. package/cjs/domain/privacyConstants.js +39 -0
  164. package/cjs/domain/privacyConstants.js.map +1 -0
  165. package/cjs/domain/requestCollection.d.ts +54 -0
  166. package/cjs/domain/requestCollection.js +111 -0
  167. package/cjs/domain/requestCollection.js.map +1 -0
  168. package/cjs/domain/resource/graphql.d.ts +23 -0
  169. package/cjs/domain/resource/graphql.js +97 -0
  170. package/cjs/domain/resource/graphql.js.map +1 -0
  171. package/cjs/domain/resource/matchRequestResourceEntry.d.ts +16 -0
  172. package/cjs/domain/resource/matchRequestResourceEntry.js +49 -0
  173. package/cjs/domain/resource/matchRequestResourceEntry.js.map +1 -0
  174. package/cjs/domain/resource/requestRegistry.d.ts +9 -0
  175. package/cjs/domain/resource/requestRegistry.js +41 -0
  176. package/cjs/domain/resource/requestRegistry.js.map +1 -0
  177. package/cjs/domain/resource/resourceCollection.d.ts +7 -0
  178. package/cjs/domain/resource/resourceCollection.js +190 -0
  179. package/cjs/domain/resource/resourceCollection.js.map +1 -0
  180. package/cjs/domain/resource/resourceUtils.d.ts +55 -0
  181. package/cjs/domain/resource/resourceUtils.js +259 -0
  182. package/cjs/domain/resource/resourceUtils.js.map +1 -0
  183. package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +4 -0
  184. package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js +24 -0
  185. package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js.map +1 -0
  186. package/cjs/domain/rumSessionManager.d.ts +36 -0
  187. package/cjs/domain/rumSessionManager.js +77 -0
  188. package/cjs/domain/rumSessionManager.js.map +1 -0
  189. package/cjs/domain/sampler/sampler.d.ts +10 -0
  190. package/cjs/domain/sampler/sampler.js +63 -0
  191. package/cjs/domain/sampler/sampler.js.map +1 -0
  192. package/cjs/domain/startCustomerDataTelemetry.d.ts +4 -0
  193. package/cjs/domain/startCustomerDataTelemetry.js +56 -0
  194. package/cjs/domain/startCustomerDataTelemetry.js.map +1 -0
  195. package/cjs/domain/tracing/getDocumentTraceId.d.ts +12 -0
  196. package/cjs/domain/tracing/getDocumentTraceId.js +76 -0
  197. package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -0
  198. package/cjs/domain/tracing/identifier.d.ts +13 -0
  199. package/cjs/domain/tracing/identifier.js +55 -0
  200. package/cjs/domain/tracing/identifier.js.map +1 -0
  201. package/cjs/domain/tracing/sampler.d.ts +10 -0
  202. package/cjs/domain/tracing/sampler.js +69 -0
  203. package/cjs/domain/tracing/sampler.js.map +1 -0
  204. package/cjs/domain/tracing/tracer.d.ts +30 -0
  205. package/cjs/domain/tracing/tracer.js +161 -0
  206. package/cjs/domain/tracing/tracer.js.map +1 -0
  207. package/cjs/domain/tracing/tracer.types.d.ts +12 -0
  208. package/cjs/domain/tracing/tracer.types.js +3 -0
  209. package/cjs/domain/tracing/tracer.types.js.map +1 -0
  210. package/cjs/domain/trackEventCounts.d.ts +17 -0
  211. package/cjs/domain/trackEventCounts.js +50 -0
  212. package/cjs/domain/trackEventCounts.js.map +1 -0
  213. package/cjs/domain/view/bfCacheSupport.d.ts +2 -0
  214. package/cjs/domain/view/bfCacheSupport.js +13 -0
  215. package/cjs/domain/view/bfCacheSupport.js.map +1 -0
  216. package/cjs/domain/view/trackViewEventCounts.d.ts +5 -0
  217. package/cjs/domain/view/trackViewEventCounts.js +16 -0
  218. package/cjs/domain/view/trackViewEventCounts.js.map +1 -0
  219. package/cjs/domain/view/trackViews.d.ts +65 -0
  220. package/cjs/domain/view/trackViews.js +275 -0
  221. package/cjs/domain/view/trackViews.js.map +1 -0
  222. package/cjs/domain/view/viewCollection.d.ts +18 -0
  223. package/cjs/domain/view/viewCollection.js +153 -0
  224. package/cjs/domain/view/viewCollection.js.map +1 -0
  225. package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.d.ts +6 -0
  226. package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js +32 -0
  227. package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +1 -0
  228. package/cjs/domain/view/viewMetrics/interactionCountPolyfill.d.ts +18 -0
  229. package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js +44 -0
  230. package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js.map +1 -0
  231. package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +6 -0
  232. package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +44 -0
  233. package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +1 -0
  234. package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +8 -0
  235. package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js +17 -0
  236. package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js.map +1 -0
  237. package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +21 -0
  238. package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js +37 -0
  239. package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js.map +1 -0
  240. package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +37 -0
  241. package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js +135 -0
  242. package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +1 -0
  243. package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +13 -0
  244. package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js +39 -0
  245. package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +1 -0
  246. package/cjs/domain/view/viewMetrics/trackFirstHidden.d.ts +10 -0
  247. package/cjs/domain/view/viewMetrics/trackFirstHidden.js +33 -0
  248. package/cjs/domain/view/viewMetrics/trackFirstHidden.js.map +1 -0
  249. package/cjs/domain/view/viewMetrics/trackFirstInput.d.ts +19 -0
  250. package/cjs/domain/view/viewMetrics/trackFirstInput.js +43 -0
  251. package/cjs/domain/view/viewMetrics/trackFirstInput.js.map +1 -0
  252. package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +15 -0
  253. package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js +41 -0
  254. package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js.map +1 -0
  255. package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +25 -0
  256. package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js +155 -0
  257. package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +1 -0
  258. package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +18 -0
  259. package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js +61 -0
  260. package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +1 -0
  261. package/cjs/domain/view/viewMetrics/trackLoadingTime.d.ts +14 -0
  262. package/cjs/domain/view/viewMetrics/trackLoadingTime.js +50 -0
  263. package/cjs/domain/view/viewMetrics/trackLoadingTime.js.map +1 -0
  264. package/cjs/domain/view/viewMetrics/trackNavigationTimings.d.ts +14 -0
  265. package/cjs/domain/view/viewMetrics/trackNavigationTimings.js +43 -0
  266. package/cjs/domain/view/viewMetrics/trackNavigationTimings.js.map +1 -0
  267. package/cjs/domain/view/viewMetrics/trackScrollMetrics.d.ts +25 -0
  268. package/cjs/domain/view/viewMetrics/trackScrollMetrics.js +78 -0
  269. package/cjs/domain/view/viewMetrics/trackScrollMetrics.js.map +1 -0
  270. package/cjs/domain/vital/vitalCollection.d.ts +55 -0
  271. package/cjs/domain/vital/vitalCollection.js +113 -0
  272. package/cjs/domain/vital/vitalCollection.js.map +1 -0
  273. package/cjs/domain/waitPageActivityEnd.d.ts +54 -0
  274. package/cjs/domain/waitPageActivityEnd.js +129 -0
  275. package/cjs/domain/waitPageActivityEnd.js.map +1 -0
  276. package/cjs/domainContext.types.d.ts +39 -0
  277. package/cjs/domainContext.types.js +6 -0
  278. package/cjs/domainContext.types.js.map +1 -0
  279. package/cjs/index.d.ts +41 -0
  280. package/cjs/index.js +59 -0
  281. package/cjs/index.js.map +1 -0
  282. package/cjs/rawRumEvent.types.d.ts +326 -0
  283. package/cjs/rawRumEvent.types.js +34 -0
  284. package/cjs/rawRumEvent.types.js.map +1 -0
  285. package/cjs/rumEvent.types.d.ts +2026 -0
  286. package/cjs/rumEvent.types.js +7 -0
  287. package/cjs/rumEvent.types.js.map +1 -0
  288. package/cjs/transport/formDataTransport.d.ts +16 -0
  289. package/cjs/transport/formDataTransport.js +46 -0
  290. package/cjs/transport/formDataTransport.js.map +1 -0
  291. package/cjs/transport/startRumBatch.d.ts +5 -0
  292. package/cjs/transport/startRumBatch.js +33 -0
  293. package/cjs/transport/startRumBatch.js.map +1 -0
  294. package/cjs/transport/startRumEventBridge.d.ts +2 -0
  295. package/cjs/transport/startRumEventBridge.js +11 -0
  296. package/cjs/transport/startRumEventBridge.js.map +1 -0
  297. package/esm/boot/preStartRum.d.ts +7 -0
  298. package/esm/boot/preStartRum.js +187 -0
  299. package/esm/boot/preStartRum.js.map +1 -0
  300. package/esm/boot/rumPublicApi.d.ts +409 -0
  301. package/esm/boot/rumPublicApi.js +165 -0
  302. package/esm/boot/rumPublicApi.js.map +1 -0
  303. package/esm/boot/startRum.d.ts +109 -0
  304. package/esm/boot/startRum.js +149 -0
  305. package/esm/boot/startRum.js.map +1 -0
  306. package/esm/browser/cookieObservable.d.ts +8 -0
  307. package/esm/browser/cookieObservable.js +35 -0
  308. package/esm/browser/cookieObservable.js.map +1 -0
  309. package/esm/browser/domMutationObservable.d.ts +27 -0
  310. package/esm/browser/domMutationObservable.js +54 -0
  311. package/esm/browser/domMutationObservable.js.map +1 -0
  312. package/esm/browser/firstInputPolyfill.d.ts +8 -0
  313. package/esm/browser/firstInputPolyfill.js +65 -0
  314. package/esm/browser/firstInputPolyfill.js.map +1 -0
  315. package/esm/browser/htmlDomUtils.d.ts +13 -0
  316. package/esm/browser/htmlDomUtils.js +36 -0
  317. package/esm/browser/htmlDomUtils.js.map +1 -0
  318. package/esm/browser/locationChangeObservable.d.ts +7 -0
  319. package/esm/browser/locationChangeObservable.js +48 -0
  320. package/esm/browser/locationChangeObservable.js.map +1 -0
  321. package/esm/browser/performanceObservable.d.ts +174 -0
  322. package/esm/browser/performanceObservable.js +121 -0
  323. package/esm/browser/performanceObservable.js.map +1 -0
  324. package/esm/browser/performanceUtils.d.ts +7 -0
  325. package/esm/browser/performanceUtils.js +38 -0
  326. package/esm/browser/performanceUtils.js.map +1 -0
  327. package/esm/browser/scroll.d.ts +2 -0
  328. package/esm/browser/scroll.js +29 -0
  329. package/esm/browser/scroll.js.map +1 -0
  330. package/esm/browser/viewportObservable.d.ts +10 -0
  331. package/esm/browser/viewportObservable.js +32 -0
  332. package/esm/browser/viewportObservable.js.map +1 -0
  333. package/esm/browser/windowOpenObservable.d.ts +5 -0
  334. package/esm/browser/windowOpenObservable.js +7 -0
  335. package/esm/browser/windowOpenObservable.js.map +1 -0
  336. package/esm/domain/action/actionCollection.d.ts +21 -0
  337. package/esm/domain/action/actionCollection.js +93 -0
  338. package/esm/domain/action/actionCollection.js.map +1 -0
  339. package/esm/domain/action/actionNameConstants.d.ts +18 -0
  340. package/esm/domain/action/actionNameConstants.js +8 -0
  341. package/esm/domain/action/actionNameConstants.js.map +1 -0
  342. package/esm/domain/action/clickChain.d.ts +8 -0
  343. package/esm/domain/action/clickChain.js +57 -0
  344. package/esm/domain/action/clickChain.js.map +1 -0
  345. package/esm/domain/action/computeFrustration.d.ts +6 -0
  346. package/esm/domain/action/computeFrustration.js +65 -0
  347. package/esm/domain/action/computeFrustration.js.map +1 -0
  348. package/esm/domain/action/getActionNameFromElement.d.ts +4 -0
  349. package/esm/domain/action/getActionNameFromElement.js +236 -0
  350. package/esm/domain/action/getActionNameFromElement.js.map +1 -0
  351. package/esm/domain/action/interactionSelectorCache.d.ts +5 -0
  352. package/esm/domain/action/interactionSelectorCache.js +18 -0
  353. package/esm/domain/action/interactionSelectorCache.js.map +1 -0
  354. package/esm/domain/action/listenActionEvents.d.ts +19 -0
  355. package/esm/domain/action/listenActionEvents.js +58 -0
  356. package/esm/domain/action/listenActionEvents.js.map +1 -0
  357. package/esm/domain/action/trackClickActions.d.ts +81 -0
  358. package/esm/domain/action/trackClickActions.js +232 -0
  359. package/esm/domain/action/trackClickActions.js.map +1 -0
  360. package/esm/domain/assembly.d.ts +5 -0
  361. package/esm/domain/assembly.js +99 -0
  362. package/esm/domain/assembly.js.map +1 -0
  363. package/esm/domain/configuration/configuration.d.ts +325 -0
  364. package/esm/domain/configuration/configuration.js +200 -0
  365. package/esm/domain/configuration/configuration.js.map +1 -0
  366. package/esm/domain/configuration/index.d.ts +2 -0
  367. package/esm/domain/configuration/index.js +3 -0
  368. package/esm/domain/configuration/index.js.map +1 -0
  369. package/esm/domain/configuration/jsonPathParser.d.ts +28 -0
  370. package/esm/domain/configuration/jsonPathParser.js +156 -0
  371. package/esm/domain/configuration/jsonPathParser.js.map +1 -0
  372. package/esm/domain/configuration/remoteConfiguration.d.ts +39 -0
  373. package/esm/domain/configuration/remoteConfiguration.js +236 -0
  374. package/esm/domain/configuration/remoteConfiguration.js.map +1 -0
  375. package/esm/domain/configuration/remoteConfiguration.types.d.ts +138 -0
  376. package/esm/domain/configuration/remoteConfiguration.types.js +6 -0
  377. package/esm/domain/configuration/remoteConfiguration.types.js.map +1 -0
  378. package/esm/domain/contexts/ciVisibilityContext.d.ts +12 -0
  379. package/esm/domain/contexts/ciVisibilityContext.js +30 -0
  380. package/esm/domain/contexts/ciVisibilityContext.js.map +1 -0
  381. package/esm/domain/contexts/connectivityContext.d.ts +2 -0
  382. package/esm/domain/contexts/connectivityContext.js +8 -0
  383. package/esm/domain/contexts/connectivityContext.js.map +1 -0
  384. package/esm/domain/contexts/defaultContext.d.ts +4 -0
  385. package/esm/domain/contexts/defaultContext.js +31 -0
  386. package/esm/domain/contexts/defaultContext.js.map +1 -0
  387. package/esm/domain/contexts/displayContext.d.ts +6 -0
  388. package/esm/domain/contexts/displayContext.js +25 -0
  389. package/esm/domain/contexts/displayContext.js.map +1 -0
  390. package/esm/domain/contexts/featureFlagContext.d.ts +19 -0
  391. package/esm/domain/contexts/featureFlagContext.js +49 -0
  392. package/esm/domain/contexts/featureFlagContext.js.map +1 -0
  393. package/esm/domain/contexts/internalContext.d.ts +12 -0
  394. package/esm/domain/contexts/internalContext.js +23 -0
  395. package/esm/domain/contexts/internalContext.js.map +1 -0
  396. package/esm/domain/contexts/pageStateHistory.d.ts +23 -0
  397. package/esm/domain/contexts/pageStateHistory.js +100 -0
  398. package/esm/domain/contexts/pageStateHistory.js.map +1 -0
  399. package/esm/domain/contexts/sessionContext.d.ts +5 -0
  400. package/esm/domain/contexts/sessionContext.js +44 -0
  401. package/esm/domain/contexts/sessionContext.js.map +1 -0
  402. package/esm/domain/contexts/syntheticsContext.d.ts +2 -0
  403. package/esm/domain/contexts/syntheticsContext.js +22 -0
  404. package/esm/domain/contexts/syntheticsContext.js.map +1 -0
  405. package/esm/domain/contexts/trackingConsentContext.d.ts +3 -0
  406. package/esm/domain/contexts/trackingConsentContext.js +11 -0
  407. package/esm/domain/contexts/trackingConsentContext.js.map +1 -0
  408. package/esm/domain/contexts/urlContexts.d.ts +22 -0
  409. package/esm/domain/contexts/urlContexts.js +60 -0
  410. package/esm/domain/contexts/urlContexts.js.map +1 -0
  411. package/esm/domain/contexts/userAgentDataContext.d.ts +2 -0
  412. package/esm/domain/contexts/userAgentDataContext.js +28 -0
  413. package/esm/domain/contexts/userAgentDataContext.js.map +1 -0
  414. package/esm/domain/contexts/viewHistory.d.ts +17 -0
  415. package/esm/domain/contexts/viewHistory.js +44 -0
  416. package/esm/domain/contexts/viewHistory.js.map +1 -0
  417. package/esm/domain/discardNegativeDuration.d.ts +2 -0
  418. package/esm/domain/discardNegativeDuration.js +5 -0
  419. package/esm/domain/discardNegativeDuration.js.map +1 -0
  420. package/esm/domain/error/errorCollection.d.ts +17 -0
  421. package/esm/domain/error/errorCollection.js +70 -0
  422. package/esm/domain/error/errorCollection.js.map +1 -0
  423. package/esm/domain/error/trackConsoleError.d.ts +4 -0
  424. package/esm/domain/error/trackConsoleError.js +10 -0
  425. package/esm/domain/error/trackConsoleError.js.map +1 -0
  426. package/esm/domain/error/trackReportError.d.ts +5 -0
  427. package/esm/domain/error/trackReportError.js +13 -0
  428. package/esm/domain/error/trackReportError.js.map +1 -0
  429. package/esm/domain/event/eventCollection.d.ts +10 -0
  430. package/esm/domain/event/eventCollection.js +24 -0
  431. package/esm/domain/event/eventCollection.js.map +1 -0
  432. package/esm/domain/getSelectorFromElement.d.ts +64 -0
  433. package/esm/domain/getSelectorFromElement.js +213 -0
  434. package/esm/domain/getSelectorFromElement.js.map +1 -0
  435. package/esm/domain/getSessionReplayUrl.d.ts +9 -0
  436. package/esm/domain/getSessionReplayUrl.js +30 -0
  437. package/esm/domain/getSessionReplayUrl.js.map +1 -0
  438. package/esm/domain/hooks.d.ts +23 -0
  439. package/esm/domain/hooks.js +3 -0
  440. package/esm/domain/hooks.js.map +1 -0
  441. package/esm/domain/lifeCycle.d.ts +73 -0
  442. package/esm/domain/lifeCycle.js +3 -0
  443. package/esm/domain/lifeCycle.js.map +1 -0
  444. package/esm/domain/limitModification.d.ts +8 -0
  445. package/esm/domain/limitModification.js +43 -0
  446. package/esm/domain/limitModification.js.map +1 -0
  447. package/esm/domain/longTask/longTaskCollection.d.ts +18 -0
  448. package/esm/domain/longTask/longTaskCollection.js +87 -0
  449. package/esm/domain/longTask/longTaskCollection.js.map +1 -0
  450. package/esm/domain/plugins.d.ts +40 -0
  451. package/esm/domain/plugins.js +12 -0
  452. package/esm/domain/plugins.js.map +1 -0
  453. package/esm/domain/privacy.d.ts +44 -0
  454. package/esm/domain/privacy.js +302 -0
  455. package/esm/domain/privacy.js.map +1 -0
  456. package/esm/domain/privacyConstants.d.ts +23 -0
  457. package/esm/domain/privacyConstants.js +35 -0
  458. package/esm/domain/privacyConstants.js.map +1 -0
  459. package/esm/domain/requestCollection.d.ts +54 -0
  460. package/esm/domain/requestCollection.js +106 -0
  461. package/esm/domain/requestCollection.js.map +1 -0
  462. package/esm/domain/resource/graphql.d.ts +23 -0
  463. package/esm/domain/resource/graphql.js +91 -0
  464. package/esm/domain/resource/graphql.js.map +1 -0
  465. package/esm/domain/resource/matchRequestResourceEntry.d.ts +16 -0
  466. package/esm/domain/resource/matchRequestResourceEntry.js +46 -0
  467. package/esm/domain/resource/matchRequestResourceEntry.js.map +1 -0
  468. package/esm/domain/resource/requestRegistry.d.ts +9 -0
  469. package/esm/domain/resource/requestRegistry.js +37 -0
  470. package/esm/domain/resource/requestRegistry.js.map +1 -0
  471. package/esm/domain/resource/resourceCollection.d.ts +7 -0
  472. package/esm/domain/resource/resourceCollection.js +187 -0
  473. package/esm/domain/resource/resourceCollection.js.map +1 -0
  474. package/esm/domain/resource/resourceUtils.d.ts +55 -0
  475. package/esm/domain/resource/resourceUtils.js +244 -0
  476. package/esm/domain/resource/resourceUtils.js.map +1 -0
  477. package/esm/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +4 -0
  478. package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js +21 -0
  479. package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js.map +1 -0
  480. package/esm/domain/rumSessionManager.d.ts +36 -0
  481. package/esm/domain/rumSessionManager.js +72 -0
  482. package/esm/domain/rumSessionManager.js.map +1 -0
  483. package/esm/domain/sampler/sampler.d.ts +10 -0
  484. package/esm/domain/sampler/sampler.js +58 -0
  485. package/esm/domain/sampler/sampler.js.map +1 -0
  486. package/esm/domain/startCustomerDataTelemetry.d.ts +4 -0
  487. package/esm/domain/startCustomerDataTelemetry.js +52 -0
  488. package/esm/domain/startCustomerDataTelemetry.js.map +1 -0
  489. package/esm/domain/tracing/getDocumentTraceId.d.ts +12 -0
  490. package/esm/domain/tracing/getDocumentTraceId.js +68 -0
  491. package/esm/domain/tracing/getDocumentTraceId.js.map +1 -0
  492. package/esm/domain/tracing/identifier.d.ts +13 -0
  493. package/esm/domain/tracing/identifier.js +50 -0
  494. package/esm/domain/tracing/identifier.js.map +1 -0
  495. package/esm/domain/tracing/sampler.d.ts +10 -0
  496. package/esm/domain/tracing/sampler.js +64 -0
  497. package/esm/domain/tracing/sampler.js.map +1 -0
  498. package/esm/domain/tracing/tracer.d.ts +30 -0
  499. package/esm/domain/tracing/tracer.js +156 -0
  500. package/esm/domain/tracing/tracer.js.map +1 -0
  501. package/esm/domain/tracing/tracer.types.d.ts +12 -0
  502. package/esm/domain/tracing/tracer.types.js +2 -0
  503. package/esm/domain/tracing/tracer.types.js.map +1 -0
  504. package/esm/domain/trackEventCounts.d.ts +17 -0
  505. package/esm/domain/trackEventCounts.js +47 -0
  506. package/esm/domain/trackEventCounts.js.map +1 -0
  507. package/esm/domain/view/bfCacheSupport.d.ts +2 -0
  508. package/esm/domain/view/bfCacheSupport.js +10 -0
  509. package/esm/domain/view/bfCacheSupport.js.map +1 -0
  510. package/esm/domain/view/trackViewEventCounts.d.ts +5 -0
  511. package/esm/domain/view/trackViewEventCounts.js +13 -0
  512. package/esm/domain/view/trackViewEventCounts.js.map +1 -0
  513. package/esm/domain/view/trackViews.d.ts +65 -0
  514. package/esm/domain/view/trackViews.js +271 -0
  515. package/esm/domain/view/trackViews.js.map +1 -0
  516. package/esm/domain/view/viewCollection.d.ts +18 -0
  517. package/esm/domain/view/viewCollection.js +150 -0
  518. package/esm/domain/view/viewCollection.js.map +1 -0
  519. package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.d.ts +6 -0
  520. package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js +28 -0
  521. package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +1 -0
  522. package/esm/domain/view/viewMetrics/interactionCountPolyfill.d.ts +18 -0
  523. package/esm/domain/view/viewMetrics/interactionCountPolyfill.js +39 -0
  524. package/esm/domain/view/viewMetrics/interactionCountPolyfill.js.map +1 -0
  525. package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +6 -0
  526. package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +41 -0
  527. package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +1 -0
  528. package/esm/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +8 -0
  529. package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js +14 -0
  530. package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js.map +1 -0
  531. package/esm/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +21 -0
  532. package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js +34 -0
  533. package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js.map +1 -0
  534. package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +37 -0
  535. package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js +130 -0
  536. package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +1 -0
  537. package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +13 -0
  538. package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js +34 -0
  539. package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +1 -0
  540. package/esm/domain/view/viewMetrics/trackFirstHidden.d.ts +10 -0
  541. package/esm/domain/view/viewMetrics/trackFirstHidden.js +30 -0
  542. package/esm/domain/view/viewMetrics/trackFirstHidden.js.map +1 -0
  543. package/esm/domain/view/viewMetrics/trackFirstInput.d.ts +19 -0
  544. package/esm/domain/view/viewMetrics/trackFirstInput.js +40 -0
  545. package/esm/domain/view/viewMetrics/trackFirstInput.js.map +1 -0
  546. package/esm/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +15 -0
  547. package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js +38 -0
  548. package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js.map +1 -0
  549. package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +25 -0
  550. package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js +149 -0
  551. package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +1 -0
  552. package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +18 -0
  553. package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js +57 -0
  554. package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +1 -0
  555. package/esm/domain/view/viewMetrics/trackLoadingTime.d.ts +14 -0
  556. package/esm/domain/view/viewMetrics/trackLoadingTime.js +47 -0
  557. package/esm/domain/view/viewMetrics/trackLoadingTime.js.map +1 -0
  558. package/esm/domain/view/viewMetrics/trackNavigationTimings.d.ts +14 -0
  559. package/esm/domain/view/viewMetrics/trackNavigationTimings.js +40 -0
  560. package/esm/domain/view/viewMetrics/trackNavigationTimings.js.map +1 -0
  561. package/esm/domain/view/viewMetrics/trackScrollMetrics.d.ts +25 -0
  562. package/esm/domain/view/viewMetrics/trackScrollMetrics.js +72 -0
  563. package/esm/domain/view/viewMetrics/trackScrollMetrics.js.map +1 -0
  564. package/esm/domain/vital/vitalCollection.d.ts +55 -0
  565. package/esm/domain/vital/vitalCollection.js +107 -0
  566. package/esm/domain/vital/vitalCollection.js.map +1 -0
  567. package/esm/domain/waitPageActivityEnd.d.ts +54 -0
  568. package/esm/domain/waitPageActivityEnd.js +123 -0
  569. package/esm/domain/waitPageActivityEnd.js.map +1 -0
  570. package/esm/domainContext.types.d.ts +39 -0
  571. package/esm/domainContext.types.js +5 -0
  572. package/esm/domainContext.types.js.map +1 -0
  573. package/esm/index.d.ts +41 -0
  574. package/esm/index.js +21 -0
  575. package/esm/index.js.map +1 -0
  576. package/esm/rawRumEvent.types.d.ts +326 -0
  577. package/esm/rawRumEvent.types.js +31 -0
  578. package/esm/rawRumEvent.types.js.map +1 -0
  579. package/esm/rumEvent.types.d.ts +2026 -0
  580. package/esm/rumEvent.types.js +6 -0
  581. package/esm/rumEvent.types.js.map +1 -0
  582. package/esm/transport/formDataTransport.d.ts +16 -0
  583. package/esm/transport/formDataTransport.js +43 -0
  584. package/esm/transport/formDataTransport.js.map +1 -0
  585. package/esm/transport/startRumBatch.d.ts +5 -0
  586. package/esm/transport/startRumBatch.js +30 -0
  587. package/esm/transport/startRumBatch.js.map +1 -0
  588. package/esm/transport/startRumEventBridge.d.ts +2 -0
  589. package/esm/transport/startRumEventBridge.js +8 -0
  590. package/esm/transport/startRumEventBridge.js.map +1 -0
  591. package/package.json +29 -0
  592. package/src/boot/preStartRum.ts +298 -0
  593. package/src/boot/rumPublicApi.ts +830 -0
  594. package/src/boot/startRum.ts +280 -0
  595. package/src/browser/cookieObservable.ts +63 -0
  596. package/src/browser/domMutationObservable.ts +98 -0
  597. package/src/browser/firstInputPolyfill.ts +87 -0
  598. package/src/browser/htmlDomUtils.ts +45 -0
  599. package/src/browser/locationChangeObservable.ts +69 -0
  600. package/src/browser/performanceObservable.ts +324 -0
  601. package/src/browser/performanceUtils.ts +50 -0
  602. package/src/browser/scroll.ts +25 -0
  603. package/src/browser/viewportObservable.ts +44 -0
  604. package/src/browser/windowOpenObservable.ts +7 -0
  605. package/src/domain/action/actionCollection.ts +146 -0
  606. package/src/domain/action/actionNameConstants.ts +20 -0
  607. package/src/domain/action/clickChain.ts +83 -0
  608. package/src/domain/action/computeFrustration.ts +77 -0
  609. package/src/domain/action/getActionNameFromElement.ts +337 -0
  610. package/src/domain/action/interactionSelectorCache.ts +21 -0
  611. package/src/domain/action/listenActionEvents.ts +119 -0
  612. package/src/domain/action/trackClickActions.ts +388 -0
  613. package/src/domain/assembly.ts +141 -0
  614. package/src/domain/configuration/configuration.ts +548 -0
  615. package/src/domain/configuration/index.ts +2 -0
  616. package/src/domain/configuration/jsonPathParser.ts +214 -0
  617. package/src/domain/configuration/remoteConfiguration.ts +304 -0
  618. package/src/domain/configuration/remoteConfiguration.types.ts +147 -0
  619. package/src/domain/contexts/ciVisibilityContext.ts +50 -0
  620. package/src/domain/contexts/connectivityContext.ts +12 -0
  621. package/src/domain/contexts/defaultContext.ts +43 -0
  622. package/src/domain/contexts/displayContext.ts +38 -0
  623. package/src/domain/contexts/featureFlagContext.ts +71 -0
  624. package/src/domain/contexts/internalContext.ts +34 -0
  625. package/src/domain/contexts/pageStateHistory.ts +171 -0
  626. package/src/domain/contexts/sessionContext.ts +59 -0
  627. package/src/domain/contexts/syntheticsContext.ts +33 -0
  628. package/src/domain/contexts/trackingConsentContext.ts +15 -0
  629. package/src/domain/contexts/urlContexts.ts +97 -0
  630. package/src/domain/contexts/userAgentDataContext.ts +36 -0
  631. package/src/domain/contexts/viewHistory.ts +70 -0
  632. package/src/domain/discardNegativeDuration.ts +6 -0
  633. package/src/domain/error/errorCollection.ts +107 -0
  634. package/src/domain/error/trackConsoleError.ts +14 -0
  635. package/src/domain/error/trackReportError.ts +16 -0
  636. package/src/domain/event/eventCollection.ts +53 -0
  637. package/src/domain/getSelectorFromElement.ts +268 -0
  638. package/src/domain/getSessionReplayUrl.ts +47 -0
  639. package/src/domain/hooks.ts +31 -0
  640. package/src/domain/lifeCycle.ts +103 -0
  641. package/src/domain/limitModification.ts +66 -0
  642. package/src/domain/longTask/longTaskCollection.ts +133 -0
  643. package/src/domain/plugins.ts +59 -0
  644. package/src/domain/privacy.ts +355 -0
  645. package/src/domain/privacyConstants.ts +43 -0
  646. package/src/domain/requestCollection.ts +179 -0
  647. package/src/domain/resource/graphql.ts +135 -0
  648. package/src/domain/resource/matchRequestResourceEntry.ts +68 -0
  649. package/src/domain/resource/requestRegistry.ts +52 -0
  650. package/src/domain/resource/resourceCollection.ts +273 -0
  651. package/src/domain/resource/resourceUtils.ts +355 -0
  652. package/src/domain/resource/retrieveInitialDocumentResourceTiming.ts +27 -0
  653. package/src/domain/rumSessionManager.ts +134 -0
  654. package/src/domain/sampler/sampler.ts +63 -0
  655. package/src/domain/startCustomerDataTelemetry.ts +83 -0
  656. package/src/domain/tracing/getDocumentTraceId.ts +90 -0
  657. package/src/domain/tracing/identifier.ts +69 -0
  658. package/src/domain/tracing/sampler.ts +69 -0
  659. package/src/domain/tracing/tracer.ts +248 -0
  660. package/src/domain/tracing/tracer.types.ts +13 -0
  661. package/src/domain/trackEventCounts.ts +67 -0
  662. package/src/domain/view/bfCacheSupport.ts +20 -0
  663. package/src/domain/view/trackViewEventCounts.ts +15 -0
  664. package/src/domain/view/trackViews.ts +431 -0
  665. package/src/domain/view/viewCollection.ts +203 -0
  666. package/src/domain/view/viewMetrics/getClsAttributionImpactedArea.ts +34 -0
  667. package/src/domain/view/viewMetrics/interactionCountPolyfill.ts +55 -0
  668. package/src/domain/view/viewMetrics/startInitialViewMetricsTelemetry.ts +70 -0
  669. package/src/domain/view/viewMetrics/trackBfcacheMetrics.ts +20 -0
  670. package/src/domain/view/viewMetrics/trackCommonViewMetrics.ts +78 -0
  671. package/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts +180 -0
  672. package/src/domain/view/viewMetrics/trackFirstContentfulPaint.ts +47 -0
  673. package/src/domain/view/viewMetrics/trackFirstHidden.ts +53 -0
  674. package/src/domain/view/viewMetrics/trackFirstInput.ts +59 -0
  675. package/src/domain/view/viewMetrics/trackInitialViewMetrics.ts +66 -0
  676. package/src/domain/view/viewMetrics/trackInteractionToNextPaint.ts +193 -0
  677. package/src/domain/view/viewMetrics/trackLargestContentfulPaint.ts +87 -0
  678. package/src/domain/view/viewMetrics/trackLoadingTime.ts +69 -0
  679. package/src/domain/view/viewMetrics/trackNavigationTimings.ts +66 -0
  680. package/src/domain/view/viewMetrics/trackScrollMetrics.ts +119 -0
  681. package/src/domain/vital/vitalCollection.ts +207 -0
  682. package/src/domain/waitPageActivityEnd.ts +189 -0
  683. package/src/domainContext.types.ts +61 -0
  684. package/src/index.ts +76 -0
  685. package/src/rawRumEvent.types.ts +409 -0
  686. package/src/rumEvent.types.ts +2151 -0
  687. package/src/transport/formDataTransport.ts +85 -0
  688. package/src/transport/startRumBatch.ts +46 -0
  689. package/src/transport/startRumEventBridge.ts +12 -0
@@ -0,0 +1,830 @@
1
+ import type {
2
+ Context,
3
+ TimeStamp,
4
+ RelativeTime,
5
+ DeflateWorker,
6
+ DeflateEncoderStreamId,
7
+ DeflateEncoder,
8
+ PublicApi,
9
+ Duration,
10
+ ContextManager,
11
+ TrackingConsent,
12
+ User,
13
+ Account,
14
+ RumInternalContext,
15
+ Telemetry,
16
+ Encoder,
17
+ } from '@kubesense/kubesense-browser-core'
18
+ import {
19
+ ContextManagerMethod,
20
+ addTelemetryUsage,
21
+ deepClone,
22
+ makePublicApi,
23
+ monitor,
24
+ clocksNow,
25
+ callMonitored,
26
+ createHandlingStack,
27
+ sanitize,
28
+ createIdentityEncoder,
29
+ displayAlreadyInitializedError,
30
+ createTrackingConsentState,
31
+ timeStampToClocks,
32
+ CustomerContextKey,
33
+ defineContextMethod,
34
+ startBufferingData,
35
+ } from '@kubesense/kubesense-browser-core'
36
+
37
+ import type { LifeCycle } from '../domain/lifeCycle'
38
+ import type { ViewHistory } from '../domain/contexts/viewHistory'
39
+ import type { RumSessionManager } from '../domain/rumSessionManager'
40
+ import type { ReplayStats } from '../rawRumEvent.types'
41
+ import { ActionType, VitalType } from '../rawRumEvent.types'
42
+ import type { RumConfiguration, RumInitConfiguration } from '../domain/configuration'
43
+ import type { ViewOptions } from '../domain/view/trackViews'
44
+ import type {
45
+ AddDurationVitalOptions,
46
+ DurationVitalReference,
47
+ DurationVitalOptions,
48
+ FeatureOperationOptions,
49
+ FailureReason,
50
+ } from '../domain/vital/vitalCollection'
51
+ import { createCustomVitalsState } from '../domain/vital/vitalCollection'
52
+ import { callPluginsMethod } from '../domain/plugins'
53
+ import type { Hooks } from '../domain/hooks'
54
+ import type { SdkName } from '../domain/contexts/defaultContext'
55
+ import type { LongTaskContexts } from '../domain/longTask/longTaskCollection'
56
+ import { createPreStartStrategy } from './preStartRum'
57
+ import type { StartRum, StartRumResult } from './startRum'
58
+
59
+ export interface StartRecordingOptions {
60
+ force: boolean
61
+ }
62
+
63
+ /**
64
+ * Public API for the RUM browser SDK.
65
+ *
66
+ * @category Main
67
+ */
68
+ export interface RumPublicApi extends PublicApi {
69
+ /**
70
+ * Init the RUM browser SDK.
71
+ *
72
+ * @category Init
73
+ * @param initConfiguration - Configuration options of the SDK
74
+ * @example
75
+ * ```ts
76
+ * kubesenseSdk.init({
77
+ * applicationId: '<KUBESENSE_APPLICATION_ID>',
78
+ * clientToken: '<KUBESENSE_CLIENT_TOKEN>',
79
+ * kubesenseRumEndpoint: '<KUBESENSE_RUM_ENDPOINT>',
80
+ * // ...
81
+ * })
82
+ * ```
83
+ *
84
+ */
85
+ init: (initConfiguration: RumInitConfiguration) => void
86
+
87
+ /**
88
+ * Set the tracking consent of the current user.
89
+ *
90
+ *
91
+ * Data will be sent only if it is set to "granted". This value won't be stored by the library
92
+ * across page loads: you will need to call this method or set the appropriate `trackingConsent`
93
+ * field in the init() method at each page load.
94
+ *
95
+ * If this method is called before the init() method, the provided value will take precedence
96
+ * over the one provided as initialization parameter.
97
+ *
98
+ * *
99
+ * @category Privacy
100
+ * @param trackingConsent - The user tracking consent
101
+ */
102
+ setTrackingConsent: (trackingConsent: TrackingConsent) => void
103
+
104
+ /**
105
+ * Set View Name.
106
+ *
107
+ * Enable to manually change the name of the current view.
108
+ * @category Context - View
109
+ * @param name name of the view
110
+ */
111
+ setViewName: (name: string) => void
112
+
113
+ /**
114
+ * Set View Context.
115
+ *
116
+ * Enable to manually set the context of the current view.
117
+ * @category Context - View
118
+ * @param context context of the view
119
+ */
120
+ setViewContext: (context: Context) => void
121
+ /**
122
+ * Set View Context Property.
123
+ *
124
+ * Enable to manually set a property of the context of the current view.
125
+ * @category Context - View
126
+ * @param key - key of the property
127
+ * @param value - value of the property
128
+ */
129
+ setViewContextProperty: (key: string, value: any) => void
130
+
131
+ /**
132
+ * Get View Context.
133
+ * @category Context - View
134
+ *
135
+ */
136
+ getViewContext(): Context
137
+
138
+ /**
139
+ * Set the global context information to all events, stored in `@context`
140
+ *
141
+ * @category internal - View
142
+ * @param context Global context
143
+ *
144
+ */
145
+ getInternalContext: (startTime?: number) => RumInternalContext | undefined
146
+
147
+ /**
148
+ * Get the init configuration
149
+ */
150
+ getInitConfiguration: () => RumInitConfiguration | undefined
151
+
152
+ /**
153
+ * Add a custom action, stored in `@action`
154
+ * @category Data Collection
155
+ * @param name Name of the action
156
+ * @param context Context of the action
157
+ *
158
+ */
159
+ addAction: (name: string, context?: object) => void
160
+
161
+ /**
162
+ * Add a custom error, stored in `@error`.
163
+ * @category Data Collection
164
+ * @param error Error. Favor sending a [Javascript Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) to have a stack trace attached to the error event.
165
+ * @param context Context of the error
166
+ *
167
+ */
168
+ addError: (error: unknown, context?: object) => void
169
+
170
+ /**
171
+ * Add a custom timing relative to the start of the current view,
172
+ * stored in `@view.custom_timings.<timing_name>`
173
+ *
174
+ * @category Data Collection
175
+ * @param name Name of the custom timing
176
+ * @param [time] Epoch timestamp of the custom timing (if not set, will use current time)
177
+ *
178
+ * Note: passing a relative time is discouraged since it is actually used as-is but displayed relative to the view start.
179
+ * We currently don't provide a way to retrieve the view start time, so it can be challenging to provide a timing relative to the view start.
180
+ */
181
+ addTiming: (name: string, time?: number) => void
182
+
183
+ /**
184
+ * Set the global context information to all events, stored in `@context`
185
+ * See [Global context](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#global-context) for further information.
186
+ *
187
+ * @category Context - Global Context
188
+ * @param context - Global context
189
+ */
190
+ setGlobalContext: (context: Context) => void
191
+
192
+ /**
193
+ * Get the global Context
194
+ *
195
+ * See [Global context](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#global-context) for further information.
196
+ *
197
+ * @category Context - Global Context
198
+ */
199
+ getGlobalContext: () => Context
200
+
201
+ /**
202
+ * Set or update a global context property, stored in `@context.<key>`
203
+ *
204
+ * See [Global context](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#global-context) for further information.
205
+ *
206
+ * @category Context - Global Context
207
+ * @param key - Key of the property
208
+ * @param value - Value of the property
209
+ */
210
+ setGlobalContextProperty: (key: any, value: any) => void
211
+
212
+ /**
213
+ * Remove a global context property
214
+ *
215
+ * See [Global context](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#global-context) for further information.
216
+ *
217
+ * @category Context - Global Context
218
+ */
219
+ removeGlobalContextProperty: (key: any) => void
220
+
221
+ /**
222
+ * Clear the global context
223
+ *
224
+ * See [Global context](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#global-context) for further information.
225
+ *
226
+ * @category Context - Global Context
227
+ */
228
+ clearGlobalContext(): void
229
+
230
+ /**
231
+ * Set user information to all events, stored in `@usr`
232
+ *
233
+ * See [User session](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#user-session) for further information.
234
+ *
235
+ * @category Context - User
236
+ * @param newUser - User information
237
+ */
238
+ setUser(newUser: User & { id: string }): void
239
+
240
+ /**
241
+ * Set user information to all events, stored in `@usr`
242
+ *
243
+ * @category Context - User
244
+ * @deprecated You must specify a user id, favor using {@link setUser} instead
245
+ * @param newUser - User information with optional id
246
+ */
247
+ setUser(newUser: User): void
248
+
249
+ /**
250
+ * Get user information
251
+ *
252
+ * See [User session](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#user-session) for further information.
253
+ *
254
+ * @category Context - User
255
+ * @returns User information
256
+ */
257
+ getUser: () => Context
258
+
259
+ /**
260
+ * Set or update the user property, stored in `@usr.<key>`
261
+ *
262
+ * See [User session](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#user-session) for further information.
263
+ *
264
+ * @category Context - User
265
+ * @param key - Key of the property
266
+ * @param property - Value of the property
267
+ */
268
+ setUserProperty: (key: any, property: any) => void
269
+
270
+ /**
271
+ * Remove a user property
272
+ *
273
+ * @category Context - User
274
+ * @param key - Key of the property to remove
275
+ * @see [User session](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#user-session) for further information.
276
+ */
277
+ removeUserProperty: (key: any) => void
278
+
279
+ /**
280
+ * Clear all user information
281
+ *
282
+ * See [User session](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#user-session) for further information.
283
+ *
284
+ * @category Context - User
285
+ */
286
+ clearUser: () => void
287
+
288
+ /**
289
+ * Set account information to all events, stored in `@account`
290
+ *
291
+ * @category Context - Account
292
+ * @param newAccount - Account information
293
+ */
294
+ setAccount: (newAccount: Account) => void
295
+
296
+ /**
297
+ * Get account information
298
+ *
299
+ * @category Context - Account
300
+ * @returns Account information
301
+ */
302
+ getAccount: () => Context
303
+
304
+ /**
305
+ * Set or update the account property, stored in `@account.<key>`
306
+ *
307
+ * @category Context - Account
308
+ * @param key - Key of the property
309
+ * @param property - Value of the property
310
+ */
311
+ setAccountProperty: (key: string, property: any) => void
312
+
313
+ /**
314
+ * Remove an account property
315
+ *
316
+ * @category Context - Account
317
+ * @param key - Key of the property to remove
318
+ */
319
+ removeAccountProperty: (key: string) => void
320
+
321
+ /**
322
+ * Clear all account information
323
+ *
324
+ * @category Context - Account
325
+ * @returns Clear all account information
326
+ */
327
+ clearAccount: () => void
328
+ /**
329
+ * Start a view manually.
330
+ * Enable to manual start a view, use `trackViewsManually: true` init parameter and call `startView()` to create RUM views and be aligned with how you’ve defined them in your SPA application routing.
331
+ *
332
+ * See [Override default RUM view names](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#override-default-rum-view-names) for further information.
333
+ *
334
+ * Context - @category Data Collection
335
+ *
336
+ * @param nameOrOptions - Name or options (name, service, version) for the view
337
+ */
338
+ startView(nameOrOptions?: string | ViewOptions): void
339
+
340
+ /**
341
+ * Stop the session. A new session will start at the next user interaction with the page.
342
+ *
343
+ * @category Session
344
+ */
345
+ stopSession(): void
346
+
347
+ /**
348
+ * Add a feature flag evaluation,
349
+ * stored in `@feature_flags.<feature_flag_key>`
350
+ *
351
+ * We recommend enabling the intake request compression when using feature flags `compressIntakeRequests: true`.
352
+ *
353
+ * See [Feature Flag Tracking](https://docs.kubesense.ai/real_user_monitoring/feature_flag_tracking/) for further information.
354
+ *
355
+ * @category Data Collection
356
+ * @param key - The key of the feature flag.
357
+ * @param value - The value of the feature flag.
358
+ */
359
+ addFeatureFlagEvaluation: (key: string, value: any) => void
360
+
361
+ /**
362
+ * Get the Session Replay Link.
363
+ *
364
+ * See [Connect Session Replay To Your Third-Party Tools](https://docs.kubesense.ai/real_user_monitoring/guide/connect-session-replay-to-your-third-party-tools) for further information.
365
+ *
366
+ * @category Session Replay
367
+ */
368
+ getSessionReplayLink: () => string | undefined
369
+
370
+ /**
371
+ * Start Session Replay recording.
372
+ * Enable to conditionally start the recording, use the `startSessionReplayRecordingManually:true` init parameter and call `startSessionReplayRecording()`
373
+ *
374
+ * See [Browser Session Replay](https://docs.kubesense.ai/real_user_monitoring/session_replay/browser) for further information.
375
+ *
376
+ * @category Session Replay
377
+ */
378
+ startSessionReplayRecording: (options?: StartRecordingOptions) => void
379
+
380
+ /**
381
+ * Stop Session Replay recording.
382
+ *
383
+ * See [Browser Session Replay](https://docs.kubesense.ai/real_user_monitoring/session_replay/browser) for further information.
384
+ *
385
+ * @category Session Replay
386
+ */
387
+ stopSessionReplayRecording: () => void
388
+
389
+ /**
390
+ * Add a custom duration vital
391
+ *
392
+ * @category Vital - Duration
393
+ * @param name - Name of the custom vital
394
+ * @param options - Options for the custom vital (startTime, duration, context, description)
395
+ */
396
+ addDurationVital: (name: string, options: AddDurationVitalOptions) => void
397
+
398
+ /**
399
+ * Start a custom duration vital.
400
+ *
401
+ * If you plan to have multiple durations for the same vital, you should use the reference returned by this method.
402
+ *
403
+ * @category Vital - Duration
404
+ * @param name - Name of the custom vital
405
+ * @param options - Options for the custom vital (context, description)
406
+ * @returns reference to the custom vital
407
+ */
408
+ startDurationVital: (name: string, options?: DurationVitalOptions) => DurationVitalReference
409
+
410
+ /**
411
+ * Stop a custom duration vital
412
+ *
413
+ * @category Vital - Duration
414
+ * @param nameOrRef - Name or reference of the custom vital
415
+ * @param options - Options for the custom vital (operationKey, context, description)
416
+ */
417
+ stopDurationVital: (nameOrRef: string | DurationVitalReference, options?: DurationVitalOptions) => void
418
+
419
+ /**
420
+ * start a feature operation
421
+ *
422
+ * @category Vital - Feature Operation
423
+ * @param name - Name of the operation step
424
+ * @param options - Options for the operation step (operationKey, context, description)
425
+ * @hidden // TODO: replace by @since when GA
426
+ */
427
+ startFeatureOperation: (name: string, options?: FeatureOperationOptions) => void
428
+
429
+ /**
430
+ * succeed a feature operation
431
+ *
432
+ * @category Vital - Feature Operation
433
+ * @param name - Name of the operation step
434
+ * @param options - Options for the operation step (operationKey, context, description)
435
+ * @hidden // TODO: replace by @since when GA
436
+ */
437
+ succeedFeatureOperation: (name: string, options?: FeatureOperationOptions) => void
438
+
439
+ /**
440
+ * fail a feature operation
441
+ *
442
+ * @category Vital - Feature Operation
443
+ * @param name - Name of the operation step
444
+ * @param failureReason
445
+ * @param options - Options for the operation step (operationKey, context, description)
446
+ * @hidden // TODO: replace by @since when GA
447
+ */
448
+ failFeatureOperation: (name: string, failureReaon: FailureReason, options?: FeatureOperationOptions) => void
449
+ }
450
+
451
+ export interface RecorderApi {
452
+ start: (options?: StartRecordingOptions) => void
453
+ stop: () => void
454
+ onRumStart: (
455
+ lifeCycle: LifeCycle,
456
+ configuration: RumConfiguration,
457
+ sessionManager: RumSessionManager,
458
+ viewHistory: ViewHistory,
459
+ deflateWorker: DeflateWorker | undefined,
460
+ telemetry: Telemetry
461
+ ) => void
462
+ isRecording: () => boolean
463
+ getReplayStats: (viewId: string) => ReplayStats | undefined
464
+ getSessionReplayLink: () => string | undefined
465
+ }
466
+
467
+ export interface ProfilerApi {
468
+ stop: () => void
469
+ onRumStart: (
470
+ lifeCycle: LifeCycle,
471
+ hooks: Hooks,
472
+ configuration: RumConfiguration,
473
+ sessionManager: RumSessionManager,
474
+ viewHistory: ViewHistory,
475
+ longTaskContexts: LongTaskContexts,
476
+ createEncoder: (streamId: DeflateEncoderStreamId) => Encoder
477
+ ) => void
478
+ }
479
+
480
+ export interface RumPublicApiOptions {
481
+ ignoreInitIfSyntheticsWillInjectRum?: boolean
482
+ startDeflateWorker?: (
483
+ configuration: RumConfiguration,
484
+ source: string,
485
+ onInitializationFailure: () => void
486
+ ) => DeflateWorker | undefined
487
+ createDeflateEncoder?: (
488
+ configuration: RumConfiguration,
489
+ worker: DeflateWorker,
490
+ streamId: DeflateEncoderStreamId
491
+ ) => DeflateEncoder
492
+ sdkName?: SdkName
493
+ }
494
+
495
+ export interface Strategy {
496
+ init: (initConfiguration: RumInitConfiguration, publicApi: RumPublicApi, errorStack?: string) => void
497
+ initConfiguration: RumInitConfiguration | undefined
498
+ getInternalContext: StartRumResult['getInternalContext']
499
+ stopSession: StartRumResult['stopSession']
500
+ addTiming: StartRumResult['addTiming']
501
+ startView: StartRumResult['startView']
502
+ setViewName: StartRumResult['setViewName']
503
+
504
+ setViewContext: StartRumResult['setViewContext']
505
+ setViewContextProperty: StartRumResult['setViewContextProperty']
506
+ getViewContext: StartRumResult['getViewContext']
507
+
508
+ globalContext: ContextManager
509
+ userContext: ContextManager
510
+ accountContext: ContextManager
511
+
512
+ addAction: StartRumResult['addAction']
513
+ addError: StartRumResult['addError']
514
+ addFeatureFlagEvaluation: StartRumResult['addFeatureFlagEvaluation']
515
+ startDurationVital: StartRumResult['startDurationVital']
516
+ stopDurationVital: StartRumResult['stopDurationVital']
517
+ addDurationVital: StartRumResult['addDurationVital']
518
+ addOperationStepVital: StartRumResult['addOperationStepVital']
519
+ }
520
+
521
+ export function makeRumPublicApi(
522
+ startRumImpl: StartRum,
523
+ recorderApi: RecorderApi,
524
+ profilerApi: ProfilerApi,
525
+ options: RumPublicApiOptions = {}
526
+ ): RumPublicApi {
527
+ const trackingConsentState = createTrackingConsentState()
528
+ const customVitalsState = createCustomVitalsState()
529
+ const bufferedDataObservable = startBufferingData().observable
530
+
531
+ let strategy = createPreStartStrategy(
532
+ options,
533
+ trackingConsentState,
534
+ customVitalsState,
535
+ (configuration, deflateWorker, initialViewOptions) => {
536
+ const createEncoder =
537
+ deflateWorker && options.createDeflateEncoder
538
+ ? (streamId: DeflateEncoderStreamId) => options.createDeflateEncoder!(configuration, deflateWorker, streamId)
539
+ : createIdentityEncoder
540
+
541
+ const startRumResult = startRumImpl(
542
+ configuration,
543
+ recorderApi,
544
+ profilerApi,
545
+ initialViewOptions,
546
+ createEncoder,
547
+ trackingConsentState,
548
+ customVitalsState,
549
+ bufferedDataObservable,
550
+ options.sdkName
551
+ )
552
+
553
+ recorderApi.onRumStart(
554
+ startRumResult.lifeCycle,
555
+ configuration,
556
+ startRumResult.session,
557
+ startRumResult.viewHistory,
558
+ deflateWorker,
559
+ startRumResult.telemetry
560
+ )
561
+
562
+ profilerApi.onRumStart(
563
+ startRumResult.lifeCycle,
564
+ startRumResult.hooks,
565
+ configuration,
566
+ startRumResult.session,
567
+ startRumResult.viewHistory,
568
+ startRumResult.longTaskContexts,
569
+ createEncoder
570
+ )
571
+
572
+ strategy = createPostStartStrategy(strategy, startRumResult)
573
+
574
+ callPluginsMethod(configuration.plugins, 'onRumStart', {
575
+ strategy, // TODO: remove this in the next major release
576
+ addEvent: startRumResult.addEvent,
577
+ })
578
+
579
+ return startRumResult
580
+ }
581
+ )
582
+ const getStrategy = () => strategy
583
+
584
+ const startView: {
585
+ (name?: string): void
586
+ (options: ViewOptions): void
587
+ } = monitor((options?: string | ViewOptions) => {
588
+ const sanitizedOptions = typeof options === 'object' ? options : { name: options }
589
+ strategy.startView(sanitizedOptions)
590
+ addTelemetryUsage({ feature: 'start-view' })
591
+ })
592
+
593
+ const rumPublicApi: RumPublicApi = makePublicApi<RumPublicApi>({
594
+ init: (initConfiguration) => {
595
+ const errorStack = new Error().stack
596
+ callMonitored(() => strategy.init(initConfiguration, rumPublicApi, errorStack))
597
+ },
598
+
599
+ setTrackingConsent: monitor((trackingConsent) => {
600
+ trackingConsentState.update(trackingConsent)
601
+ addTelemetryUsage({ feature: 'set-tracking-consent', tracking_consent: trackingConsent })
602
+ }),
603
+
604
+ setViewName: monitor((name: string) => {
605
+ strategy.setViewName(name)
606
+ addTelemetryUsage({ feature: 'set-view-name' })
607
+ }),
608
+
609
+ setViewContext: monitor((context: Context) => {
610
+ strategy.setViewContext(context)
611
+ addTelemetryUsage({ feature: 'set-view-context' })
612
+ }),
613
+
614
+ setViewContextProperty: monitor((key: string, value: any) => {
615
+ strategy.setViewContextProperty(key, value)
616
+ addTelemetryUsage({ feature: 'set-view-context-property' })
617
+ }),
618
+
619
+ getViewContext: monitor(() => {
620
+ addTelemetryUsage({ feature: 'set-view-context-property' })
621
+ return strategy.getViewContext()
622
+ }),
623
+
624
+ getInternalContext: monitor((startTime) => strategy.getInternalContext(startTime)),
625
+
626
+ getInitConfiguration: monitor(() => deepClone(strategy.initConfiguration)),
627
+
628
+ addAction: (name, context) => {
629
+ const handlingStack = createHandlingStack('action')
630
+
631
+ callMonitored(() => {
632
+ strategy.addAction({
633
+ name: sanitize(name)!,
634
+ context: sanitize(context) as Context,
635
+ startClocks: clocksNow(),
636
+ type: ActionType.CUSTOM,
637
+ handlingStack,
638
+ })
639
+ addTelemetryUsage({ feature: 'add-action' })
640
+ })
641
+ },
642
+
643
+ addError: (error, context) => {
644
+ const handlingStack = createHandlingStack('error')
645
+ callMonitored(() => {
646
+ strategy.addError({
647
+ error, // Do not sanitize error here, it is needed unserialized by computeRawError()
648
+ handlingStack,
649
+ context: sanitize(context) as Context,
650
+ startClocks: clocksNow(),
651
+ })
652
+ addTelemetryUsage({ feature: 'add-error' })
653
+ })
654
+ },
655
+
656
+ addTiming: monitor((name, time) => {
657
+ // TODO: next major decide to drop relative time support or update its behaviour
658
+ strategy.addTiming(sanitize(name)!, time as RelativeTime | TimeStamp | undefined)
659
+ }),
660
+
661
+ setGlobalContext: defineContextMethod(
662
+ getStrategy,
663
+ CustomerContextKey.globalContext,
664
+ ContextManagerMethod.setContext,
665
+ 'set-global-context'
666
+ ),
667
+ getGlobalContext: defineContextMethod(
668
+ getStrategy,
669
+ CustomerContextKey.globalContext,
670
+ ContextManagerMethod.getContext,
671
+ 'get-global-context'
672
+ ),
673
+ setGlobalContextProperty: defineContextMethod(
674
+ getStrategy,
675
+ CustomerContextKey.globalContext,
676
+ ContextManagerMethod.setContextProperty,
677
+ 'set-global-context-property'
678
+ ),
679
+ removeGlobalContextProperty: defineContextMethod(
680
+ getStrategy,
681
+ CustomerContextKey.globalContext,
682
+ ContextManagerMethod.removeContextProperty,
683
+ 'remove-global-context-property'
684
+ ),
685
+ clearGlobalContext: defineContextMethod(
686
+ getStrategy,
687
+ CustomerContextKey.globalContext,
688
+ ContextManagerMethod.clearContext,
689
+ 'clear-global-context'
690
+ ),
691
+
692
+ setUser: defineContextMethod(
693
+ getStrategy,
694
+ CustomerContextKey.userContext,
695
+ ContextManagerMethod.setContext,
696
+ 'set-user'
697
+ ),
698
+ getUser: defineContextMethod(
699
+ getStrategy,
700
+ CustomerContextKey.userContext,
701
+ ContextManagerMethod.getContext,
702
+ 'get-user'
703
+ ),
704
+ setUserProperty: defineContextMethod(
705
+ getStrategy,
706
+ CustomerContextKey.userContext,
707
+ ContextManagerMethod.setContextProperty,
708
+ 'set-user-property'
709
+ ),
710
+ removeUserProperty: defineContextMethod(
711
+ getStrategy,
712
+ CustomerContextKey.userContext,
713
+ ContextManagerMethod.removeContextProperty,
714
+ 'remove-user-property'
715
+ ),
716
+ clearUser: defineContextMethod(
717
+ getStrategy,
718
+ CustomerContextKey.userContext,
719
+ ContextManagerMethod.clearContext,
720
+ 'clear-user'
721
+ ),
722
+
723
+ setAccount: defineContextMethod(
724
+ getStrategy,
725
+ CustomerContextKey.accountContext,
726
+ ContextManagerMethod.setContext,
727
+ 'set-account'
728
+ ),
729
+ getAccount: defineContextMethod(
730
+ getStrategy,
731
+ CustomerContextKey.accountContext,
732
+ ContextManagerMethod.getContext,
733
+ 'get-account'
734
+ ),
735
+ setAccountProperty: defineContextMethod(
736
+ getStrategy,
737
+ CustomerContextKey.accountContext,
738
+ ContextManagerMethod.setContextProperty,
739
+ 'set-account-property'
740
+ ),
741
+ removeAccountProperty: defineContextMethod(
742
+ getStrategy,
743
+ CustomerContextKey.accountContext,
744
+ ContextManagerMethod.removeContextProperty,
745
+ 'remove-account-property'
746
+ ),
747
+ clearAccount: defineContextMethod(
748
+ getStrategy,
749
+ CustomerContextKey.accountContext,
750
+ ContextManagerMethod.clearContext,
751
+ 'clear-account'
752
+ ),
753
+
754
+ startView,
755
+
756
+ stopSession: monitor(() => {
757
+ strategy.stopSession()
758
+ addTelemetryUsage({ feature: 'stop-session' })
759
+ }),
760
+
761
+ addFeatureFlagEvaluation: monitor((key, value) => {
762
+ strategy.addFeatureFlagEvaluation(sanitize(key)!, sanitize(value))
763
+ addTelemetryUsage({ feature: 'add-feature-flag-evaluation' })
764
+ }),
765
+
766
+ getSessionReplayLink: monitor(() => recorderApi.getSessionReplayLink()),
767
+
768
+ startSessionReplayRecording: monitor((options?: StartRecordingOptions) => {
769
+ recorderApi.start(options)
770
+ addTelemetryUsage({ feature: 'start-session-replay-recording', force: options && options.force })
771
+ }),
772
+
773
+ stopSessionReplayRecording: monitor(() => recorderApi.stop()),
774
+
775
+ addDurationVital: monitor((name, options) => {
776
+ addTelemetryUsage({ feature: 'add-duration-vital' })
777
+ strategy.addDurationVital({
778
+ name: sanitize(name)!,
779
+ type: VitalType.DURATION,
780
+ startClocks: timeStampToClocks(options.startTime as TimeStamp),
781
+ duration: options.duration as Duration,
782
+ context: sanitize(options && options.context) as Context,
783
+ description: sanitize(options && options.description) as string | undefined,
784
+ })
785
+ }),
786
+
787
+ startDurationVital: monitor((name, options) => {
788
+ addTelemetryUsage({ feature: 'start-duration-vital' })
789
+ return strategy.startDurationVital(sanitize(name)!, {
790
+ context: sanitize(options && options.context) as Context,
791
+ description: sanitize(options && options.description) as string | undefined,
792
+ })
793
+ }),
794
+
795
+ stopDurationVital: monitor((nameOrRef, options) => {
796
+ addTelemetryUsage({ feature: 'stop-duration-vital' })
797
+ strategy.stopDurationVital(typeof nameOrRef === 'string' ? sanitize(nameOrRef)! : nameOrRef, {
798
+ context: sanitize(options && options.context) as Context,
799
+ description: sanitize(options && options.description) as string | undefined,
800
+ })
801
+ }),
802
+
803
+ startFeatureOperation: monitor((name, options) => {
804
+ addTelemetryUsage({ feature: 'add-operation-step-vital', action_type: 'start' })
805
+ strategy.addOperationStepVital(name, 'start', options)
806
+ }),
807
+
808
+ succeedFeatureOperation: monitor((name, options) => {
809
+ addTelemetryUsage({ feature: 'add-operation-step-vital', action_type: 'succeed' })
810
+ strategy.addOperationStepVital(name, 'end', options)
811
+ }),
812
+
813
+ failFeatureOperation: monitor((name, failureReason, options) => {
814
+ addTelemetryUsage({ feature: 'add-operation-step-vital', action_type: 'fail' })
815
+ strategy.addOperationStepVital(name, 'end', options, failureReason)
816
+ }),
817
+ })
818
+
819
+ return rumPublicApi
820
+ }
821
+
822
+ function createPostStartStrategy(preStartStrategy: Strategy, startRumResult: StartRumResult): Strategy {
823
+ return {
824
+ init: (initConfiguration: RumInitConfiguration) => {
825
+ displayAlreadyInitializedError('KUBESENSE_SDK', initConfiguration)
826
+ },
827
+ initConfiguration: preStartStrategy.initConfiguration,
828
+ ...startRumResult,
829
+ }
830
+ }