@utk09/ui-observability 0.10.0 → 0.12.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 (406) hide show
  1. package/CHANGELOG.md +77 -1
  2. package/README.md +323 -113
  3. package/bin/uiobs.mjs +1 -1
  4. package/dist/{batch-BMdT9mKm.js → batch-BjQUwjA6.js} +5 -6
  5. package/dist/batch-BjQUwjA6.js.map +1 -0
  6. package/dist/{batch-BHXypM1j.cjs → batch-D5LlU4Q9.cjs} +2 -2
  7. package/dist/batch-D5LlU4Q9.cjs.map +1 -0
  8. package/dist/bus/bus.d.ts +48 -47
  9. package/dist/bus/links.d.ts +4 -4
  10. package/dist/bus/validation.d.ts +1 -1
  11. package/dist/bus-D_7pd7RN.cjs +2 -0
  12. package/dist/bus-D_7pd7RN.cjs.map +1 -0
  13. package/dist/{bus-DKfBaica.js → bus-ecxUNTja.js} +105 -109
  14. package/dist/bus-ecxUNTja.js.map +1 -0
  15. package/dist/capture/console.d.ts +10 -10
  16. package/dist/capture/errors.d.ts +6 -6
  17. package/dist/capture/interactions.d.ts +14 -14
  18. package/dist/capture/lifecycle.d.ts +3 -3
  19. package/dist/capture/long-frames.d.ts +6 -6
  20. package/dist/capture/network.d.ts +17 -17
  21. package/dist/capture/profiler-frames.d.ts +44 -0
  22. package/dist/capture/replay-buffer.d.ts +46 -0
  23. package/dist/capture/replay-upload.d.ts +74 -0
  24. package/dist/capture/replay.d.ts +114 -0
  25. package/dist/capture/reports.d.ts +2 -2
  26. package/dist/capture/resource-timing.d.ts +1 -1
  27. package/dist/capture/server-timing.d.ts +3 -3
  28. package/dist/capture/storm.d.ts +3 -3
  29. package/dist/capture/types.d.ts +45 -33
  30. package/dist/capture/unclean-exit.d.ts +8 -8
  31. package/dist/capture/user-timing.d.ts +3 -3
  32. package/dist/capture/web-socket.d.ts +11 -11
  33. package/dist/capture/web-vitals.d.ts +20 -7
  34. package/dist/compression-AJJCMBOa.js +11 -0
  35. package/dist/compression-AJJCMBOa.js.map +1 -0
  36. package/dist/compression-lD9abCcO.cjs +2 -0
  37. package/dist/compression-lD9abCcO.cjs.map +1 -0
  38. package/dist/console-CLz_PvFn.cjs +2 -0
  39. package/dist/console-CLz_PvFn.cjs.map +1 -0
  40. package/dist/{console-BX_0UCV7.js → console-cwgHKXvM.js} +14 -15
  41. package/dist/console-cwgHKXvM.js.map +1 -0
  42. package/dist/constants-Bwl_YtQi.js +349 -0
  43. package/dist/constants-Bwl_YtQi.js.map +1 -0
  44. package/dist/constants-DakMxVB2.cjs +2 -0
  45. package/dist/constants-DakMxVB2.cjs.map +1 -0
  46. package/dist/constants.d.ts +150 -103
  47. package/dist/context-storage-BjzeBSxH.cjs.map +1 -1
  48. package/dist/{context-storage-DxZf4Gfh.js → context-storage-BzkoHzkQ.js} +2 -3
  49. package/dist/context-storage-BzkoHzkQ.js.map +1 -0
  50. package/dist/core/breadcrumbs.d.ts +16 -15
  51. package/dist/core/config.d.ts +3 -3
  52. package/dist/core/context.d.ts +7 -7
  53. package/dist/core/debug-buffer.d.ts +10 -10
  54. package/dist/core/debug-bundle.d.ts +3 -3
  55. package/dist/core/deferred.d.ts +2 -2
  56. package/dist/core/diagnostics.d.ts +24 -21
  57. package/dist/core/drops.d.ts +7 -7
  58. package/dist/core/hold-buffer.d.ts +1 -1
  59. package/dist/core/journey.d.ts +22 -23
  60. package/dist/core/logger.d.ts +22 -21
  61. package/dist/core/measure.d.ts +7 -7
  62. package/dist/core/meter.d.ts +25 -21
  63. package/dist/core/pipeline.d.ts +42 -41
  64. package/dist/core/profile-buckets.d.ts +31 -0
  65. package/dist/core/profiler.d.ts +218 -0
  66. package/dist/core/record.d.ts +23 -23
  67. package/dist/core/remote-rules.d.ts +4 -4
  68. package/dist/core/remote-sampling.d.ts +21 -20
  69. package/dist/core/runtime.d.ts +206 -137
  70. package/dist/core/sampling.d.ts +18 -18
  71. package/dist/core/sender.d.ts +22 -20
  72. package/dist/core/spans.d.ts +5 -5
  73. package/dist/{deadline-5_PecIl5.js → deadline-C4ccAuk5.js} +4 -9
  74. package/dist/deadline-C4ccAuk5.js.map +1 -0
  75. package/dist/deadline-CUGbto-y.cjs +2 -0
  76. package/dist/deadline-CUGbto-y.cjs.map +1 -0
  77. package/dist/{debug-bundle-CZZ6SQQh.js → debug-bundle-BOdYmCeV.js} +12 -6
  78. package/dist/debug-bundle-BOdYmCeV.js.map +1 -0
  79. package/dist/debug-bundle-Ex4L_LSP.cjs +2 -0
  80. package/dist/debug-bundle-Ex4L_LSP.cjs.map +1 -0
  81. package/dist/doctor.cjs +1 -1
  82. package/dist/doctor.cjs.map +1 -1
  83. package/dist/doctor.d.ts +16 -6
  84. package/dist/doctor.js +148 -54
  85. package/dist/doctor.js.map +1 -1
  86. package/dist/{emergency-queue-Cs8-i2xw.js → emergency-queue-B9WZxanZ.js} +15 -17
  87. package/dist/emergency-queue-B9WZxanZ.js.map +1 -0
  88. package/dist/{emergency-queue-CQ-9acZf.cjs → emergency-queue-HBpL5r3V.cjs} +2 -2
  89. package/dist/emergency-queue-HBpL5r3V.cjs.map +1 -0
  90. package/dist/{error-like-Ywo5uRHo.js → error-like-B11pB4aL.js} +2 -3
  91. package/dist/error-like-B11pB4aL.js.map +1 -0
  92. package/dist/error-like-gGRx2s36.cjs.map +1 -1
  93. package/dist/{errors-oyxrpHjY.js → errors-D6bwgJtO.js} +5 -6
  94. package/dist/errors-D6bwgJtO.js.map +1 -0
  95. package/dist/{errors-CigX45pL.cjs → errors-DCOCRdSi.cjs} +2 -2
  96. package/dist/errors-DCOCRdSi.cjs.map +1 -0
  97. package/dist/{factory-BkjNzPYL.cjs → factory-DLFDjdLv.cjs} +2 -2
  98. package/dist/factory-DLFDjdLv.cjs.map +1 -0
  99. package/dist/{factory-Bgsky_e0.js → factory-e9Qo3K0z.js} +18 -22
  100. package/dist/factory-e9Qo3K0z.js.map +1 -0
  101. package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
  102. package/dist/{fixed-window-CtaFHanJ.js → fixed-window-Dq3MLUUv.js} +2 -3
  103. package/dist/fixed-window-Dq3MLUUv.js.map +1 -0
  104. package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
  105. package/dist/{global-scope-dp2jADRl.js → global-scope-D9I8s-oN.js} +2 -3
  106. package/dist/global-scope-D9I8s-oN.js.map +1 -0
  107. package/dist/{guards-CpvOpJL6.js → guards-Cidk71ME.js} +2 -3
  108. package/dist/guards-Cidk71ME.js.map +1 -0
  109. package/dist/guards-nJ70syPt.cjs.map +1 -1
  110. package/dist/{identity-BMlKGHUM.cjs → identity-BlvlgjrU.cjs} +2 -2
  111. package/dist/identity-BlvlgjrU.cjs.map +1 -0
  112. package/dist/{identity-DOaHdfhT.js → identity-BrQp_5J5.js} +20 -21
  113. package/dist/identity-BrQp_5J5.js.map +1 -0
  114. package/dist/index.cjs +1 -1
  115. package/dist/index.cjs.map +1 -1
  116. package/dist/index.d.ts +112 -79
  117. package/dist/index.js +797 -659
  118. package/dist/index.js.map +1 -1
  119. package/dist/{indexeddb-storage-CaXGJqDD.cjs → indexeddb-storage-CtLvZH1r.cjs} +2 -2
  120. package/dist/indexeddb-storage-CtLvZH1r.cjs.map +1 -0
  121. package/dist/{indexeddb-storage-D-lUW_5P.js → indexeddb-storage-DLXQzAGh.js} +5 -6
  122. package/dist/indexeddb-storage-DLXQzAGh.js.map +1 -0
  123. package/dist/{interactions-CqDNrtIR.js → interactions-B6z2I4tU.js} +10 -11
  124. package/dist/interactions-B6z2I4tU.js.map +1 -0
  125. package/dist/{interactions-8DgxtmgO.cjs → interactions-P6pz08Jn.cjs} +2 -2
  126. package/dist/interactions-P6pz08Jn.cjs.map +1 -0
  127. package/dist/{journey-DgIjhrIc.js → journey-35yCMNFo.js} +21 -21
  128. package/dist/journey-35yCMNFo.js.map +1 -0
  129. package/dist/journey-DAGh5h9k.cjs +2 -0
  130. package/dist/journey-DAGh5h9k.cjs.map +1 -0
  131. package/dist/keys-BHhw_0Wh.cjs.map +1 -1
  132. package/dist/{keys-D5r_GH9q.js → keys-BU9j5YqW.js} +2 -3
  133. package/dist/keys-BU9j5YqW.js.map +1 -0
  134. package/dist/{library-console-g_VU-wzP.cjs → library-console-BFWEuQsl.cjs} +2 -2
  135. package/dist/library-console-BFWEuQsl.cjs.map +1 -0
  136. package/dist/library-console-Dl_Ly6DQ.js +13 -0
  137. package/dist/library-console-Dl_Ly6DQ.js.map +1 -0
  138. package/dist/{library-request-FQaiWjCP.cjs → library-request-Da-CHKzT.cjs} +2 -2
  139. package/dist/library-request-Da-CHKzT.cjs.map +1 -0
  140. package/dist/{library-request-CyC-9IOk.js → library-request-nI6pvI6I.js} +4 -5
  141. package/dist/library-request-nI6pvI6I.js.map +1 -0
  142. package/dist/{lifecycle-C2z_d8OX.cjs → lifecycle-BGGOcN4N.cjs} +2 -2
  143. package/dist/lifecycle-BGGOcN4N.cjs.map +1 -0
  144. package/dist/{lifecycle-BLC4VU7c.js → lifecycle-CZ6RRXc6.js} +3 -4
  145. package/dist/lifecycle-CZ6RRXc6.js.map +1 -0
  146. package/dist/{log-record-DKvo-B-d.cjs → log-record-D7bA1RPb.cjs} +2 -2
  147. package/dist/log-record-D7bA1RPb.cjs.map +1 -0
  148. package/dist/{log-record-CndanC-p.js → log-record-DIA6McNr.js} +3 -4
  149. package/dist/log-record-DIA6McNr.js.map +1 -0
  150. package/dist/{long-frames-BQef9rXR.js → long-frames-430_85Da.js} +9 -8
  151. package/dist/long-frames-430_85Da.js.map +1 -0
  152. package/dist/long-frames-Dd8tsi2U.cjs +2 -0
  153. package/dist/long-frames-Dd8tsi2U.cjs.map +1 -0
  154. package/dist/models/batch.d.ts +14 -15
  155. package/dist/models/bus.d.ts +24 -24
  156. package/dist/models/config.d.ts +402 -216
  157. package/dist/models/drop.d.ts +13 -11
  158. package/dist/models/health.d.ts +13 -13
  159. package/dist/models/log-record.d.ts +13 -14
  160. package/dist/models/metric.d.ts +82 -17
  161. package/dist/models/plugin.d.ts +13 -13
  162. package/dist/models/replay.d.ts +60 -0
  163. package/dist/models/serializer.d.ts +2 -3
  164. package/dist/models/stats.d.ts +2 -2
  165. package/dist/models/storage.d.ts +12 -11
  166. package/dist/{network-CvkvYzRU.js → network-C7SkLf4v.js} +30 -32
  167. package/dist/network-C7SkLf4v.js.map +1 -0
  168. package/dist/{network-CqnQOqon.cjs → network-pEX3PAJv.cjs} +2 -2
  169. package/dist/network-pEX3PAJv.cjs.map +1 -0
  170. package/dist/openfin-Bxelt0yg.js +7 -0
  171. package/dist/openfin-Bxelt0yg.js.map +1 -0
  172. package/dist/openfin-DtH2f7zX.cjs.map +1 -1
  173. package/dist/otlp-2MCrC3kd.cjs +2 -0
  174. package/dist/otlp-2MCrC3kd.cjs.map +1 -0
  175. package/dist/{otlp-CYIL7MOE.js → otlp-COq033e3.js} +26 -35
  176. package/dist/otlp-COq033e3.js.map +1 -0
  177. package/dist/patch-BX8KrPCT.cjs.map +1 -1
  178. package/dist/{patch-CCWfuEY7.js → patch-UdPz1ea8.js} +2 -3
  179. package/dist/patch-UdPz1ea8.js.map +1 -0
  180. package/dist/{platform-KMWkoI-v.cjs → platform-12uR7kBQ.cjs} +2 -2
  181. package/dist/platform-12uR7kBQ.cjs.map +1 -0
  182. package/dist/{platform-wcAkkv9F.js → platform-CVewe4wQ.js} +9 -10
  183. package/dist/platform-CVewe4wQ.js.map +1 -0
  184. package/dist/profiler-BVWIOgnq.js +310 -0
  185. package/dist/profiler-BVWIOgnq.js.map +1 -0
  186. package/dist/profiler-eVCknCzS.cjs +2 -0
  187. package/dist/profiler-eVCknCzS.cjs.map +1 -0
  188. package/dist/profiler-frames-CLXlT_xL.js +86 -0
  189. package/dist/profiler-frames-CLXlT_xL.js.map +1 -0
  190. package/dist/profiler-frames-Dg2OebB2.cjs +2 -0
  191. package/dist/profiler-frames-Dg2OebB2.cjs.map +1 -0
  192. package/dist/{remote-rules-CH_7PphT.js → remote-rules-BJGDJGwA.js} +29 -30
  193. package/dist/remote-rules-BJGDJGwA.js.map +1 -0
  194. package/dist/{remote-rules-BL8km4xk.cjs → remote-rules-CJD3ToVk.cjs} +2 -2
  195. package/dist/remote-rules-CJD3ToVk.cjs.map +1 -0
  196. package/dist/replay-0zAJv9T3.js +338 -0
  197. package/dist/replay-0zAJv9T3.js.map +1 -0
  198. package/dist/replay-DomJpXqW.cjs +2 -0
  199. package/dist/replay-DomJpXqW.cjs.map +1 -0
  200. package/dist/{reports-Bh_-KpZ2.cjs → reports-BsbqmP8h.cjs} +2 -2
  201. package/dist/reports-BsbqmP8h.cjs.map +1 -0
  202. package/dist/{reports-BOKyY3_A.js → reports-BuXekPOS.js} +4 -5
  203. package/dist/reports-BuXekPOS.js.map +1 -0
  204. package/dist/{resource-timing-BROnEJ0E.js → resource-timing-CXGHwFRD.js} +6 -7
  205. package/dist/resource-timing-CXGHwFRD.js.map +1 -0
  206. package/dist/{resource-timing-CbgwNpog.cjs → resource-timing-DkycFGDa.cjs} +2 -2
  207. package/dist/resource-timing-DkycFGDa.cjs.map +1 -0
  208. package/dist/{sampling-ECGVYiDD.cjs → sampling-Dd0wllyq.cjs} +2 -2
  209. package/dist/sampling-Dd0wllyq.cjs.map +1 -0
  210. package/dist/{sampling-BLO_pcV4.js → sampling-UUDbi3K0.js} +11 -12
  211. package/dist/sampling-UUDbi3K0.js.map +1 -0
  212. package/dist/{sanitize-DS0G4_ea.js → sanitize-CNmsD9r3.js} +4 -5
  213. package/dist/sanitize-CNmsD9r3.js.map +1 -0
  214. package/dist/{sanitize-Bsn8HQWC.cjs → sanitize-ChLn97Ch.cjs} +2 -2
  215. package/dist/sanitize-ChLn97Ch.cjs.map +1 -0
  216. package/dist/{select-DWO0-w8_.cjs → select-CTk-K5mG.cjs} +3 -3
  217. package/dist/select-CTk-K5mG.cjs.map +1 -0
  218. package/dist/{select-wqt9Wxio.js → select-DPv_j6wq.js} +64 -67
  219. package/dist/select-DPv_j6wq.js.map +1 -0
  220. package/dist/{sender-BkAVt-Rq.js → sender-15zEsZpr.js} +98 -101
  221. package/dist/sender-15zEsZpr.js.map +1 -0
  222. package/dist/sender-Bfpv9tad.cjs +2 -0
  223. package/dist/sender-Bfpv9tad.cjs.map +1 -0
  224. package/dist/storage/context-storage.d.ts +34 -33
  225. package/dist/storage/emergency-queue.d.ts +9 -9
  226. package/dist/storage/eviction.d.ts +12 -12
  227. package/dist/storage/factory.d.ts +8 -7
  228. package/dist/storage/gap.d.ts +6 -6
  229. package/dist/storage/idb-driver.d.ts +31 -32
  230. package/dist/storage/indexeddb-storage.d.ts +26 -27
  231. package/dist/storage/keys.d.ts +7 -7
  232. package/dist/storage/local-storage.d.ts +38 -38
  233. package/dist/storage/memory-storage.d.ts +21 -22
  234. package/dist/storage/persistence.d.ts +1 -1
  235. package/dist/storage-BA9RqRO-.cjs.map +1 -1
  236. package/dist/{storage-w7Tslvlq.js → storage-DZwed89z.js} +2 -3
  237. package/dist/storage-DZwed89z.js.map +1 -0
  238. package/dist/{storm-DD4cUkoL.js → storm-BTSNTIWI.js} +4 -5
  239. package/dist/storm-BTSNTIWI.js.map +1 -0
  240. package/dist/{storm-DCEsqViG.cjs → storm-D0_qZOEg.cjs} +2 -2
  241. package/dist/storm-D0_qZOEg.cjs.map +1 -0
  242. package/dist/transport/compression.d.ts +2 -2
  243. package/dist/transport/errors.d.ts +7 -7
  244. package/dist/transport/exit-flush.d.ts +39 -39
  245. package/dist/transport/headers.d.ts +2 -2
  246. package/dist/transport/http-transport.d.ts +28 -27
  247. package/dist/transport/memory-transport.d.ts +6 -6
  248. package/dist/transport/retry-engine.d.ts +35 -34
  249. package/dist/transport/serializers/ecs.d.ts +1 -1
  250. package/dist/transport/serializers/otlp-metrics.d.ts +1 -1
  251. package/dist/transport/serializers/otlp-traces.d.ts +1 -1
  252. package/dist/transport/serializers/otlp.d.ts +16 -16
  253. package/dist/transport/serializers/select.d.ts +7 -7
  254. package/dist/transport/status-transport.d.ts +20 -20
  255. package/dist/transport/worker-protocol.d.ts +3 -3
  256. package/dist/{types-BR9t_w28.js → types-BAerHgCq.js} +2 -3
  257. package/dist/types-BAerHgCq.js.map +1 -0
  258. package/dist/types-C7WNpnG1.cjs.map +1 -1
  259. package/dist/{unclean-exit-CwdpbUDg.cjs → unclean-exit-ClGzrc2A.cjs} +2 -2
  260. package/dist/unclean-exit-ClGzrc2A.cjs.map +1 -0
  261. package/dist/{unclean-exit-BYZ5yaSI.js → unclean-exit-Cob_jyTv.js} +3 -4
  262. package/dist/unclean-exit-Cob_jyTv.js.map +1 -0
  263. package/dist/unref-CU9Nyz_9.cjs +2 -0
  264. package/dist/unref-CU9Nyz_9.cjs.map +1 -0
  265. package/dist/unref-DgHPQeWv.js +7 -0
  266. package/dist/unref-DgHPQeWv.js.map +1 -0
  267. package/dist/user-timing-CdYqx3PF.cjs +2 -0
  268. package/dist/user-timing-CdYqx3PF.cjs.map +1 -0
  269. package/dist/{user-timing-Di2ra5DB.js → user-timing-DgHubxCI.js} +7 -6
  270. package/dist/user-timing-DgHubxCI.js.map +1 -0
  271. package/dist/utils/console.d.ts +2 -2
  272. package/dist/utils/deadline.d.ts +4 -4
  273. package/dist/utils/error-like.d.ts +7 -7
  274. package/dist/utils/fixed-window.d.ts +9 -8
  275. package/dist/utils/global-scope.d.ts +8 -8
  276. package/dist/utils/guards.d.ts +2 -2
  277. package/dist/utils/identity.d.ts +17 -17
  278. package/dist/utils/library-console.d.ts +4 -4
  279. package/dist/utils/library-request.d.ts +10 -10
  280. package/dist/utils/lock.d.ts +10 -9
  281. package/dist/utils/openfin.d.ts +5 -5
  282. package/dist/utils/patch.d.ts +6 -6
  283. package/dist/utils/platform.d.ts +13 -11
  284. package/dist/utils/sanitize.d.ts +4 -4
  285. package/dist/utils/timer.d.ts +1 -1
  286. package/dist/utils/tracing.d.ts +38 -38
  287. package/dist/utils/unref.d.ts +3 -3
  288. package/dist/{web-socket-DwBNhgre.cjs → web-socket-BTuvYoJI.cjs} +2 -2
  289. package/dist/web-socket-BTuvYoJI.cjs.map +1 -0
  290. package/dist/{web-socket-B-5qqPy7.js → web-socket-DthJuSAg.js} +14 -15
  291. package/dist/web-socket-DthJuSAg.js.map +1 -0
  292. package/dist/web-vitals-Ch5BpDmo.cjs +2 -0
  293. package/dist/web-vitals-Ch5BpDmo.cjs.map +1 -0
  294. package/dist/web-vitals-CsGCWnUr.js +77 -0
  295. package/dist/web-vitals-CsGCWnUr.js.map +1 -0
  296. package/dist/{worker-protocol-0HMf4-kY.js → worker-protocol-B0_8rWy5.js} +6 -7
  297. package/dist/worker-protocol-B0_8rWy5.js.map +1 -0
  298. package/dist/{worker-protocol-DXekoADQ.cjs → worker-protocol-BjzFORfq.cjs} +2 -2
  299. package/dist/worker-protocol-BjzFORfq.cjs.map +1 -0
  300. package/dist/worker-server-4en-Lt-3.cjs +2 -0
  301. package/dist/worker-server-4en-Lt-3.cjs.map +1 -0
  302. package/dist/{worker-server-CKcmX5m5.js → worker-server-Cne9MX9I.js} +25 -26
  303. package/dist/{worker-server-CKcmX5m5.js.map → worker-server-Cne9MX9I.js.map} +1 -1
  304. package/dist/worker-transport-B-GF4Aqn.cjs +2 -0
  305. package/dist/worker-transport-B-GF4Aqn.cjs.map +1 -0
  306. package/dist/{worker-transport-2220ghFZ.js → worker-transport-C3SjJAEC.js} +64 -65
  307. package/dist/worker-transport-C3SjJAEC.js.map +1 -0
  308. package/package.json +33 -41
  309. package/dist/batch-BHXypM1j.cjs.map +0 -1
  310. package/dist/batch-BMdT9mKm.js.map +0 -1
  311. package/dist/bus-DKfBaica.js.map +0 -1
  312. package/dist/bus-Dea9rVhy.cjs +0 -2
  313. package/dist/bus-Dea9rVhy.cjs.map +0 -1
  314. package/dist/console-BX_0UCV7.js.map +0 -1
  315. package/dist/console-DZEcs7FL.cjs +0 -2
  316. package/dist/console-DZEcs7FL.cjs.map +0 -1
  317. package/dist/constants-CL0ZdI2f.cjs +0 -2
  318. package/dist/constants-CL0ZdI2f.cjs.map +0 -1
  319. package/dist/constants-CU60FG4w.js +0 -305
  320. package/dist/constants-CU60FG4w.js.map +0 -1
  321. package/dist/context-storage-DxZf4Gfh.js.map +0 -1
  322. package/dist/deadline-5_PecIl5.js.map +0 -1
  323. package/dist/deadline-XSnm95pg.cjs +0 -2
  324. package/dist/deadline-XSnm95pg.cjs.map +0 -1
  325. package/dist/debug-bundle-CZZ6SQQh.js.map +0 -1
  326. package/dist/debug-bundle-yRkrU1ny.cjs +0 -2
  327. package/dist/debug-bundle-yRkrU1ny.cjs.map +0 -1
  328. package/dist/emergency-queue-CQ-9acZf.cjs.map +0 -1
  329. package/dist/emergency-queue-Cs8-i2xw.js.map +0 -1
  330. package/dist/error-like-Ywo5uRHo.js.map +0 -1
  331. package/dist/errors-CigX45pL.cjs.map +0 -1
  332. package/dist/errors-oyxrpHjY.js.map +0 -1
  333. package/dist/factory-Bgsky_e0.js.map +0 -1
  334. package/dist/factory-BkjNzPYL.cjs.map +0 -1
  335. package/dist/fixed-window-CtaFHanJ.js.map +0 -1
  336. package/dist/global-scope-dp2jADRl.js.map +0 -1
  337. package/dist/guards-CpvOpJL6.js.map +0 -1
  338. package/dist/identity-BMlKGHUM.cjs.map +0 -1
  339. package/dist/identity-DOaHdfhT.js.map +0 -1
  340. package/dist/indexeddb-storage-CaXGJqDD.cjs.map +0 -1
  341. package/dist/indexeddb-storage-D-lUW_5P.js.map +0 -1
  342. package/dist/interactions-8DgxtmgO.cjs.map +0 -1
  343. package/dist/interactions-CqDNrtIR.js.map +0 -1
  344. package/dist/journey-5tcxEbnG.cjs +0 -2
  345. package/dist/journey-5tcxEbnG.cjs.map +0 -1
  346. package/dist/journey-DgIjhrIc.js.map +0 -1
  347. package/dist/keys-D5r_GH9q.js.map +0 -1
  348. package/dist/library-console-CabK2j2-.js +0 -14
  349. package/dist/library-console-CabK2j2-.js.map +0 -1
  350. package/dist/library-console-g_VU-wzP.cjs.map +0 -1
  351. package/dist/library-request-CyC-9IOk.js.map +0 -1
  352. package/dist/library-request-FQaiWjCP.cjs.map +0 -1
  353. package/dist/lifecycle-BLC4VU7c.js.map +0 -1
  354. package/dist/lifecycle-C2z_d8OX.cjs.map +0 -1
  355. package/dist/log-record-CndanC-p.js.map +0 -1
  356. package/dist/log-record-DKvo-B-d.cjs.map +0 -1
  357. package/dist/long-frames-BQef9rXR.js.map +0 -1
  358. package/dist/long-frames-CV5ZG2cx.cjs +0 -2
  359. package/dist/long-frames-CV5ZG2cx.cjs.map +0 -1
  360. package/dist/network-CqnQOqon.cjs.map +0 -1
  361. package/dist/network-CvkvYzRU.js.map +0 -1
  362. package/dist/openfin-BwEN0uj4.js +0 -8
  363. package/dist/openfin-BwEN0uj4.js.map +0 -1
  364. package/dist/otlp-CYIL7MOE.js.map +0 -1
  365. package/dist/otlp-RVbkNQRh.cjs +0 -2
  366. package/dist/otlp-RVbkNQRh.cjs.map +0 -1
  367. package/dist/patch-CCWfuEY7.js.map +0 -1
  368. package/dist/platform-KMWkoI-v.cjs.map +0 -1
  369. package/dist/platform-wcAkkv9F.js.map +0 -1
  370. package/dist/remote-rules-BL8km4xk.cjs.map +0 -1
  371. package/dist/remote-rules-CH_7PphT.js.map +0 -1
  372. package/dist/reports-BOKyY3_A.js.map +0 -1
  373. package/dist/reports-Bh_-KpZ2.cjs.map +0 -1
  374. package/dist/resource-timing-BROnEJ0E.js.map +0 -1
  375. package/dist/resource-timing-CbgwNpog.cjs.map +0 -1
  376. package/dist/sampling-BLO_pcV4.js.map +0 -1
  377. package/dist/sampling-ECGVYiDD.cjs.map +0 -1
  378. package/dist/sanitize-Bsn8HQWC.cjs.map +0 -1
  379. package/dist/sanitize-DS0G4_ea.js.map +0 -1
  380. package/dist/select-DWO0-w8_.cjs.map +0 -1
  381. package/dist/select-wqt9Wxio.js.map +0 -1
  382. package/dist/sender-BkAVt-Rq.js.map +0 -1
  383. package/dist/sender-D82PxlCY.cjs +0 -2
  384. package/dist/sender-D82PxlCY.cjs.map +0 -1
  385. package/dist/storage-w7Tslvlq.js.map +0 -1
  386. package/dist/storm-DCEsqViG.cjs.map +0 -1
  387. package/dist/storm-DD4cUkoL.js.map +0 -1
  388. package/dist/types-BR9t_w28.js.map +0 -1
  389. package/dist/unclean-exit-BYZ5yaSI.js.map +0 -1
  390. package/dist/unclean-exit-CwdpbUDg.cjs.map +0 -1
  391. package/dist/user-timing-C1kB3JEg.cjs +0 -2
  392. package/dist/user-timing-C1kB3JEg.cjs.map +0 -1
  393. package/dist/user-timing-Di2ra5DB.js.map +0 -1
  394. package/dist/web-socket-B-5qqPy7.js.map +0 -1
  395. package/dist/web-socket-DwBNhgre.cjs.map +0 -1
  396. package/dist/web-vitals-Bflr5jSA.js +0 -53
  397. package/dist/web-vitals-Bflr5jSA.js.map +0 -1
  398. package/dist/web-vitals-DFuoTQbZ.cjs +0 -2
  399. package/dist/web-vitals-DFuoTQbZ.cjs.map +0 -1
  400. package/dist/worker-protocol-0HMf4-kY.js.map +0 -1
  401. package/dist/worker-protocol-DXekoADQ.cjs.map +0 -1
  402. package/dist/worker-server-BQK5z2yl.cjs +0 -2
  403. package/dist/worker-server-BQK5z2yl.cjs.map +0 -1
  404. package/dist/worker-transport-2220ghFZ.js.map +0 -1
  405. package/dist/worker-transport-Dj2yCQN5.cjs +0 -2
  406. package/dist/worker-transport-Dj2yCQN5.cjs.map +0 -1
