@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,29 +1,31 @@
1
1
  import type { LogRecord } from "./log-record";
2
2
  /**
3
- * Cause of a loss.
4
- * - "buffer_full": a hold buffer before startup or before the sender loads is full.
5
- * - "expired", "over_capacity", "quota": storage removed stored batches. The reasons are
6
- * `retention.maxAgeMs`, `retention.maxBatches` and the storage quota of the browser.
3
+ * Why records were lost.
4
+ * - "security_context": the delivery identity changed. The old identity's undelivered records
5
+ * are removed unless the rotation keeps them, and so are records forwarded during the change.
6
+ * - "buffer_full": a hold buffer filled up before startup or before the sender loaded.
7
+ * - "expired", "over_capacity", "quota": storage removed stored batches because of
8
+ * `retention.maxAgeMs`, `retention.maxBatches` or the browser's storage quota.
7
9
  * - "max_attempts": a stored batch reached `retention.maxAttempts`.
8
10
  * - "rejected": the server refused the batch permanently, or one record is too large for it.
9
11
  * - "unserializable": the serializer threw on the batch.
10
- * - "exit_queue_full": the exit queue in localStorage is full. It drops its oldest batch.
11
- * - "load_failed": the delivery code did not load, or shutdown() came first. The held records are
12
- * lost.
13
- * - "not_stored": storage did not keep a batch after a failed send. The cause is a write error or
12
+ * - "exit_queue_full": the exit queue in localStorage is full, so it drops its oldest batch.
13
+ * - "load_failed": the delivery code failed to load, or shutdown() came first. The held records
14
+ * are lost.
15
+ * - "not_stored": storage did not keep a batch after a failed send, because of a write error or
14
16
  * `storage: "none"`.
15
17
  */
16
18
  export type LossReason = "security_context" | "buffer_full" | "expired" | "over_capacity" | "quota" | "max_attempts" | "rejected" | "unserializable" | "exit_queue_full" | "load_failed" | "not_stored";
17
19
  /**
18
- * One report of lost records. The library joins the losses of one reason in one task.
19
- * Each list holds at most 20 different values.
20
+ * One report of lost records. Losses with the same reason in the same task are merged into one
21
+ * report. Each list holds at most 20 distinct values.
20
22
  */
