@utk09/ui-observability 0.11.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.
- package/CHANGELOG.md +61 -0
- package/README.md +273 -102
- package/bin/uiobs.mjs +1 -1
- package/dist/{batch-CL9uWYY3.js → batch-BjQUwjA6.js} +4 -4
- package/dist/batch-BjQUwjA6.js.map +1 -0
- package/dist/{batch-C8OcWR2L.cjs → batch-D5LlU4Q9.cjs} +2 -2
- package/dist/batch-D5LlU4Q9.cjs.map +1 -0
- package/dist/bus/bus.d.ts +48 -47
- package/dist/bus/links.d.ts +4 -4
- package/dist/bus/validation.d.ts +1 -1
- package/dist/bus-D_7pd7RN.cjs +2 -0
- package/dist/bus-D_7pd7RN.cjs.map +1 -0
- package/dist/{bus-BZ0GldpT.js → bus-ecxUNTja.js} +91 -91
- package/dist/bus-ecxUNTja.js.map +1 -0
- package/dist/capture/console.d.ts +10 -10
- package/dist/capture/errors.d.ts +6 -6
- package/dist/capture/interactions.d.ts +14 -14
- package/dist/capture/lifecycle.d.ts +3 -3
- package/dist/capture/long-frames.d.ts +6 -6
- package/dist/capture/network.d.ts +17 -17
- package/dist/capture/profiler-frames.d.ts +44 -0
- package/dist/capture/replay-buffer.d.ts +46 -0
- package/dist/capture/replay-upload.d.ts +74 -0
- package/dist/capture/replay.d.ts +114 -0
- package/dist/capture/reports.d.ts +2 -2
- package/dist/capture/resource-timing.d.ts +1 -1
- package/dist/capture/server-timing.d.ts +3 -3
- package/dist/capture/storm.d.ts +3 -3
- package/dist/capture/types.d.ts +45 -33
- package/dist/capture/unclean-exit.d.ts +8 -8
- package/dist/capture/user-timing.d.ts +3 -3
- package/dist/capture/web-socket.d.ts +11 -11
- package/dist/capture/web-vitals.d.ts +20 -7
- package/dist/compression-AJJCMBOa.js +11 -0
- package/dist/compression-AJJCMBOa.js.map +1 -0
- package/dist/compression-lD9abCcO.cjs +2 -0
- package/dist/compression-lD9abCcO.cjs.map +1 -0
- package/dist/{console-BPZCuSLc.cjs → console-CLz_PvFn.cjs} +2 -2
- package/dist/console-CLz_PvFn.cjs.map +1 -0
- package/dist/{console-BeCF7n59.js → console-cwgHKXvM.js} +4 -4
- package/dist/console-cwgHKXvM.js.map +1 -0
- package/dist/constants-Bwl_YtQi.js +349 -0
- package/dist/constants-Bwl_YtQi.js.map +1 -0
- package/dist/constants-DakMxVB2.cjs +2 -0
- package/dist/constants-DakMxVB2.cjs.map +1 -0
- package/dist/constants.d.ts +150 -103
- package/dist/context-storage-BjzeBSxH.cjs.map +1 -1
- package/dist/context-storage-BzkoHzkQ.js.map +1 -1
- package/dist/core/breadcrumbs.d.ts +16 -15
- package/dist/core/config.d.ts +3 -3
- package/dist/core/context.d.ts +7 -7
- package/dist/core/debug-buffer.d.ts +10 -10
- package/dist/core/debug-bundle.d.ts +3 -3
- package/dist/core/deferred.d.ts +2 -2
- package/dist/core/diagnostics.d.ts +24 -21
- package/dist/core/drops.d.ts +7 -7
- package/dist/core/hold-buffer.d.ts +1 -1
- package/dist/core/journey.d.ts +22 -23
- package/dist/core/logger.d.ts +22 -21
- package/dist/core/measure.d.ts +7 -7
- package/dist/core/meter.d.ts +25 -21
- package/dist/core/pipeline.d.ts +42 -41
- package/dist/core/profile-buckets.d.ts +31 -0
- package/dist/core/profiler.d.ts +218 -0
- package/dist/core/record.d.ts +23 -23
- package/dist/core/remote-rules.d.ts +4 -4
- package/dist/core/remote-sampling.d.ts +21 -20
- package/dist/core/runtime.d.ts +206 -137
- package/dist/core/sampling.d.ts +18 -18
- package/dist/core/sender.d.ts +22 -20
- package/dist/core/spans.d.ts +5 -5
- package/dist/{deadline-BOjOxNHj.js → deadline-C4ccAuk5.js} +3 -6
- package/dist/deadline-C4ccAuk5.js.map +1 -0
- package/dist/deadline-CUGbto-y.cjs +2 -0
- package/dist/deadline-CUGbto-y.cjs.map +1 -0
- package/dist/{debug-bundle-C7UkHZ-q.js → debug-bundle-BOdYmCeV.js} +10 -3
- package/dist/debug-bundle-BOdYmCeV.js.map +1 -0
- package/dist/debug-bundle-Ex4L_LSP.cjs +2 -0
- package/dist/debug-bundle-Ex4L_LSP.cjs.map +1 -0
- package/dist/doctor.cjs +1 -1
- package/dist/doctor.cjs.map +1 -1
- package/dist/doctor.d.ts +16 -6
- package/dist/doctor.js +147 -52
- package/dist/doctor.js.map +1 -1
- package/dist/{emergency-queue-Zy6lNafo.js → emergency-queue-B9WZxanZ.js} +4 -4
- package/dist/emergency-queue-B9WZxanZ.js.map +1 -0
- package/dist/{emergency-queue-CNTRui5t.cjs → emergency-queue-HBpL5r3V.cjs} +2 -2
- package/dist/emergency-queue-HBpL5r3V.cjs.map +1 -0
- package/dist/error-like-B11pB4aL.js.map +1 -1
- package/dist/error-like-gGRx2s36.cjs.map +1 -1
- package/dist/{errors-Dh7kef0i.js → errors-D6bwgJtO.js} +3 -3
- package/dist/errors-D6bwgJtO.js.map +1 -0
- package/dist/{errors-tfEr48bS.cjs → errors-DCOCRdSi.cjs} +2 -2
- package/dist/errors-DCOCRdSi.cjs.map +1 -0
- package/dist/{factory-CJXVYp0R.cjs → factory-DLFDjdLv.cjs} +2 -2
- package/dist/factory-DLFDjdLv.cjs.map +1 -0
- package/dist/{factory-BonqI3NL.js → factory-e9Qo3K0z.js} +13 -13
- package/dist/factory-e9Qo3K0z.js.map +1 -0
- package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
- package/dist/fixed-window-Dq3MLUUv.js.map +1 -1
- package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
- package/dist/global-scope-D9I8s-oN.js.map +1 -1
- package/dist/guards-Cidk71ME.js.map +1 -1
- package/dist/guards-nJ70syPt.cjs.map +1 -1
- package/dist/{identity-Cxgj6pZX.cjs → identity-BlvlgjrU.cjs} +2 -2
- package/dist/identity-BlvlgjrU.cjs.map +1 -0
- package/dist/{identity-DT5VmvXy.js → identity-BrQp_5J5.js} +19 -19
- package/dist/identity-BrQp_5J5.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +112 -79
- package/dist/index.js +783 -635
- package/dist/index.js.map +1 -1
- package/dist/{indexeddb-storage-CIoW21Xd.cjs → indexeddb-storage-CtLvZH1r.cjs} +2 -2
- package/dist/indexeddb-storage-CtLvZH1r.cjs.map +1 -0
- package/dist/{indexeddb-storage-BJVtiQKm.js → indexeddb-storage-DLXQzAGh.js} +4 -4
- package/dist/indexeddb-storage-DLXQzAGh.js.map +1 -0
- package/dist/{interactions-DTgKy_6K.js → interactions-B6z2I4tU.js} +3 -3
- package/dist/interactions-B6z2I4tU.js.map +1 -0
- package/dist/{interactions-fEN6FbVo.cjs → interactions-P6pz08Jn.cjs} +2 -2
- package/dist/interactions-P6pz08Jn.cjs.map +1 -0
- package/dist/{journey-CuJrHzEg.js → journey-35yCMNFo.js} +20 -19
- package/dist/journey-35yCMNFo.js.map +1 -0
- package/dist/journey-DAGh5h9k.cjs +2 -0
- package/dist/journey-DAGh5h9k.cjs.map +1 -0
- package/dist/keys-BHhw_0Wh.cjs.map +1 -1
- package/dist/keys-BU9j5YqW.js.map +1 -1
- package/dist/{library-console-D2GY9Or6.cjs → library-console-BFWEuQsl.cjs} +2 -2
- package/dist/library-console-BFWEuQsl.cjs.map +1 -0
- package/dist/{library-console-C1m6g1BR.js → library-console-Dl_Ly6DQ.js} +2 -2
- package/dist/library-console-Dl_Ly6DQ.js.map +1 -0
- package/dist/{library-request-1BX_UlaX.cjs → library-request-Da-CHKzT.cjs} +2 -2
- package/dist/library-request-Da-CHKzT.cjs.map +1 -0
- package/dist/{library-request-BQBT9N9Q.js → library-request-nI6pvI6I.js} +2 -2
- package/dist/library-request-nI6pvI6I.js.map +1 -0
- package/dist/{lifecycle-2EtUaRpo.cjs → lifecycle-BGGOcN4N.cjs} +2 -2
- package/dist/lifecycle-BGGOcN4N.cjs.map +1 -0
- package/dist/{lifecycle-BaKx_-32.js → lifecycle-CZ6RRXc6.js} +2 -2
- package/dist/lifecycle-CZ6RRXc6.js.map +1 -0
- package/dist/{log-record-i9zOTkpQ.cjs → log-record-D7bA1RPb.cjs} +2 -2
- package/dist/log-record-D7bA1RPb.cjs.map +1 -0
- package/dist/{log-record-CAoGBBf3.js → log-record-DIA6McNr.js} +2 -2
- package/dist/log-record-DIA6McNr.js.map +1 -0
- package/dist/{long-frames-Czk7IupC.js → long-frames-430_85Da.js} +8 -6
- package/dist/long-frames-430_85Da.js.map +1 -0
- package/dist/long-frames-Dd8tsi2U.cjs +2 -0
- package/dist/long-frames-Dd8tsi2U.cjs.map +1 -0
- package/dist/models/batch.d.ts +14 -15
- package/dist/models/bus.d.ts +24 -24
- package/dist/models/config.d.ts +402 -216
- package/dist/models/drop.d.ts +13 -11
- package/dist/models/health.d.ts +13 -13
- package/dist/models/log-record.d.ts +13 -14
- package/dist/models/metric.d.ts +82 -17
- package/dist/models/plugin.d.ts +13 -13
- package/dist/models/replay.d.ts +60 -0
- package/dist/models/serializer.d.ts +2 -3
- package/dist/models/stats.d.ts +2 -2
- package/dist/models/storage.d.ts +12 -11
- package/dist/{network-DBNwApoF.js → network-C7SkLf4v.js} +12 -12
- package/dist/network-C7SkLf4v.js.map +1 -0
- package/dist/{network-xbbuvG_6.cjs → network-pEX3PAJv.cjs} +2 -2
- package/dist/network-pEX3PAJv.cjs.map +1 -0
- package/dist/openfin-Bxelt0yg.js.map +1 -1
- package/dist/openfin-DtH2f7zX.cjs.map +1 -1
- package/dist/otlp-2MCrC3kd.cjs +2 -0
- package/dist/otlp-2MCrC3kd.cjs.map +1 -0
- package/dist/{otlp-BTJdIa6F.js → otlp-COq033e3.js} +25 -32
- package/dist/otlp-COq033e3.js.map +1 -0
- package/dist/patch-BX8KrPCT.cjs.map +1 -1
- package/dist/patch-UdPz1ea8.js.map +1 -1
- package/dist/{platform-C2Ez5kDc.cjs → platform-12uR7kBQ.cjs} +2 -2
- package/dist/platform-12uR7kBQ.cjs.map +1 -0
- package/dist/{platform-DkcuXwe-.js → platform-CVewe4wQ.js} +7 -7
- package/dist/platform-CVewe4wQ.js.map +1 -0
- package/dist/profiler-BVWIOgnq.js +310 -0
- package/dist/profiler-BVWIOgnq.js.map +1 -0
- package/dist/profiler-eVCknCzS.cjs +2 -0
- package/dist/profiler-eVCknCzS.cjs.map +1 -0
- package/dist/profiler-frames-CLXlT_xL.js +86 -0
- package/dist/profiler-frames-CLXlT_xL.js.map +1 -0
- package/dist/profiler-frames-Dg2OebB2.cjs +2 -0
- package/dist/profiler-frames-Dg2OebB2.cjs.map +1 -0
- package/dist/{remote-rules-Cfb4K-Nl.js → remote-rules-BJGDJGwA.js} +27 -27
- package/dist/remote-rules-BJGDJGwA.js.map +1 -0
- package/dist/{remote-rules-vzvk7aKf.cjs → remote-rules-CJD3ToVk.cjs} +2 -2
- package/dist/remote-rules-CJD3ToVk.cjs.map +1 -0
- package/dist/replay-0zAJv9T3.js +338 -0
- package/dist/replay-0zAJv9T3.js.map +1 -0
- package/dist/replay-DomJpXqW.cjs +2 -0
- package/dist/replay-DomJpXqW.cjs.map +1 -0
- package/dist/{reports-Dk2YhKIh.cjs → reports-BsbqmP8h.cjs} +2 -2
- package/dist/reports-BsbqmP8h.cjs.map +1 -0
- package/dist/{reports-TA-zInnq.js → reports-BuXekPOS.js} +3 -3
- package/dist/reports-BuXekPOS.js.map +1 -0
- package/dist/{resource-timing-BLv3EA2A.js → resource-timing-CXGHwFRD.js} +4 -4
- package/dist/resource-timing-CXGHwFRD.js.map +1 -0
- package/dist/{resource-timing-Cysw1S1f.cjs → resource-timing-DkycFGDa.cjs} +2 -2
- package/dist/resource-timing-DkycFGDa.cjs.map +1 -0
- package/dist/{sampling-Ckh2yW9k.cjs → sampling-Dd0wllyq.cjs} +2 -2
- package/dist/sampling-Dd0wllyq.cjs.map +1 -0
- package/dist/{sampling-C4VV-1MS.js → sampling-UUDbi3K0.js} +9 -9
- package/dist/sampling-UUDbi3K0.js.map +1 -0
- package/dist/{sanitize-6ymPlVvP.js → sanitize-CNmsD9r3.js} +2 -2
- package/dist/sanitize-CNmsD9r3.js.map +1 -0
- package/dist/{sanitize-BAWzkZt0.cjs → sanitize-ChLn97Ch.cjs} +2 -2
- package/dist/sanitize-ChLn97Ch.cjs.map +1 -0
- package/dist/{select-ZF4by-lF.cjs → select-CTk-K5mG.cjs} +3 -3
- package/dist/select-CTk-K5mG.cjs.map +1 -0
- package/dist/{select-xtQaenIi.js → select-DPv_j6wq.js} +61 -61
- package/dist/select-DPv_j6wq.js.map +1 -0
- package/dist/{sender-CiMHC9YG.js → sender-15zEsZpr.js} +61 -60
- package/dist/sender-15zEsZpr.js.map +1 -0
- package/dist/sender-Bfpv9tad.cjs +2 -0
- package/dist/sender-Bfpv9tad.cjs.map +1 -0
- package/dist/storage/context-storage.d.ts +34 -33
- package/dist/storage/emergency-queue.d.ts +9 -9
- package/dist/storage/eviction.d.ts +12 -12
- package/dist/storage/factory.d.ts +8 -7
- package/dist/storage/gap.d.ts +6 -6
- package/dist/storage/idb-driver.d.ts +31 -32
- package/dist/storage/indexeddb-storage.d.ts +26 -27
- package/dist/storage/keys.d.ts +7 -7
- package/dist/storage/local-storage.d.ts +38 -38
- package/dist/storage/memory-storage.d.ts +21 -22
- package/dist/storage/persistence.d.ts +1 -1
- package/dist/storage-BA9RqRO-.cjs.map +1 -1
- package/dist/storage-DZwed89z.js.map +1 -1
- package/dist/{storm-VR024_QN.js → storm-BTSNTIWI.js} +2 -2
- package/dist/storm-BTSNTIWI.js.map +1 -0
- package/dist/{storm-CYi9Swpx.cjs → storm-D0_qZOEg.cjs} +2 -2
- package/dist/storm-D0_qZOEg.cjs.map +1 -0
- package/dist/transport/compression.d.ts +2 -2
- package/dist/transport/errors.d.ts +7 -7
- package/dist/transport/exit-flush.d.ts +39 -39
- package/dist/transport/headers.d.ts +2 -2
- package/dist/transport/http-transport.d.ts +28 -27
- package/dist/transport/memory-transport.d.ts +6 -6
- package/dist/transport/retry-engine.d.ts +35 -34
- package/dist/transport/serializers/ecs.d.ts +1 -1
- package/dist/transport/serializers/otlp-metrics.d.ts +1 -1
- package/dist/transport/serializers/otlp-traces.d.ts +1 -1
- package/dist/transport/serializers/otlp.d.ts +16 -16
- package/dist/transport/serializers/select.d.ts +7 -7
- package/dist/transport/status-transport.d.ts +20 -20
- package/dist/transport/worker-protocol.d.ts +3 -3
- package/dist/types-BAerHgCq.js.map +1 -1
- package/dist/types-C7WNpnG1.cjs.map +1 -1
- package/dist/{unclean-exit-DFUN57wY.cjs → unclean-exit-ClGzrc2A.cjs} +2 -2
- package/dist/unclean-exit-ClGzrc2A.cjs.map +1 -0
- package/dist/{unclean-exit-CwcUhFOn.js → unclean-exit-Cob_jyTv.js} +2 -2
- package/dist/unclean-exit-Cob_jyTv.js.map +1 -0
- package/dist/unref-CU9Nyz_9.cjs +2 -0
- package/dist/unref-CU9Nyz_9.cjs.map +1 -0
- package/dist/unref-DgHPQeWv.js +7 -0
- package/dist/unref-DgHPQeWv.js.map +1 -0
- package/dist/user-timing-CdYqx3PF.cjs +2 -0
- package/dist/user-timing-CdYqx3PF.cjs.map +1 -0
- package/dist/{user-timing-_jZIhDKI.js → user-timing-DgHubxCI.js} +5 -3
- package/dist/user-timing-DgHubxCI.js.map +1 -0
- package/dist/utils/console.d.ts +2 -2
- package/dist/utils/deadline.d.ts +4 -4
- package/dist/utils/error-like.d.ts +7 -7
- package/dist/utils/fixed-window.d.ts +9 -8
- package/dist/utils/global-scope.d.ts +8 -8
- package/dist/utils/guards.d.ts +2 -2
- package/dist/utils/identity.d.ts +17 -17
- package/dist/utils/library-console.d.ts +4 -4
- package/dist/utils/library-request.d.ts +10 -10
- package/dist/utils/lock.d.ts +10 -9
- package/dist/utils/openfin.d.ts +5 -5
- package/dist/utils/patch.d.ts +6 -6
- package/dist/utils/platform.d.ts +13 -11
- package/dist/utils/sanitize.d.ts +4 -4
- package/dist/utils/timer.d.ts +1 -1
- package/dist/utils/tracing.d.ts +38 -38
- package/dist/utils/unref.d.ts +3 -3
- package/dist/{web-socket-BWUoqBh8.cjs → web-socket-BTuvYoJI.cjs} +2 -2
- package/dist/web-socket-BTuvYoJI.cjs.map +1 -0
- package/dist/{web-socket-CV7yIMnm.js → web-socket-DthJuSAg.js} +4 -4
- package/dist/web-socket-DthJuSAg.js.map +1 -0
- package/dist/web-vitals-Ch5BpDmo.cjs +2 -0
- package/dist/web-vitals-Ch5BpDmo.cjs.map +1 -0
- package/dist/web-vitals-CsGCWnUr.js +77 -0
- package/dist/web-vitals-CsGCWnUr.js.map +1 -0
- package/dist/{worker-protocol-CrsdSDLn.js → worker-protocol-B0_8rWy5.js} +4 -4
- package/dist/worker-protocol-B0_8rWy5.js.map +1 -0
- package/dist/{worker-protocol-Bai7GAIA.cjs → worker-protocol-BjzFORfq.cjs} +2 -2
- package/dist/worker-protocol-BjzFORfq.cjs.map +1 -0
- package/dist/worker-server-4en-Lt-3.cjs +2 -0
- package/dist/worker-server-4en-Lt-3.cjs.map +1 -0
- package/dist/{worker-server-Dp5HYm4b.js → worker-server-Cne9MX9I.js} +8 -8
- package/dist/{worker-server-Dp5HYm4b.js.map → worker-server-Cne9MX9I.js.map} +1 -1
- package/dist/worker-transport-B-GF4Aqn.cjs +2 -0
- package/dist/worker-transport-B-GF4Aqn.cjs.map +1 -0
- package/dist/{worker-transport-D6jtgpqN.js → worker-transport-C3SjJAEC.js} +62 -61
- package/dist/worker-transport-C3SjJAEC.js.map +1 -0
- package/package.json +8 -2
- package/dist/batch-C8OcWR2L.cjs.map +0 -1
- package/dist/batch-CL9uWYY3.js.map +0 -1
- package/dist/bus-BZ0GldpT.js.map +0 -1
- package/dist/bus-VWlmM5xs.cjs +0 -2
- package/dist/bus-VWlmM5xs.cjs.map +0 -1
- package/dist/console-BPZCuSLc.cjs.map +0 -1
- package/dist/console-BeCF7n59.js.map +0 -1
- package/dist/constants-DqKJH_MP.cjs +0 -2
- package/dist/constants-DqKJH_MP.cjs.map +0 -1
- package/dist/constants-zyrqveN4.js +0 -304
- package/dist/constants-zyrqveN4.js.map +0 -1
- package/dist/deadline-BOjOxNHj.js.map +0 -1
- package/dist/deadline-XSnm95pg.cjs +0 -2
- package/dist/deadline-XSnm95pg.cjs.map +0 -1
- package/dist/debug-bundle-BzJNpbF0.cjs +0 -2
- package/dist/debug-bundle-BzJNpbF0.cjs.map +0 -1
- package/dist/debug-bundle-C7UkHZ-q.js.map +0 -1
- package/dist/emergency-queue-CNTRui5t.cjs.map +0 -1
- package/dist/emergency-queue-Zy6lNafo.js.map +0 -1
- package/dist/errors-Dh7kef0i.js.map +0 -1
- package/dist/errors-tfEr48bS.cjs.map +0 -1
- package/dist/factory-BonqI3NL.js.map +0 -1
- package/dist/factory-CJXVYp0R.cjs.map +0 -1
- package/dist/identity-Cxgj6pZX.cjs.map +0 -1
- package/dist/identity-DT5VmvXy.js.map +0 -1
- package/dist/indexeddb-storage-BJVtiQKm.js.map +0 -1
- package/dist/indexeddb-storage-CIoW21Xd.cjs.map +0 -1
- package/dist/interactions-DTgKy_6K.js.map +0 -1
- package/dist/interactions-fEN6FbVo.cjs.map +0 -1
- package/dist/journey-CuJrHzEg.js.map +0 -1
- package/dist/journey-pffMVMfa.cjs +0 -2
- package/dist/journey-pffMVMfa.cjs.map +0 -1
- package/dist/library-console-C1m6g1BR.js.map +0 -1
- package/dist/library-console-D2GY9Or6.cjs.map +0 -1
- package/dist/library-request-1BX_UlaX.cjs.map +0 -1
- package/dist/library-request-BQBT9N9Q.js.map +0 -1
- package/dist/lifecycle-2EtUaRpo.cjs.map +0 -1
- package/dist/lifecycle-BaKx_-32.js.map +0 -1
- package/dist/log-record-CAoGBBf3.js.map +0 -1
- package/dist/log-record-i9zOTkpQ.cjs.map +0 -1
- package/dist/long-frames-BVg4i5SC.cjs +0 -2
- package/dist/long-frames-BVg4i5SC.cjs.map +0 -1
- package/dist/long-frames-Czk7IupC.js.map +0 -1
- package/dist/network-DBNwApoF.js.map +0 -1
- package/dist/network-xbbuvG_6.cjs.map +0 -1
- package/dist/otlp-BDvFrLnc.cjs +0 -2
- package/dist/otlp-BDvFrLnc.cjs.map +0 -1
- package/dist/otlp-BTJdIa6F.js.map +0 -1
- package/dist/platform-C2Ez5kDc.cjs.map +0 -1
- package/dist/platform-DkcuXwe-.js.map +0 -1
- package/dist/remote-rules-Cfb4K-Nl.js.map +0 -1
- package/dist/remote-rules-vzvk7aKf.cjs.map +0 -1
- package/dist/reports-Dk2YhKIh.cjs.map +0 -1
- package/dist/reports-TA-zInnq.js.map +0 -1
- package/dist/resource-timing-BLv3EA2A.js.map +0 -1
- package/dist/resource-timing-Cysw1S1f.cjs.map +0 -1
- package/dist/sampling-C4VV-1MS.js.map +0 -1
- package/dist/sampling-Ckh2yW9k.cjs.map +0 -1
- package/dist/sanitize-6ymPlVvP.js.map +0 -1
- package/dist/sanitize-BAWzkZt0.cjs.map +0 -1
- package/dist/select-ZF4by-lF.cjs.map +0 -1
- package/dist/select-xtQaenIi.js.map +0 -1
- package/dist/sender-CiMHC9YG.js.map +0 -1
- package/dist/sender-D5wBoXA8.cjs +0 -2
- package/dist/sender-D5wBoXA8.cjs.map +0 -1
- package/dist/storm-CYi9Swpx.cjs.map +0 -1
- package/dist/storm-VR024_QN.js.map +0 -1
- package/dist/unclean-exit-CwcUhFOn.js.map +0 -1
- package/dist/unclean-exit-DFUN57wY.cjs.map +0 -1
- package/dist/user-timing-C9kfRq3J.cjs +0 -2
- package/dist/user-timing-C9kfRq3J.cjs.map +0 -1
- package/dist/user-timing-_jZIhDKI.js.map +0 -1
- package/dist/web-socket-BWUoqBh8.cjs.map +0 -1
- package/dist/web-socket-CV7yIMnm.js.map +0 -1
- package/dist/web-vitals-Bq4WFHQo.js +0 -52
- package/dist/web-vitals-Bq4WFHQo.js.map +0 -1
- package/dist/web-vitals-DFuoTQbZ.cjs +0 -2
- package/dist/web-vitals-DFuoTQbZ.cjs.map +0 -1
- package/dist/worker-protocol-Bai7GAIA.cjs.map +0 -1
- package/dist/worker-protocol-CrsdSDLn.js.map +0 -1
- package/dist/worker-server-BrIYkfoa.cjs +0 -2
- package/dist/worker-server-BrIYkfoa.cjs.map +0 -1
- package/dist/worker-transport-Bwej4N2e.cjs +0 -2
- package/dist/worker-transport-Bwej4N2e.cjs.map +0 -1
- package/dist/worker-transport-D6jtgpqN.js.map +0 -1
|
@@ -9,12 +9,12 @@ export interface BatchTransport {
|
|
|
9
9
|
/**
|
|
10
10
|
* Sends one batch.
|
|
11
11
|
* @param batch Batch to send.
|
|
12
|
-
* @param onKeepalive Runs when
|
|
13
|
-
* @throws TransportError when the batch
|
|
12
|
+
* @param onKeepalive Runs when one of the batch's requests starts with keepalive.
|
|
13
|
+
* @throws TransportError when the batch isn't accepted.
|
|
14
14
|
*/
|
|
15
15
|
send(batch: LogBatch, onKeepalive?: () => void): Promise<void>;
|
|
16
16
|
/**
|
|
17
|
-
* Returns the remaining throttle delay
|
|
17
|
+
* Returns the remaining throttle delay for a batch's endpoint.
|
|
18
18
|
* @param batch Batch to send.
|
|
19
19
|
* @returns Milliseconds until the throttle ends, or 0.
|
|
20
20
|
*/
|
|
@@ -38,12 +38,12 @@ export declare abstract class StatusTransport implements BatchTransport {
|
|
|
38
38
|
private readonly onClock;
|
|
39
39
|
/** Abort controller shared by the requests of this delivery context. */
|
|
40
40
|
protected readonly cancellation: AbortController;
|
|
41
|
-
/** Cancels
|
|
41
|
+
/** Cancels this context's work. A custom transport receives the same abort signal. */
|
|
42
42
|
stop(): void;
|
|
43
43
|
/**
|
|
44
|
-
* Checks the batch context after
|
|
44
|
+
* Checks the batch context after every asynchronous step and before a send.
|
|
45
45
|
* @param batch Batch to check.
|
|
46
|
-
* @throws TransportError if the context stopped or the context id
|
|
46
|
+
* @throws TransportError if the context stopped or the context id doesn't match.
|
|
47
47
|
*/
|
|
48
48
|
protected assertContext(batch: LogBatch): void;
|
|
49
49
|
/**
|
|
@@ -54,8 +54,8 @@ export declare abstract class StatusTransport implements BatchTransport {
|
|
|
54
54
|
*/
|
|
55
55
|
protected untilCancelled<T>(work: Promise<T>): Promise<T>;
|
|
56
56
|
/**
|
|
57
|
-
* Epoch time in milliseconds when the server throttle ends,
|
|
58
|
-
* metricsEndpoint
|
|
57
|
+
* Epoch time in milliseconds when the server throttle ends, per endpoint, so that a 429 from
|
|
58
|
+
* metricsEndpoint doesn't stop the log batches.
|
|
59
59
|
*/
|
|
60
60
|
private readonly throttledUntil;
|
|
61
61
|
/** Epoch time in milliseconds when the server last accepted a batch, or null. */
|
|
@@ -63,20 +63,20 @@ export declare abstract class StatusTransport implements BatchTransport {
|
|
|
63
63
|
/**
|
|
64
64
|
* @param config Active configuration instance.
|
|
65
65
|
* @param diagnostics Diagnostics reporter.
|
|
66
|
-
* @param onSampling Receives
|
|
67
|
-
* @param onLoss Receives the records of a batch that the serializer
|
|
68
|
-
* @param onClock Receives
|
|
66
|
+
* @param onSampling Receives an accepted batch's sampling rules, before validation.
|
|
67
|
+
* @param onLoss Receives the records of a batch that the serializer can't encode.
|
|
68
|
+
* @param onClock Receives an accepted batch's clock offset, in milliseconds.
|
|
69
69
|
*/
|
|
70
70
|
constructor(config: ResolvedConfig, diagnostics: Diagnostics, onSampling?: (raw: unknown) => void, onLoss?: LossReporter, onClock?: (offsetMs: number) => void);
|
|
71
71
|
/**
|
|
72
72
|
* Sends one batch.
|
|
73
73
|
* @param batch Batch to send.
|
|
74
|
-
* @param onKeepalive Runs when
|
|
75
|
-
* @throws TransportError when the batch
|
|
74
|
+
* @param onKeepalive Runs when one of the batch's requests starts with keepalive.
|
|
75
|
+
* @throws TransportError when the batch isn't accepted.
|
|
76
76
|
*/
|
|
77
77
|
abstract send(batch: LogBatch, onKeepalive?: () => void): Promise<void>;
|
|
78
78
|
/**
|
|
79
|
-
* Returns the remaining throttle delay
|
|
79
|
+
* Returns the remaining throttle delay for a batch's endpoint, in milliseconds.
|
|
80
80
|
* @param batch Batch to send.
|
|
81
81
|
* @returns Milliseconds remaining in throttle window, or 0 if unthrottled.
|
|
82
82
|
*/
|
|
@@ -88,21 +88,21 @@ export declare abstract class StatusTransport implements BatchTransport {
|
|
|
88
88
|
lastSendAt(): number | null;
|
|
89
89
|
/**
|
|
90
90
|
* Serializes a batch with the configured serializer. A metrics batch gets the OTLP metrics
|
|
91
|
-
* format.
|
|
91
|
+
* format. Reports a serializer that throws.
|
|
92
92
|
* @param batch Batch to serialize.
|
|
93
93
|
* @returns The serialized batch, or undefined if the serializer threw.
|
|
94
94
|
*/
|
|
95
95
|
protected serialize(batch: LogBatch): SerializedBatch | undefined;
|
|
96
96
|
/**
|
|
97
|
-
* Records an accepted batch
|
|
97
|
+
* Records an accepted batch and ends the server throttle for that batch's endpoint.
|
|
98
98
|
* @param kind Kind of the accepted batch.
|
|
99
|
-
* @param sampling
|
|
100
|
-
* @param date Date header
|
|
99
|
+
* @param sampling The answer's sampling rules, as text or as an object.
|
|
100
|
+
* @param date The answer's Date header. Null when the server doesn't expose it.
|
|
101
101
|
*/
|
|
102
102
|
protected accept(kind: BatchKind, sampling: unknown, date: unknown): void;
|
|
103
103
|
/**
|
|
104
|
-
* Converts a status code
|
|
105
|
-
* @param status
|
|
104
|
+
* Converts a non-2xx status code into a classified TransportError.
|
|
105
|
+
* @param status The answer's status code.
|
|
106
106
|
* @param batchId Identifier of the rejected batch.
|
|
107
107
|
* @param kind Kind of the rejected batch. A throttle applies only to its endpoint.
|
|
108
108
|
* @param hints Delay, size limit and advice that come with the answer.
|
|
@@ -22,13 +22,13 @@ export interface WorkerResponse {
|
|
|
22
22
|
maxBytes?: number;
|
|
23
23
|
compressionFailed?: boolean;
|
|
24
24
|
}
|
|
25
|
-
/** A worker failure
|
|
25
|
+
/** A worker failure never carries app exception text. */
|
|
26
26
|
export type WorkerResult = WorkerResponse | {
|
|
27
27
|
failure: "serialize" | "network" | "timeout" | "protocol";
|
|
28
28
|
};
|
|
29
|
-
/**
|
|
29
|
+
/** Builds a versioned message for the private channel. */
|
|
30
30
|
export declare function workerMessage(type: string, fields?: Record<string, unknown>): Record<string, unknown>;
|
|
31
|
-
/**
|
|
31
|
+
/** Checks the protocol and the exact library version. */
|
|
32
32
|
export declare function isWorkerMessage(value: unknown): value is Record<string, unknown>;
|
|
33
33
|
/** Validates a result before it changes the main transport state. */
|
|
34
34
|
export declare function isWorkerResult(value: unknown): value is WorkerResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-BAerHgCq.js","names":["matchesAny","url","patterns","pattern"],"sources":["../src/capture/types.ts"],"sourcesContent":["// src/capture/types.ts\n//\n// Shared interfaces, logger
|
|
1
|
+
{"version":3,"file":"types-BAerHgCq.js","names":["matchesAny","url","patterns","pattern"],"sources":["../src/capture/types.ts"],"sourcesContent":["// src/capture/types.ts\n//\n// Shared interfaces, the logger abstraction and helpers for the auto-capture modules.\n\nimport type { BreadcrumbBuffer } from \"../core/breadcrumbs\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport type { SpanData } from \"../core/spans\";\nimport type { ResolvedConfig } from \"../models/config\";\nimport type { LogRecord, MetricType } from \"../models/log-record\";\nimport type { InstrumentDef, MetricAttributes } from \"../models/metric\";\nimport type { TraceEngine } from \"../utils/tracing\";\n\n/**\n * The logging interface the auto-capture modules use. Referring to the runtime class here\n * would create an import cycle, because the runtime installs the capture modules.\n */\nexport interface CaptureLogger {\n /**\n * Logs an error event, with the error or reason behind it.\n * @param message Error description.\n * @param error The caught error or reason.\n * @param payload Optional attributes.\n */\n error(message: string, error?: unknown, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a warning event.\n * @param message Warning description.\n * @param payload Optional attributes.\n */\n warn(message: string, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a single lifecycle or user event.\n * @param name Event identifier.\n * @param payload Optional attributes.\n */\n logEvent(name: string, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a numeric metric measurement.\n * @param name Metric name.\n * @param value The measurement.\n * @param unit Unit of measurement.\n * @param type Metric type.\n * @param attrs Optional metric attributes.\n */\n logMetric(\n name: string,\n value: number,\n unit?: string,\n type?: MetricType,\n attrs?: Record<string, unknown>,\n ): void;\n\n /**\n * Logs a debug message.\n * @param message Debug message.\n * @param payload Optional attributes.\n */\n debug(message: string, payload?: Record<string, unknown>): void;\n}\n\n/**\n * Capture work that runs once per document, not once per install. A reconfigure\n * builds new capture instances, so instance state can't hold these flags.\n * web-vitals has no unsubscribe, and a second subscription would report every\n * metric twice.\n */\nexport interface CaptureOnce {\n /** True once the web-vitals reporters are subscribed. */\n webVitals: boolean;\n /** True once navigation timing has been reported. */\n navigationTiming: boolean;\n /** True after the first long frame install. Only that install reads buffered frames. */\n longFrames: boolean;\n /** True once we've read the previous page's alive marker. */\n uncleanExit: boolean;\n /** True after the first user timing install. Only that install reads buffered entries. */\n userTiming: boolean;\n /** True after the first resource timing install. Later installs skip buffered entries. */\n resourceTiming?: boolean;\n /** Page state and when it started. A reinstall keeps them, so it logs no false transition. */\n lifecycle?: { state: string; enteredAt: number };\n /** Set once the frame phases capture has reported a browser without long animation frames. */\n framePhases?: boolean;\n /** Set once the profiler's frame pacing has reported a context without frame callbacks. */\n framePacing?: boolean;\n /** Set once session replay has reported why it can't record in this document. */\n replay?: boolean;\n}\n\n/** Runtime dependencies shared by all auto-capture instances. */\nexport interface CaptureContext {\n /** False while the runtime is stopping or changing its security context. */\n isActive?: () => boolean;\n /** Active runtime configuration. */\n config: ResolvedConfig;\n /** Diagnostics reporter for capture faults. */\n diagnostics: Diagnostics;\n /** Logger for the telemetry the captures record. */\n logger: CaptureLogger;\n /** Breadcrumb buffer. */\n breadcrumbs: BreadcrumbBuffer;\n /** Active trace context provider. */\n tracing: TraceEngine;\n /** Guards for capture work that a reinstall must not repeat. */\n once: CaptureOnce;\n /** Adds a value to one of the runtime's counters or histograms. */\n recordMetric: (def: InstrumentDef, value: number, attributes?: MetricAttributes) => void;\n /** Records a span. The runtime drops it when spans are off. */\n recordSpan: (span: SpanData) => void;\n /** Returns the current session id. */\n sessionId: () => string;\n /** Sets or clears the hook that receives every ERROR and FATAL record from the runtime. */\n onError?: (hook: ((record: LogRecord) => void) | undefined) => void;\n /** Sets an ambient attribute on every later record. Undefined removes it. */\n setContext?: (key: string, value: string | undefined) => void;\n /** True after startReplay(), false after stopReplay(), undefined if neither was called. */\n replayConsent?: () => boolean | undefined;\n}\n\n/** Lifecycle interface for the browser instrumentation modules. */\nexport interface Capture {\n /** Module identifier used in diagnostics. */\n readonly name: string;\n /**\n * Attaches the instrumentation listeners and patches the target APIs. Patching an\n * already patched function adds a second wrapper and doubles every record, so a\n * second call must do nothing.\n */\n install(): void;\n /** Restores the native APIs and removes the listeners. */\n uninstall(): void;\n}\n\n/**\n * Checks whether a URL matches any of the substring or regular expression patterns.\n * @param url URL to test. A value that isn't a string matches nothing.\n * @param patterns Substrings and regular expressions to test against.\n * @returns True if any pattern matches the URL.\n */\nexport function matchesAny(url: unknown, patterns: (string | RegExp)[]): boolean {\n // Guard against a URL that isn't a string. includes() on it would throw inside the host's call.\n if (typeof url !== \"string\") {\n return false;\n }\n\n return patterns.some((pattern) =>\n typeof pattern === \"string\" ? url.includes(pattern) : pattern.test(url),\n );\n}\n"],"mappings":";AA8IA,SAAgBA,EAAW,GAAc,GAAwC;CAM/E,OAJI,OAAOC,KAAQ,YAIZC,EAAS,MAAM,MACpB,OAAOC,KAAY,WAAWF,EAAI,SAASE,CAAO,IAAIA,EAAQ,KAAKF,CAAG,CACxE;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-C7WNpnG1.cjs","names":["matchesAny","url","patterns","pattern"],"sources":["../src/capture/types.ts"],"sourcesContent":["// src/capture/types.ts\n//\n// Shared interfaces, logger
|
|
1
|
+
{"version":3,"file":"types-C7WNpnG1.cjs","names":["matchesAny","url","patterns","pattern"],"sources":["../src/capture/types.ts"],"sourcesContent":["// src/capture/types.ts\n//\n// Shared interfaces, the logger abstraction and helpers for the auto-capture modules.\n\nimport type { BreadcrumbBuffer } from \"../core/breadcrumbs\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport type { SpanData } from \"../core/spans\";\nimport type { ResolvedConfig } from \"../models/config\";\nimport type { LogRecord, MetricType } from \"../models/log-record\";\nimport type { InstrumentDef, MetricAttributes } from \"../models/metric\";\nimport type { TraceEngine } from \"../utils/tracing\";\n\n/**\n * The logging interface the auto-capture modules use. Referring to the runtime class here\n * would create an import cycle, because the runtime installs the capture modules.\n */\nexport interface CaptureLogger {\n /**\n * Logs an error event, with the error or reason behind it.\n * @param message Error description.\n * @param error The caught error or reason.\n * @param payload Optional attributes.\n */\n error(message: string, error?: unknown, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a warning event.\n * @param message Warning description.\n * @param payload Optional attributes.\n */\n warn(message: string, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a single lifecycle or user event.\n * @param name Event identifier.\n * @param payload Optional attributes.\n */\n logEvent(name: string, payload?: Record<string, unknown>): void;\n\n /**\n * Logs a numeric metric measurement.\n * @param name Metric name.\n * @param value The measurement.\n * @param unit Unit of measurement.\n * @param type Metric type.\n * @param attrs Optional metric attributes.\n */\n logMetric(\n name: string,\n value: number,\n unit?: string,\n type?: MetricType,\n attrs?: Record<string, unknown>,\n ): void;\n\n /**\n * Logs a debug message.\n * @param message Debug message.\n * @param payload Optional attributes.\n */\n debug(message: string, payload?: Record<string, unknown>): void;\n}\n\n/**\n * Capture work that runs once per document, not once per install. A reconfigure\n * builds new capture instances, so instance state can't hold these flags.\n * web-vitals has no unsubscribe, and a second subscription would report every\n * metric twice.\n */\nexport interface CaptureOnce {\n /** True once the web-vitals reporters are subscribed. */\n webVitals: boolean;\n /** True once navigation timing has been reported. */\n navigationTiming: boolean;\n /** True after the first long frame install. Only that install reads buffered frames. */\n longFrames: boolean;\n /** True once we've read the previous page's alive marker. */\n uncleanExit: boolean;\n /** True after the first user timing install. Only that install reads buffered entries. */\n userTiming: boolean;\n /** True after the first resource timing install. Later installs skip buffered entries. */\n resourceTiming?: boolean;\n /** Page state and when it started. A reinstall keeps them, so it logs no false transition. */\n lifecycle?: { state: string; enteredAt: number };\n /** Set once the frame phases capture has reported a browser without long animation frames. */\n framePhases?: boolean;\n /** Set once the profiler's frame pacing has reported a context without frame callbacks. */\n framePacing?: boolean;\n /** Set once session replay has reported why it can't record in this document. */\n replay?: boolean;\n}\n\n/** Runtime dependencies shared by all auto-capture instances. */\nexport interface CaptureContext {\n /** False while the runtime is stopping or changing its security context. */\n isActive?: () => boolean;\n /** Active runtime configuration. */\n config: ResolvedConfig;\n /** Diagnostics reporter for capture faults. */\n diagnostics: Diagnostics;\n /** Logger for the telemetry the captures record. */\n logger: CaptureLogger;\n /** Breadcrumb buffer. */\n breadcrumbs: BreadcrumbBuffer;\n /** Active trace context provider. */\n tracing: TraceEngine;\n /** Guards for capture work that a reinstall must not repeat. */\n once: CaptureOnce;\n /** Adds a value to one of the runtime's counters or histograms. */\n recordMetric: (def: InstrumentDef, value: number, attributes?: MetricAttributes) => void;\n /** Records a span. The runtime drops it when spans are off. */\n recordSpan: (span: SpanData) => void;\n /** Returns the current session id. */\n sessionId: () => string;\n /** Sets or clears the hook that receives every ERROR and FATAL record from the runtime. */\n onError?: (hook: ((record: LogRecord) => void) | undefined) => void;\n /** Sets an ambient attribute on every later record. Undefined removes it. */\n setContext?: (key: string, value: string | undefined) => void;\n /** True after startReplay(), false after stopReplay(), undefined if neither was called. */\n replayConsent?: () => boolean | undefined;\n}\n\n/** Lifecycle interface for the browser instrumentation modules. */\nexport interface Capture {\n /** Module identifier used in diagnostics. */\n readonly name: string;\n /**\n * Attaches the instrumentation listeners and patches the target APIs. Patching an\n * already patched function adds a second wrapper and doubles every record, so a\n * second call must do nothing.\n */\n install(): void;\n /** Restores the native APIs and removes the listeners. */\n uninstall(): void;\n}\n\n/**\n * Checks whether a URL matches any of the substring or regular expression patterns.\n * @param url URL to test. A value that isn't a string matches nothing.\n * @param patterns Substrings and regular expressions to test against.\n * @returns True if any pattern matches the URL.\n */\nexport function matchesAny(url: unknown, patterns: (string | RegExp)[]): boolean {\n // Guard against a URL that isn't a string. includes() on it would throw inside the host's call.\n if (typeof url !== \"string\") {\n return false;\n }\n\n return patterns.some((pattern) =>\n typeof pattern === \"string\" ? url.includes(pattern) : pattern.test(url),\n );\n}\n"],"mappings":"AA8IA,SAAgBA,EAAW,EAAc,EAAwC,CAM/E,OAJI,OAAOC,GAAQ,UAIZC,EAAS,KAAM,GACpB,OAAOC,GAAY,SAAWF,EAAI,SAASE,CAAO,EAAIA,EAAQ,KAAKF,CAAG,CACxE,CACF,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./constants-
|
|
2
|
-
//# sourceMappingURL=unclean-exit-
|
|
1
|
+
const e=require("./constants-DakMxVB2.cjs");function t(e){let t=e===null?null:JSON.parse(e);if(typeof t!=`object`||!t)return null;let{sessionId:n,at:r,visibility:i}=t;return typeof n==`string`&&Number.isFinite(r)&&typeof i==`string`?{sessionId:n,at:r,visibility:i}:null}var n=class{ctx;name=`uncleanExit`;installed=!1;timer;closing=!1;constructor(e){this.ctx=e}install(){this.installed||typeof document>`u`||window.parent!==window||(this.ctx.config.identity===`memory`?this.ctx.diagnostics.report(`capture.install_failed`,`capture.uncleanExit needs sessionStorage. identity: "memory" turns it off.`):(this.installed=!0,this.ctx.once.uncleanExit||(this.ctx.once.uncleanExit=!0,window.opener||this.reportPrevious()),this.mark(),addEventListener(`pagehide`,this.onPageHide),addEventListener(`pageshow`,this.onPageShow),document.addEventListener(`visibilitychange`,this.mark),this.timer=setInterval(this.mark,e.r)))}uninstall(){this.installed&&(this.installed=!1,removeEventListener(`pagehide`,this.onPageHide),removeEventListener(`pageshow`,this.onPageShow),document.removeEventListener(`visibilitychange`,this.mark),clearInterval(this.timer),this.clear())}reportPrevious(){let n=this.ctx.diagnostics.guard(`storage.unavailable`,`The library could not read the alive marker in sessionStorage.`,()=>t(sessionStorage.getItem(e.n)));n&&this.ctx.logger.warn(`ui.unclean_exit`,{"exit.session_id":n.sessionId,"exit.last_seen_ms":n.at,"exit.visibility":n.visibility,"exit.discarded":document.wasDiscarded===!0})}mark=()=>{if(this.closing)return;let t={sessionId:this.ctx.sessionId(),at:Date.now(),visibility:document.visibilityState};this.ctx.diagnostics.guard(`storage.unavailable`,`The library could not write the alive marker to sessionStorage.`,()=>{sessionStorage.setItem(e.n,JSON.stringify(t))})};clear(){this.ctx.diagnostics.guard(`storage.unavailable`,`The library could not remove the alive marker from sessionStorage.`,()=>{sessionStorage.removeItem(e.n)})}onPageHide=()=>{this.closing=!0,this.clear()};onPageShow=e=>{e.persisted&&(this.closing=!1,this.mark())}};exports.UncleanExitCapture=n;
|
|
2
|
+
//# sourceMappingURL=unclean-exit-ClGzrc2A.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unclean-exit-ClGzrc2A.cjs","names":["ALIVE_UPDATE_MS","ALIVE_KEY","require_constants","readMarker","value","text","sessionId","at","visibility","UncleanExitCapture","ctx","marker","event"],"sources":["../src/capture/unclean-exit.ts"],"sourcesContent":["// src/capture/unclean-exit.ts\n//\n// Detects a page in this tab that ended without a clean close, for example after a crash. The\n// top document keeps a marker in sessionStorage and a clean close removes it, so if the tab's\n// next page finds a marker, it reports it.\n\nimport { ALIVE_KEY, ALIVE_UPDATE_MS } from \"../constants\";\nimport type { Capture, CaptureContext } from \"./types\";\n\n/** Marker left by a page that is alive. */\ninterface AliveMarker {\n /** The page's session id. */\n sessionId: string;\n /** When the marker was last updated, in epoch milliseconds. */\n at: number;\n /** The page's visibility at the last update. */\n visibility: string;\n}\n\n/** A document with the flag the browser sets on a page it discarded to free memory. */\ninterface DiscardDocument {\n wasDiscarded?: boolean;\n}\n\n/**\n * Reads a marker from its sessionStorage text.\n * @param text Stored text, or null when there is no marker.\n * @returns The marker, or null if there is none or it has the wrong shape.\n * @throws SyntaxError for text that isn't JSON. The caller reports it.\n */\nfunction readMarker(text: string | null): AliveMarker | null {\n const value: unknown = text === null ? null : JSON.parse(text);\n if (typeof value !== \"object\" || value === null) {\n return null;\n }\n\n const { sessionId, at, visibility } = value as Partial<Record<keyof AliveMarker, unknown>>;\n const valid =\n typeof sessionId === \"string\" && Number.isFinite(at) && typeof visibility === \"string\";\n\n return valid ? { sessionId, at: at as number, visibility } : null;\n}\n\n/** Reports the previous page's unclean exit, and maintains this page's marker. */\nexport class UncleanExitCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"uncleanExit\";\n\n /** Prevents duplicate listener registration. */\n private installed = false;\n\n /** Timer that updates the marker. */\n private timer: ReturnType<typeof setInterval> | undefined;\n\n /** True after pagehide. Needed because the browser fires visibilitychange after pagehide. */\n private closing = false;\n\n /**\n * @param ctx Capture context with the config, diagnostics, logger and session id.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Reports the previous page's marker once, then starts maintaining this page's own. */\n install(): void {\n // Only the top document keeps the marker, because a same-origin frame shares its\n // sessionStorage.\n if (this.installed || typeof document === \"undefined\" || window.parent !== window) {\n return;\n }\n\n // The marker holds the session id, and memory identity writes nothing to the device.\n if (this.ctx.config.identity === \"memory\") {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n 'capture.uncleanExit needs sessionStorage. identity: \"memory\" turns it off.',\n );\n return;\n }\n this.installed = true;\n\n if (!this.ctx.once.uncleanExit) {\n this.ctx.once.uncleanExit = true;\n // A popup copies its live opener's sessionStorage, so that marker isn't a crash.\n if (!window.opener) {\n this.reportPrevious();\n }\n }\n\n this.mark();\n addEventListener(\"pagehide\", this.onPageHide);\n addEventListener(\"pageshow\", this.onPageShow);\n document.addEventListener(\"visibilitychange\", this.mark);\n this.timer = setInterval(this.mark, ALIVE_UPDATE_MS);\n }\n\n /** Removes the listeners, the timer and the marker, since the capture stopped without a crash. */\n uninstall(): void {\n if (!this.installed) {\n return;\n }\n this.installed = false;\n\n removeEventListener(\"pagehide\", this.onPageHide);\n removeEventListener(\"pageshow\", this.onPageShow);\n document.removeEventListener(\"visibilitychange\", this.mark);\n clearInterval(this.timer);\n this.clear();\n }\n\n /** Logs WARN `ui.unclean_exit` if this tab's previous page left its marker behind. */\n private reportPrevious(): void {\n const marker = this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not read the alive marker in sessionStorage.\",\n () => readMarker(sessionStorage.getItem(ALIVE_KEY)),\n );\n if (!marker) {\n return;\n }\n\n this.ctx.logger.warn(\"ui.unclean_exit\", {\n \"exit.session_id\": marker.sessionId,\n \"exit.last_seen_ms\": marker.at,\n \"exit.visibility\": marker.visibility,\n \"exit.discarded\": (document as DiscardDocument).wasDiscarded === true,\n });\n }\n\n /** Writes this page's marker with the current time and visibility. */\n private readonly mark = (): void => {\n if (this.closing) {\n return;\n }\n\n const marker: AliveMarker = {\n sessionId: this.ctx.sessionId(),\n at: Date.now(),\n visibility: document.visibilityState,\n };\n\n this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not write the alive marker to sessionStorage.\",\n () => {\n sessionStorage.setItem(ALIVE_KEY, JSON.stringify(marker));\n },\n );\n };\n\n /** Removes this page's marker. */\n private clear(): void {\n this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not remove the alive marker from sessionStorage.\",\n () => {\n sessionStorage.removeItem(ALIVE_KEY);\n },\n );\n }\n\n /** A clean close removes the marker. The page may still live on in the back-forward cache. */\n private readonly onPageHide = (): void => {\n this.closing = true;\n this.clear();\n };\n\n /** A page that comes back from the back-forward cache is alive again. */\n private readonly onPageShow = (event: Event): void => {\n if ((event as PageTransitionEvent).persisted) {\n this.closing = false;\n this.mark();\n }\n };\n}\n"],"mappings":"A,4CA8BA,SAASG,EAAW,EAAyC,CAC3D,IAAMC,EAAiBC,IAAS,KAAO,KAAO,KAAK,MAAMA,CAAI,EAC7D,GAAI,OAAOD,GAAU,WAAYA,EAC/B,OAAO,KAGT,GAAM,CAAE,YAAW,KAAI,cAAeA,EAItC,OAFE,OAAOE,GAAc,UAAY,OAAO,SAASC,CAAE,GAAK,OAAOC,GAAe,SAEjE,CAAE,YAAe,KAAc,YAAW,EAAI,IAC/D,CAGA,IAAaC,EAAb,KAAmD,CAgBpB,IAd7B,KAAgB,cAGhB,UAAoB,GAGpB,MAGA,QAAkB,GAKlB,YAAY,EAAsC,CAArB,KAAA,IAAAC,CAAsB,CAGnD,SAAgB,CAGV,KAAK,WAAa,OAAO,SAAa,KAAe,OAAO,SAAW,SAKvE,KAAK,IAAI,OAAO,WAAa,SAC/B,KAAK,IAAI,YAAY,OACnB,yBACA,4EACF,GAGF,KAAK,UAAY,GAEZ,KAAK,IAAI,KAAK,cACjB,KAAK,IAAI,KAAK,YAAc,GAEvB,OAAO,QACV,KAAK,eAAe,GAIxB,KAAK,KAAK,EACV,iBAAiB,WAAY,KAAK,UAAU,EAC5C,iBAAiB,WAAY,KAAK,UAAU,EAC5C,SAAS,iBAAiB,mBAAoB,KAAK,IAAI,EACvD,KAAK,MAAQ,YAAY,KAAK,KAAMV,EAAAA,CAAe,GACrD,CAGA,WAAkB,CACX,KAAK,YAGV,KAAK,UAAY,GAEjB,oBAAoB,WAAY,KAAK,UAAU,EAC/C,oBAAoB,WAAY,KAAK,UAAU,EAC/C,SAAS,oBAAoB,mBAAoB,KAAK,IAAI,EAC1D,cAAc,KAAK,KAAK,EACxB,KAAK,MAAM,EACb,CAGA,gBAA+B,CAC7B,IAAMW,EAAS,KAAK,IAAI,YAAY,MAClC,sBACA,qEACMR,EAAW,eAAe,QAAQF,EAAAA,CAAS,CAAC,CACpD,EACKU,GAIL,KAAK,IAAI,OAAO,KAAK,kBAAmB,CACtC,kBAAmBA,EAAO,UAC1B,oBAAqBA,EAAO,GAC5B,kBAAmBA,EAAO,WAC1B,iBAAmB,SAA6B,eAAiB,EACnE,CAAC,CACH,CAGA,SAAoC,CAClC,GAAI,KAAK,QACP,OAGF,IAAMA,EAAsB,CAC1B,UAAW,KAAK,IAAI,UAAU,EAC9B,GAAI,KAAK,IAAI,EACb,WAAY,SAAS,eACvB,EAEA,KAAK,IAAI,YAAY,MACnB,sBACA,sEACM,CACJ,eAAe,QAAQV,EAAAA,EAAW,KAAK,UAAUU,CAAM,CAAC,CAC1D,CACF,CACF,EAGA,OAAsB,CACpB,KAAK,IAAI,YAAY,MACnB,sBACA,yEACM,CACJ,eAAe,WAAWV,EAAAA,CAAS,CACrC,CACF,CACF,CAGA,eAA0C,CACxC,KAAK,QAAU,GACf,KAAK,MAAM,CACb,EAGA,WAA+B,GAAuB,CAC/CW,EAA8B,YACjC,KAAK,QAAU,GACf,KAAK,KAAK,EAEd,CACF,E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, r as t } from "./constants-
|
|
1
|
+
import { n as e, r as t } from "./constants-Bwl_YtQi.js";
|
|
2
2
|
// src/capture/unclean-exit.ts
|
|
3
3
|
function n(e) {
|
|
4
4
|
let t = e === null ? null : JSON.parse(e);
|
|
@@ -59,4 +59,4 @@ var r = class {
|
|
|
59
59
|
};
|
|
60
60
|
export { r as UncleanExitCapture };
|
|
61
61
|
|
|
62
|
-
//# sourceMappingURL=unclean-exit-
|
|
62
|
+
//# sourceMappingURL=unclean-exit-Cob_jyTv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unclean-exit-Cob_jyTv.js","names":["ALIVE_KEY","ALIVE_UPDATE_MS","readMarker","value","text","sessionId","at","visibility","UncleanExitCapture","ctx","marker","event"],"sources":["../src/capture/unclean-exit.ts"],"sourcesContent":["// src/capture/unclean-exit.ts\n//\n// Detects a page in this tab that ended without a clean close, for example after a crash. The\n// top document keeps a marker in sessionStorage and a clean close removes it, so if the tab's\n// next page finds a marker, it reports it.\n\nimport { ALIVE_KEY, ALIVE_UPDATE_MS } from \"../constants\";\nimport type { Capture, CaptureContext } from \"./types\";\n\n/** Marker left by a page that is alive. */\ninterface AliveMarker {\n /** The page's session id. */\n sessionId: string;\n /** When the marker was last updated, in epoch milliseconds. */\n at: number;\n /** The page's visibility at the last update. */\n visibility: string;\n}\n\n/** A document with the flag the browser sets on a page it discarded to free memory. */\ninterface DiscardDocument {\n wasDiscarded?: boolean;\n}\n\n/**\n * Reads a marker from its sessionStorage text.\n * @param text Stored text, or null when there is no marker.\n * @returns The marker, or null if there is none or it has the wrong shape.\n * @throws SyntaxError for text that isn't JSON. The caller reports it.\n */\nfunction readMarker(text: string | null): AliveMarker | null {\n const value: unknown = text === null ? null : JSON.parse(text);\n if (typeof value !== \"object\" || value === null) {\n return null;\n }\n\n const { sessionId, at, visibility } = value as Partial<Record<keyof AliveMarker, unknown>>;\n const valid =\n typeof sessionId === \"string\" && Number.isFinite(at) && typeof visibility === \"string\";\n\n return valid ? { sessionId, at: at as number, visibility } : null;\n}\n\n/** Reports the previous page's unclean exit, and maintains this page's marker. */\nexport class UncleanExitCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"uncleanExit\";\n\n /** Prevents duplicate listener registration. */\n private installed = false;\n\n /** Timer that updates the marker. */\n private timer: ReturnType<typeof setInterval> | undefined;\n\n /** True after pagehide. Needed because the browser fires visibilitychange after pagehide. */\n private closing = false;\n\n /**\n * @param ctx Capture context with the config, diagnostics, logger and session id.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Reports the previous page's marker once, then starts maintaining this page's own. */\n install(): void {\n // Only the top document keeps the marker, because a same-origin frame shares its\n // sessionStorage.\n if (this.installed || typeof document === \"undefined\" || window.parent !== window) {\n return;\n }\n\n // The marker holds the session id, and memory identity writes nothing to the device.\n if (this.ctx.config.identity === \"memory\") {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n 'capture.uncleanExit needs sessionStorage. identity: \"memory\" turns it off.',\n );\n return;\n }\n this.installed = true;\n\n if (!this.ctx.once.uncleanExit) {\n this.ctx.once.uncleanExit = true;\n // A popup copies its live opener's sessionStorage, so that marker isn't a crash.\n if (!window.opener) {\n this.reportPrevious();\n }\n }\n\n this.mark();\n addEventListener(\"pagehide\", this.onPageHide);\n addEventListener(\"pageshow\", this.onPageShow);\n document.addEventListener(\"visibilitychange\", this.mark);\n this.timer = setInterval(this.mark, ALIVE_UPDATE_MS);\n }\n\n /** Removes the listeners, the timer and the marker, since the capture stopped without a crash. */\n uninstall(): void {\n if (!this.installed) {\n return;\n }\n this.installed = false;\n\n removeEventListener(\"pagehide\", this.onPageHide);\n removeEventListener(\"pageshow\", this.onPageShow);\n document.removeEventListener(\"visibilitychange\", this.mark);\n clearInterval(this.timer);\n this.clear();\n }\n\n /** Logs WARN `ui.unclean_exit` if this tab's previous page left its marker behind. */\n private reportPrevious(): void {\n const marker = this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not read the alive marker in sessionStorage.\",\n () => readMarker(sessionStorage.getItem(ALIVE_KEY)),\n );\n if (!marker) {\n return;\n }\n\n this.ctx.logger.warn(\"ui.unclean_exit\", {\n \"exit.session_id\": marker.sessionId,\n \"exit.last_seen_ms\": marker.at,\n \"exit.visibility\": marker.visibility,\n \"exit.discarded\": (document as DiscardDocument).wasDiscarded === true,\n });\n }\n\n /** Writes this page's marker with the current time and visibility. */\n private readonly mark = (): void => {\n if (this.closing) {\n return;\n }\n\n const marker: AliveMarker = {\n sessionId: this.ctx.sessionId(),\n at: Date.now(),\n visibility: document.visibilityState,\n };\n\n this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not write the alive marker to sessionStorage.\",\n () => {\n sessionStorage.setItem(ALIVE_KEY, JSON.stringify(marker));\n },\n );\n };\n\n /** Removes this page's marker. */\n private clear(): void {\n this.ctx.diagnostics.guard(\n \"storage.unavailable\",\n \"The library could not remove the alive marker from sessionStorage.\",\n () => {\n sessionStorage.removeItem(ALIVE_KEY);\n },\n );\n }\n\n /** A clean close removes the marker. The page may still live on in the back-forward cache. */\n private readonly onPageHide = (): void => {\n this.closing = true;\n this.clear();\n };\n\n /** A page that comes back from the back-forward cache is alive again. */\n private readonly onPageShow = (event: Event): void => {\n if ((event as PageTransitionEvent).persisted) {\n this.closing = false;\n this.mark();\n }\n };\n}\n"],"mappings":";;AA8BA,SAASE,EAAW,GAAyC;CAC3D,IAAMC,IAAiBC,MAAS,OAAO,OAAO,KAAK,MAAMA,CAAI;CAC7D,IAAI,OAAOD,KAAU,aAAYA,GAC/B,OAAO;CAGT,IAAM,EAAE,cAAW,OAAI,kBAAeA;CAItC,OAFE,OAAOE,KAAc,YAAY,OAAO,SAASC,CAAE,KAAK,OAAOC,KAAe,WAEjE;EAAE;EAAe;EAAc;CAAW,IAAI;AAC/D;AAGA,IAAaC,IAAb,MAAmD;CAgBpB;CAd7B,OAAgB;CAGhB,YAAoB;CAGpB;CAGA,UAAkB;CAKlB,YAAY,GAAsC;EAArB,KAAA,MAAAC;CAAsB;CAGnD,UAAgB;EAGd,AAAI,KAAK,aAAa,OAAO,WAAa,OAAe,OAAO,WAAW,WAKvE,KAAK,IAAI,OAAO,aAAa,WAC/B,KAAK,IAAI,YAAY,OACnB,0BACA,8EACF,KAGF,KAAK,YAAY,IAEZ,KAAK,IAAI,KAAK,gBACjB,KAAK,IAAI,KAAK,cAAc,IAEvB,OAAO,UACV,KAAK,eAAe,IAIxB,KAAK,KAAK,GACV,iBAAiB,YAAY,KAAK,UAAU,GAC5C,iBAAiB,YAAY,KAAK,UAAU,GAC5C,SAAS,iBAAiB,oBAAoB,KAAK,IAAI,GACvD,KAAK,QAAQ,YAAY,KAAK,MAAMR,CAAe;CACrD;CAGA,YAAkB;EAChB,AAAK,KAAK,cAGV,KAAK,YAAY,IAEjB,oBAAoB,YAAY,KAAK,UAAU,GAC/C,oBAAoB,YAAY,KAAK,UAAU,GAC/C,SAAS,oBAAoB,oBAAoB,KAAK,IAAI,GAC1D,cAAc,KAAK,KAAK,GACxB,KAAK,MAAM;CACb;CAGA,iBAA+B;EAC7B,IAAMS,IAAS,KAAK,IAAI,YAAY,MAClC,uBACA,wEACMR,EAAW,eAAe,QAAQF,CAAS,CAAC,CACpD;EACA,AAAKU,KAIL,KAAK,IAAI,OAAO,KAAK,mBAAmB;GACtC,mBAAmBA,EAAO;GAC1B,qBAAqBA,EAAO;GAC5B,mBAAmBA,EAAO;GAC1B,kBAAmB,SAA6B,iBAAiB;EACnE,CAAC;CACH;CAGA,aAAoC;EAClC,IAAI,KAAK,SACP;EAGF,IAAMA,IAAsB;GAC1B,WAAW,KAAK,IAAI,UAAU;GAC9B,IAAI,KAAK,IAAI;GACb,YAAY,SAAS;EACvB;EAEA,KAAK,IAAI,YAAY,MACnB,uBACA,yEACM;GACJ,eAAe,QAAQV,GAAW,KAAK,UAAUU,CAAM,CAAC;EAC1D,CACF;CACF;CAGA,QAAsB;EACpB,KAAK,IAAI,YAAY,MACnB,uBACA,4EACM;GACJ,eAAe,WAAWV,CAAS;EACrC,CACF;CACF;CAGA,mBAA0C;EAExC,AADA,KAAK,UAAU,IACf,KAAK,MAAM;CACb;CAGA,cAA+B,MAAuB;EACpD,AAAKW,EAA8B,cACjC,KAAK,UAAU,IACf,KAAK,KAAK;CAEd;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unref-CU9Nyz_9.cjs","names":["unrefTimer","timer"],"sources":["../src/utils/unref.ts"],"sourcesContent":["// src/utils/unref.ts\n//\n// Unreferences timer handles in Node and browser environments. A pending timer\n// keeps a Node process alive under SSR and in tests.\n\n/** A timer handle. A number in a browser, a Timeout object in Node. */\nexport type TimerHandle = number | { unref?: () => void };\n\n/**\n * Unreferences a timer handle, so a pending timer doesn't keep a Node.js process alive.\n * @param timer The timer handle returned by setTimeout.\n */\nexport function unrefTimer(timer: TimerHandle): void {\n if (typeof timer !== \"number\") {\n timer.unref?.();\n }\n}\n"],"mappings":"AAYA,SAAgBA,EAAW,EAA0B,CAC/C,OAAOC,GAAU,UACnBA,EAAM,QAAQ,CAElB,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unref-DgHPQeWv.js","names":["unrefTimer","timer"],"sources":["../src/utils/unref.ts"],"sourcesContent":["// src/utils/unref.ts\n//\n// Unreferences timer handles in Node and browser environments. A pending timer\n// keeps a Node process alive under SSR and in tests.\n\n/** A timer handle. A number in a browser, a Timeout object in Node. */\nexport type TimerHandle = number | { unref?: () => void };\n\n/**\n * Unreferences a timer handle, so a pending timer doesn't keep a Node.js process alive.\n * @param timer The timer handle returned by setTimeout.\n */\nexport function unrefTimer(timer: TimerHandle): void {\n if (typeof timer !== \"number\") {\n timer.unref?.();\n }\n}\n"],"mappings":";AAYA,SAAgBA,EAAW,GAA0B;CACnD,AAAI,OAAOC,KAAU,YACnBA,EAAM,QAAQ;AAElB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("./platform-12uR7kBQ.cjs"),t=require("./types-C7WNpnG1.cjs");var n={name:`ui.user_timing.duration`,kind:`histogram`,unit:`ms`,boundaries:[1,5,10,25,50,100,250,500,1e3,2500,5e3,1e4]},r=class{ctx;name=`userTiming`;observer;constructor(e){this.ctx=e}install(){if(this.observer)return;let{once:e}=this.ctx,t=!e.userTiming;e.userTiming=!0;let n=typeof PerformanceObserver>`u`?void 0:PerformanceObserver.supportedEntryTypes;n?.includes(`measure`)?(this.observer=new PerformanceObserver(e=>{this.ctx.diagnostics.guard(`capture.record_failed`,`The library could not record a user timing entry.`,()=>{this.record(e.getEntries())})}),this.observer.observe({type:`measure`,buffered:t}),n.includes(`mark`)&&this.observer.observe({type:`mark`,buffered:t})):t&&this.ctx.diagnostics.report(`capture.install_failed`,`The browser does not report User Timing entries. The user timing capture is off.`)}uninstall(){this.observer?.disconnect(),this.observer=void 0}record(r){if(this.ctx.isActive?.()===!1)return;let{fullUrls:i,userTimingInclude:a}=this.ctx.config.capture;for(let o of r){if(a.length>0&&!t.t(o.name,a))continue;let r=e.i(o.name,i);o.entryType===`measure`?this.ctx.recordMetric(n,o.duration,{"user_timing.name":r}):this.ctx.breadcrumbs.push({t:Math.round(performance.timeOrigin+o.startTime),category:`event`,message:r.slice(0,this.ctx.config.limits.maxBodyChars)})}}};exports.UserTimingCapture=r;
|
|
2
|
+
//# sourceMappingURL=user-timing-CdYqx3PF.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-timing-CdYqx3PF.cjs","names":["matchesAny","recordedUrl","require_platform","require_types","USER_TIMING_DURATION","UserTimingCapture","ctx","first","once","supported","list","entry","entries","userTimingInclude","name","fullUrls"],"sources":["../src/capture/user-timing.ts"],"sourcesContent":["// src/capture/user-timing.ts\n//\n// Records the app's marks and measures from the User Timing API. A measure goes into a\n// histogram, and a mark adds a breadcrumb.\n\nimport type { InstrumentDef } from \"../models/metric\";\nimport { recordedUrl } from \"../utils/platform\";\nimport { type Capture, type CaptureContext, matchesAny } from \"./types\";\n\n/** Histogram of the app's measures, in milliseconds. */\nconst USER_TIMING_DURATION: InstrumentDef = {\n name: \"ui.user_timing.duration\",\n kind: \"histogram\",\n unit: \"ms\",\n boundaries: [1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000],\n};\n\n/** Observes the app's marks and measures. */\nexport class UserTimingCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"userTiming\";\n\n /** Observer for the mark and measure entries. */\n private observer: PerformanceObserver | undefined;\n\n /**\n * @param ctx Capture context with the config, the meter and the breadcrumbs.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Observes marks and measures. Only the first install in a document reads buffered entries. */\n install(): void {\n if (this.observer) {\n return;\n }\n\n const { once } = this.ctx;\n const first = !once.userTiming;\n once.userTiming = true;\n\n // Older browsers have no supportedEntryTypes, and the capture stays off there.\n const supported: readonly string[] | undefined =\n typeof PerformanceObserver === \"undefined\"\n ? undefined\n : PerformanceObserver.supportedEntryTypes;\n if (!supported?.includes(\"measure\")) {\n if (first) {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n \"The browser does not report User Timing entries. The user timing capture is off.\",\n );\n }\n return;\n }\n\n this.observer = new PerformanceObserver((list) => {\n // The browser calls this directly, so anything we throw is an uncaught error on the page.\n this.ctx.diagnostics.guard(\n \"capture.record_failed\",\n \"The library could not record a user timing entry.\",\n () => {\n this.record(list.getEntries());\n },\n );\n });\n // Buffered entries include the marks and measures made before this chunk loaded.\n this.observer.observe({ type: \"measure\", buffered: first });\n if (supported.includes(\"mark\")) {\n this.observer.observe({ type: \"mark\", buffered: first });\n }\n }\n\n /** Disconnects the observer. */\n uninstall(): void {\n this.observer?.disconnect();\n this.observer = undefined;\n }\n\n /**\n * Records the entries whose name `userTimingInclude` selects.\n * @param entries Mark and measure entries.\n */\n private record(entries: PerformanceEntryList): void {\n if (this.ctx.isActive?.() === false) {\n return;\n }\n\n const { fullUrls, userTimingInclude } = this.ctx.config.capture;\n for (const entry of entries) {\n if (userTimingInclude.length > 0 && !matchesAny(entry.name, userTimingInclude)) {\n continue;\n }\n\n // A third-party script can write any name, so a name can hold a URL with a token.\n const name = recordedUrl(entry.name, fullUrls);\n if (entry.entryType === \"measure\") {\n this.ctx.recordMetric(USER_TIMING_DURATION, entry.duration, { \"user_timing.name\": name });\n } else {\n this.ctx.breadcrumbs.push({\n // A buffered entry reaches the observer late, and the trail needs the mark's own time.\n t: Math.round(performance.timeOrigin + entry.startTime),\n category: \"event\",\n message: name.slice(0, this.ctx.config.limits.maxBodyChars),\n });\n }\n }\n }\n}\n"],"mappings":"A,6EAUA,IAAMI,EAAsC,CAC1C,KAAM,0BACN,KAAM,YACN,KAAM,KACN,WAAY,CAAC,EAAG,EAAG,GAAI,GAAI,GAAI,IAAK,IAAK,IAAK,IAAM,KAAM,IAAM,GAAK,CACvE,EAGaC,EAAb,KAAkD,CAUnB,IAR7B,KAAgB,aAGhB,SAKA,YAAY,EAAsC,CAArB,KAAA,IAAAC,CAAsB,CAGnD,SAAgB,CACd,GAAI,KAAK,SACP,OAGF,GAAM,CAAE,QAAS,KAAK,IAChBC,EAAQ,CAACC,EAAK,WACpB,EAAK,WAAa,GAGlB,IAAMC,EACJ,OAAO,oBAAwB,IAC3B,IAAA,GACA,oBAAoB,oBACrBA,GAAW,SAAS,SAAS,GAUlC,KAAK,SAAW,IAAI,oBAAqB,GAAS,CAEhD,KAAK,IAAI,YAAY,MACnB,wBACA,wDACM,CACJ,KAAK,OAAOC,EAAK,WAAW,CAAC,CAC/B,CACF,CACF,CAAC,EAED,KAAK,SAAS,QAAQ,CAAE,KAAM,UAAW,SAAUH,CAAM,CAAC,EACtDE,EAAU,SAAS,MAAM,GAC3B,KAAK,SAAS,QAAQ,CAAE,KAAM,OAAQ,SAAUF,CAAM,CAAC,GAtBnDA,GACF,KAAK,IAAI,YAAY,OACnB,yBACA,kFACF,CAoBN,CAGA,WAAkB,CAChB,KAAK,UAAU,WAAW,EAC1B,KAAK,SAAW,IAAA,EAClB,CAMA,OAAe,EAAqC,CAClD,GAAI,KAAK,IAAI,WAAW,IAAM,GAC5B,OAGF,GAAM,CAAE,WAAU,qBAAsB,KAAK,IAAI,OAAO,QACxD,IAAK,IAAMI,KAASC,EAAS,CAC3B,GAAIC,EAAkB,OAAS,GAAK,CAACb,EAAAA,EAAWW,EAAM,KAAME,CAAiB,EAC3E,SAIF,IAAMC,EAAOb,EAAAA,EAAYU,EAAM,KAAMI,CAAQ,EACzCJ,EAAM,YAAc,UACtB,KAAK,IAAI,aAAaP,EAAsBO,EAAM,SAAU,CAAE,mBAAoBG,CAAK,CAAC,EAExF,KAAK,IAAI,YAAY,KAAK,CAExB,EAAG,KAAK,MAAM,YAAY,WAAaH,EAAM,SAAS,EACtD,SAAU,QACV,QAASG,EAAK,MAAM,EAAG,KAAK,IAAI,OAAO,OAAO,YAAY,CAC5D,CAAC,CAEL,CACF,CACF,E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e } from "./platform-
|
|
1
|
+
import { i as e } from "./platform-CVewe4wQ.js";
|
|
2
2
|
import { t } from "./types-BAerHgCq.js";
|
|
3
3
|
// src/capture/user-timing.ts
|
|
4
4
|
var n = {
|
|
@@ -32,7 +32,9 @@ var n = {
|
|
|
32
32
|
e.userTiming = !0;
|
|
33
33
|
let n = typeof PerformanceObserver > "u" ? void 0 : PerformanceObserver.supportedEntryTypes;
|
|
34
34
|
n?.includes("measure") ? (this.observer = new PerformanceObserver((e) => {
|
|
35
|
-
this.
|
|
35
|
+
this.ctx.diagnostics.guard("capture.record_failed", "The library could not record a user timing entry.", () => {
|
|
36
|
+
this.record(e.getEntries());
|
|
37
|
+
});
|
|
36
38
|
}), this.observer.observe({
|
|
37
39
|
type: "measure",
|
|
38
40
|
buffered: t
|
|
@@ -60,4 +62,4 @@ var n = {
|
|
|
60
62
|
};
|
|
61
63
|
export { r as UserTimingCapture };
|
|
62
64
|
|
|
63
|
-
//# sourceMappingURL=user-timing-
|
|
65
|
+
//# sourceMappingURL=user-timing-DgHubxCI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-timing-DgHubxCI.js","names":["recordedUrl","USER_TIMING_DURATION","UserTimingCapture","ctx","first","once","supported","list","entry","entries","userTimingInclude","matchesAny","name","fullUrls"],"sources":["../src/capture/user-timing.ts"],"sourcesContent":["// src/capture/user-timing.ts\n//\n// Records the app's marks and measures from the User Timing API. A measure goes into a\n// histogram, and a mark adds a breadcrumb.\n\nimport type { InstrumentDef } from \"../models/metric\";\nimport { recordedUrl } from \"../utils/platform\";\nimport { type Capture, type CaptureContext, matchesAny } from \"./types\";\n\n/** Histogram of the app's measures, in milliseconds. */\nconst USER_TIMING_DURATION: InstrumentDef = {\n name: \"ui.user_timing.duration\",\n kind: \"histogram\",\n unit: \"ms\",\n boundaries: [1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000],\n};\n\n/** Observes the app's marks and measures. */\nexport class UserTimingCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"userTiming\";\n\n /** Observer for the mark and measure entries. */\n private observer: PerformanceObserver | undefined;\n\n /**\n * @param ctx Capture context with the config, the meter and the breadcrumbs.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Observes marks and measures. Only the first install in a document reads buffered entries. */\n install(): void {\n if (this.observer) {\n return;\n }\n\n const { once } = this.ctx;\n const first = !once.userTiming;\n once.userTiming = true;\n\n // Older browsers have no supportedEntryTypes, and the capture stays off there.\n const supported: readonly string[] | undefined =\n typeof PerformanceObserver === \"undefined\"\n ? undefined\n : PerformanceObserver.supportedEntryTypes;\n if (!supported?.includes(\"measure\")) {\n if (first) {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n \"The browser does not report User Timing entries. The user timing capture is off.\",\n );\n }\n return;\n }\n\n this.observer = new PerformanceObserver((list) => {\n // The browser calls this directly, so anything we throw is an uncaught error on the page.\n this.ctx.diagnostics.guard(\n \"capture.record_failed\",\n \"The library could not record a user timing entry.\",\n () => {\n this.record(list.getEntries());\n },\n );\n });\n // Buffered entries include the marks and measures made before this chunk loaded.\n this.observer.observe({ type: \"measure\", buffered: first });\n if (supported.includes(\"mark\")) {\n this.observer.observe({ type: \"mark\", buffered: first });\n }\n }\n\n /** Disconnects the observer. */\n uninstall(): void {\n this.observer?.disconnect();\n this.observer = undefined;\n }\n\n /**\n * Records the entries whose name `userTimingInclude` selects.\n * @param entries Mark and measure entries.\n */\n private record(entries: PerformanceEntryList): void {\n if (this.ctx.isActive?.() === false) {\n return;\n }\n\n const { fullUrls, userTimingInclude } = this.ctx.config.capture;\n for (const entry of entries) {\n if (userTimingInclude.length > 0 && !matchesAny(entry.name, userTimingInclude)) {\n continue;\n }\n\n // A third-party script can write any name, so a name can hold a URL with a token.\n const name = recordedUrl(entry.name, fullUrls);\n if (entry.entryType === \"measure\") {\n this.ctx.recordMetric(USER_TIMING_DURATION, entry.duration, { \"user_timing.name\": name });\n } else {\n this.ctx.breadcrumbs.push({\n // A buffered entry reaches the observer late, and the trail needs the mark's own time.\n t: Math.round(performance.timeOrigin + entry.startTime),\n category: \"event\",\n message: name.slice(0, this.ctx.config.limits.maxBodyChars),\n });\n }\n }\n }\n}\n"],"mappings":";;;AAUA,IAAMC,IAAsC;CAC1C,MAAM;CACN,MAAM;CACN,MAAM;CACN,YAAY;EAAC;EAAG;EAAG;EAAI;EAAI;EAAI;EAAK;EAAK;EAAK;EAAM;EAAM;EAAM;CAAK;AACvE,GAGaC,IAAb,MAAkD;CAUnB;CAR7B,OAAgB;CAGhB;CAKA,YAAY,GAAsC;EAArB,KAAA,MAAAC;CAAsB;CAGnD,UAAgB;EACd,IAAI,KAAK,UACP;EAGF,IAAM,EAAE,YAAS,KAAK,KAChBC,IAAQ,CAACC,EAAK;EACpB,EAAK,aAAa;EAGlB,IAAMC,IACJ,OAAO,sBAAwB,MAC3B,KAAA,IACA,oBAAoB;EAC1B,AAAKA,GAAW,SAAS,SAAS,KAUlC,KAAK,WAAW,IAAI,qBAAqB,MAAS;GAEhD,KAAK,IAAI,YAAY,MACnB,yBACA,2DACM;IACJ,KAAK,OAAOC,EAAK,WAAW,CAAC;GAC/B,CACF;EACF,CAAC,GAED,KAAK,SAAS,QAAQ;GAAE,MAAM;GAAW,UAAUH;EAAM,CAAC,GACtDE,EAAU,SAAS,MAAM,KAC3B,KAAK,SAAS,QAAQ;GAAE,MAAM;GAAQ,UAAUF;EAAM,CAAC,KAtBnDA,KACF,KAAK,IAAI,YAAY,OACnB,0BACA,kFACF;CAoBN;CAGA,YAAkB;EAEhB,AADA,KAAK,UAAU,WAAW,GAC1B,KAAK,WAAW,KAAA;CAClB;CAMA,OAAe,GAAqC;EAClD,IAAI,KAAK,IAAI,WAAW,MAAM,IAC5B;EAGF,IAAM,EAAE,aAAU,yBAAsB,KAAK,IAAI,OAAO;EACxD,KAAK,IAAMI,KAASC,GAAS;GAC3B,IAAIC,EAAkB,SAAS,KAAK,CAACC,EAAWH,EAAM,MAAME,CAAiB,GAC3E;GAIF,IAAME,IAAOZ,EAAYQ,EAAM,MAAMK,CAAQ;GAC7C,AAAIL,EAAM,cAAc,YACtB,KAAK,IAAI,aAAaP,GAAsBO,EAAM,UAAU,EAAE,oBAAoBI,EAAK,CAAC,IAExF,KAAK,IAAI,YAAY,KAAK;IAExB,GAAG,KAAK,MAAM,YAAY,aAAaJ,EAAM,SAAS;IACtD,UAAU;IACV,SAASI,EAAK,MAAM,GAAG,KAAK,IAAI,OAAO,OAAO,YAAY;GAC5D,CAAC;EAEL;CACF;AACF"}
|
package/dist/utils/console.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare class ConsoleSink {
|
|
|
10
10
|
/**
|
|
11
11
|
* @param settings Console level and styles. A null level prints nothing.
|
|
12
12
|
* @param diagnostics Diagnostics reporter.
|
|
13
|
-
* @param limits Size limits
|
|
13
|
+
* @param limits Size limits for the printed payload. Same as the record limits.
|
|
14
14
|
*/
|
|
15
15
|
constructor(settings: ResolvedConsole, diagnostics: Diagnostics, limits?: SanitizeLimits);
|
|
16
16
|
/**
|
|
@@ -19,7 +19,7 @@ export declare class ConsoleSink {
|
|
|
19
19
|
*/
|
|
20
20
|
update(settings: ResolvedConsole): void;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Checks whether a level clears the console threshold.
|
|
23
23
|
* @param level Severity level of the record.
|
|
24
24
|
* @returns True if the sink prints this level.
|
|
25
25
|
*/
|
package/dist/utils/deadline.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** The error for a promise that didn't settle before its deadline. */
|
|
2
2
|
export declare class DeadlineError extends Error {
|
|
3
3
|
/**
|
|
4
4
|
* @param ms Deadline in milliseconds.
|
|
@@ -6,9 +6,9 @@ export declare class DeadlineError extends Error {
|
|
|
6
6
|
constructor(ms: number);
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Rejects when a promise
|
|
10
|
-
* @param work
|
|
9
|
+
* Rejects when a promise doesn't settle within a deadline.
|
|
10
|
+
* @param work The promise to bound.
|
|
11
11
|
* @param ms Deadline in milliseconds.
|
|
12
|
-
* @returns The value
|
|
12
|
+
* @returns The promise's value, or a rejection after the deadline.
|
|
13
13
|
*/
|
|
14
14
|
export declare function withDeadline<T>(work: Promise<T>, ms: number): Promise<T>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** The standard error fields. Any other own field is written as error data. */
|
|
2
2
|
export declare const ERROR_OWN_KEYS: ReadonlySet<string>;
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* config
|
|
4
|
+
* Checks whether a value is a field that error data keeps. An object field, such as an
|
|
5
|
+
* AxiosError's config, holds credentials and request bodies.
|
|
6
6
|
* @param value Field value.
|
|
7
7
|
* @returns True for a string, a number or a boolean.
|
|
8
8
|
*/
|
|
9
9
|
export declare function isDataField(value: unknown): boolean;
|
|
10
|
-
/** The fields
|
|
10
|
+
/** The error fields that the library reads. */
|
|
11
11
|
export interface ErrorLike {
|
|
12
12
|
/** Error class name, for example "TypeError". */
|
|
13
13
|
name: string;
|
|
@@ -17,9 +17,9 @@ export interface ErrorLike {
|
|
|
17
17
|
stack?: string;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @param value
|
|
20
|
+
* Checks whether a value has the shape of an error. A getter on a hostile value can throw, so
|
|
21
|
+
* call this inside a diagnostics guard.
|
|
22
|
+
* @param value The value to check.
|
|
23
23
|
* @returns True for an object with a string name, a string message and a string or no stack.
|
|
24
24
|
*/
|
|
25
25
|
export declare function isErrorLike(value: unknown): value is ErrorLike;
|
|
@@ -7,18 +7,19 @@ export interface StormWindow {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Counts one event in a fixed window.
|
|
10
|
-
* @param window
|
|
11
|
-
* @param limit Maximum events
|
|
12
|
-
* @param windowMs
|
|
10
|
+
* @param window The window state to update.
|
|
11
|
+
* @param limit Maximum events per window.
|
|
12
|
+
* @param windowMs Window length in milliseconds.
|
|
13
13
|
* @returns False when the window has no allowance left. The caller must drop the event.
|
|
14
14
|
*/
|
|
15
15
|
export declare function countInWindow(window: StormWindow, limit: number, windowMs: number): boolean;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Checks whether a fixed window has ended. The bus uses the same rule to expire its source
|
|
18
|
+
* entries.
|
|
18
19
|
* @param window Window state.
|
|
19
|
-
* @param windowMs
|
|
20
|
-
* @param now Current epoch time
|
|
21
|
-
* @returns True
|
|
22
|
-
* check, a clock that moves back
|
|
20
|
+
* @param windowMs Window length in milliseconds.
|
|
21
|
+
* @param now Current epoch time in milliseconds.
|
|
22
|
+
* @returns True once the window length has passed, or when the clock moved back. Without the
|
|
23
|
+
* second check, a clock that moves back would keep the window open.
|
|
23
24
|
*/
|
|
24
25
|
export declare function windowEnded(window: StormWindow, windowMs: number, now: number): boolean;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** A scope that a function runs inside. */
|
|
2
2
|
export interface GlobalScope {
|
|
3
3
|
/**
|
|
4
|
-
* Runs a function inside the scope.
|
|
5
|
-
* @param fn
|
|
6
|
-
* @returns The return value
|
|
4
|
+
* Runs a function inside the scope. Only the synchronous part of the function is covered.
|
|
5
|
+
* @param fn The function to run.
|
|
6
|
+
* @returns The function's return value.
|
|
7
7
|
*/
|
|
8
8
|
run<T>(fn: () => T): T;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @returns True while a function
|
|
10
|
+
* Checks whether a scope is open.
|
|
11
|
+
* @returns True while a function is running inside the scope.
|
|
12
12
|
*/
|
|
13
13
|
open(): boolean;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @param key
|
|
16
|
+
* Creates a scope whose count lives on a global symbol.
|
|
17
|
+
* @param key The global symbol's key.
|
|
18
18
|
* @returns The scope.
|
|
19
19
|
*/
|
|
20
20
|
export declare function globalScope(key: string): GlobalScope;
|
package/dist/utils/guards.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param value
|
|
2
|
+
* Checks whether a value is a non-null object that isn't an array.
|
|
3
|
+
* @param value The value to check.
|
|
4
4
|
* @returns True for an object with string keys.
|
|
5
5
|
*/
|
|
6
6
|
export declare function isObject(value: unknown): value is Record<string, unknown>;
|
package/dist/utils/identity.d.ts
CHANGED
|
@@ -35,31 +35,31 @@ export interface IdentityStores {
|
|
|
35
35
|
/** Store that lasts for one tab. */
|
|
36
36
|
session(): KeyValueStore;
|
|
37
37
|
}
|
|
38
|
-
/** Stores that write to the browser.
|
|
38
|
+
/** Stores that write to the browser. Used by the `identity: "storage"` option. */
|
|
39
39
|
export declare const BROWSER_STORES: IdentityStores;
|
|
40
40
|
/**
|
|
41
|
-
* Creates stores that keep values in memory only.
|
|
41
|
+
* Creates stores that keep values in memory only. Used by the `identity: "memory"` option.
|
|
42
42
|
* @returns Stores that write nothing to the browser.
|
|
43
43
|
*/
|
|
44
44
|
export declare function memoryStores(): IdentityStores;
|
|
45
45
|
/**
|
|
46
|
-
* Generates a random lowercase hexadecimal string of the
|
|
47
|
-
*
|
|
46
|
+
* Generates a random lowercase hexadecimal string of the given byte length. Uses
|
|
47
|
+
* crypto.getRandomValues when it is available, and Math.random otherwise.
|
|
48
48
|
* @param byteLength Number of random bytes to generate.
|
|
49
49
|
* @returns Hexadecimal string of length byteLength * 2.
|
|
50
50
|
*/
|
|
51
51
|
export declare function randomHex(byteLength: number): string;
|
|
52
52
|
/**
|
|
53
|
-
* Generates a unique identifier
|
|
54
|
-
* @param diagnostics Diagnostics reporter.
|
|
55
|
-
* @returns UUID or random hex identifier.
|
|
53
|
+
* Generates a unique identifier with crypto.randomUUID, falling back to randomHex.
|
|
54
|
+
* @param diagnostics Diagnostics reporter. Counts a blocked crypto.randomUUID call.
|
|
55
|
+
* @returns A UUID or a random hex identifier.
|
|
56
56
|
*/
|
|
57
57
|
export declare function newId(diagnostics: Diagnostics): string;
|
|
58
58
|
/**
|
|
59
|
-
* Resolves or initializes session, tab, and context identifiers for the active realm.
|
|
59
|
+
* Resolves or initializes the session, tab, and context identifiers for the active realm.
|
|
60
60
|
* @param diagnostics Diagnostics reporter.
|
|
61
61
|
* @param stores Identity stores.
|
|
62
|
-
* @returns
|
|
62
|
+
* @returns The populated Identity object.
|
|
63
63
|
*/
|
|
64
64
|
export declare function resolveIdentity(diagnostics: Diagnostics, stores?: IdentityStores, idleMs?: number): Identity;
|
|
65
65
|
/**
|
|
@@ -70,9 +70,9 @@ export declare function resolveIdentity(diagnostics: Diagnostics, stores?: Ident
|
|
|
70
70
|
*/
|
|
71
71
|
export declare function persistTabId(tabId: string, diagnostics: Diagnostics, stores: IdentityStores): void;
|
|
72
72
|
/**
|
|
73
|
-
* Writes the last-seen timestamp
|
|
74
|
-
*
|
|
75
|
-
*
|
|
73
|
+
* Writes the session's last-seen timestamp, throttled by `SESSION_TOUCH_MS`. The throttle
|
|
74
|
+
* state lives on the instance, not the module, so two runtimes in one document don't block
|
|
75
|
+
* each other's session writes.
|
|
76
76
|
*/
|
|
77
77
|
export declare class SessionTouch {
|
|
78
78
|
private diagnostics;
|
|
@@ -87,18 +87,18 @@ export declare class SessionTouch {
|
|
|
87
87
|
*/
|
|
88
88
|
constructor(diagnostics: Diagnostics, stores?: IdentityStores, touchMs?: number, idleMs?: number);
|
|
89
89
|
/**
|
|
90
|
-
* Writes the session activity time to the local store
|
|
91
|
-
* @param sessionId
|
|
90
|
+
* Writes the session activity time to the local store, at most once per throttle window.
|
|
91
|
+
* @param sessionId The active session identifier.
|
|
92
92
|
*/
|
|
93
93
|
touch(sessionId: string): void;
|
|
94
94
|
/**
|
|
95
|
-
* Reads the live session id
|
|
95
|
+
* Reads the live session id from the local store.
|
|
96
96
|
* @returns The stored session id, or undefined if no session is live.
|
|
97
97
|
*/
|
|
98
98
|
stored(): string | undefined;
|
|
99
99
|
/**
|
|
100
|
-
* Writes a new session id to the local store
|
|
101
|
-
* @param sessionId
|
|
100
|
+
* Writes a new session id to the local store right away, bypassing the throttle.
|
|
101
|
+
* @param sessionId The new session identifier.
|
|
102
102
|
*/
|
|
103
103
|
restart(sessionId: string): void;
|
|
104
104
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Runs a function inside the library console scope.
|
|
3
|
-
* @param fn
|
|
4
|
-
* @returns The return value
|
|
3
|
+
* @param fn The function that writes to the console.
|
|
4
|
+
* @returns The function's return value.
|
|
5
5
|
*/
|
|
6
6
|
export declare function runAsLibraryConsole<T>(fn: () => T): T;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @returns True while the library
|
|
8
|
+
* Checks whether a library console scope is open.
|
|
9
|
+
* @returns True while the library is writing to the console.
|
|
10
10
|
*/
|
|
11
11
|
export declare function isLibraryConsole(): boolean;
|