@@ -1,67 +1,66 @@
1
1
  import type { LogBatch } from "../models/batch";
2
- /** This class wraps one IndexedDB database that holds undelivered batches by id. */
2
+ /** Wraps one IndexedDB database that holds undelivered batches by id. */
3
3
  export declare class IdbDriver {
4
4
  private readonly name;
5
- /** This field holds the pending or completed open. The driver reuses it for one database. */
5
+ /** The pending or completed open. Reused for every call on this database. */
6
6
  private connection;
7
7
  /**
8
8
  * @param name IndexedDB database name.
9
9
  */
10
10
  constructor(name: string);
11
11
  /**
12
- * Writes a batch. It replaces a stored batch with the same id.
13
- * @param batch Batch to persist.
12
+ * Writes a batch, replacing any stored batch with the same id.
13
+ * @param batch The batch to persist.
14
14
  */
15
15
  put(batch: LogBatch): Promise<void>;
16
16
  /**
17
- * Reads batches of one context in creation order without removing them.
17
+ * Reads one context's batches in creation order without removing them.
18
18
  * @param id Delivery context id.
19
- * @param limit Maximum batches to return.
20
- * @returns Batches of this context, oldest first.
19
+ * @param limit Maximum number of batches to return.
20
+ * @returns This context's batches, oldest first.
21
21
  */
22
22
  takeContext(id: string, limit: number): Promise<LogBatch[]>;
23
23
  /**
24
- * Counts stored batches of one context.
24
+ * Counts one context's stored batches.
25
25
  * @param id Delivery context id.
26
- * @returns Number of batches in this context.
26
+ * @returns The number of batches in this context.
27
27
  */
28
28
  countContext(id: string): Promise<number>;
29
29
  /**
30
- * Reads the oldest batches by createdAt. It does not remove them.
30
+ * Reads the oldest batches by createdAt without removing them.
31
31
  * @param limit Maximum number of batches to return.
32
- * @returns Batches in ascending createdAt order.
32
+ * @returns The batches in ascending createdAt order.
33
33
  */
34
34
  takeOldest(limit: number): Promise<LogBatch[]>;
35
35
  /**
36
- * Walks the batches by createdAt, oldest first. It does not remove them. A cursor reads one
37
- * batch at a time. The walk can then stop before it reads the full store.
38
- * @param visit Receives each batch. It returns false to stop the walk.
36
+ * Walks the batches by createdAt, oldest first, without removing them. A cursor reads one
37
+ * batch at a time, so the walk can stop before it has read the whole store.
38
+ * @param visit Receives each batch. Return false to stop the walk.
39
39
  */
40
40
  walkOldest(visit: (batch: LogBatch) => boolean): Promise<void>;
41
41
  /**
42
- * Reads each batch with a createdAt value before the cutoff.
42
+ * Reads every batch whose createdAt is before the cutoff.
43
43
  * @param cutoff Exclusive upper bound in epoch milliseconds.
44
- * @returns Batches older than the cutoff.
44
+ * @returns The batches older than the cutoff.
45
45
  */
46
46
  takeBefore(cutoff: number): Promise<LogBatch[]>;
47
47
  /**
48
- * Deletes one batch. An id that is not stored resolves without error.
48
+ * Deletes one batch. An id that isn't stored resolves without an error.
49
49
  * @param id Batch identifier.
50
50
  */
51
51
  delete(id: string): Promise<void>;
52
52
  /**
53
- * Deletes several batches in one transaction. A partial failure deletes none of
54
- * them.
53
+ * Deletes several batches in one transaction. If any delete fails, none of them are deleted.
55
54
  * @param ids Batch identifiers.
56
55
  */
57
56
  deleteMany(ids: string[]): Promise<void>;
58
57
  /**
59
- * Sets the attempt count of a stored batch. It ignores an id that is not stored.
60
- * A batch that the library delivered and deleted must not come back. The get and the put use one
61
- * transaction. With two transactions, a prune in another window can delete the batch
62
- * between them. The put then restores it.
58
+ * Sets a stored batch's attempt count, ignoring an id that isn't stored. A batch we already
59
+ * delivered and deleted must not come back, so the get and the put share one transaction.
60
+ * With two transactions, a prune in another window could delete the batch in between and
61
+ * the put would restore it.
63
62
  * @param id Batch identifier.
64
- * @param attempts New absolute attempt count.
63
+ * @param attempts The new absolute attempt count.
65
64
  */
66
65
  bumpAttempts(id: string, attempts: number): Promise<void>;
67
66
  /**
@@ -69,25 +68,25 @@ export declare class IdbDriver {
69
68
  * @returns Total batch count.
70
69
  */
71
70
  count(): Promise<number>;
72
- /** This method deletes all stored batches. */
71
+ /** Deletes every stored batch. */
73
72
  clear(): Promise<void>;
74
73
  /**
75
- * Opens the connection. A host that defines indexedDB but rejects open() fails
76
- * here. The factory can then select a different adapter.
74
+ * Opens the connection. A host that defines indexedDB but rejects open() fails here, which
75
+ * lets the factory pick a different adapter.
77
76
  */
78
77
  ready(): Promise<void>;
79
- /** This method closes the connection when a connection exists. */
78
+ /** Closes the connection, if there is one. */
80
79
  close(): Promise<void>;
81
80
  /**
82
- * Opens the batch store in a new transaction. A transaction is valid only until
83
- * control returns to the event loop. Each call takes a new transaction.
81
+ * Opens the batch store in a new transaction. A transaction is only valid until control
82
+ * returns to the event loop, so every call takes a fresh one.
84
83
  * @param mode Transaction mode.
85
84
  * @returns The batch object store.
86
85
  */
87
86
  private store;
88
87
  /**
89
- * Opens the database one time. It gives the same connection to each later call.
90
- * It does not keep a failed open. The next call then opens again.
88
+ * Opens the database once and hands the same connection to every later call. A failed
89
+ * open isn't kept, so the next call tries again.
91
90
  * @returns The open database.
92
91
  */
93
92
  private open;
@@ -1,49 +1,49 @@
1
1
  import type { Diagnostics } from "../core/diagnostics";
2
2
  import { type LogBatch } from "../models/batch";
3
3
  import type { GapReporter, PruneResult, StorageAdapter, StorageLimits } from "../models/storage";
4
- /** This StorageAdapter keeps batches in IndexedDB. */
4
+ /** StorageAdapter that keeps batches in IndexedDB. */
5
5
  export declare class IndexedDbStorage implements StorageAdapter {
6
6
  private readonly limits;
7
7
  private readonly diagnostics;
8
8
  private readonly onGap?;
9
- /** This field holds the storage strategy name. */
9
+ /** The storage strategy name. */
10
10
  readonly name = "indexeddb";
11
- /** This driver holds the IndexedDB code for the batch store. */
11
+ /** Holds the IndexedDB code for the batch store. */
12
12
  private readonly db;
13
13
  /**
14
14
  * @param dbName Database name.
15
15
  * @param limits Storage capacity and retention thresholds.
16
16
  * @param diagnostics Diagnostics reporter.
17
- * @param onGap Optional callback for dropped record reporting.
17
+ * @param onGap Optional callback for reporting dropped records.
18
18
  */
19
19
  constructor(dbName: string, limits: StorageLimits, diagnostics: Diagnostics, onGap?: GapReporter | undefined);
20
20
  /**
21
- * Opens the database. It has no guard. The factory needs the rejection to
22
- * select the next adapter.
21
+ * Opens the database. Not guarded, because the factory needs the rejection to pick the
22
+ * next adapter.
23
23
  */
24
24
  open(): Promise<void>;
25
25
  /**
26
- * Writes a batch to IndexedDB. It then prunes the storage.
27
- * @param batch Batch to store.
26
+ * Writes a batch to IndexedDB, then prunes the storage.
27
+ * @param batch The batch to store.
28
28
  */
29
29
  save(batch: LogBatch): Promise<void>;
30
30
  /**
31
- * Reads batches of one context in creation order without removing them.
31
+ * Reads one context's batches in creation order without removing them.
32
32
  * @param id Delivery context id.
33
- * @param limit Maximum batches to return.
34
- * @returns Batches of this context, oldest first.
33
+ * @param limit Maximum number of batches to return.
34
+ * @returns This context's batches, oldest first.
35
35
  */
36
36
  takeContext(id: string, limit: number): Promise<LogBatch[]>;
37
37
  /**
38
- * Counts stored batches of one context.
38
+ * Counts one context's stored batches.
39
39
  * @param id Delivery context id.
40
- * @returns Number of batches in this context.
40
+ * @returns The number of batches in this context.
41
41
  */
42
42
  countContext(id: string): Promise<number>;
43
43
  /**
44
- * Reads up to `limit` batches in FIFO order. It does not delete them.
44
+ * Reads up to `limit` batches in FIFO order without deleting them.
45
45
  * @param limit Maximum number of batches to retrieve.
46
- * @returns Array of retrieved batches.
46
+ * @returns The retrieved batches.
47
47
  */
48
48
  take(limit: number): Promise<LogBatch[]>;
49
49
  /**
@@ -52,37 +52,36 @@ export declare class IndexedDbStorage implements StorageAdapter {
52
52
  */
53
53
  remove(id: string): Promise<void>;
54
54
  /**
55
- * Sets the delivery attempt count of a stored batch.
55
+ * Sets a stored batch's delivery attempt count.
56
56
  * @param id Batch identifier.
57
- * @param attempts New absolute attempt count.
57
+ * @param attempts The new absolute attempt count.
58
58
  */
59
59
  bumpAttempts(id: string, attempts: number): Promise<void>;
60
60
  /**
61
- * Removes expired batches. It then removes the oldest batches above the
62
- * capacity limit.
61
+ * Removes expired batches, then the oldest batches above the capacity limit.
63
62
  * @returns Prune summary metrics.
64
63
  */
65
64
  prune(): Promise<PruneResult>;
66
65
  /**
67
66
  * Returns the number of stored batches.
68
- * @returns Total batch count or 0 on failure.
67
+ * @returns The total batch count, or 0 on failure.
69
68
  */
70
69
  count(): Promise<number>;
71
- /** This method deletes all stored batches from the database. */
70
+ /** Deletes every stored batch from the database. */
72
71
  clear(): Promise<void>;
73
- /** This method closes the active IndexedDB connection. */
72
+ /** Closes the active IndexedDB connection. */
74
73
  close(): Promise<void>;
75
74
  /**
76
- * Adds dropped batches to the prune result. It reports them with their own reason.
77
- * @param result Prune result of all rules.
78
- * @param reason Rule that dropped the batches.
75
+ * Adds dropped batches to the prune result and reports them under their own reason.
76
+ * @param result The prune result across all rules.
77
+ * @param reason The rule that dropped the batches.
79
78
  * @param dropped The dropped batches.
80
79
  */
81
80
  private addGap;
82
81
  /**
83
82
  * Deletes the given number of stored batches. Batches without an action go first, oldest
84
- * first. An action is an audit fact. It has no guard. Both callers guard it. A guard here
85
- * hides the failure and reports an eviction that did not occur.
83
+ * first, because an action is an audit fact. Not guarded, because both callers guard it. A
84
+ * guard here would hide the failure and report an eviction that never happened.
86
85
  * @param howMany Number of batches to evict.
87
86
  * @returns The evicted batches.
88
87
  */
@@ -1,17 +1,17 @@
1
1
  import type { Diagnostics } from "../core/diagnostics";
2
2
  import type { LogBatch } from "../models/batch";
3
3
  /**
4
- * Formats a storage key with a zero-padded creation time. The keys sort in FIFO order. Always use
5
- * batch.createdAt, never Date.now(). A key from Date.now() does not match the written key.
4
+ * Formats a storage key with a zero-padded creation time, so the keys sort in FIFO order.
5
+ * Always use batch.createdAt, never Date.now(), or the key won't match the written one.
6
6
  * @param prefix Storage key prefix.
7
- * @param batch Target log batch.
8
- * @returns Prefixed, timestamp-ordered storage key.
7
+ * @param batch The target log batch.
8
+ * @returns The prefixed, timestamp-ordered storage key.
9
9
  */
10
10
  export declare function batchKey(prefix: string, batch: LogBatch): string;
11
11
  /**
12
- * Returns all localStorage keys that start with the prefix, in sorted order.
13
- * @param prefix Storage key prefix to filter by.
12
+ * Returns every localStorage key that starts with the prefix, sorted.
13
+ * @param prefix The storage key prefix to filter by.
14
14
  * @param diagnostics Diagnostics reporter.
15
- * @returns Sorted array of matching storage keys.
15
+ * @returns The matching storage keys, sorted.
16
16
  */
17
17
  export declare function keysWithPrefix(prefix: string, diagnostics: Diagnostics): string[];
@@ -1,47 +1,48 @@
1
1
  import type { Diagnostics } from "../core/diagnostics";
2
2
  import { type LogBatch } from "../models/batch";
3
3
  import type { GapReporter, PruneResult, StorageAdapter, StorageLimits } from "../models/storage";
4
- /** This StorageAdapter keeps batches in localStorage. */
4
+ /** StorageAdapter that keeps batches in localStorage. */
5
5
  export declare class LocalStorageStorage implements StorageAdapter {
6
6
  private readonly limits;
7
7
  private readonly diagnostics;
8
8
  private readonly onGap?;
9
9
  private readonly prefix;
10
- /** This field holds the storage strategy name. */
10
+ /** The storage strategy name. */
11
11
  readonly name = "localstorage";
12
12
  /**
13
13
  * @param limits Storage capacity and retention thresholds.
14
14
  * @param diagnostics Diagnostics reporter.
15
- * @param onGap Optional callback for dropped record reporting.
15
+ * @param onGap Optional callback for reporting dropped records.
16
16
  */
17
17
  constructor(limits: StorageLimits, diagnostics: Diagnostics, onGap?: GapReporter | undefined, prefix?: string);
18
18
  /**
19
- * Writes a batch to localStorage. It removes the oldest entries on a quota error.
20
- * @param batch Batch to store.
19
+ * Writes a batch to localStorage, removing the oldest entries on a quota error.
20
+ * @param batch The batch to store.
21
21
  */
22
22
  save(batch: LogBatch): Promise<void>;
23
23
  /**
24
- * Returns up to `limit` batches in FIFO order. It does not delete them.
24
+ * Returns up to `limit` batches in FIFO order without deleting them.
25
25
  * @param limit Maximum number of batches to retrieve.
26
- * @returns Promise that resolves to an array of valid batches.
26
+ * @returns A promise that resolves to the valid batches.
27
27
  */
28
28
  take(limit: number): Promise<LogBatch[]>;
29
29
  /**
30
- * Returns up to `limit` batches of one context in FIFO order. It does not delete them.
31
- * It stops at the limit. The later entries then stay unparsed.
30
+ * Returns up to `limit` batches of one context in FIFO order without deleting them. Stops
31
+ * at the limit, so later entries are never parsed.
32
32
  * @param id Delivery context id.
33
33
  * @param limit Maximum number of batches to retrieve.
34
- * @returns Promise that resolves to the batches of this context.
34
+ * @returns A promise that resolves to this context's batches.
35
35
  */
36
36
  takeContext(id: string, limit: number): Promise<LogBatch[]>;
37
37
  /**
38
- * Counts the stored batches of one context. The context id is not in the key. Each entry is read.
38
+ * Counts one context's stored batches. The context id isn't in the key, so every entry is
39
+ * read.
39
40
  * @param id Delivery context id.
40
- * @returns Promise that resolves to the batch count of this context.
41
+ * @returns A promise that resolves to this context's batch count.
41
42
  */
42
43
  countContext(id: string): Promise<number>;
43
44
  /**
44
- * Reads the valid batches one at a time, oldest first. It removes a corrupt entry.
45
+ * Reads the valid batches one at a time, oldest first, and removes any corrupt entry.
45
46
  * @yields Each valid batch.
46
47
  */
47
48
  private batches;
@@ -51,67 +52,66 @@ export declare class LocalStorageStorage implements StorageAdapter {
51
52
  */
52
53
  remove(id: string): Promise<void>;
53
54
  /**
54
- * Sets the delivery attempt count of a stored batch. It does not change the key.
55
+ * Sets a stored batch's delivery attempt count. The key doesn't change.
55
56
  * @param id Batch identifier.
56
- * @param attempts New absolute attempt count.
57
+ * @param attempts The new absolute attempt count.
57
58
  */
58
59
  bumpAttempts(id: string, attempts: number): Promise<void>;
59
60
  /**
60
- * Deletes expired batches. It then removes the oldest batches above the
61
- * capacity limit.
62
- * @returns Promise that resolves to prune summary metrics.
61
+ * Deletes expired batches, then the oldest batches above the capacity limit.
62
+ * @returns A promise that resolves to the prune summary metrics.
63
63
  */
64
64
  prune(): Promise<PruneResult>;
65
65
  /**
66
- * Returns the number of stored batch keys. It does not deserialize the batches.
67
- * @returns Promise that resolves to batch count.
66
+ * Returns the number of stored batch keys without deserializing the batches.
67
+ * @returns A promise that resolves to the batch count.
68
68
  */
69
69
  count(): Promise<number>;
70
- /** This method deletes all batch keys from localStorage. */
70
+ /** Deletes every batch key from localStorage. */
71
71
  clear(): Promise<void>;
72
- /** This method does nothing. localStorage has no connection to close. */
72
+ /** Does nothing. localStorage has no connection to close. */
73
73
  close(): Promise<void>;
74
74
  /**
75
75
  * Writes a batch to localStorage.
76
- * @param batch Batch to store.
77
- * @param context Text that diagnostics reports when the write fails.
76
+ * @param batch The batch to store.
77
+ * @param context The text diagnostics reports if the write fails.
78
78
  * @returns True if the write succeeded.
79
79
  */
80
80
  private write;
81
- /** This method removes a quarter of the store to free quota. It counts the loss. */
81
+ /** Removes a quarter of the store to free quota, and counts the loss. */
82
82
  private evictForQuota;
83
83
  /**
84
- * Picks the entries to evict. Entries without an action go first. An action is an audit fact.
85
- * A corrupt entry has no action. It goes first.
84
+ * Picks the entries to evict. Entries without an action go first, because an action is an
85
+ * audit fact. A corrupt entry has no action, so it goes first too.
86
86
  * @param keys Batch keys, oldest first.
87
87
  * @param howMany Number of entries to evict.
88
88
  * @returns The picked entries.
89
89
  */
90
90
  private evictable;
91
91
  /**
92
- * Reads the entries one at a time. The eviction walk stops early. The later entries then stay
93
- * unparsed.
92
+ * Reads the entries one at a time. The eviction walk stops early, so later entries are
93
+ * never parsed.
94
94
  * @param keys Batch keys.
95
95
  * @yields Each key with its batch.
96
96
  */
97
97
  private entries;
98
98
  /**
99
- * Removes entries. It reports them with their own reason.
100
- * @param result Prune result of all rules.
101
- * @param reason Rule that removes the entries.
102
- * @param entries Entries to remove.
99
+ * Removes entries and reports them under their own reason.
100
+ * @param result The prune result across all rules.
101
+ * @param reason The rule that removes the entries.
102
+ * @param entries The entries to remove.
103
103
  */
104
104
  private drop;
105
105
  /**
106
106
  * Reads and validates the stored batch at a key.
107
- * @param key Storage key to read.
108
- * @returns Validated LogBatch or null if missing or malformed.
107
+ * @param key The storage key to read.
108
+ * @returns The validated LogBatch, or null if it is missing or malformed.
109
109
  */
110
110
  private read;
111
111
  /**
112
112
  * Finds the storage key that ends with the batch ID.
113
113
  * @param id Batch identifier.
114
- * @returns Matching storage key string or null.
114
+ * @returns The matching storage key, or null.
115
115
  */
116
116
  private keyOf;
117
117
  /**
@@ -125,8 +125,8 @@ export declare class LocalStorageStorage implements StorageAdapter {
125
125
  */
126
126
  private removeKey;
127
127
  /**
128
- * Returns all batch storage keys in sorted order.
129
- * @returns Sorted array of storage keys.
128
+ * Returns every batch storage key, sorted.
129
+ * @returns The sorted storage keys.
130
130
  */
131
131
  private keys;
132
132
  }
@@ -1,40 +1,40 @@
1
1
  import { type LogBatch } from "../models/batch";
2
2
  import type { GapReporter, PruneResult, StorageAdapter, StorageLimits } from "../models/storage";
3
- /** This StorageAdapter keeps batches in volatile memory. */
3
+ /** StorageAdapter that keeps batches in volatile memory. */
4
4
  export declare class MemoryStorage implements StorageAdapter {
5
5
  private readonly limits;
6
6
  private readonly onGap?;
7
- /** This field holds the storage strategy name. */
7
+ /** The storage strategy name. */
8
8
  readonly name = "memory";
9
- /** This array holds the batches in FIFO order. */
9
+ /** The batches, in FIFO order. */
10
10
  private batches;
11
11
  /**
12
12
  * @param limits Storage capacity and retention thresholds.
13
- * @param onGap Optional callback for dropped record reporting.
13
+ * @param onGap Optional callback for reporting dropped records.
14
14
  */
15
15
  constructor(limits: StorageLimits, onGap?: GapReporter | undefined);
16
16
  /**
17
17
  * Appends a batch and applies retention pruning.
18
- * @param batch Batch to store.
18
+ * @param batch The batch to store.
19
19
  */
20
20
  save(batch: LogBatch): Promise<void>;
21
21
  /**
22
- * Returns up to `limit` batches in FIFO order. It does not delete them.
22
+ * Returns up to `limit` batches in FIFO order without deleting them.
23
23
  * @param limit Maximum number of batches to retrieve.
24
- * @returns Promise that resolves to an array of batches.
24
+ * @returns A promise that resolves to the batches.
25
25
  */
26
26
  take(limit: number): Promise<LogBatch[]>;
27
27
  /**
28
- * Returns up to `limit` batches of one context in FIFO order. It does not delete them.
28
+ * Returns up to `limit` batches of one context in FIFO order without deleting them.
29
29
  * @param id Delivery context id.
30
30
  * @param limit Maximum number of batches to retrieve.
31
- * @returns Promise that resolves to the batches of this context.
31
+ * @returns A promise that resolves to this context's batches.
32
32
  */
33
33
  takeContext(id: string, limit: number): Promise<LogBatch[]>;
34
34
  /**
35
- * Counts the stored batches of one context.
35
+ * Counts one context's stored batches.
36
36
  * @param id Delivery context id.
37
- * @returns Promise that resolves to the batch count of this context.
37
+ * @returns A promise that resolves to this context's batch count.
38
38
  */
39
39
  countContext(id: string): Promise<number>;
40
40
  /**
@@ -43,31 +43,30 @@ export declare class MemoryStorage implements StorageAdapter {
43
43
  */
44
44
  remove(id: string): Promise<void>;
45
45
  /**
46
- * Sets the delivery attempt count of a stored batch.
46
+ * Sets a stored batch's delivery attempt count.
47
47
  * @param id Batch identifier.
48
- * @param attempts New absolute attempt count.
48
+ * @param attempts The new absolute attempt count.
49
49
  */
50
50
  bumpAttempts(id: string, attempts: number): Promise<void>;
51
51
  /**
52
- * Removes expired batches. It then removes the oldest batches above the
53
- * capacity limit.
54
- * @returns Promise that resolves to prune summary metrics.
52
+ * Removes expired batches, then the oldest batches above the capacity limit.
53
+ * @returns A promise that resolves to the prune summary metrics.
55
54
  */
56
55
  prune(): Promise<PruneResult>;
57
56
  /**
58
- * Adds dropped batches to the prune result. It reports them with their own reason.
59
- * @param result Prune result of all rules.
60
- * @param reason Rule that dropped the batches.
57
+ * Adds dropped batches to the prune result and reports them under their own reason.
58
+ * @param result The prune result across all rules.
59
+ * @param reason The rule that dropped the batches.
61
60
  * @param dropped The dropped batches.
62
61
  */
63
62
  private report;
64
63
  /**
65
64
  * Returns the number of stored batches.
66
- * @returns Promise that resolves to batch count.
65
+ * @returns A promise that resolves to the batch count.
67
66
  */
68
67
  count(): Promise<number>;
69
- /** This method deletes all stored batches. */
68
+ /** Deletes every stored batch. */
70
69
  clear(): Promise<void>;
71
- /** This method deletes all stored batches when the storage closes. */
70
+ /** Deletes every stored batch when the storage closes. */
72
71
  close(): Promise<void>;
73
72
  }
@@ -3,6 +3,6 @@ import type { StoragePersistence } from "../models/storage";
3
3
  /**
4
4
  * Asks the browser for persistent storage. Firefox can show a permission prompt.
5
5
  * @param diagnostics Diagnostics reporter.
6
- * @returns The answer of the browser. It never rejects.
6
+ * @returns The browser's answer. Never rejects.
7
7
  */
8
8
  export declare function requestPersistence(diagnostics: Diagnostics): Promise<StoragePersistence>;
@@ -1 +1 @@
1
- {"version":3,"file":"storage-BA9RqRO-.cjs","names":["storageLimits","retention"],"sources":["../src/models/storage.ts"],"sourcesContent":["// src/models/storage.ts\n//\n// Storage interface for undelivered batches, with adapters for IndexedDB,\n// localStorage, memory, and a fallback that does nothing.\n\nimport type { LogBatch } from \"./batch\";\nimport type { RetentionOptions } from \"./config\";\n\n/**\n * State of the request for persistent storage. \"off\" means no request. \"pending\" waits for the\n * browser. \"unsupported\" means the browser has no `navigator.storage.persist()`.\n */\nexport type StoragePersistence = \"off\" | \"pending\" | \"granted\" | \"denied\" | \"unsupported\";\n\n/** Persistent batch storage interface. All methods must resolve and never throw. */\nexport interface StorageAdapter {\n /** Adapter identifier name. */\n readonly name: string;\n\n /**\n * Persists a batch to storage.\n * @param batch The batch to store.\n */\n save(batch: LogBatch): Promise<void>;\n\n /**\n * Reads up to `limit` batches in FIFO order without removing them.\n * @param limit Maximum number of batches to retrieve.\n * @returns Oldest persisted batches.\n */\n take(limit: number): Promise<LogBatch[]>;\n /**\n * Reads batches of one context without loading batches of other contexts.\n * @param id Delivery context id.\n * @param limit Maximum batches to return.\n * @returns Batches of this context, oldest first.\n */\n takeContext?(id: string, limit: number): Promise<LogBatch[]>;\n /**\n * Counts batches of one context without loading them.\n * @param id Delivery context id.\n * @returns Number of batches in this context.\n */\n countContext?(id: string): Promise<number>;\n\n /**\n * Removes a batch by ID. A call with an unknown ID resolves without error.\n * @param id Batch identifier.\n */\n remove(id: string): Promise<void>;\n\n /**\n * Updates the total delivery attempts for a batch.\n * @param id Batch identifier.\n * @param attempts Absolute attempt count.\n */\n bumpAttempts(id: string, attempts: number): Promise<void>;\n\n /**\n * Deletes expired and over-capacity batches.\n * @returns Prune summary metrics.\n */\n prune(): Promise<PruneResult>;\n\n /** Returns the total number of stored batches. */\n count(): Promise<number>;\n\n /** Deletes all batches in storage. */\n clear(): Promise<void>;\n\n /** Closes storage connections and releases resources. */\n close(): Promise<void>;\n}\n\n/** Capacity and retention thresholds enforced by a storage adapter. */\nexport interface StorageLimits {\n /** Maximum batch capacity before FIFO eviction. */\n maxBatches: number;\n /** Maximum time-to-live for a stored batch in milliseconds. */\n maxAgeMs: number;\n /** Maximum delivery attempts before dead-letter drop. */\n maxAttempts: number;\n}\n\n/**\n * Gives the storage limits of a retention setting. \"until-delivered\" has no age limit and no\n * attempt limit. The batch cap still applies.\n * @param retention Retention setting from the config.\n * @returns The limits for the storage adapters and the retry engine.\n */\nexport function storageLimits(retention: RetentionOptions): StorageLimits {\n const { maxBatches } = retention;\n\n if (retention.mode === \"until-delivered\") {\n return { maxBatches, maxAgeMs: Infinity, maxAttempts: Infinity };\n }\n\n return { maxBatches, maxAgeMs: retention.maxAgeMs, maxAttempts: retention.maxAttempts };\n}\n\n/** Metrics for batches and records dropped during storage pruning. */\nexport interface PruneResult {\n /** Total batches dropped. */\n batches: number;\n /** Total records dropped within evicted batches. */\n records: number;\n /**\n * Cause of the drop. If more than one rule applies, this is the last rule. \"not_stored\" means\n * that storage did not keep a batch after a failed send.\n */\n reason: \"expired\" | \"over_capacity\" | \"quota\" | \"not_stored\";\n}\n\n/**\n * Callback invoked when dropped records create a telemetry gap.\n * @param result Summary of evicted data.\n * @param dropped The dropped batches. A corrupt entry has no batch. The list then has none for it.\n */\nexport type GapReporter = (result: PruneResult, dropped: readonly LogBatch[]) => void;\n"],"mappings":"AA0FA,SAAgBA,EAAc,EAA4C,CACxE,GAAM,CAAE,cAAeC,EAMvB,OAJIA,EAAU,OAAS,kBACd,CAAE,aAAY,SAAU,IAAU,YAAa,GAAS,EAG1D,CAAE,aAAY,SAAUA,EAAU,SAAU,YAAaA,EAAU,WAAY,CACxF"}
1
+ {"version":3,"file":"storage-BA9RqRO-.cjs","names":["storageLimits","retention"],"sources":["../src/models/storage.ts"],"sourcesContent":["// src/models/storage.ts\n//\n// Storage interface for undelivered batches, with adapters for IndexedDB,\n// localStorage, memory, and a fallback that does nothing.\n\nimport type { LogBatch } from \"./batch\";\nimport type { RetentionOptions } from \"./config\";\n\n/**\n * State of the request for persistent storage. \"off\" means no request was made and \"pending\"\n * is waiting for the browser. \"unsupported\" means the browser has no\n * `navigator.storage.persist()`.\n */\nexport type StoragePersistence = \"off\" | \"pending\" | \"granted\" | \"denied\" | \"unsupported\";\n\n/** Persistent batch storage interface. All methods must resolve and never throw. */\nexport interface StorageAdapter {\n /** Adapter name. */\n readonly name: string;\n\n /**\n * Persists a batch to storage.\n * @param batch The batch to store.\n */\n save(batch: LogBatch): Promise<void>;\n\n /**\n * Reads up to `limit` batches in FIFO order without removing them.\n * @param limit Maximum number of batches to retrieve.\n * @returns Oldest persisted batches.\n */\n take(limit: number): Promise<LogBatch[]>;\n /**\n * Reads one context's batches without loading those of other contexts.\n * @param id Delivery context id.\n * @param limit Maximum batches to return.\n * @returns This context's batches, oldest first.\n */\n takeContext?(id: string, limit: number): Promise<LogBatch[]>;\n /**\n * Counts one context's batches without loading them.\n * @param id Delivery context id.\n * @returns Number of batches in this context.\n */\n countContext?(id: string): Promise<number>;\n\n /**\n * Removes a batch by ID. A call with an unknown ID resolves without error.\n * @param id Batch identifier.\n */\n remove(id: string): Promise<void>;\n\n /**\n * Updates the total delivery attempts for a batch.\n * @param id Batch identifier.\n * @param attempts Absolute attempt count.\n */\n bumpAttempts(id: string, attempts: number): Promise<void>;\n\n /**\n * Deletes expired and over-capacity batches.\n * @returns Prune summary metrics.\n */\n prune(): Promise<PruneResult>;\n\n /** Returns the total number of stored batches. */\n count(): Promise<number>;\n\n /** Deletes all batches in storage. */\n clear(): Promise<void>;\n\n /** Closes storage connections and releases resources. */\n close(): Promise<void>;\n}\n\n/** Capacity and retention thresholds enforced by a storage adapter. */\nexport interface StorageLimits {\n /** Maximum batch capacity before FIFO eviction. */\n maxBatches: number;\n /** Maximum time-to-live for a stored batch in milliseconds. */\n maxAgeMs: number;\n /** Maximum delivery attempts before dead-letter drop. */\n maxAttempts: number;\n}\n\n/**\n * Returns the storage limits for a retention setting. \"until-delivered\" has no age limit and\n * no attempt limit, but the batch cap still applies.\n * @param retention Retention setting from the config.\n * @returns The limits for the storage adapters and the retry engine.\n */\nexport function storageLimits(retention: RetentionOptions): StorageLimits {\n const { maxBatches } = retention;\n\n if (retention.mode === \"until-delivered\") {\n return { maxBatches, maxAgeMs: Infinity, maxAttempts: Infinity };\n }\n\n return { maxBatches, maxAgeMs: retention.maxAgeMs, maxAttempts: retention.maxAttempts };\n}\n\n/** Metrics for batches and records dropped during storage pruning. */\nexport interface PruneResult {\n /** Total batches dropped. */\n batches: number;\n /** Total records dropped within evicted batches. */\n records: number;\n /**\n * Cause of the drop. If more than one rule applied, this is the last one. \"not_stored\" means\n * storage did not keep a batch after a failed send.\n */\n reason: \"expired\" | \"over_capacity\" | \"quota\" | \"not_stored\";\n}\n\n/**\n * Callback invoked when dropped records create a telemetry gap.\n * @param result Summary of evicted data.\n * @param dropped The dropped batches. A corrupt entry has no batch, so the list omits it.\n */\nexport type GapReporter = (result: PruneResult, dropped: readonly LogBatch[]) => void;\n"],"mappings":"AA2FA,SAAgBA,EAAc,EAA4C,CACxE,GAAM,CAAE,cAAeC,EAMvB,OAJIA,EAAU,OAAS,kBACd,CAAE,aAAY,SAAU,IAAU,YAAa,GAAS,EAG1D,CAAE,aAAY,SAAUA,EAAU,SAAU,YAAaA,EAAU,WAAY,CACxF,C"}
@@ -1,4 +1,4 @@
1
- //#region src/models/storage.ts
1
+ // src/models/storage.ts
2
2
  function e(e) {
3
3
  let { maxBatches: t } = e;
4
4
  return e.mode === "until-delivered" ? {
@@ -11,7 +11,6 @@ function e(e) {
11
11
  maxAttempts: e.maxAttempts
12
12
  };
13
13
  }
14
- //#endregion
15
14
  export { e as storageLimits };
16
15
 
17
- //# sourceMappingURL=storage-w7Tslvlq.js.map
16
+ //# sourceMappingURL=storage-DZwed89z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-DZwed89z.js","names":["storageLimits","retention"],"sources":["../src/models/storage.ts"],"sourcesContent":["// src/models/storage.ts\n//\n// Storage interface for undelivered batches, with adapters for IndexedDB,\n// localStorage, memory, and a fallback that does nothing.\n\nimport type { LogBatch } from \"./batch\";\nimport type { RetentionOptions } from \"./config\";\n\n/**\n * State of the request for persistent storage. \"off\" means no request was made and \"pending\"\n * is waiting for the browser. \"unsupported\" means the browser has no\n * `navigator.storage.persist()`.\n */\nexport type StoragePersistence = \"off\" | \"pending\" | \"granted\" | \"denied\" | \"unsupported\";\n\n/** Persistent batch storage interface. All methods must resolve and never throw. */\nexport interface StorageAdapter {\n /** Adapter name. */\n readonly name: string;\n\n /**\n * Persists a batch to storage.\n * @param batch The batch to store.\n */\n save(batch: LogBatch): Promise<void>;\n\n /**\n * Reads up to `limit` batches in FIFO order without removing them.\n * @param limit Maximum number of batches to retrieve.\n * @returns Oldest persisted batches.\n */\n take(limit: number): Promise<LogBatch[]>;\n /**\n * Reads one context's batches without loading those of other contexts.\n * @param id Delivery context id.\n * @param limit Maximum batches to return.\n * @returns This context's batches, oldest first.\n */\n takeContext?(id: string, limit: number): Promise<LogBatch[]>;\n /**\n * Counts one context's batches without loading them.\n * @param id Delivery context id.\n * @returns Number of batches in this context.\n */\n countContext?(id: string): Promise<number>;\n\n /**\n * Removes a batch by ID. A call with an unknown ID resolves without error.\n * @param id Batch identifier.\n */\n remove(id: string): Promise<void>;\n\n /**\n * Updates the total delivery attempts for a batch.\n * @param id Batch identifier.\n * @param attempts Absolute attempt count.\n */\n bumpAttempts(id: string, attempts: number): Promise<void>;\n\n /**\n * Deletes expired and over-capacity batches.\n * @returns Prune summary metrics.\n */\n prune(): Promise<PruneResult>;\n\n /** Returns the total number of stored batches. */\n count(): Promise<number>;\n\n /** Deletes all batches in storage. */\n clear(): Promise<void>;\n\n /** Closes storage connections and releases resources. */\n close(): Promise<void>;\n}\n\n/** Capacity and retention thresholds enforced by a storage adapter. */\nexport interface StorageLimits {\n /** Maximum batch capacity before FIFO eviction. */\n maxBatches: number;\n /** Maximum time-to-live for a stored batch in milliseconds. */\n maxAgeMs: number;\n /** Maximum delivery attempts before dead-letter drop. */\n maxAttempts: number;\n}\n\n/**\n * Returns the storage limits for a retention setting. \"until-delivered\" has no age limit and\n * no attempt limit, but the batch cap still applies.\n * @param retention Retention setting from the config.\n * @returns The limits for the storage adapters and the retry engine.\n */\nexport function storageLimits(retention: RetentionOptions): StorageLimits {\n const { maxBatches } = retention;\n\n if (retention.mode === \"until-delivered\") {\n return { maxBatches, maxAgeMs: Infinity, maxAttempts: Infinity };\n }\n\n return { maxBatches, maxAgeMs: retention.maxAgeMs, maxAttempts: retention.maxAttempts };\n}\n\n/** Metrics for batches and records dropped during storage pruning. */\nexport interface PruneResult {\n /** Total batches dropped. */\n batches: number;\n /** Total records dropped within evicted batches. */\n records: number;\n /**\n * Cause of the drop. If more than one rule applied, this is the last one. \"not_stored\" means\n * storage did not keep a batch after a failed send.\n */\n reason: \"expired\" | \"over_capacity\" | \"quota\" | \"not_stored\";\n}\n\n/**\n * Callback invoked when dropped records create a telemetry gap.\n * @param result Summary of evicted data.\n * @param dropped The dropped batches. A corrupt entry has no batch, so the list omits it.\n */\nexport type GapReporter = (result: PruneResult, dropped: readonly LogBatch[]) => void;\n"],"mappings":";AA2FA,SAAgBA,EAAc,GAA4C;CACxE,IAAM,EAAE,kBAAeC;CAMvB,OAJIA,EAAU,SAAS,oBACd;EAAE;EAAY,UAAU;EAAU,aAAa;CAAS,IAG1D;EAAE;EAAY,UAAUA,EAAU;EAAU,aAAaA,EAAU;CAAY;AACxF"}
@@ -1,10 +1,9 @@
1
- import { nt as e } from "./constants-CU60FG4w.js";
2
- import { t } from "./fixed-window-CtaFHanJ.js";
3
- //#region src/capture/storm.ts
1
+ import { nt as e } from "./constants-Bwl_YtQi.js";
2
+ import { t } from "./fixed-window-Dq3MLUUv.js";
3
+ // src/capture/storm.ts
4
4
  function n(n, r, i, a, o = e) {
5
5
  return r === 0 || t(n, r, o) ? !0 : (i.report("capture.rate_limited", `More than ${String(r)} ${a} occurred in ${String(o)} ms. The library ignores the other ${a} in this window.`), !1);
6
6
  }
7
- //#endregion
8
7
  export { n as t };
9
8
 
10
- //# sourceMappingURL=storm-DD4cUkoL.js.map
9
+ //# sourceMappingURL=storm-BTSNTIWI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storm-BTSNTIWI.js","names":["ERROR_STORM_WINDOW_MS","allowInWindow","limit","countInWindow","window","windowMs","diagnostics","what"],"sources":["../src/capture/storm.ts"],"sourcesContent":["// src/capture/storm.ts\n//\n// Fixed-window rate limit for the capture modules. A render loop that throws or freezes\n// produces thousands of events a second, and sending them all would flood the ingest endpoint.\n\nimport { ERROR_STORM_WINDOW_MS } from \"../constants\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport { countInWindow, type StormWindow } from \"../utils/fixed-window\";\n\nexport type { StormWindow } from \"../utils/fixed-window\";\n\n/**\n * Counts one event in a fixed window and reports every event over the limit.\n * @param window Window state to update.\n * @param limit Maximum events per window.\n * @param diagnostics Diagnostics reporter.\n * @param what Plural name of the events, for the diagnostic message.\n * @param windowMs Rate limit window, in milliseconds.\n * @returns False when the window has no allowance left. The caller must drop the event.\n */\nexport function allowInWindow(\n window: StormWindow,\n limit: number,\n diagnostics: Diagnostics,\n what: string,\n windowMs = ERROR_STORM_WINDOW_MS,\n): boolean {\n if (limit === 0 || countInWindow(window, limit, windowMs)) {\n return true;\n }\n\n diagnostics.report(\n \"capture.rate_limited\",\n `More than ${String(limit)} ${what} occurred in ${String(windowMs)} ms. The library ignores the other ${what} in this window.`,\n );\n return false;\n}\n"],"mappings":";;;AAoBA,SAAgBC,EACd,GACA,GACA,GACA,GACA,IAAWD,GACF;CAST,OARIE,MAAU,KAAKC,EAAcC,GAAQF,GAAOG,CAAQ,IAC/C,MAGTC,EAAY,OACV,wBACA,aAAa,OAAOJ,CAAK,EAAE,GAAGK,EAAK,eAAe,OAAOF,CAAQ,EAAE,qCAAqCE,EAAK,iBAC/G,GACO;AACT"}
@@ -1,2 +1,2 @@
1
- const e=require("./constants-CL0ZdI2f.cjs"),t=require("./fixed-window-CvESpFYV.cjs");function n(n,r,i,a,o=e.nt){return r===0||t.t(n,r,o)?!0:(i.report(`capture.rate_limited`,`More than ${String(r)} ${a} occurred in ${String(o)} ms. The library ignores the other ${a} in this window.`),!1)}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
2
- //# sourceMappingURL=storm-DCEsqViG.cjs.map
1
+ const e=require("./constants-DakMxVB2.cjs"),t=require("./fixed-window-CvESpFYV.cjs");function n(n,r,i,a,o=e.nt){return r===0||t.t(n,r,o)?!0:(i.report(`capture.rate_limited`,`More than ${String(r)} ${a} occurred in ${String(o)} ms. The library ignores the other ${a} in this window.`),!1)}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
2
+ //# sourceMappingURL=storm-D0_qZOEg.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storm-D0_qZOEg.cjs","names":["ERROR_STORM_WINDOW_MS","countInWindow","require_constants","require_fixed_window","allowInWindow","limit","window","windowMs","diagnostics","what"],"sources":["../src/capture/storm.ts"],"sourcesContent":["// src/capture/storm.ts\n//\n// Fixed-window rate limit for the capture modules. A render loop that throws or freezes\n// produces thousands of events a second, and sending them all would flood the ingest endpoint.\n\nimport { ERROR_STORM_WINDOW_MS } from \"../constants\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport { countInWindow, type StormWindow } from \"../utils/fixed-window\";\n\nexport type { StormWindow } from \"../utils/fixed-window\";\n\n/**\n * Counts one event in a fixed window and reports every event over the limit.\n * @param window Window state to update.\n * @param limit Maximum events per window.\n * @param diagnostics Diagnostics reporter.\n * @param what Plural name of the events, for the diagnostic message.\n * @param windowMs Rate limit window, in milliseconds.\n * @returns False when the window has no allowance left. The caller must drop the event.\n */\nexport function allowInWindow(\n window: StormWindow,\n limit: number,\n diagnostics: Diagnostics,\n what: string,\n windowMs = ERROR_STORM_WINDOW_MS,\n): boolean {\n if (limit === 0 || countInWindow(window, limit, windowMs)) {\n return true;\n }\n\n diagnostics.report(\n \"capture.rate_limited\",\n `More than ${String(limit)} ${what} occurred in ${String(windowMs)} ms. The library ignores the other ${what} in this window.`,\n );\n return false;\n}\n"],"mappings":"A,qFAoBA,SAAgBI,EACd,EACA,EACA,EACA,EACA,EAAWJ,EAAAA,GACF,CAST,OARIK,IAAU,GAAKJ,EAAAA,EAAcK,EAAQD,EAAOE,CAAQ,EAC/C,IAGTC,EAAY,OACV,uBACA,aAAa,OAAOH,CAAK,EAAE,GAAGI,EAAK,eAAe,OAAOF,CAAQ,EAAE,qCAAqCE,EAAK,iBAC/G,EACO,GACT,C"}