21
23
  export interface DropSummary {
22
24
  /** Cause of the loss. */
23
25
  reason: LossReason;
24
26
  /** Number of lost records. */
25
27
  records: number;
26
- /** Ids of the lost batches. A hold buffer loses records, not batches. Its list is empty. */
28
+ /** Ids of the lost batches. Empty for a hold buffer, which loses records, not batches. */
27
29
  batchIds: string[];
28
30
  /** Journey ids of the lost records. */
29
31
  journeyIds: string[];
@@ -2,7 +2,7 @@ import type { DeliveryStats } from "./stats";
2
2
  import type { BusOptions, LoggerCacheOptions, SecurityContextOptions } from "./config";
3
3
  import type { LogRecord } from "./log-record";
4
4
  import type { StoragePersistence } from "./storage";
5
- /** State of this SDK copy. A configured console-only runtime can have the status "ready". */
5
+ /** State of this SDK copy. A configured console-only runtime can report the status "ready". */
6
6
  export interface ObservabilityHealth extends DeliveryStats {
7
7
  /** Version of this SDK copy. */
8
8
  sdkVersion: string;
@@ -16,7 +16,7 @@ export interface ObservabilityHealth extends DeliveryStats {
16
16
  senderReady: boolean;
17
17
  /** True if configure() cannot change the current settings. */
18
18
  configurationLocked: boolean;
19
- /** Codes of the current runtime or context failures. */
19
+ /** Codes for the current runtime or context failures. */
20
20
  issues: ("runtime.version_mismatch" | "sender.unavailable" | "security.context_mismatch")[];
21
21
  /** Logger cache capacity and the number of cached loggers. */
22
22
  loggerCache: LoggerCacheOptions & {
@@ -24,29 +24,29 @@ export interface ObservabilityHealth extends DeliveryStats {
24
24
  };
25
25
  /** Active delivery context id and isolation rule. */
26
26
  securityContext: SecurityContextOptions;
27
- /** State of the request of `persistence.requestPersistent`. */
27
+ /** State of the `persistence.requestPersistent` request. */
28
28
  storagePersistence: StoragePersistence;
29
- /** Source, validation and capacity rules of the bus. */
29
+ /** The bus's source, validation and capacity rules. */
30
30
  bus: Pick<BusOptions, "sourcePolicy" | "validation" | "maxMessageBytes" | "maxRecordsPerMessage" | "maxMessagesPerSecond" | "maxTrackedSources">;
31
31
  }
32
- /** State of the library for a support ticket. Each field is JSON-safe. */
32
+ /** Library state for a support ticket. Every field is JSON-safe. */
33
33
  export interface DebugBundle {
34
- /** Time of the bundle, as an ISO 8601 string. */
34
+ /** When the bundle was created, as an ISO 8601 string. */
35
35
  createdAt: string;
36
36
  /** Version of this SDK copy. */
37
37
  sdkVersion: string;
38
- /** Health snapshot, as getHealth() gives it. */
38
+ /** Health snapshot, as returned by getHealth(). */
39
39
  health: ObservabilityHealth;
40
- /** Number of reports of each diagnostic code since startup. */
40
+ /** How many times each diagnostic code was reported since startup. */
41
41
  diagnostics: Record<string, number>;
42
- /** Resource attributes of this context, for example service.name and session.id. */
42
+ /** This context's resource attributes, for example service.name and session.id. */
43
43
  resource: Record<string, unknown>;
44
- /** Page URL, with the rules of the page.url attribute. */
44
+ /** Page URL, under the same rules as the page.url attribute. */
45
45
  pageUrl: string;
46
- /** Recent breadcrumbs. The processors and redact processed them. */
46
+ /** Recent breadcrumbs, after the processors and redact have run on them. */
47
47
  breadcrumbs: unknown[];
48
- /** Records that the debug buffer keeps now. */
48
+ /** Records currently in the debug buffer. */
49
49
  debugBuffer: LogRecord[];
50
- /** Resolved config without headers. Endpoints have no query. A function shows only its name. */
50
+ /** Resolved config without headers. Endpoints lose their query. Functions show only a name. */
51
51
  config: Record<string, unknown>;
52
52
  }
@@ -1,9 +1,9 @@
1
1
  /** OpenTelemetry severity levels, in ascending order. */
2
2
  export type LogLevel = "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL";
3
3
  /**
4
- * Kind of thing that a record tells about. `action` is something that a person did.
5
- * `event` is something that the application did. `metric` is a measurement.
6
- * `log` is a log call of the application. `system` is the output of this library.
4
+ * What a record is about. `action` is something a person did, `event` is something the
5
+ * application did, and `metric` is a measurement. `log` is an application log call,
6
+ * `system` is this library's own output and `span` is one span of a trace.
7
7
  */
8
8
  export type LogType = "action" | "event" | "metric" | "log" | "system" | "span";
9
9
  /** Metric value type: level, running total, or distribution. */
@@ -16,8 +16,8 @@ export interface LogRecord {
16
16
  */
17
17
  timeUnixNano: string;
18
18
  /**
19
- * Time when this library received the event, if it differs from `timeUnixNano`.
20
- * For example, a forwarded record can have a different time.
19
+ * When this library received the event, if that differs from `timeUnixNano`. A forwarded
20
+ * record, for example, can have a different time.
21
21
  */
22
22
  observedTimeUnixNano?: string;
23
23
  /** Distributed trace id. */
@@ -38,24 +38,23 @@ export interface LogRecord {
38
38
  resource: Record<string, unknown>;
39
39
  }
40
40
  /**
41
- * Returns the current time as a Unix nanosecond timestamp.
42
- * The function appends zeros and does not multiply. `Date.now() * 1e6` is larger
43
- * than `Number.MAX_SAFE_INTEGER` and corrupts digits without an error. The trailing
44
- * zeros show unknown precision. They are not measured digits.
41
+ * Returns the current time as a Unix nanosecond timestamp. Appends zeros instead of
42
+ * multiplying, because `Date.now() * 1e6` exceeds `Number.MAX_SAFE_INTEGER` and corrupts
43
+ * digits without an error. The trailing zeros mean unknown precision, not measured digits.
45
44
  * @returns Epoch timestamp in nanoseconds, as a decimal string.
46
45
  */
47
46
  export declare function nowUnixNano(): string;
48
47
  /**
49
- * Checks if a value is a known log level. An own-key check rejects "toString".
48
+ * Checks whether a value is a known log level. The own-key check rejects "toString".
50
49
  * @param value The value to check.
51
50
  * @returns True if `value` is a key of the severity table.
52
51
  */
53
52
  export declare function isLogLevel(value: unknown): value is LogLevel;
54
53
  /**
55
- * Checks if a value has the shape `LogRecord` requires.
56
- * Use it to validate records from another realm. A malformed record throws
57
- * during serialization. The check accepts any string as `severityText`, not only
58
- * a known level. Thus an unknown level from a newer version passes.
54
+ * Checks whether a value has the shape `LogRecord` requires. Use it to validate records from
55
+ * another realm, because a malformed record throws during serialization. Any string is
56
+ * accepted as `severityText`, not only a known level, so an unknown level from a newer
57
+ * version still passes.
59
58
  * @param value The value to check.
60
59
  * @returns True if `value` has the shape `LogRecord` requires.
61
60
  */
@@ -1,6 +1,6 @@
1
- /** Attribute set of a metric point. Keep it small. Each set is one series in the backend. */
1
+ /** Attribute set of a metric point. Keep it small, because every set is a series in the backend. */
2
2
  export type MetricAttributes = Record<string, string | number | boolean>;
3
- /** Options of an instrument. */
3
+ /** Instrument options. */
4
4
  export interface InstrumentOptions {
5
5
  /**
6
6
  * Unit of the values, for example "ms" or "By".
@@ -8,38 +8,38 @@ export interface InstrumentOptions {
8
8
  */
9
9
  unit?: string;
10
10
  }
11
- /** Options of a histogram. */
11
+ /** Histogram options. */
12
12
  export interface HistogramOptions extends InstrumentOptions {
13
13
  /**
14
14
  * Ascending bucket boundaries, at most 50. A value goes into the first bucket whose boundary
15
- * is equal to or larger than the value.
15
+ * is greater than or equal to it.
16
16
  * @default [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000]
17
17
  */
18
18
  boundaries?: readonly number[];
19
19
  }
20
- /** Counter that sums its values in memory. The library sends one point at each interval. */
20
+ /** Counter that sums its values in memory. The library sends one point every interval. */
21
21
  export interface Counter {
22
22
  /**
23
- * Adds a value to the sum of an attribute set.
23
+ * Adds a value to an attribute set's sum.
24
24
  * @param value Finite number, 0 or larger.
25
- * @param attributes Attribute set of the point.
25
+ * @param attributes The point's attribute set.
26
26
  */
27
27
  add(value: number, attributes?: MetricAttributes): void;
28
28
  }
29
- /** Histogram that counts its values in buckets in memory. It sends one point at each interval. */
29
+ /** Histogram that counts its values into buckets in memory. Sends one point every interval. */
30
30
  export interface Histogram {
31
31
  /**
32
- * Adds a value to the buckets of an attribute set.
32
+ * Adds a value to an attribute set's buckets.
33
33
  * @param value Finite number.
34
- * @param attributes Attribute set of the point.
34
+ * @param attributes The point's attribute set.
35
35
  */
36
36
  record(value: number, attributes?: MetricAttributes): void;
37
37
  }
38
- /** Handle of one timed operation. */
38
+ /** Handle for one timed operation. */
39
39
  export interface Measure {
40
40
  /**
41
- * Closes the open phase and starts the next phase. A call after `end()` does nothing.
42
- * @param name Phase name. Each name makes one series.
41
+ * Closes the open phase and starts the next one. Does nothing after `end()`.
42
+ * @param name Phase name. Every name creates its own series.
43
43
  */
44
44
  phase(name: string): void;
45
45
  /**
@@ -48,16 +48,81 @@ export interface Measure {
48
48
  */
49
49
  end(outcome?: string): void;
50
50
  }
51
- /** Kind of an instrument. */
51
+ /** Probe options. */
52
+ export interface ProbeOptions {
53
+ /**
54
+ * Record one span out of every `sampleEvery`. An integer from 1 to 2147483647.
55
+ * @default 1
56
+ */
57
+ sampleEvery?: number;
58
+ /**
59
+ * A span that runs longer than this many milliseconds leaves a breadcrumb. Must be a finite
60
+ * number, 0 or more. Unset by default, which means no breadcrumbs.
61
+ */
62
+ slowMs?: number;
63
+ /**
64
+ * Set to true when an `await` splits the probe's spans. Those spans report total time only:
65
+ * they have no self time, and they don't eat into the self time of other spans.
66
+ * @default false
67
+ */
68
+ async?: boolean;
69
+ }
70
+ /**
71
+ * Times one span of app code. Every member is a function property rather than a method, so you
72
+ * can destructure them and unbound-method lint rules stay quiet.
73
+ */
74
+ export interface Probe {
75
+ /**
76
+ * Starts a span.
77
+ * @returns A token to pass to `end()`, or -1 if the profiler isn't measuring this span.
78
+ */
79
+ begin: () => number;
80
+ /**
81
+ * Ends a span.
82
+ * @param token The token `begin()` returned.
83
+ */
84
+ end: (token: number) => void;
85
+ /**
86
+ * Ends a span after the page's next paint, so the duration includes style, layout and paint.
87
+ * Where there is no frame callback, or the page is hidden, the span ends right away.
88
+ * @param token The token `begin()` returned.
89
+ */
90
+ endAfterPaint: (token: number) => void;
91
+ /**
92
+ * Adds a duration you measured some other way.
93
+ * @param durationMs Duration in milliseconds. A finite number, 0 or larger.
94
+ */
95
+ record: (durationMs: number) => void;
96
+ }
97
+ /** Creates the app's probes. `probe` is a function property, so destructuring it works. */
98
+ export interface Profiler {
99
+ /**
100
+ * Returns the probe for a name. The same name always gives the same probe, and only the
101
+ * options from the first call count.
102
+ * @param name Probe name. A non-empty string.
103
+ * @param options Probe options.
104
+ * @returns The probe.
105
+ */
106
+ probe: (name: string, options?: ProbeOptions) => Probe;
107
+ /**
108
+ * Calls a function and times it with the named probe. If the result has a `then` function,
109
+ * the span ends when it settles. Errors from the function go to the caller.
110
+ * @param name Probe name. A non-empty string.
111
+ * @param fn The function to call.
112
+ * @returns Whatever `fn` returned, or the result of its `then` call.
113
+ */
114
+ time: <T>(name: string, fn: () => T) => T;
115
+ }
116
+ /** Instrument kind. */
52
117
  export type InstrumentKind = "counter" | "histogram";
53
- /** Definition of an instrument. A handle gives it to the meter at each call. */
118
+ /** Instrument definition. A handle passes it to the meter on every call. */
54
119
  export interface InstrumentDef {
55
120
  /** Metric name. */
56
121
  name: string;
57
- /** Kind of the instrument. */
122
+ /** Instrument kind. */
58
123
  kind: InstrumentKind;
59
124
  /** Unit of the values. */
60
125
  unit: string;
61
- /** Bucket boundaries of a histogram. A counter has none. */
126
+ /** A histogram's bucket boundaries. A counter has none. */
62
127
  boundaries: readonly number[];
63
128
  }
@@ -1,47 +1,47 @@
1
1
  import type { OneLogger } from "../core/logger";
2
2
  import type { Counter, Histogram, HistogramOptions, InstrumentOptions } from "./metric";
3
- /** Tools that the library gives to a capture plugin. */
3
+ /** Tools the library hands to a capture plugin. */
4
4
  export interface PluginContext {
5
- /** Logger for the namespace `uiobs.capture.<plugin name>`. */
5
+ /** Logger for the `uiobs.capture.<plugin name>` namespace. */
6
6
  logger: OneLogger;
7
7
  /**
8
- * Gives a counter. It is the same as `counter()`.
8
+ * Returns a counter. Same as `counter()`.
9
9
  * @param name Metric name.
10
10
  * @param options Unit of the values.
11
11
  * @returns The counter.
12
12
  */
13
13
  counter(name: string, options?: InstrumentOptions): Counter;
14
14
  /**
15
- * Gives a histogram. It is the same as `histogram()`.
15
+ * Returns a histogram. Same as `histogram()`.
16
16
  * @param name Metric name.
17
17
  * @param options Unit of the values and the bucket boundaries.
18
18
  * @returns The histogram.
19
19
  */
20
20
  histogram(name: string, options?: HistogramOptions): Histogram;
21
21
  /**
22
- * Adds a breadcrumb with the category `custom`. It is the same as `addBreadcrumb()`.
22
+ * Adds a breadcrumb with the category `custom`. Same as `addBreadcrumb()`.
23
23
  * @param message Description of the event.
24
24
  * @param data Optional metadata.
25
25
  */
26
26
  addBreadcrumb(message: string, data?: Record<string, unknown>): void;
27
27
  /**
28
- * Runs a function. The network capture does not record a request that the function starts
29
- * synchronously, and does not add `traceparent` to it. Use it for the requests of the plugin.
28
+ * Runs a function. The network capture doesn't record any request the function starts
29
+ * synchronously, and doesn't add `traceparent` to it. Use it for the plugin's own requests.
30
30
  * @param fn Function that starts the request.
31
- * @returns The return value of the function.
31
+ * @returns The function's return value.
32
32
  */
33
33
  ownRequest<T>(fn: () => T): T;
34
34
  }
35
- /** Capture module from the app. The library installs it with the built-in capture modules. */
35
+ /** Capture module supplied by the app. The library installs it alongside the built-in ones. */
36
36
  export interface CapturePlugin {
37
- /** Name of the plugin. Its logger namespace and its diagnostic messages use it. */
37
+ /** Plugin name, used in its logger namespace and its diagnostic messages. */
38
38
  readonly name: string;
39
39
  /**
40
40
  * Starts the capture. A later `configure()` that changes the capture section calls
41
- * `uninstall()`, then calls `install()` again.
42
- * @param ctx Tools of the plugin.
41
+ * `uninstall()` and then `install()` again.
42
+ * @param ctx The plugin's tools.
43
43
  */
44
44
  install(ctx: PluginContext): void;
45
- /** Stops the capture. Restore each function that the plugin replaced. */
45
+ /** Stops the capture. Restore every function the plugin replaced. */
46
46
  uninstall(): void;
47
47
  }
@@ -0,0 +1,60 @@
1
+ /** A recorder event. The library only looks at the type. */
2
+ export interface ReplayEvent {
3
+ /** The recorder's event type. 4 is the meta event that starts a full snapshot. */
4
+ type: number;
5
+ }
6
+ /** The parts of the `record` function from `@rrweb/record` that the library uses. */
7
+ export interface ReplayRecord {
8
+ /**
9
+ * Starts the recorder.
10
+ * @param options Recorder options.
11
+ * @returns A function that stops the recorder, or undefined.
12
+ */
13
+ (options: Record<string, unknown>): (() => void) | undefined;
14
+ /** Takes a full snapshot right now. Not every recorder version has it. */
15
+ takeFullSnapshot?: (isCheckout?: boolean) => void;
16
+ /** Looks up the DOM node for a recorder node id. Not every recorder version has it. */
17
+ mirror?: {
18
+ getNode: (id: number) => unknown;
19
+ };
20
+ }
21
+ /** Loads the recorder package. The app owns the import, e.g. `import("@rrweb/record")`. */
22
+ export type ReplayLoader = () => Promise<{
23
+ record: ReplayRecord;
24
+ }>;
25
+ /** What the library passes to a plugin loader. */
26
+ export interface ReplayPluginTools {
27
+ /**
28
+ * A ready-made `transformRequestFn` for the recorder's network plugin. It skips requests to
29
+ * any URL in `capture.ignoreUrls`, which includes every library endpoint and the replay
30
+ * endpoint. It also strips the query and fragment from URLs unless `capture.fullUrls` is set.
31
+ * @param request The network plugin's request.
32
+ * @returns The request to record, or undefined to skip it.
33
+ */
34
+ transformRequest: <T extends {
35
+ name: string;
36
+ }>(request: T) => T | undefined;
37
+ }
38
+ /** Creates one of the recorder's record plugins. The app owns the import of the plugin package. */
39
+ export type ReplayPluginLoader = (tools: ReplayPluginTools) => unknown;
40
+ /** One chunk of a replay upload. */
41
+ export interface ReplaySegment {
42
+ /** Recording id. Every recorder start gets a new one. */
43
+ "replay.id": string;
44
+ /** Session id from the record that triggered the upload. */
45
+ "session.id": string;
46
+ /** Tab id from the record that triggered the upload. */
47
+ "tab.id": string;
48
+ /** The runtime's service name. */
49
+ "service.name": string;
50
+ /** Position of the segment within its recording, starting at 0. */
51
+ sequence: number;
52
+ /** Number of events in the segment. */
53
+ events: number;
54
+ /** Length of the payload. */
55
+ bytes: number;
56
+ /** The event list as JSON text. */
57
+ payload: string;
58
+ }
59
+ /** What triggers an upload. `onError` uploads after an ERROR or FATAL record. */
60
+ export type ReplayMode = "onError";
@@ -14,9 +14,8 @@ export interface LogSerializer {
14
14
  /** Serializer name used in configuration. */
15
15
  name: string;
16
16
  /**
17
- * Serializes a batch of records to payload bytes.
18
- * The transport calls it one time for each delivery attempt, not one time for each batch.
19
- * Thus each retry encodes the records again.
17
+ * Serializes a batch of records to payload bytes. The transport calls it once per delivery
18
+ * attempt, not once per batch, so every retry encodes the records again.
20
19
  * @param records Batch records, in log order.
21
20
  * @returns Serialized batch ready for transport.
22
21
  */
@@ -1,10 +1,10 @@
1
1
  /** Delivery state of this context. A forwarder reports only its own buffers. */
2
2
  export interface DeliveryStats {
3
- /** Records in a buffer of the library. No request carries them yet. */
3
+ /** Records in one of the library's buffers, not yet in any request. */
4
4
  pending: number;
5
5
  /** Records in requests that have not completed. */
6
6
  inFlight: number;
7
- /** Batches in storage that wait for a retry. */
7
+ /** Batches in storage waiting for a retry. */
8
8
  stored: number;
9
9
  /** Epoch time in milliseconds when the server last accepted a batch, or null. */
10
10
  lastSendAt: number | null;
@@ -1,13 +1,14 @@
1
1
  import type { LogBatch } from "./batch";
2
2
  import type { RetentionOptions } from "./config";
3
3
  /**
4
- * State of the request for persistent storage. "off" means no request. "pending" waits for the
5
- * browser. "unsupported" means the browser has no `navigator.storage.persist()`.
4
+ * State of the request for persistent storage. "off" means no request was made and "pending"
5
+ * is waiting for the browser. "unsupported" means the browser has no
6
+ * `navigator.storage.persist()`.
6
7
  */
7
8
  export type StoragePersistence = "off" | "pending" | "granted" | "denied" | "unsupported";
8
9
  /** Persistent batch storage interface. All methods must resolve and never throw. */
9
10
  export interface StorageAdapter {
10
- /** Adapter identifier name. */
11
+ /** Adapter name. */
11
12
  readonly name: string;
12
13
  /**
13
14
  * Persists a batch to storage.
@@ -21,14 +22,14 @@ export interface StorageAdapter {
21
22
  */
22
23
  take(limit: number): Promise<LogBatch[]>;
23
24
  /**
24
- * Reads batches of one context without loading batches of other contexts.
25
+ * Reads one context's batches without loading those of other contexts.
25
26
  * @param id Delivery context id.
26
27
  * @param limit Maximum batches to return.
27
- * @returns Batches of this context, oldest first.
28
+ * @returns This context's batches, oldest first.
28
29
  */
29
30
  takeContext?(id: string, limit: number): Promise<LogBatch[]>;
30
31
  /**
31
- * Counts batches of one context without loading them.
32
+ * Counts one context's batches without loading them.
32
33
  * @param id Delivery context id.
33
34
  * @returns Number of batches in this context.
34
35
  */
@@ -66,8 +67,8 @@ export interface StorageLimits {
66
67
  maxAttempts: number;
67
68
  }
68
69
  /**
69
- * Gives the storage limits of a retention setting. "until-delivered" has no age limit and no
70
- * attempt limit. The batch cap still applies.
70
+ * Returns the storage limits for a retention setting. "until-delivered" has no age limit and
71
+ * no attempt limit, but the batch cap still applies.
71
72
  * @param retention Retention setting from the config.
72
73
  * @returns The limits for the storage adapters and the retry engine.
73
74
  */
@@ -79,14 +80,14 @@ export interface PruneResult {
79
80
  /** Total records dropped within evicted batches. */
80
81
  records: number;
81
82
  /**
82
- * Cause of the drop. If more than one rule applies, this is the last rule. "not_stored" means
83
- * that storage did not keep a batch after a failed send.
83
+ * Cause of the drop. If more than one rule applied, this is the last one. "not_stored" means
84
+ * storage did not keep a batch after a failed send.
84
85
  */
85
86
  reason: "expired" | "over_capacity" | "quota" | "not_stored";
86
87
  }
87
88
  /**
88
89
  * Callback invoked when dropped records create a telemetry gap.
89
90
  * @param result Summary of evicted data.
90
- * @param dropped The dropped batches. A corrupt entry has no batch. The list then has none for it.
91
+ * @param dropped The dropped batches. A corrupt entry has no batch, so the list omits it.
91
92
  */
92
93
  export type GapReporter = (result: PruneResult, dropped: readonly LogBatch[]) => void;