@openobserve/browser-core 0.2.11-rc1 → 0.2.12-beta.1

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 (626) hide show
  1. package/package.json +6 -5
  2. package/src/boot/displayAlreadyInitializedError.ts +8 -0
  3. package/src/boot/init.ts +29 -15
  4. package/src/browser/addEventListener.ts +13 -10
  5. package/src/browser/{types.ts → browser.types.ts} +42 -0
  6. package/src/browser/cookie.ts +49 -14
  7. package/src/browser/fetchObservable.ts +80 -21
  8. package/src/browser/{pageExitObservable.ts → pageMayExitObservable.ts} +11 -22
  9. package/src/browser/runOnReadyState.ts +14 -4
  10. package/src/browser/xhrObservable.ts +17 -4
  11. package/src/domain/allowedTrackingOrigins.ts +30 -0
  12. package/src/domain/bufferedData.ts +32 -0
  13. package/src/domain/configuration/configuration.ts +352 -83
  14. package/src/domain/configuration/endpointBuilder.ts +29 -32
  15. package/src/domain/configuration/index.ts +6 -5
  16. package/src/domain/configuration/transportConfiguration.ts +42 -35
  17. package/src/domain/connectivity/connectivity.ts +5 -1
  18. package/src/domain/console/consoleObservable.ts +57 -21
  19. package/src/domain/context/contextConstants.ts +22 -0
  20. package/src/domain/context/contextManager.ts +48 -11
  21. package/src/domain/context/contextUtils.ts +14 -0
  22. package/src/domain/context/defineContextMethod.ts +31 -0
  23. package/src/domain/context/storeContextManager.ts +7 -3
  24. package/src/domain/contexts/accountContext.ts +47 -0
  25. package/src/domain/contexts/globalContext.ts +30 -0
  26. package/src/domain/contexts/rumInternalContext.type.ts +15 -0
  27. package/src/domain/contexts/userContext.ts +64 -0
  28. package/src/domain/deflate/{types.ts → deflate.types.ts} +6 -4
  29. package/src/domain/deflate/index.ts +1 -1
  30. package/src/domain/error/error.ts +28 -84
  31. package/src/domain/error/error.types.ts +10 -2
  32. package/src/domain/error/trackRuntimeError.ts +29 -32
  33. package/src/domain/eventRateLimiter/createEventRateLimiter.ts +5 -2
  34. package/src/domain/extension/extensionUtils.ts +28 -0
  35. package/src/domain/intakeSites.ts +18 -0
  36. package/src/domain/report/reportObservable.ts +35 -30
  37. package/src/domain/resourceUtils.ts +20 -16
  38. package/src/domain/session/README.md +193 -0
  39. package/src/domain/session/oldCookiesMigration.ts +2 -2
  40. package/src/domain/session/sessionConstants.ts +16 -1
  41. package/src/domain/session/sessionManager.ts +179 -15
  42. package/src/domain/session/sessionState.ts +49 -17
  43. package/src/domain/session/sessionStateValidation.ts +9 -0
  44. package/src/domain/session/sessionStore.ts +118 -55
  45. package/src/domain/session/sessionStoreOperations.ts +47 -20
  46. package/src/domain/session/storeStrategies/sessionInCookie.ts +105 -26
  47. package/src/domain/session/storeStrategies/sessionInLocalStorage.ts +10 -8
  48. package/src/domain/session/storeStrategies/sessionStoreStrategy.ts +5 -2
  49. package/src/domain/synthetics/syntheticsWorkerValues.ts +13 -2
  50. package/src/domain/tags.ts +76 -0
  51. package/src/domain/telemetry/index.ts +12 -4
  52. package/src/domain/telemetry/rawTelemetryEvent.types.ts +6 -3
  53. package/src/domain/telemetry/telemetry.ts +235 -106
  54. package/src/domain/telemetry/telemetryEvent.types.ts +514 -5
  55. package/src/domain/trackingConsent.ts +34 -0
  56. package/src/index.ts +90 -59
  57. package/src/tools/abstractHooks.ts +72 -0
  58. package/src/tools/abstractLifeCycle.ts +1 -0
  59. package/src/tools/boundedBuffer.ts +36 -8
  60. package/src/tools/display.ts +4 -0
  61. package/src/tools/encoder.ts +3 -2
  62. package/src/tools/experimentalFeatures.ts +18 -7
  63. package/src/tools/getZoneJsOriginalValue.ts +1 -1
  64. package/src/tools/{getGlobalObject.ts → globalObject.ts} +20 -0
  65. package/src/tools/instrumentMethod.ts +58 -41
  66. package/src/tools/matchOption.ts +1 -2
  67. package/src/tools/monitor.ts +11 -7
  68. package/src/tools/observable.ts +78 -12
  69. package/src/tools/queueMicrotask.ts +13 -0
  70. package/src/tools/readBytesFromStream.ts +24 -64
  71. package/src/tools/requestIdleCallback.ts +40 -0
  72. package/src/tools/sendToExtension.ts +3 -1
  73. package/src/tools/serialisation/context.ts +4 -1
  74. package/src/tools/serialisation/sanitize.ts +32 -14
  75. package/src/{domain/error → tools/stackTrace}/computeStackTrace.ts +72 -8
  76. package/src/tools/stackTrace/handlingStack.ts +48 -0
  77. package/src/tools/taskQueue.ts +63 -0
  78. package/src/tools/timer.ts +1 -1
  79. package/src/tools/utils/arrayUtils.ts +11 -3
  80. package/src/tools/utils/browserDetection.ts +0 -9
  81. package/src/tools/utils/byteUtils.ts +13 -2
  82. package/src/tools/utils/functionUtils.ts +0 -2
  83. package/src/tools/utils/numberUtils.ts +2 -1
  84. package/src/tools/utils/objectUtils.ts +1 -3
  85. package/src/tools/utils/polyfills.ts +6 -107
  86. package/src/tools/utils/responseUtils.ts +1 -1
  87. package/src/tools/utils/stringUtils.ts +34 -2
  88. package/src/tools/utils/timeUtils.ts +18 -13
  89. package/src/tools/utils/timezone.ts +9 -0
  90. package/src/tools/utils/urlPolyfill.ts +29 -59
  91. package/src/tools/valueHistory.ts +66 -35
  92. package/src/transport/batch.ts +77 -80
  93. package/src/transport/eventBridge.ts +24 -5
  94. package/src/transport/flushController.ts +27 -21
  95. package/src/transport/httpRequest.ts +92 -71
  96. package/src/transport/index.ts +7 -4
  97. package/src/transport/sendWithRetryStrategy.ts +55 -36
  98. package/cjs/boot/init.d.ts +0 -5
  99. package/cjs/boot/init.js +0 -36
  100. package/cjs/boot/init.js.map +0 -1
  101. package/cjs/browser/addEventListener.d.ts +0 -84
  102. package/cjs/browser/addEventListener.js +0 -94
  103. package/cjs/browser/addEventListener.js.map +0 -1
  104. package/cjs/browser/cookie.d.ts +0 -17
  105. package/cjs/browser/cookie.js +0 -86
  106. package/cjs/browser/cookie.js.map +0 -1
  107. package/cjs/browser/fetchObservable.d.ts +0 -23
  108. package/cjs/browser/fetchObservable.js +0 -69
  109. package/cjs/browser/fetchObservable.js.map +0 -1
  110. package/cjs/browser/pageExitObservable.d.ts +0 -14
  111. package/cjs/browser/pageExitObservable.js +0 -57
  112. package/cjs/browser/pageExitObservable.js.map +0 -1
  113. package/cjs/browser/runOnReadyState.d.ts +0 -2
  114. package/cjs/browser/runOnReadyState.js +0 -15
  115. package/cjs/browser/runOnReadyState.js.map +0 -1
  116. package/cjs/browser/types.d.ts +0 -19
  117. package/cjs/browser/types.js +0 -6
  118. package/cjs/browser/types.js.map +0 -1
  119. package/cjs/browser/xhrObservable.d.ts +0 -21
  120. package/cjs/browser/xhrObservable.js +0 -85
  121. package/cjs/browser/xhrObservable.js.map +0 -1
  122. package/cjs/domain/configuration/configuration.d.ts +0 -72
  123. package/cjs/domain/configuration/configuration.js +0 -94
  124. package/cjs/domain/configuration/configuration.js.map +0 -1
  125. package/cjs/domain/configuration/endpointBuilder.d.ts +0 -10
  126. package/cjs/domain/configuration/endpointBuilder.js +0 -84
  127. package/cjs/domain/configuration/endpointBuilder.js.map +0 -1
  128. package/cjs/domain/configuration/index.d.ts +0 -4
  129. package/cjs/domain/configuration/index.js +0 -27
  130. package/cjs/domain/configuration/index.js.map +0 -1
  131. package/cjs/domain/configuration/intakeSites.d.ts +0 -5
  132. package/cjs/domain/configuration/intakeSites.js +0 -9
  133. package/cjs/domain/configuration/intakeSites.js.map +0 -1
  134. package/cjs/domain/configuration/tags.d.ts +0 -4
  135. package/cjs/domain/configuration/tags.js +0 -39
  136. package/cjs/domain/configuration/tags.js.map +0 -1
  137. package/cjs/domain/configuration/transportConfiguration.d.ts +0 -16
  138. package/cjs/domain/configuration/transportConfiguration.js +0 -42
  139. package/cjs/domain/configuration/transportConfiguration.js.map +0 -1
  140. package/cjs/domain/connectivity/connectivity.d.ts +0 -13
  141. package/cjs/domain/connectivity/connectivity.js +0 -14
  142. package/cjs/domain/connectivity/connectivity.js.map +0 -1
  143. package/cjs/domain/connectivity/index.d.ts +0 -1
  144. package/cjs/domain/connectivity/index.js +0 -18
  145. package/cjs/domain/connectivity/index.js.map +0 -1
  146. package/cjs/domain/console/consoleObservable.d.ts +0 -11
  147. package/cjs/domain/console/consoleObservable.js +0 -72
  148. package/cjs/domain/console/consoleObservable.js.map +0 -1
  149. package/cjs/domain/context/contextConstants.d.ts +0 -5
  150. package/cjs/domain/context/contextConstants.js +0 -3
  151. package/cjs/domain/context/contextConstants.js.map +0 -1
  152. package/cjs/domain/context/contextManager.d.ts +0 -12
  153. package/cjs/domain/context/contextManager.js +0 -43
  154. package/cjs/domain/context/contextManager.js.map +0 -1
  155. package/cjs/domain/context/customerDataTracker.d.ts +0 -45
  156. package/cjs/domain/context/customerDataTracker.js +0 -107
  157. package/cjs/domain/context/customerDataTracker.js.map +0 -1
  158. package/cjs/domain/context/storeContextManager.d.ts +0 -6
  159. package/cjs/domain/context/storeContextManager.js +0 -38
  160. package/cjs/domain/context/storeContextManager.js.map +0 -1
  161. package/cjs/domain/deflate/types.d.ts +0 -0
  162. package/cjs/domain/deflate/types.js +0 -3
  163. package/cjs/domain/deflate/types.js.map +0 -1
  164. package/cjs/domain/error/computeStackTrace.d.ts +0 -33
  165. package/cjs/domain/error/computeStackTrace.js +0 -142
  166. package/cjs/domain/error/computeStackTrace.js.map +0 -1
  167. package/cjs/domain/error/error.d.ts +0 -28
  168. package/cjs/domain/error/error.js +0 -131
  169. package/cjs/domain/error/error.js.map +0 -1
  170. package/cjs/domain/error/error.types.d.ts +0 -40
  171. package/cjs/domain/error/error.types.js +0 -13
  172. package/cjs/domain/error/error.types.js.map +0 -1
  173. package/cjs/domain/error/trackRuntimeError.d.ts +0 -13
  174. package/cjs/domain/error/trackRuntimeError.js +0 -54
  175. package/cjs/domain/error/trackRuntimeError.js.map +0 -1
  176. package/cjs/domain/eventRateLimiter/createEventRateLimiter.d.ts +0 -5
  177. package/cjs/domain/eventRateLimiter/createEventRateLimiter.js +0 -40
  178. package/cjs/domain/eventRateLimiter/createEventRateLimiter.js.map +0 -1
  179. package/cjs/domain/report/browser.types.d.ts +0 -34
  180. package/cjs/domain/report/browser.types.js +0 -3
  181. package/cjs/domain/report/browser.types.js.map +0 -1
  182. package/cjs/domain/report/reportObservable.d.ts +0 -17
  183. package/cjs/domain/report/reportObservable.js +0 -94
  184. package/cjs/domain/report/reportObservable.js.map +0 -1
  185. package/cjs/domain/resourceUtils.d.ts +0 -16
  186. package/cjs/domain/resourceUtils.js +0 -3
  187. package/cjs/domain/resourceUtils.js.map +0 -1
  188. package/cjs/domain/session/oldCookiesMigration.d.ts +0 -11
  189. package/cjs/domain/session/oldCookiesMigration.js +0 -40
  190. package/cjs/domain/session/oldCookiesMigration.js.map +0 -1
  191. package/cjs/domain/session/sessionConstants.d.ts +0 -2
  192. package/cjs/domain/session/sessionConstants.js +0 -7
  193. package/cjs/domain/session/sessionConstants.js.map +0 -1
  194. package/cjs/domain/session/sessionManager.d.ts +0 -20
  195. package/cjs/domain/session/sessionManager.js +0 -65
  196. package/cjs/domain/session/sessionManager.js.map +0 -1
  197. package/cjs/domain/session/sessionState.d.ts +0 -11
  198. package/cjs/domain/session/sessionState.js +0 -45
  199. package/cjs/domain/session/sessionState.js.map +0 -1
  200. package/cjs/domain/session/sessionStore.d.ts +0 -34
  201. package/cjs/domain/session/sessionStore.js +0 -144
  202. package/cjs/domain/session/sessionStore.js.map +0 -1
  203. package/cjs/domain/session/sessionStoreOperations.d.ts +0 -10
  204. package/cjs/domain/session/sessionStoreOperations.js +0 -96
  205. package/cjs/domain/session/sessionStoreOperations.js.map +0 -1
  206. package/cjs/domain/session/storeStrategies/sessionInCookie.d.ts +0 -6
  207. package/cjs/domain/session/storeStrategies/sessionInCookie.js +0 -59
  208. package/cjs/domain/session/storeStrategies/sessionInCookie.js.map +0 -1
  209. package/cjs/domain/session/storeStrategies/sessionInLocalStorage.d.ts +0 -3
  210. package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js +0 -41
  211. package/cjs/domain/session/storeStrategies/sessionInLocalStorage.js.map +0 -1
  212. package/cjs/domain/session/storeStrategies/sessionStoreStrategy.d.ts +0 -15
  213. package/cjs/domain/session/storeStrategies/sessionStoreStrategy.js +0 -5
  214. package/cjs/domain/session/storeStrategies/sessionStoreStrategy.js.map +0 -1
  215. package/cjs/domain/synthetics/syntheticsWorkerValues.d.ts +0 -11
  216. package/cjs/domain/synthetics/syntheticsWorkerValues.js +0 -22
  217. package/cjs/domain/synthetics/syntheticsWorkerValues.js.map +0 -1
  218. package/cjs/domain/telemetry/index.d.ts +0 -3
  219. package/cjs/domain/telemetry/index.js +0 -28
  220. package/cjs/domain/telemetry/index.js.map +0 -1
  221. package/cjs/domain/telemetry/rawTelemetryEvent.types.d.ts +0 -15
  222. package/cjs/domain/telemetry/rawTelemetryEvent.types.js +0 -8
  223. package/cjs/domain/telemetry/rawTelemetryEvent.types.js.map +0 -1
  224. package/cjs/domain/telemetry/telemetry.d.ts +0 -116
  225. package/cjs/domain/telemetry/telemetry.js +0 -157
  226. package/cjs/domain/telemetry/telemetry.js.map +0 -1
  227. package/cjs/domain/telemetry/telemetryEvent.types.d.ts +0 -391
  228. package/cjs/domain/telemetry/telemetryEvent.types.js +0 -7
  229. package/cjs/domain/telemetry/telemetryEvent.types.js.map +0 -1
  230. package/cjs/domain/user/index.d.ts +0 -2
  231. package/cjs/domain/user/index.js +0 -19
  232. package/cjs/domain/user/index.js.map +0 -1
  233. package/cjs/domain/user/user.d.ts +0 -12
  234. package/cjs/domain/user/user.js +0 -35
  235. package/cjs/domain/user/user.js.map +0 -1
  236. package/cjs/domain/user/user.types.d.ts +0 -6
  237. package/cjs/domain/user/user.types.js +0 -3
  238. package/cjs/domain/user/user.types.js.map +0 -1
  239. package/cjs/tools/abstractLifeCycle.d.ts +0 -23
  240. package/cjs/tools/abstractLifeCycle.js +0 -29
  241. package/cjs/tools/abstractLifeCycle.js.map +0 -1
  242. package/cjs/tools/boundedBuffer.d.ts +0 -5
  243. package/cjs/tools/boundedBuffer.js +0 -22
  244. package/cjs/tools/boundedBuffer.js.map +0 -1
  245. package/cjs/tools/catchUserErrors.d.ts +0 -1
  246. package/cjs/tools/catchUserErrors.js +0 -20
  247. package/cjs/tools/catchUserErrors.js.map +0 -1
  248. package/cjs/tools/display.d.ts +0 -35
  249. package/cjs/tools/display.js +0 -41
  250. package/cjs/tools/display.js.map +0 -1
  251. package/cjs/tools/encoder.d.ts +0 -53
  252. package/cjs/tools/encoder.js +0 -41
  253. package/cjs/tools/encoder.js.map +0 -1
  254. package/cjs/tools/experimentalFeatures.d.ts +0 -22
  255. package/cjs/tools/experimentalFeatures.js +0 -45
  256. package/cjs/tools/experimentalFeatures.js.map +0 -1
  257. package/cjs/tools/getGlobalObject.d.ts +0 -4
  258. package/cjs/tools/getGlobalObject.js +0 -37
  259. package/cjs/tools/getGlobalObject.js.map +0 -1
  260. package/cjs/tools/getZoneJsOriginalValue.d.ts +0 -19
  261. package/cjs/tools/getZoneJsOriginalValue.js +0 -30
  262. package/cjs/tools/getZoneJsOriginalValue.js.map +0 -1
  263. package/cjs/tools/instrumentMethod.d.ts +0 -59
  264. package/cjs/tools/instrumentMethod.js +0 -106
  265. package/cjs/tools/instrumentMethod.js.map +0 -1
  266. package/cjs/tools/matchOption.d.ts +0 -8
  267. package/cjs/tools/matchOption.js +0 -38
  268. package/cjs/tools/matchOption.js.map +0 -1
  269. package/cjs/tools/mergeInto.d.ts +0 -25
  270. package/cjs/tools/mergeInto.js +0 -105
  271. package/cjs/tools/mergeInto.js.map +0 -1
  272. package/cjs/tools/monitor.d.ts +0 -8
  273. package/cjs/tools/monitor.js +0 -76
  274. package/cjs/tools/monitor.js.map +0 -1
  275. package/cjs/tools/observable.d.ts +0 -12
  276. package/cjs/tools/observable.js +0 -43
  277. package/cjs/tools/observable.js.map +0 -1
  278. package/cjs/tools/readBytesFromStream.d.ts +0 -11
  279. package/cjs/tools/readBytesFromStream.js +0 -64
  280. package/cjs/tools/readBytesFromStream.js.map +0 -1
  281. package/cjs/tools/sendToExtension.d.ts +0 -3
  282. package/cjs/tools/sendToExtension.js +0 -11
  283. package/cjs/tools/sendToExtension.js.map +0 -1
  284. package/cjs/tools/serialisation/context.d.ts +0 -6
  285. package/cjs/tools/serialisation/context.js +0 -3
  286. package/cjs/tools/serialisation/context.js.map +0 -1
  287. package/cjs/tools/serialisation/jsonStringify.d.ts +0 -13
  288. package/cjs/tools/serialisation/jsonStringify.js +0 -49
  289. package/cjs/tools/serialisation/jsonStringify.js.map +0 -1
  290. package/cjs/tools/serialisation/sanitize.d.ts +0 -18
  291. package/cjs/tools/serialisation/sanitize.js +0 -185
  292. package/cjs/tools/serialisation/sanitize.js.map +0 -1
  293. package/cjs/tools/timer.d.ts +0 -5
  294. package/cjs/tools/timer.js +0 -23
  295. package/cjs/tools/timer.js.map +0 -1
  296. package/cjs/tools/utils/arrayUtils.d.ts +0 -1
  297. package/cjs/tools/utils/arrayUtils.js +0 -11
  298. package/cjs/tools/utils/arrayUtils.js.map +0 -1
  299. package/cjs/tools/utils/browserDetection.d.ts +0 -10
  300. package/cjs/tools/utils/browserDetection.js +0 -42
  301. package/cjs/tools/utils/browserDetection.js.map +0 -1
  302. package/cjs/tools/utils/byteUtils.d.ts +0 -4
  303. package/cjs/tools/utils/byteUtils.js +0 -31
  304. package/cjs/tools/utils/byteUtils.js.map +0 -1
  305. package/cjs/tools/utils/functionUtils.d.ts +0 -9
  306. package/cjs/tools/utils/functionUtils.js +0 -48
  307. package/cjs/tools/utils/functionUtils.js.map +0 -1
  308. package/cjs/tools/utils/numberUtils.d.ts +0 -8
  309. package/cjs/tools/utils/numberUtils.js +0 -24
  310. package/cjs/tools/utils/numberUtils.js.map +0 -1
  311. package/cjs/tools/utils/objectUtils.d.ts +0 -10
  312. package/cjs/tools/utils/objectUtils.js +0 -26
  313. package/cjs/tools/utils/objectUtils.js.map +0 -1
  314. package/cjs/tools/utils/polyfills.d.ts +0 -24
  315. package/cjs/tools/utils/polyfills.js +0 -110
  316. package/cjs/tools/utils/polyfills.js.map +0 -1
  317. package/cjs/tools/utils/responseUtils.d.ts +0 -2
  318. package/cjs/tools/utils/responseUtils.js +0 -18
  319. package/cjs/tools/utils/responseUtils.js.map +0 -1
  320. package/cjs/tools/utils/stringUtils.d.ts +0 -8
  321. package/cjs/tools/utils/stringUtils.js +0 -59
  322. package/cjs/tools/utils/stringUtils.js.map +0 -1
  323. package/cjs/tools/utils/timeUtils.d.ts +0 -57
  324. package/cjs/tools/utils/timeUtils.js +0 -99
  325. package/cjs/tools/utils/timeUtils.js.map +0 -1
  326. package/cjs/tools/utils/typeUtils.d.ts +0 -4
  327. package/cjs/tools/utils/typeUtils.js +0 -17
  328. package/cjs/tools/utils/typeUtils.js.map +0 -1
  329. package/cjs/tools/utils/urlPolyfill.d.ts +0 -14
  330. package/cjs/tools/utils/urlPolyfill.js +0 -92
  331. package/cjs/tools/utils/urlPolyfill.js.map +0 -1
  332. package/cjs/tools/valueHistory.d.ts +0 -50
  333. package/cjs/tools/valueHistory.js +0 -106
  334. package/cjs/tools/valueHistory.js.map +0 -1
  335. package/cjs/transport/batch.d.ts +0 -21
  336. package/cjs/transport/batch.js +0 -123
  337. package/cjs/transport/batch.js.map +0 -1
  338. package/cjs/transport/eventBridge.d.ts +0 -12
  339. package/cjs/transport/eventBridge.js +0 -34
  340. package/cjs/transport/eventBridge.js.map +0 -1
  341. package/cjs/transport/flushController.d.ts +0 -58
  342. package/cjs/transport/flushController.js +0 -112
  343. package/cjs/transport/flushController.js.map +0 -1
  344. package/cjs/transport/httpRequest.d.ts +0 -38
  345. package/cjs/transport/httpRequest.js +0 -95
  346. package/cjs/transport/httpRequest.js.map +0 -1
  347. package/cjs/transport/index.d.ts +0 -4
  348. package/cjs/transport/index.js +0 -13
  349. package/cjs/transport/index.js.map +0 -1
  350. package/cjs/transport/sendWithRetryStrategy.d.ts +0 -39
  351. package/cjs/transport/sendWithRetryStrategy.js +0 -151
  352. package/cjs/transport/sendWithRetryStrategy.js.map +0 -1
  353. package/cjs/transport/startBatchWithReplica.d.ts +0 -20
  354. package/cjs/transport/startBatchWithReplica.js +0 -42
  355. package/cjs/transport/startBatchWithReplica.js.map +0 -1
  356. package/esm/boot/init.d.ts +0 -5
  357. package/esm/boot/init.js +0 -31
  358. package/esm/boot/init.js.map +0 -1
  359. package/esm/browser/addEventListener.d.ts +0 -84
  360. package/esm/browser/addEventListener.js +0 -89
  361. package/esm/browser/addEventListener.js.map +0 -1
  362. package/esm/browser/cookie.d.ts +0 -17
  363. package/esm/browser/cookie.js +0 -76
  364. package/esm/browser/cookie.js.map +0 -1
  365. package/esm/browser/fetchObservable.d.ts +0 -23
  366. package/esm/browser/fetchObservable.js +0 -65
  367. package/esm/browser/fetchObservable.js.map +0 -1
  368. package/esm/browser/pageExitObservable.d.ts +0 -14
  369. package/esm/browser/pageExitObservable.js +0 -52
  370. package/esm/browser/pageExitObservable.js.map +0 -1
  371. package/esm/browser/runOnReadyState.d.ts +0 -2
  372. package/esm/browser/runOnReadyState.js +0 -11
  373. package/esm/browser/runOnReadyState.js.map +0 -1
  374. package/esm/browser/types.d.ts +0 -19
  375. package/esm/browser/types.js +0 -5
  376. package/esm/browser/types.js.map +0 -1
  377. package/esm/browser/xhrObservable.d.ts +0 -21
  378. package/esm/browser/xhrObservable.js +0 -81
  379. package/esm/browser/xhrObservable.js.map +0 -1
  380. package/esm/domain/configuration/configuration.d.ts +0 -72
  381. package/esm/domain/configuration/configuration.js +0 -89
  382. package/esm/domain/configuration/configuration.js.map +0 -1
  383. package/esm/domain/configuration/endpointBuilder.d.ts +0 -10
  384. package/esm/domain/configuration/endpointBuilder.js +0 -80
  385. package/esm/domain/configuration/endpointBuilder.js.map +0 -1
  386. package/esm/domain/configuration/index.d.ts +0 -4
  387. package/esm/domain/configuration/index.js +0 -5
  388. package/esm/domain/configuration/index.js.map +0 -1
  389. package/esm/domain/configuration/intakeSites.d.ts +0 -5
  390. package/esm/domain/configuration/intakeSites.js +0 -6
  391. package/esm/domain/configuration/intakeSites.js.map +0 -1
  392. package/esm/domain/configuration/tags.d.ts +0 -4
  393. package/esm/domain/configuration/tags.js +0 -34
  394. package/esm/domain/configuration/tags.js.map +0 -1
  395. package/esm/domain/configuration/transportConfiguration.d.ts +0 -16
  396. package/esm/domain/configuration/transportConfiguration.js +0 -38
  397. package/esm/domain/configuration/transportConfiguration.js.map +0 -1
  398. package/esm/domain/connectivity/connectivity.d.ts +0 -13
  399. package/esm/domain/connectivity/connectivity.js +0 -10
  400. package/esm/domain/connectivity/connectivity.js.map +0 -1
  401. package/esm/domain/connectivity/index.d.ts +0 -1
  402. package/esm/domain/connectivity/index.js +0 -2
  403. package/esm/domain/connectivity/index.js.map +0 -1
  404. package/esm/domain/console/consoleObservable.d.ts +0 -11
  405. package/esm/domain/console/consoleObservable.js +0 -67
  406. package/esm/domain/console/consoleObservable.js.map +0 -1
  407. package/esm/domain/context/contextConstants.d.ts +0 -5
  408. package/esm/domain/context/contextConstants.js +0 -2
  409. package/esm/domain/context/contextConstants.js.map +0 -1
  410. package/esm/domain/context/contextManager.d.ts +0 -12
  411. package/esm/domain/context/contextManager.js +0 -39
  412. package/esm/domain/context/contextManager.js.map +0 -1
  413. package/esm/domain/context/customerDataTracker.d.ts +0 -45
  414. package/esm/domain/context/customerDataTracker.js +0 -102
  415. package/esm/domain/context/customerDataTracker.js.map +0 -1
  416. package/esm/domain/context/storeContextManager.d.ts +0 -6
  417. package/esm/domain/context/storeContextManager.js +0 -32
  418. package/esm/domain/context/storeContextManager.js.map +0 -1
  419. package/esm/domain/deflate/index.d.ts +0 -1
  420. package/esm/domain/deflate/index.js +0 -2
  421. package/esm/domain/deflate/index.js.map +0 -1
  422. package/esm/domain/deflate/types.d.ts +0 -38
  423. package/esm/domain/deflate/types.js +0 -2
  424. package/esm/domain/deflate/types.js.map +0 -1
  425. package/esm/domain/error/computeStackTrace.d.ts +0 -33
  426. package/esm/domain/error/computeStackTrace.js +0 -137
  427. package/esm/domain/error/computeStackTrace.js.map +0 -1
  428. package/esm/domain/error/error.d.ts +0 -28
  429. package/esm/domain/error/error.js +0 -121
  430. package/esm/domain/error/error.js.map +0 -1
  431. package/esm/domain/error/error.types.d.ts +0 -40
  432. package/esm/domain/error/error.types.js +0 -10
  433. package/esm/domain/error/error.types.js.map +0 -1
  434. package/esm/domain/error/trackRuntimeError.d.ts +0 -13
  435. package/esm/domain/error/trackRuntimeError.js +0 -48
  436. package/esm/domain/error/trackRuntimeError.js.map +0 -1
  437. package/esm/domain/eventRateLimiter/createEventRateLimiter.d.ts +0 -5
  438. package/esm/domain/eventRateLimiter/createEventRateLimiter.js +0 -36
  439. package/esm/domain/eventRateLimiter/createEventRateLimiter.js.map +0 -1
  440. package/esm/domain/report/browser.types.d.ts +0 -34
  441. package/esm/domain/report/browser.types.js +0 -2
  442. package/esm/domain/report/browser.types.js.map +0 -1
  443. package/esm/domain/report/reportObservable.d.ts +0 -17
  444. package/esm/domain/report/reportObservable.js +0 -90
  445. package/esm/domain/report/reportObservable.js.map +0 -1
  446. package/esm/domain/resourceUtils.d.ts +0 -16
  447. package/esm/domain/resourceUtils.js +0 -2
  448. package/esm/domain/resourceUtils.js.map +0 -1
  449. package/esm/domain/session/oldCookiesMigration.d.ts +0 -11
  450. package/esm/domain/session/oldCookiesMigration.js +0 -36
  451. package/esm/domain/session/oldCookiesMigration.js.map +0 -1
  452. package/esm/domain/session/sessionConstants.d.ts +0 -2
  453. package/esm/domain/session/sessionConstants.js +0 -4
  454. package/esm/domain/session/sessionConstants.js.map +0 -1
  455. package/esm/domain/session/sessionManager.d.ts +0 -20
  456. package/esm/domain/session/sessionManager.js +0 -60
  457. package/esm/domain/session/sessionManager.js.map +0 -1
  458. package/esm/domain/session/sessionState.d.ts +0 -11
  459. package/esm/domain/session/sessionState.js +0 -38
  460. package/esm/domain/session/sessionState.js.map +0 -1
  461. package/esm/domain/session/sessionStore.d.ts +0 -34
  462. package/esm/domain/session/sessionStore.js +0 -139
  463. package/esm/domain/session/sessionStore.js.map +0 -1
  464. package/esm/domain/session/sessionStoreOperations.d.ts +0 -10
  465. package/esm/domain/session/sessionStoreOperations.js +0 -92
  466. package/esm/domain/session/sessionStoreOperations.js.map +0 -1
  467. package/esm/domain/session/storeStrategies/sessionInCookie.d.ts +0 -6
  468. package/esm/domain/session/storeStrategies/sessionInCookie.js +0 -53
  469. package/esm/domain/session/storeStrategies/sessionInCookie.js.map +0 -1
  470. package/esm/domain/session/storeStrategies/sessionInLocalStorage.d.ts +0 -3
  471. package/esm/domain/session/storeStrategies/sessionInLocalStorage.js +0 -36
  472. package/esm/domain/session/storeStrategies/sessionInLocalStorage.js.map +0 -1
  473. package/esm/domain/session/storeStrategies/sessionStoreStrategy.d.ts +0 -15
  474. package/esm/domain/session/storeStrategies/sessionStoreStrategy.js +0 -2
  475. package/esm/domain/session/storeStrategies/sessionStoreStrategy.js.map +0 -1
  476. package/esm/domain/synthetics/syntheticsWorkerValues.d.ts +0 -11
  477. package/esm/domain/synthetics/syntheticsWorkerValues.js +0 -16
  478. package/esm/domain/synthetics/syntheticsWorkerValues.js.map +0 -1
  479. package/esm/domain/telemetry/index.d.ts +0 -3
  480. package/esm/domain/telemetry/index.js +0 -4
  481. package/esm/domain/telemetry/index.js.map +0 -1
  482. package/esm/domain/telemetry/rawTelemetryEvent.types.d.ts +0 -15
  483. package/esm/domain/telemetry/rawTelemetryEvent.types.js +0 -5
  484. package/esm/domain/telemetry/rawTelemetryEvent.types.js.map +0 -1
  485. package/esm/domain/telemetry/telemetry.d.ts +0 -116
  486. package/esm/domain/telemetry/telemetry.js +0 -145
  487. package/esm/domain/telemetry/telemetry.js.map +0 -1
  488. package/esm/domain/telemetry/telemetryEvent.types.d.ts +0 -391
  489. package/esm/domain/telemetry/telemetryEvent.types.js +0 -6
  490. package/esm/domain/telemetry/telemetryEvent.types.js.map +0 -1
  491. package/esm/domain/user/index.d.ts +0 -2
  492. package/esm/domain/user/index.js +0 -3
  493. package/esm/domain/user/index.js.map +0 -1
  494. package/esm/domain/user/user.d.ts +0 -12
  495. package/esm/domain/user/user.js +0 -30
  496. package/esm/domain/user/user.js.map +0 -1
  497. package/esm/domain/user/user.types.d.ts +0 -6
  498. package/esm/domain/user/user.types.js +0 -2
  499. package/esm/domain/user/user.types.js.map +0 -1
  500. package/esm/index.d.ts +0 -67
  501. package/esm/index.js +0 -64
  502. package/esm/index.js.map +0 -1
  503. package/esm/tools/abstractLifeCycle.d.ts +0 -23
  504. package/esm/tools/abstractLifeCycle.js +0 -26
  505. package/esm/tools/abstractLifeCycle.js.map +0 -1
  506. package/esm/tools/boundedBuffer.d.ts +0 -5
  507. package/esm/tools/boundedBuffer.js +0 -19
  508. package/esm/tools/boundedBuffer.js.map +0 -1
  509. package/esm/tools/catchUserErrors.d.ts +0 -1
  510. package/esm/tools/catchUserErrors.js +0 -16
  511. package/esm/tools/catchUserErrors.js.map +0 -1
  512. package/esm/tools/display.d.ts +0 -35
  513. package/esm/tools/display.js +0 -38
  514. package/esm/tools/display.js.map +0 -1
  515. package/esm/tools/encoder.d.ts +0 -53
  516. package/esm/tools/encoder.js +0 -37
  517. package/esm/tools/encoder.js.map +0 -1
  518. package/esm/tools/experimentalFeatures.d.ts +0 -22
  519. package/esm/tools/experimentalFeatures.js +0 -38
  520. package/esm/tools/experimentalFeatures.js.map +0 -1
  521. package/esm/tools/getGlobalObject.d.ts +0 -4
  522. package/esm/tools/getGlobalObject.js +0 -33
  523. package/esm/tools/getGlobalObject.js.map +0 -1
  524. package/esm/tools/getZoneJsOriginalValue.d.ts +0 -19
  525. package/esm/tools/getZoneJsOriginalValue.js +0 -26
  526. package/esm/tools/getZoneJsOriginalValue.js.map +0 -1
  527. package/esm/tools/instrumentMethod.d.ts +0 -59
  528. package/esm/tools/instrumentMethod.js +0 -101
  529. package/esm/tools/instrumentMethod.js.map +0 -1
  530. package/esm/tools/matchOption.d.ts +0 -8
  531. package/esm/tools/matchOption.js +0 -33
  532. package/esm/tools/matchOption.js.map +0 -1
  533. package/esm/tools/mergeInto.d.ts +0 -25
  534. package/esm/tools/mergeInto.js +0 -99
  535. package/esm/tools/mergeInto.js.map +0 -1
  536. package/esm/tools/monitor.d.ts +0 -8
  537. package/esm/tools/monitor.js +0 -66
  538. package/esm/tools/monitor.js.map +0 -1
  539. package/esm/tools/observable.d.ts +0 -12
  540. package/esm/tools/observable.js +0 -39
  541. package/esm/tools/observable.js.map +0 -1
  542. package/esm/tools/readBytesFromStream.d.ts +0 -11
  543. package/esm/tools/readBytesFromStream.js +0 -60
  544. package/esm/tools/readBytesFromStream.js.map +0 -1
  545. package/esm/tools/sendToExtension.d.ts +0 -3
  546. package/esm/tools/sendToExtension.js +0 -7
  547. package/esm/tools/sendToExtension.js.map +0 -1
  548. package/esm/tools/serialisation/context.d.ts +0 -6
  549. package/esm/tools/serialisation/context.js +0 -2
  550. package/esm/tools/serialisation/context.js.map +0 -1
  551. package/esm/tools/serialisation/jsonStringify.d.ts +0 -13
  552. package/esm/tools/serialisation/jsonStringify.js +0 -44
  553. package/esm/tools/serialisation/jsonStringify.js.map +0 -1
  554. package/esm/tools/serialisation/sanitize.d.ts +0 -18
  555. package/esm/tools/serialisation/sanitize.js +0 -181
  556. package/esm/tools/serialisation/sanitize.js.map +0 -1
  557. package/esm/tools/timer.d.ts +0 -5
  558. package/esm/tools/timer.js +0 -16
  559. package/esm/tools/timer.js.map +0 -1
  560. package/esm/tools/utils/arrayUtils.d.ts +0 -1
  561. package/esm/tools/utils/arrayUtils.js +0 -7
  562. package/esm/tools/utils/arrayUtils.js.map +0 -1
  563. package/esm/tools/utils/browserDetection.d.ts +0 -10
  564. package/esm/tools/utils/browserDetection.js +0 -35
  565. package/esm/tools/utils/browserDetection.js.map +0 -1
  566. package/esm/tools/utils/byteUtils.d.ts +0 -4
  567. package/esm/tools/utils/byteUtils.js +0 -26
  568. package/esm/tools/utils/byteUtils.js.map +0 -1
  569. package/esm/tools/utils/functionUtils.d.ts +0 -9
  570. package/esm/tools/utils/functionUtils.js +0 -43
  571. package/esm/tools/utils/functionUtils.js.map +0 -1
  572. package/esm/tools/utils/numberUtils.d.ts +0 -8
  573. package/esm/tools/utils/numberUtils.js +0 -17
  574. package/esm/tools/utils/numberUtils.js.map +0 -1
  575. package/esm/tools/utils/objectUtils.d.ts +0 -10
  576. package/esm/tools/utils/objectUtils.js +0 -19
  577. package/esm/tools/utils/objectUtils.js.map +0 -1
  578. package/esm/tools/utils/polyfills.d.ts +0 -24
  579. package/esm/tools/utils/polyfills.js +0 -95
  580. package/esm/tools/utils/polyfills.js.map +0 -1
  581. package/esm/tools/utils/responseUtils.d.ts +0 -2
  582. package/esm/tools/utils/responseUtils.js +0 -13
  583. package/esm/tools/utils/responseUtils.js.map +0 -1
  584. package/esm/tools/utils/stringUtils.d.ts +0 -8
  585. package/esm/tools/utils/stringUtils.js +0 -52
  586. package/esm/tools/utils/stringUtils.js.map +0 -1
  587. package/esm/tools/utils/timeUtils.d.ts +0 -57
  588. package/esm/tools/utils/timeUtils.js +0 -82
  589. package/esm/tools/utils/timeUtils.js.map +0 -1
  590. package/esm/tools/utils/typeUtils.d.ts +0 -4
  591. package/esm/tools/utils/typeUtils.js +0 -13
  592. package/esm/tools/utils/typeUtils.js.map +0 -1
  593. package/esm/tools/utils/urlPolyfill.d.ts +0 -14
  594. package/esm/tools/utils/urlPolyfill.js +0 -80
  595. package/esm/tools/utils/urlPolyfill.js.map +0 -1
  596. package/esm/tools/valueHistory.d.ts +0 -50
  597. package/esm/tools/valueHistory.js +0 -103
  598. package/esm/tools/valueHistory.js.map +0 -1
  599. package/esm/transport/batch.d.ts +0 -21
  600. package/esm/transport/batch.js +0 -120
  601. package/esm/transport/batch.js.map +0 -1
  602. package/esm/transport/eventBridge.d.ts +0 -12
  603. package/esm/transport/eventBridge.js +0 -29
  604. package/esm/transport/eventBridge.js.map +0 -1
  605. package/esm/transport/flushController.d.ts +0 -58
  606. package/esm/transport/flushController.js +0 -108
  607. package/esm/transport/flushController.js.map +0 -1
  608. package/esm/transport/httpRequest.d.ts +0 -38
  609. package/esm/transport/httpRequest.js +0 -89
  610. package/esm/transport/httpRequest.js.map +0 -1
  611. package/esm/transport/index.d.ts +0 -4
  612. package/esm/transport/index.js +0 -5
  613. package/esm/transport/index.js.map +0 -1
  614. package/esm/transport/sendWithRetryStrategy.d.ts +0 -39
  615. package/esm/transport/sendWithRetryStrategy.js +0 -146
  616. package/esm/transport/sendWithRetryStrategy.js.map +0 -1
  617. package/esm/transport/startBatchWithReplica.d.ts +0 -20
  618. package/esm/transport/startBatchWithReplica.js +0 -38
  619. package/esm/transport/startBatchWithReplica.js.map +0 -1
  620. package/src/domain/configuration/intakeSites.ts +0 -5
  621. package/src/domain/configuration/tags.ts +0 -43
  622. package/src/domain/context/customerDataTracker.ts +0 -134
  623. package/src/domain/user/index.ts +0 -2
  624. package/src/domain/user/user.ts +0 -33
  625. package/src/domain/user/user.types.ts +0 -6
  626. package/src/transport/startBatchWithReplica.ts +0 -68
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeUtils.js","sourceRoot":"","sources":["../../../src/tools/utils/timeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE/C,MAAM,CAAC,IAAM,UAAU,GAAG,IAAI,CAAA;AAC9B,MAAM,CAAC,IAAM,UAAU,GAAG,EAAE,GAAG,UAAU,CAAA;AACzC,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,GAAG,UAAU,CAAA;AACvC,MAAM,CAAC,IAAM,OAAO,GAAG,EAAE,GAAG,QAAQ,CAAA;AACpC,MAAM,CAAC,IAAM,QAAQ,GAAG,GAAG,GAAG,OAAO,CAAA;AAQrC,MAAM,UAAU,gBAAgB,CAAC,QAAsB;IACrD,OAAO,EAAE,QAAQ,UAAA,EAAE,SAAS,EAAE,qBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAA;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,YAA0B;IACvD,IAAM,eAAe,GAAG,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,GAAG,EAAE,CAAc,CAAA;IACpE,2CAA2C;IAC3C,IAAI,eAAe,GAAG,kBAAkB,EAAE,EA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EAAE,CAAS;IAC9C,OAAO,CAAC,GAAG,CAAC,CAAA;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,SAAoB;IAClD,OAAO,CAAC,SAAS,GAAG,kBAAkB,EAAE,CAAiB,CAAA;AAC3D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,YAA0B;IACrD,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,EAAE,EAAE,YAAY,CAAC,CAAc,CAAA;AACjF,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAA8B;IAClE,OAAO,IAAI,GAAG,QAAQ,CAAA;AACxB,CAAC;AAED;;GAEG;AACH,IAAI,eAAsC,CAAA;AAE1C,SAAS,kBAAkB;IACzB,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAClC,eAAe,GAAG,WAAW,CAAC,MAAM,CAAC,eAA4B,CAAA;IACnE,CAAC;IACD,OAAO,eAAe,CAAA;AACxB,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,eAAe,GAAG,SAAS,CAAA;AAC7B,CAAC"}
@@ -1,4 +0,0 @@
1
- /**
2
- * Similar to `typeof`, but distinguish plain objects from `null` and arrays
3
- */
4
- export declare function getType(value: unknown): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "null" | "array";
@@ -1,13 +0,0 @@
1
- /**
2
- * Similar to `typeof`, but distinguish plain objects from `null` and arrays
3
- */
4
- export function getType(value) {
5
- if (value === null) {
6
- return 'null';
7
- }
8
- if (Array.isArray(value)) {
9
- return 'array';
10
- }
11
- return typeof value;
12
- }
13
- //# sourceMappingURL=typeUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typeUtils.js","sourceRoot":"","sources":["../../../src/tools/utils/typeUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,KAAc;IACpC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,MAAM,CAAA;IACf,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,OAAO,OAAO,KAAK,CAAA;AACrB,CAAC"}
@@ -1,14 +0,0 @@
1
- export declare function normalizeUrl(url: string): string;
2
- export declare function isValidUrl(url: string): boolean;
3
- export declare function getOrigin(url: string): string;
4
- export declare function getPathName(url: string): string;
5
- export declare function getSearch(url: string): string;
6
- export declare function getHash(url: string): string;
7
- export declare function buildUrl(url: string, base?: string): URL | HTMLAnchorElement;
8
- export declare function getLocationOrigin(): string;
9
- /**
10
- * Fallback
11
- * On IE HTMLAnchorElement origin is not supported: https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/origin
12
- * On Firefox window.location.origin is "null" for file: URIs: https://bugzilla.mozilla.org/show_bug.cgi?id=878297
13
- */
14
- export declare function getLinkElementOrigin(element: Location | HTMLAnchorElement | URL): string;
@@ -1,80 +0,0 @@
1
- import { jsonStringify } from '../serialisation/jsonStringify';
2
- export function normalizeUrl(url) {
3
- return buildUrl(url, getLocationOrigin()).href;
4
- }
5
- export function isValidUrl(url) {
6
- try {
7
- return !!buildUrl(url);
8
- }
9
- catch (_a) {
10
- return false;
11
- }
12
- }
13
- export function getOrigin(url) {
14
- return getLinkElementOrigin(buildUrl(url));
15
- }
16
- export function getPathName(url) {
17
- var pathname = buildUrl(url).pathname;
18
- return pathname[0] === '/' ? pathname : "/".concat(pathname);
19
- }
20
- export function getSearch(url) {
21
- return buildUrl(url).search;
22
- }
23
- export function getHash(url) {
24
- return buildUrl(url).hash;
25
- }
26
- export function buildUrl(url, base) {
27
- var supportedURL = getSupportedUrl();
28
- if (supportedURL) {
29
- try {
30
- return base !== undefined ? new supportedURL(url, base) : new supportedURL(url);
31
- }
32
- catch (error) {
33
- throw new Error("Failed to construct URL: ".concat(String(error), " ").concat(jsonStringify({ url: url, base: base })));
34
- }
35
- }
36
- if (base === undefined && !/:/.test(url)) {
37
- throw new Error("Invalid URL: '".concat(url, "'"));
38
- }
39
- var doc = document;
40
- var anchorElement = doc.createElement('a');
41
- if (base !== undefined) {
42
- doc = document.implementation.createHTMLDocument('');
43
- var baseElement = doc.createElement('base');
44
- baseElement.href = base;
45
- doc.head.appendChild(baseElement);
46
- doc.body.appendChild(anchorElement);
47
- }
48
- anchorElement.href = url;
49
- return anchorElement;
50
- }
51
- var originalURL = URL;
52
- var isURLSupported;
53
- function getSupportedUrl() {
54
- if (isURLSupported === undefined) {
55
- try {
56
- var url = new originalURL('http://test/path');
57
- isURLSupported = url.href === 'http://test/path';
58
- }
59
- catch (_a) {
60
- isURLSupported = false;
61
- }
62
- }
63
- return isURLSupported ? originalURL : undefined;
64
- }
65
- export function getLocationOrigin() {
66
- return getLinkElementOrigin(window.location);
67
- }
68
- /**
69
- * Fallback
70
- * On IE HTMLAnchorElement origin is not supported: https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/origin
71
- * On Firefox window.location.origin is "null" for file: URIs: https://bugzilla.mozilla.org/show_bug.cgi?id=878297
72
- */
73
- export function getLinkElementOrigin(element) {
74
- if (element.origin && element.origin !== 'null') {
75
- return element.origin;
76
- }
77
- var sanitizedHost = element.host.replace(/(:80|:443)$/, '');
78
- return "".concat(element.protocol, "//").concat(sanitizedHost);
79
- }
80
- //# sourceMappingURL=urlPolyfill.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"urlPolyfill.js","sourceRoot":"","sources":["../../../src/tools/utils/urlPolyfill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAE9D,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,QAAQ,CAAC,GAAG,EAAE,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAAA;AAChD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,CAAC;QACH,OAAO,CAAC,CAAC,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AI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAChD,OAAO,OAAO,CAAC,MAAM,CAAA;IACvB,CAAC;IACD,IAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;IAC7D,OAAO,UAAG,OAAO,CAAC,QAAQ,eAAK,aAAa,CAAE,CAAA;AAChD,CAAC"}
@@ -1,50 +0,0 @@
1
- import type { Duration, RelativeTime } from './utils/timeUtils';
2
- export interface ValueHistoryEntry<T> {
3
- startTime: RelativeTime;
4
- endTime: RelativeTime;
5
- value: T;
6
- remove(): void;
7
- close(endTime: RelativeTime): void;
8
- }
9
- export declare const CLEAR_OLD_VALUES_INTERVAL: number;
10
- /**
11
- * Store and keep track of values spans. This whole class assumes that values are added in
12
- * chronological order (i.e. all entries have an increasing start time).
13
- */
14
- export declare class ValueHistory<Value> {
15
- private expireDelay;
16
- private maxEntries?;
17
- private entries;
18
- private clearOldValuesInterval;
19
- constructor(expireDelay: number, maxEntries?: number | undefined);
20
- /**
21
- * Add a value to the history associated with a start time. Returns a reference to this newly
22
- * added entry that can be removed or closed.
23
- */
24
- add(value: Value, startTime: RelativeTime): ValueHistoryEntry<Value>;
25
- /**
26
- * Return the latest value that was active during `startTime`, or the currently active value
27
- * if no `startTime` is provided. This method assumes that entries are not overlapping.
28
- */
29
- find(startTime?: RelativeTime): Value | undefined;
30
- /**
31
- * Helper function to close the currently active value, if any. This method assumes that entries
32
- * are not overlapping.
33
- */
34
- closeActive(endTime: RelativeTime): void;
35
- /**
36
- * Return all values with an active period overlapping with the duration,
37
- * or all values that were active during `startTime` if no duration is provided,
38
- * or all currently active values if no `startTime` is provided.
39
- */
40
- findAll(startTime?: RelativeTime, duration?: Duration): Value[];
41
- /**
42
- * Remove all entries from this collection.
43
- */
44
- reset(): void;
45
- /**
46
- * Stop internal garbage collection of past entries.
47
- */
48
- stop(): void;
49
- private clearOldValues;
50
- }
@@ -1,103 +0,0 @@
1
- import { setInterval, clearInterval } from './timer';
2
- import { addDuration, relativeNow, ONE_MINUTE } from './utils/timeUtils';
3
- var END_OF_TIMES = Infinity;
4
- export var CLEAR_OLD_VALUES_INTERVAL = ONE_MINUTE;
5
- /**
6
- * Store and keep track of values spans. This whole class assumes that values are added in
7
- * chronological order (i.e. all entries have an increasing start time).
8
- */
9
- var ValueHistory = /** @class */ (function () {
10
- function ValueHistory(expireDelay, maxEntries) {
11
- var _this = this;
12
- this.expireDelay = expireDelay;
13
- this.maxEntries = maxEntries;
14
- this.entries = [];
15
- this.clearOldValuesInterval = setInterval(function () { return _this.clearOldValues(); }, CLEAR_OLD_VALUES_INTERVAL);
16
- }
17
- /**
18
- * Add a value to the history associated with a start time. Returns a reference to this newly
19
- * added entry that can be removed or closed.
20
- */
21
- ValueHistory.prototype.add = function (value, startTime) {
22
- var _this = this;
23
- var entry = {
24
- value: value,
25
- startTime: startTime,
26
- endTime: END_OF_TIMES,
27
- remove: function () {
28
- var index = _this.entries.indexOf(entry);
29
- if (index >= 0) {
30
- _this.entries.splice(index, 1);
31
- }
32
- },
33
- close: function (endTime) {
34
- entry.endTime = endTime;
35
- },
36
- };
37
- if (this.maxEntries && this.entries.length >= this.maxEntries) {
38
- this.entries.pop();
39
- }
40
- this.entries.unshift(entry);
41
- return entry;
42
- };
43
- /**
44
- * Return the latest value that was active during `startTime`, or the currently active value
45
- * if no `startTime` is provided. This method assumes that entries are not overlapping.
46
- */
47
- ValueHistory.prototype.find = function (startTime) {
48
- if (startTime === void 0) { startTime = END_OF_TIMES; }
49
- for (var _i = 0, _a = this.entries; _i < _a.length; _i++) {
50
- var entry = _a[_i];
51
- if (entry.startTime <= startTime) {
52
- if (startTime <= entry.endTime) {
53
- return entry.value;
54
- }
55
- break;
56
- }
57
- }
58
- };
59
- /**
60
- * Helper function to close the currently active value, if any. This method assumes that entries
61
- * are not overlapping.
62
- */
63
- ValueHistory.prototype.closeActive = function (endTime) {
64
- var latestEntry = this.entries[0];
65
- if (latestEntry && latestEntry.endTime === END_OF_TIMES) {
66
- latestEntry.close(endTime);
67
- }
68
- };
69
- /**
70
- * Return all values with an active period overlapping with the duration,
71
- * or all values that were active during `startTime` if no duration is provided,
72
- * or all currently active values if no `startTime` is provided.
73
- */
74
- ValueHistory.prototype.findAll = function (startTime, duration) {
75
- if (startTime === void 0) { startTime = END_OF_TIMES; }
76
- if (duration === void 0) { duration = 0; }
77
- var endTime = addDuration(startTime, duration);
78
- return this.entries
79
- .filter(function (entry) { return entry.startTime <= endTime && startTime <= entry.endTime; })
80
- .map(function (entry) { return entry.value; });
81
- };
82
- /**
83
- * Remove all entries from this collection.
84
- */
85
- ValueHistory.prototype.reset = function () {
86
- this.entries = [];
87
- };
88
- /**
89
- * Stop internal garbage collection of past entries.
90
- */
91
- ValueHistory.prototype.stop = function () {
92
- clearInterval(this.clearOldValuesInterval);
93
- };
94
- ValueHistory.prototype.clearOldValues = function () {
95
- var oldTimeThreshold = relativeNow() - this.expireDelay;
96
- while (this.entries.length > 0 && this.entries[this.entries.length - 1].endTime < oldTimeThreshold) {
97
- this.entries.pop();
98
- }
99
- };
100
- return ValueHistory;
101
- }());
102
- export { ValueHistory };
103
- //# sourceMappingURL=valueHistory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"valueHistory.js","sourceRoot":"","sources":["../../src/tools/valueHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAGpD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAExE,IAAM,YAAY,GAAG,QAAwB,CAAA;AAU7C,MAAM,CAAC,IAAM,yBAAyB,GAAG,UAAU,CAAA;AAEnD;;;GAGG;AACH;IAIE,sBACU,WAAmB,EACnB,UAAmB;QAF7B,iBAKC;QAJS,gBAAW,GAAX,WAAW,CAAQ;QACnB,eAAU,GAAV,UAAU,CAAS;QALrB,YAAO,GAAoC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A;QACpB,CAAC;IACH,CAAC;IACH,mBAAC;AAAD,CAAC,AAlGD,IAkGC"}
@@ -1,21 +0,0 @@
1
- import type { Context } from '../tools/serialisation/context';
2
- import type { Encoder } from '../tools/encoder';
3
- import type { HttpRequest } from './httpRequest';
4
- import type { FlushController } from './flushController';
5
- export declare class Batch {
6
- private encoder;
7
- private request;
8
- flushController: FlushController;
9
- private messageBytesLimit;
10
- private upsertBuffer;
11
- private flushSubscription;
12
- constructor(encoder: Encoder, request: HttpRequest, flushController: FlushController, messageBytesLimit: number);
13
- add(message: Context): void;
14
- upsert(message: Context, key: string): void;
15
- stop(): void;
16
- private flush;
17
- private addOrUpdate;
18
- private push;
19
- private remove;
20
- private hasMessageFor;
21
- }
@@ -1,120 +0,0 @@
1
- import { display } from '../tools/display';
2
- import { objectValues } from '../tools/utils/polyfills';
3
- import { isPageExitReason } from '../browser/pageExitObservable';
4
- import { jsonStringify } from '../tools/serialisation/jsonStringify';
5
- import { computeBytesCount } from '../tools/utils/byteUtils';
6
- var Batch = /** @class */ (function () {
7
- function Batch(encoder, request, flushController, messageBytesLimit) {
8
- var _this = this;
9
- this.encoder = encoder;
10
- this.request = request;
11
- this.flushController = flushController;
12
- this.messageBytesLimit = messageBytesLimit;
13
- this.upsertBuffer = {};
14
- this.flushSubscription = this.flushController.flushObservable.subscribe(function (event) { return _this.flush(event); });
15
- }
16
- Batch.prototype.add = function (message) {
17
- this.addOrUpdate(message);
18
- };
19
- Batch.prototype.upsert = function (message, key) {
20
- this.addOrUpdate(message, key);
21
- };
22
- Batch.prototype.stop = function () {
23
- this.flushSubscription.unsubscribe();
24
- };
25
- Batch.prototype.flush = function (event) {
26
- var upsertMessages = objectValues(this.upsertBuffer).join('\n');
27
- this.upsertBuffer = {};
28
- var isPageExit = isPageExitReason(event.reason);
29
- var send = isPageExit ? this.request.sendOnExit : this.request.send;
30
- if (isPageExit &&
31
- // Note: checking that the encoder is async is not strictly needed, but it's an optimization:
32
- // if the encoder is async we need to send two requests in some cases (one for encoded data
33
- // and the other for non-encoded data). But if it's not async, we don't have to worry about
34
- // it and always send a single request.
35
- this.encoder.isAsync) {
36
- var encoderResult = this.encoder.finishSync();
37
- // Send encoded messages
38
- if (encoderResult.outputBytesCount) {
39
- send(formatPayloadFromEncoder(encoderResult, event));
40
- }
41
- // Send messages that are not yet encoded at this point
42
- var pendingMessages = [encoderResult.pendingData, upsertMessages].filter(Boolean).join('\n');
43
- if (pendingMessages) {
44
- send({
45
- data: pendingMessages,
46
- bytesCount: computeBytesCount(pendingMessages),
47
- flushReason: event.reason,
48
- });
49
- }
50
- }
51
- else {
52
- if (upsertMessages) {
53
- this.encoder.write(this.encoder.isEmpty ? upsertMessages : "\n".concat(upsertMessages));
54
- }
55
- this.encoder.finish(function (encoderResult) {
56
- send(formatPayloadFromEncoder(encoderResult, event));
57
- });
58
- }
59
- };
60
- Batch.prototype.addOrUpdate = function (message, key) {
61
- var serializedMessage = jsonStringify(message);
62
- var estimatedMessageBytesCount = this.encoder.estimateEncodedBytesCount(serializedMessage);
63
- if (estimatedMessageBytesCount >= this.messageBytesLimit) {
64
- display.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit, "KB."));
65
- return;
66
- }
67
- if (this.hasMessageFor(key)) {
68
- this.remove(key);
69
- }
70
- this.push(serializedMessage, estimatedMessageBytesCount, key);
71
- };
72
- Batch.prototype.push = function (serializedMessage, estimatedMessageBytesCount, key) {
73
- var _this = this;
74
- this.flushController.notifyBeforeAddMessage(estimatedMessageBytesCount);
75
- if (key !== undefined) {
76
- this.upsertBuffer[key] = serializedMessage;
77
- this.flushController.notifyAfterAddMessage();
78
- }
79
- else {
80
- this.encoder.write(this.encoder.isEmpty ? serializedMessage : "\n".concat(serializedMessage), function (realMessageBytesCount) {
81
- _this.flushController.notifyAfterAddMessage(realMessageBytesCount - estimatedMessageBytesCount);
82
- });
83
- }
84
- };
85
- Batch.prototype.remove = function (key) {
86
- var removedMessage = this.upsertBuffer[key];
87
- delete this.upsertBuffer[key];
88
- var messageBytesCount = this.encoder.estimateEncodedBytesCount(removedMessage);
89
- this.flushController.notifyAfterRemoveMessage(messageBytesCount);
90
- };
91
- Batch.prototype.hasMessageFor = function (key) {
92
- return key !== undefined && this.upsertBuffer[key] !== undefined;
93
- };
94
- return Batch;
95
- }());
96
- export { Batch };
97
- function formatPayloadFromEncoder(encoderResult, flushEvent) {
98
- var data;
99
- if (typeof encoderResult.output === 'string') {
100
- data = encoderResult.output;
101
- }
102
- else {
103
- data = new Blob([encoderResult.output], {
104
- // This will set the 'Content-Type: text/plain' header. Reasoning:
105
- // * The intake rejects the request if there is no content type.
106
- // * The browser will issue CORS preflight requests if we set it to 'application/json', which
107
- // could induce higher intake load (and maybe has other impacts).
108
- // * Also it's not quite JSON, since we are concatenating multiple JSON objects separated by
109
- // new lines.
110
- type: 'text/plain',
111
- });
112
- }
113
- return {
114
- data: data,
115
- bytesCount: encoderResult.outputBytesCount,
116
- encoding: encoderResult.encoding,
117
- flushReason: flushEvent.reason,
118
- };
119
- }
120
- //# sourceMappingURL=batch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"batch.js","sourceRoot":"","sources":["../../src/transport/batch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAA;AAGpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAI5D;IAIE,eACU,OAAgB,EAChB,OAAoB,EACrB,eAAgC,EAC/B,iBAAyB;QAJnC,iBAOC;QANS,YAAO,GAAP,OAAO,CAAS;QAChB,YAAO,GAAP,OAAO,CAAa;QACrB,oBAAe,GAAf,eAAe,CAAiB;QAC/B,sBAAiB,GAAjB,iBAAiB,CAAQ;Q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E,CAAC;QAC7C,IAAI,GAAG,aAAa,CAAC,MAAM,CAAA;IAC7B,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;YACtC,kEAAkE;YAClE,gEAAgE;YAChE,6FAA6F;YAC7F,iEAAiE;YACjE,4FAA4F;YAC5F,aAAa;YACb,IAAI,EAAE,YAAY;SACnB,CAAC,CAAA;IACJ,CAAC;IAED,OAAO;QACL,IAAI,MAAA;QACJ,UAAU,EAAE,aAAa,CAAC,gBAAgB;QAC1C,QAAQ,EAAE,aAAa,CAAC,QAAQ;QAChC,WAAW,EAAE,UAAU,CAAC,MAAM;KAC/B,CAAA;AACH,CAAC"}
@@ -1,12 +0,0 @@
1
- export interface BrowserWindowWithEventBridge extends Window {
2
- DatadogEventBridge?: DatadogEventBridge;
3
- }
4
- export interface DatadogEventBridge {
5
- getAllowedWebViewHosts(): string;
6
- send(msg: string): void;
7
- }
8
- export declare function getEventBridge<T, E>(): {
9
- getAllowedWebViewHosts(): string[];
10
- send(eventType: T, event: E): void;
11
- } | undefined;
12
- export declare function canUseEventBridge(currentHost?: string): boolean;
@@ -1,29 +0,0 @@
1
- import { endsWith } from '../tools/utils/polyfills';
2
- import { getGlobalObject } from '../tools/getGlobalObject';
3
- export function getEventBridge() {
4
- var eventBridgeGlobal = getEventBridgeGlobal();
5
- if (!eventBridgeGlobal) {
6
- return;
7
- }
8
- return {
9
- getAllowedWebViewHosts: function () {
10
- return JSON.parse(eventBridgeGlobal.getAllowedWebViewHosts());
11
- },
12
- send: function (eventType, event) {
13
- eventBridgeGlobal.send(JSON.stringify({ eventType: eventType, event: event }));
14
- },
15
- };
16
- }
17
- export function canUseEventBridge(currentHost) {
18
- var _a;
19
- if (currentHost === void 0) { currentHost = (_a = getGlobalObject().location) === null || _a === void 0 ? void 0 : _a.hostname; }
20
- var bridge = getEventBridge();
21
- return (!!bridge &&
22
- bridge
23
- .getAllowedWebViewHosts()
24
- .some(function (allowedHost) { return currentHost === allowedHost || endsWith(currentHost, ".".concat(allowedHost)); }));
25
- }
26
- function getEventBridgeGlobal() {
27
- return getGlobalObject().DatadogEventBridge;
28
- }
29
- //# sourceMappingURL=eventBridge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eventBridge.js","sourceRoot":"","sources":["../../src/transport/eventBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAW1D,MAAM,UAAU,cAAc;IAC5B,IAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAA;IAEhD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAM;IACR,CAAC;IAED,OAAO;QACL,sBAAsB;YACpB,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAa,CAAA;QAC3E,CAAC;QACD,IAAI,YAAC,SAAY,EAAE,KAAQ;YACzB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,WAAA,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC,CAAA;QAC9D,CAAC;KACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,WAA0D;;IAA1D,4BAAA,EAAA,oBAAc,eAAe,EAAU,CAAC,QAAQ,0CAAE,QAAQ;IAC1F,IAAM,MAAM,GAAG,cAAc,EAAE,CAAA;IAC/B,OAAO,CACL,CAAC,CAAC,MAAM;QACR,MAAM;aACH,sBAAsB,EAAE;aACxB,IAAI,CAAC,UAAC,WAAW,IAAK,OAAA,WAAW,KAAK,WAAW,IAAI,QAAQ,CAAC,WAAW,EAAE,WAAI,WAAW,CAAE,CAAC,EAAvE,CAAuE,CAAC,CAClG,CAAA;AACH,CAAC;AAED,SAAS,oBAAoB;IAC3B,OAAO,eAAe,EAAgC,CAAC,kBAAkB,CAAA;AAC3E,CAAC"}
@@ -1,58 +0,0 @@
1
- import type { PageExitEvent, PageExitReason } from '../browser/pageExitObservable';
2
- import { Observable } from '../tools/observable';
3
- import type { Duration } from '../tools/utils/timeUtils';
4
- export type FlushReason = PageExitReason | 'duration_limit' | 'bytes_limit' | 'messages_limit' | 'session_expire';
5
- export type FlushController = ReturnType<typeof createFlushController>;
6
- export interface FlushEvent {
7
- reason: FlushReason;
8
- bytesCount: number;
9
- messagesCount: number;
10
- }
11
- interface FlushControllerOptions {
12
- messagesLimit: number;
13
- bytesLimit: number;
14
- durationLimit: Duration;
15
- pageExitObservable: Observable<PageExitEvent>;
16
- sessionExpireObservable: Observable<void>;
17
- }
18
- /**
19
- * Returns a "flush controller", responsible of notifying when flushing a pool of pending data needs
20
- * to happen. The implementation is designed to support both synchronous and asynchronous usages,
21
- * but relies on invariants described in each method documentation to keep a coherent state.
22
- */
23
- export declare function createFlushController({ messagesLimit, bytesLimit, durationLimit, pageExitObservable, sessionExpireObservable, }: FlushControllerOptions): {
24
- flushObservable: Observable<FlushEvent>;
25
- readonly messagesCount: number;
26
- /**
27
- * Notifies that a message will be added to a pool of pending messages waiting to be flushed.
28
- *
29
- * This function needs to be called synchronously, right before adding the message, so no flush
30
- * event can happen after `notifyBeforeAddMessage` and before adding the message.
31
- *
32
- * @param estimatedMessageBytesCount: an estimation of the message bytes count once it is
33
- * actually added.
34
- */
35
- notifyBeforeAddMessage(estimatedMessageBytesCount: number): void;
36
- /**
37
- * Notifies that a message *was* added to a pool of pending messages waiting to be flushed.
38
- *
39
- * This function can be called asynchronously after the message was added, but in this case it
40
- * should not be called if a flush event occurred in between.
41
- *
42
- * @param messageBytesCountDiff: the difference between the estimated message bytes count and
43
- * its actual bytes count once added to the pool.
44
- */
45
- notifyAfterAddMessage(messageBytesCountDiff?: number): void;
46
- /**
47
- * Notifies that a message was removed from a pool of pending messages waiting to be flushed.
48
- *
49
- * This function needs to be called synchronously, right after removing the message, so no flush
50
- * event can happen after removing the message and before `notifyAfterRemoveMessage`.
51
- *
52
- * @param messageBytesCount: the message bytes count that was added to the pool. Should
53
- * correspond to the sum of bytes counts passed to `notifyBeforeAddMessage` and
54
- * `notifyAfterAddMessage`.
55
- */
56
- notifyAfterRemoveMessage(messageBytesCount: number): void;
57
- };
58
- export {};