@utk09/ui-observability 0.11.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +481 -0
- package/README.md +73 -669
- package/bin/uiobs.mjs +1 -1
- package/dist/{batch-CL9uWYY3.js → batch-CXmPmTse.js} +3 -3
- package/dist/batch-CXmPmTse.js.map +1 -0
- package/dist/{batch-C8OcWR2L.cjs → batch-mmPigCpi.cjs} +2 -2
- package/dist/batch-mmPigCpi.cjs.map +1 -0
- package/dist/bus/bus.d.cts +331 -0
- package/dist/bus/bus.d.ts +108 -57
- package/dist/bus/links.d.cts +132 -0
- package/dist/bus/links.d.ts +22 -7
- package/dist/bus/validation.d.cts +16 -0
- package/dist/bus/validation.d.ts +11 -2
- package/dist/bus-C39wspFV.js +775 -0
- package/dist/bus-C39wspFV.js.map +1 -0
- package/dist/bus-_EaOVPGq.cjs +2 -0
- package/dist/bus-_EaOVPGq.cjs.map +1 -0
- package/dist/capture/console.d.cts +37 -0
- package/dist/capture/console.d.ts +11 -11
- package/dist/capture/errors.d.cts +32 -0
- package/dist/capture/errors.d.ts +7 -7
- package/dist/capture/interactions.d.cts +48 -0
- package/dist/capture/interactions.d.ts +15 -15
- package/dist/capture/lifecycle.d.cts +20 -0
- package/dist/capture/lifecycle.d.ts +4 -4
- package/dist/capture/long-frames.d.cts +31 -0
- package/dist/capture/long-frames.d.ts +7 -7
- package/dist/capture/network.d.cts +57 -0
- package/dist/capture/network.d.ts +18 -18
- package/dist/capture/profiler-frames.d.cts +44 -0
- package/dist/capture/profiler-frames.d.ts +44 -0
- package/dist/capture/replay-buffer.d.cts +45 -0
- package/dist/capture/replay-buffer.d.ts +45 -0
- package/dist/capture/replay-upload.d.cts +79 -0
- package/dist/capture/replay-upload.d.ts +79 -0
- package/dist/capture/replay.d.cts +114 -0
- package/dist/capture/replay.d.ts +114 -0
- package/dist/capture/reports.d.cts +17 -0
- package/dist/capture/reports.d.ts +3 -3
- package/dist/capture/resource-timing.d.cts +14 -0
- package/dist/capture/resource-timing.d.ts +2 -2
- package/dist/capture/server-timing.d.cts +19 -0
- package/dist/capture/server-timing.d.ts +3 -3
- package/dist/capture/storm.d.cts +13 -0
- package/dist/capture/storm.d.ts +7 -7
- package/dist/capture/types.d.cts +128 -0
- package/dist/capture/types.d.ts +54 -41
- package/dist/capture/unclean-exit.d.cts +31 -0
- package/dist/capture/unclean-exit.d.ts +9 -9
- package/dist/capture/user-timing.d.cts +22 -0
- package/dist/capture/user-timing.d.ts +4 -4
- package/dist/capture/web-socket.d.cts +40 -0
- package/dist/capture/web-socket.d.ts +14 -14
- package/dist/capture/web-vitals.d.cts +40 -0
- package/dist/capture/web-vitals.d.ts +21 -8
- package/dist/compression-CvED_Jel.cjs +2 -0
- package/dist/compression-CvED_Jel.cjs.map +1 -0
- package/dist/compression-tVtXwVjX.js +11 -0
- package/dist/compression-tVtXwVjX.js.map +1 -0
- package/dist/config-DUs7uHHt.cjs +2 -0
- package/dist/config-DUs7uHHt.cjs.map +1 -0
- package/dist/config-SgQcCP1_.js +560 -0
- package/dist/config-SgQcCP1_.js.map +1 -0
- package/dist/console-BGgGnjSi.js +81 -0
- package/dist/console-BGgGnjSi.js.map +1 -0
- package/dist/console-CSZ5_Vx5.cjs +2 -0
- package/dist/console-CSZ5_Vx5.cjs.map +1 -0
- package/dist/constants-CUyd9cTZ.js +357 -0
- package/dist/constants-CUyd9cTZ.js.map +1 -0
- package/dist/constants-CqdJhTxH.cjs +2 -0
- package/dist/constants-CqdJhTxH.cjs.map +1 -0
- package/dist/constants.d.cts +751 -0
- package/dist/constants.d.ts +231 -116
- package/dist/core/breadcrumbs.d.cts +54 -0
- package/dist/core/breadcrumbs.d.ts +21 -15
- package/dist/core/config.d.cts +45 -0
- package/dist/core/config.d.ts +33 -5
- package/dist/core/context.d.cts +24 -0
- package/dist/core/context.d.ts +8 -13
- package/dist/core/debug-buffer.d.cts +34 -0
- package/dist/core/debug-buffer.d.ts +13 -13
- package/dist/core/debug-bundle.d.cts +12 -0
- package/dist/core/debug-bundle.d.ts +6 -6
- package/dist/core/deferred.d.cts +7 -0
- package/dist/core/deferred.d.ts +4 -4
- package/dist/core/diagnostics.d.cts +86 -0
- package/dist/core/diagnostics.d.ts +25 -22
- package/dist/core/drops.d.cts +39 -0
- package/dist/core/drops.d.ts +22 -12
- package/dist/core/hold-buffer.d.cts +36 -0
- package/dist/core/hold-buffer.d.ts +16 -7
- package/dist/core/journey.d.cts +148 -0
- package/dist/core/journey.d.ts +28 -29
- package/dist/core/logger.d.cts +141 -0
- package/dist/core/logger.d.ts +45 -51
- package/dist/core/measure.d.cts +30 -0
- package/dist/core/measure.d.ts +21 -10
- package/dist/core/meter.d.cts +78 -0
- package/dist/core/meter.d.ts +38 -28
- package/dist/core/pipeline.d.cts +227 -0
- package/dist/core/pipeline.d.ts +114 -50
- package/dist/core/profile-buckets.d.cts +31 -0
- package/dist/core/profile-buckets.d.ts +31 -0
- package/dist/core/profiler.d.cts +218 -0
- package/dist/core/profiler.d.ts +218 -0
- package/dist/core/record.d.cts +190 -0
- package/dist/core/record.d.ts +67 -35
- package/dist/core/remote-rules.d.cts +17 -0
- package/dist/core/remote-rules.d.ts +7 -7
- package/dist/core/remote-sampling.d.cts +74 -0
- package/dist/core/remote-sampling.d.ts +24 -23
- package/dist/core/rotation.d.cts +75 -0
- package/dist/core/rotation.d.ts +75 -0
- package/dist/core/runtime.d.cts +765 -0
- package/dist/core/runtime.d.ts +430 -186
- package/dist/core/sampling.d.cts +86 -0
- package/dist/core/sampling.d.ts +22 -22
- package/dist/core/sender.d.cts +161 -0
- package/dist/core/sender.d.ts +80 -34
- package/dist/core/spans.d.cts +39 -0
- package/dist/core/spans.d.ts +6 -6
- 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-BXIlwDKM.cjs +2 -0
- package/dist/debug-bundle-BXIlwDKM.cjs.map +1 -0
- package/dist/debug-bundle-CRpYV_ui.js +35 -0
- package/dist/debug-bundle-CRpYV_ui.js.map +1 -0
- package/dist/defineProperty-X1c4tIPD.cjs +1 -0
- package/dist/defineProperty-s2S8BXUc.js +35 -0
- package/dist/doctor.cjs +1 -1
- package/dist/doctor.cjs.map +1 -1
- package/dist/doctor.d.cts +36 -0
- package/dist/doctor.d.ts +19 -6
- package/dist/doctor.js +180 -53
- package/dist/doctor.js.map +1 -1
- package/dist/error-like-B11pB4aL.js.map +1 -1
- package/dist/error-like-gGRx2s36.cjs.map +1 -1
- package/dist/errors-BE_EZV7Q.js +86 -0
- package/dist/errors-BE_EZV7Q.js.map +1 -0
- package/dist/errors-CNPbesMs.cjs +3 -0
- package/dist/errors-CNPbesMs.cjs.map +1 -0
- package/dist/factory-CTi0Is3F.js +404 -0
- package/dist/factory-CTi0Is3F.js.map +1 -0
- package/dist/factory-hRrH32v5.cjs +2 -0
- package/dist/factory-hRrH32v5.cjs.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-BlYGRK4l.js +10 -0
- package/dist/guards-BlYGRK4l.js.map +1 -0
- package/dist/guards-EjG3ahFp.cjs +2 -0
- package/dist/guards-EjG3ahFp.cjs.map +1 -0
- package/dist/{identity-DT5VmvXy.js → identity-DdhKgrpk.js} +11 -15
- package/dist/identity-DdhKgrpk.js.map +1 -0
- package/dist/identity-DlWRIuwy.cjs +2 -0
- package/dist/identity-DlWRIuwy.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +300 -0
- package/dist/index.d.ts +165 -141
- package/dist/index.js +1283 -1468
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-storage-CL9uqBCy.cjs +2 -0
- package/dist/indexeddb-storage-CL9uqBCy.cjs.map +1 -0
- package/dist/{indexeddb-storage-BJVtiQKm.js → indexeddb-storage-GHdl0t8A.js} +51 -47
- package/dist/indexeddb-storage-GHdl0t8A.js.map +1 -0
- package/dist/interactions-CUkzK8sR.cjs +2 -0
- package/dist/interactions-CUkzK8sR.cjs.map +1 -0
- package/dist/{interactions-DTgKy_6K.js → interactions-DiFvCosX.js} +41 -49
- package/dist/interactions-DiFvCosX.js.map +1 -0
- package/dist/journey-B4Adltjm.cjs +2 -0
- package/dist/journey-B4Adltjm.cjs.map +1 -0
- package/dist/{journey-CuJrHzEg.js → journey-D2_sia57.js} +51 -53
- package/dist/journey-D2_sia57.js.map +1 -0
- package/dist/{library-console-C1m6g1BR.js → library-console-Btrzt814.js} +2 -2
- package/dist/library-console-Btrzt814.js.map +1 -0
- package/dist/{library-console-D2GY9Or6.cjs → library-console-CPW6bvZH.cjs} +2 -2
- package/dist/library-console-CPW6bvZH.cjs.map +1 -0
- package/dist/{library-request-BQBT9N9Q.js → library-request-BJ9PLRaD.js} +2 -2
- package/dist/library-request-BJ9PLRaD.js.map +1 -0
- package/dist/{library-request-1BX_UlaX.cjs → library-request-D7OvTxZV.cjs} +2 -2
- package/dist/library-request-D7OvTxZV.cjs.map +1 -0
- package/dist/{lifecycle-BaKx_-32.js → lifecycle-22CUCrc9.js} +21 -29
- package/dist/lifecycle-22CUCrc9.js.map +1 -0
- package/dist/lifecycle-IaAm1mOC.cjs +2 -0
- package/dist/lifecycle-IaAm1mOC.cjs.map +1 -0
- package/dist/{log-record-CAoGBBf3.js → log-record-BNiLfqtL.js} +8 -7
- package/dist/log-record-BNiLfqtL.js.map +1 -0
- package/dist/log-record-CkivuiEl.cjs +2 -0
- package/dist/log-record-CkivuiEl.cjs.map +1 -0
- package/dist/long-frames-BUUbXd-B.cjs +2 -0
- package/dist/long-frames-BUUbXd-B.cjs.map +1 -0
- package/dist/long-frames-DNFaRnC3.js +62 -0
- package/dist/long-frames-DNFaRnC3.js.map +1 -0
- package/dist/models/batch.d.cts +57 -0
- package/dist/models/batch.d.ts +16 -17
- package/dist/models/bus.d.cts +158 -0
- package/dist/models/bus.d.ts +46 -26
- package/dist/models/config.d.cts +1540 -0
- package/dist/models/config.d.ts +692 -405
- package/dist/models/drop.d.cts +54 -0
- package/dist/models/drop.d.ts +29 -14
- package/dist/models/health.d.cts +148 -0
- package/dist/models/health.d.ts +119 -23
- package/dist/models/log-record.d.cts +61 -0
- package/dist/models/log-record.d.ts +13 -14
- package/dist/models/metric.d.cts +139 -0
- package/dist/models/metric.d.ts +94 -18
- package/dist/models/plugin.d.cts +47 -0
- package/dist/models/plugin.d.ts +16 -16
- package/dist/models/replay.d.cts +60 -0
- package/dist/models/replay.d.ts +60 -0
- package/dist/models/serializer.d.cts +23 -0
- package/dist/models/serializer.d.ts +3 -4
- package/dist/models/storage.d.cts +95 -0
- package/dist/models/storage.d.ts +17 -14
- package/dist/network-CGMLQ-mA.cjs +2 -0
- package/dist/network-CGMLQ-mA.cjs.map +1 -0
- package/dist/{network-DBNwApoF.js → network-on2zZT6H.js} +57 -57
- package/dist/network-on2zZT6H.js.map +1 -0
- package/dist/openfin-Bxelt0yg.js.map +1 -1
- package/dist/openfin-DtH2f7zX.cjs.map +1 -1
- package/dist/otlp-BENHf3g9.cjs +2 -0
- package/dist/otlp-BENHf3g9.cjs.map +1 -0
- package/dist/{otlp-BTJdIa6F.js → otlp-DimfrRor.js} +22 -29
- package/dist/otlp-DimfrRor.js.map +1 -0
- package/dist/patch-BX8KrPCT.cjs.map +1 -1
- package/dist/patch-UdPz1ea8.js.map +1 -1
- package/dist/{platform-DkcuXwe-.js → platform-BaaFIPCU.js} +8 -8
- package/dist/platform-BaaFIPCU.js.map +1 -0
- package/dist/{platform-C2Ez5kDc.cjs → platform-CfA3-7sJ.cjs} +2 -2
- package/dist/platform-CfA3-7sJ.cjs.map +1 -0
- package/dist/profiler-BAZoh7A4.js +292 -0
- package/dist/profiler-BAZoh7A4.js.map +1 -0
- package/dist/profiler-D4tJpDRc.cjs +2 -0
- package/dist/profiler-D4tJpDRc.cjs.map +1 -0
- package/dist/profiler-frames-C4xr7KfH.cjs +2 -0
- package/dist/profiler-frames-C4xr7KfH.cjs.map +1 -0
- package/dist/profiler-frames-cJMx9wNM.js +78 -0
- package/dist/profiler-frames-cJMx9wNM.js.map +1 -0
- package/dist/remote-rules-Dz9MRAsB.js +95 -0
- package/dist/remote-rules-Dz9MRAsB.js.map +1 -0
- package/dist/remote-rules-_tY0zj5o.cjs +2 -0
- package/dist/remote-rules-_tY0zj5o.cjs.map +1 -0
- package/dist/replay-B3gFXIZd.cjs +2 -0
- package/dist/replay-B3gFXIZd.cjs.map +1 -0
- package/dist/replay-Ds-ANH34.js +310 -0
- package/dist/replay-Ds-ANH34.js.map +1 -0
- package/dist/reports-BDSe4dFH.cjs +2 -0
- package/dist/reports-BDSe4dFH.cjs.map +1 -0
- package/dist/{reports-TA-zInnq.js → reports-C-thq-bk.js} +25 -30
- package/dist/reports-C-thq-bk.js.map +1 -0
- package/dist/resource-timing-C576gFIQ.cjs +2 -0
- package/dist/resource-timing-C576gFIQ.cjs.map +1 -0
- package/dist/{resource-timing-BLv3EA2A.js → resource-timing-eUl2dNgC.js} +20 -23
- package/dist/resource-timing-eUl2dNgC.js.map +1 -0
- package/dist/response-body-YdNl-HkR.cjs +3 -0
- package/dist/response-body-YdNl-HkR.cjs.map +1 -0
- package/dist/response-body-eoSQpLiH.js +331 -0
- package/dist/response-body-eoSQpLiH.js.map +1 -0
- package/dist/rotation-Cwct4ckk.js +94 -0
- package/dist/rotation-Cwct4ckk.js.map +1 -0
- package/dist/rotation-D4qUAHAu.cjs +2 -0
- package/dist/rotation-D4qUAHAu.cjs.map +1 -0
- package/dist/sampling-BlrI8jor.js +63 -0
- package/dist/sampling-BlrI8jor.js.map +1 -0
- package/dist/sampling-mXt4dstx.cjs +2 -0
- package/dist/sampling-mXt4dstx.cjs.map +1 -0
- package/dist/{sanitize-6ymPlVvP.js → sanitize-Ba0KqU06.js} +2 -2
- package/dist/sanitize-Ba0KqU06.js.map +1 -0
- package/dist/{sanitize-BAWzkZt0.cjs → sanitize-DQyiI_KY.cjs} +2 -2
- package/dist/sanitize-DQyiI_KY.cjs.map +1 -0
- package/dist/sender-BdRuNVhF.cjs +2 -0
- package/dist/sender-BdRuNVhF.cjs.map +1 -0
- package/dist/sender-Dv8rAmpV.js +979 -0
- package/dist/sender-Dv8rAmpV.js.map +1 -0
- package/dist/storage/context-storage.d.cts +90 -0
- package/dist/storage/context-storage.d.ts +38 -37
- package/dist/storage/emergency-queue.d.cts +27 -0
- package/dist/storage/emergency-queue.d.ts +13 -13
- package/dist/storage/eviction.d.cts +40 -0
- package/dist/storage/eviction.d.ts +13 -13
- package/dist/storage/factory.d.cts +21 -0
- package/dist/storage/factory.d.ts +11 -10
- package/dist/storage/gap.d.cts +20 -0
- package/dist/storage/gap.d.ts +9 -9
- package/dist/storage/idb-driver.d.cts +93 -0
- package/dist/storage/idb-driver.d.ts +32 -33
- package/dist/storage/indexeddb-storage.d.cts +97 -0
- package/dist/storage/indexeddb-storage.d.ts +38 -31
- package/dist/storage/keys.d.cts +17 -0
- package/dist/storage/keys.d.ts +9 -9
- package/dist/storage/local-storage.d.cts +139 -0
- package/dist/storage/local-storage.d.ts +49 -42
- package/dist/storage/memory-storage.d.cts +73 -0
- package/dist/storage/memory-storage.d.ts +25 -25
- package/dist/storage/persistence.d.cts +8 -0
- package/dist/storage/persistence.d.ts +3 -3
- package/dist/storage/stored-context.d.cts +34 -0
- package/dist/storage/stored-context.d.ts +34 -0
- package/dist/stored-context-B2EzVuYm.js +51 -0
- package/dist/stored-context-B2EzVuYm.js.map +1 -0
- package/dist/stored-context-CXt7eHZL.cjs +2 -0
- package/dist/stored-context-CXt7eHZL.cjs.map +1 -0
- package/dist/storm-C-zYSdDX.cjs +2 -0
- package/dist/storm-C-zYSdDX.cjs.map +1 -0
- package/dist/storm-DjKetLKZ.js +9 -0
- package/dist/storm-DjKetLKZ.js.map +1 -0
- package/dist/transport/compression.d.cts +7 -0
- package/dist/transport/compression.d.ts +2 -2
- package/dist/transport/custom-transport.d.cts +22 -0
- package/dist/transport/custom-transport.d.ts +6 -5
- package/dist/transport/errors.d.cts +31 -0
- package/dist/transport/errors.d.ts +7 -7
- package/dist/transport/exit-flush.d.cts +135 -0
- package/dist/transport/exit-flush.d.ts +62 -45
- package/dist/transport/headers.d.cts +8 -0
- package/dist/transport/headers.d.ts +4 -4
- package/dist/transport/http-transport.d.cts +116 -0
- package/dist/transport/http-transport.d.ts +48 -35
- package/dist/transport/memory-transport.d.cts +30 -0
- package/dist/transport/memory-transport.d.ts +8 -8
- package/dist/transport/response-body.d.cts +49 -0
- package/dist/transport/response-body.d.ts +49 -0
- package/dist/transport/retry-engine.d.cts +129 -0
- package/dist/transport/retry-engine.d.ts +62 -43
- package/dist/transport/serializers/ecs.d.cts +3 -0
- package/dist/transport/serializers/ecs.d.ts +2 -2
- package/dist/transport/serializers/otlp-metrics.d.cts +3 -0
- package/dist/transport/serializers/otlp-metrics.d.ts +2 -2
- package/dist/transport/serializers/otlp-traces.d.cts +3 -0
- package/dist/transport/serializers/otlp-traces.d.ts +2 -2
- package/dist/transport/serializers/otlp.d.cts +47 -0
- package/dist/transport/serializers/otlp.d.ts +18 -18
- package/dist/transport/serializers/select.d.cts +38 -0
- package/dist/transport/serializers/select.d.ts +11 -11
- package/dist/transport/status-transport.d.cts +129 -0
- package/dist/transport/status-transport.d.ts +45 -28
- package/dist/transport/worker-client.d.cts +23 -0
- package/dist/transport/worker-client.d.ts +12 -3
- package/dist/transport/worker-entry.d.cts +5 -0
- package/dist/transport/worker-entry.d.ts +1 -1
- package/dist/transport/worker-protocol.d.cts +38 -0
- package/dist/transport/worker-protocol.d.ts +7 -5
- package/dist/transport/worker-server.d.cts +3 -0
- package/dist/transport/worker-server.d.ts +1 -1
- package/dist/transport/worker-transport.d.cts +10 -0
- package/dist/transport/worker-transport.d.ts +5 -4
- package/dist/types-BAerHgCq.js.map +1 -1
- package/dist/types-C7WNpnG1.cjs.map +1 -1
- package/dist/{unclean-exit-CwcUhFOn.js → unclean-exit-DQD1cT7c.js} +23 -30
- package/dist/unclean-exit-DQD1cT7c.js.map +1 -0
- package/dist/unclean-exit-py99ApzT.cjs +2 -0
- package/dist/unclean-exit-py99ApzT.cjs.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-_jZIhDKI.js → user-timing-BePqb1uN.js} +18 -18
- package/dist/user-timing-BePqb1uN.js.map +1 -0
- package/dist/user-timing-D6XTmpuM.cjs +2 -0
- package/dist/user-timing-D6XTmpuM.cjs.map +1 -0
- package/dist/utils/console.d.cts +36 -0
- package/dist/utils/console.d.ts +6 -6
- package/dist/utils/deadline.d.cts +14 -0
- package/dist/utils/deadline.d.ts +4 -4
- package/dist/utils/error-like.d.cts +25 -0
- package/dist/utils/error-like.d.ts +7 -7
- package/dist/utils/fixed-window.d.cts +25 -0
- package/dist/utils/fixed-window.d.ts +9 -8
- package/dist/utils/global-scope.d.cts +20 -0
- package/dist/utils/global-scope.d.ts +8 -8
- package/dist/utils/guards.d.cts +14 -0
- package/dist/utils/guards.d.ts +10 -2
- package/dist/utils/identity.d.cts +109 -0
- package/dist/utils/identity.d.ts +20 -21
- package/dist/utils/library-console.d.cts +11 -0
- package/dist/utils/library-console.d.ts +4 -4
- package/dist/utils/library-request.d.cts +24 -0
- package/dist/utils/library-request.d.ts +10 -10
- package/dist/utils/lock.d.cts +24 -0
- package/dist/utils/lock.d.ts +11 -10
- package/dist/utils/openfin.d.cts +48 -0
- package/dist/utils/openfin.d.ts +5 -5
- package/dist/utils/patch.d.cts +9 -0
- package/dist/utils/patch.d.ts +6 -6
- package/dist/utils/platform.d.cts +62 -0
- package/dist/utils/platform.d.ts +15 -13
- package/dist/utils/sanitize.d.cts +52 -0
- package/dist/utils/sanitize.d.ts +5 -5
- package/dist/utils/sequence.d.cts +10 -0
- package/dist/utils/tracing.d.cts +158 -0
- package/dist/utils/tracing.d.ts +49 -42
- package/dist/utils/unref.d.cts +9 -0
- package/dist/utils/unref.d.ts +3 -3
- package/dist/web-socket-CoIUBM3C.cjs +2 -0
- package/dist/web-socket-CoIUBM3C.cjs.map +1 -0
- package/dist/{web-socket-CV7yIMnm.js → web-socket-DSHgDiZ6.js} +23 -28
- package/dist/web-socket-DSHgDiZ6.js.map +1 -0
- package/dist/web-vitals-4pWACwaR.js +71 -0
- package/dist/web-vitals-4pWACwaR.js.map +1 -0
- package/dist/web-vitals-__X7t4pj.cjs +2 -0
- package/dist/web-vitals-__X7t4pj.cjs.map +1 -0
- package/dist/worker-protocol-QbvqNazn.cjs +2 -0
- package/dist/worker-protocol-QbvqNazn.cjs.map +1 -0
- package/dist/{worker-protocol-CrsdSDLn.js → worker-protocol-x074Rpet.js} +14 -11
- package/dist/worker-protocol-x074Rpet.js.map +1 -0
- package/dist/worker-server-CFe4nvos.cjs +2 -0
- package/dist/worker-server-CFe4nvos.cjs.map +1 -0
- package/dist/worker-server-iUVSjH8L.js +94 -0
- package/dist/worker-server-iUVSjH8L.js.map +1 -0
- package/dist/worker-transport-CRAX-09c.cjs +2 -0
- package/dist/worker-transport-CRAX-09c.cjs.map +1 -0
- package/dist/worker-transport-Dy1KMA7t.js +190 -0
- package/dist/worker-transport-Dy1KMA7t.js.map +1 -0
- package/llms.txt +397 -0
- package/package.json +55 -41
- package/dist/batch-C8OcWR2L.cjs.map +0 -1
- package/dist/batch-CL9uWYY3.js.map +0 -1
- package/dist/bus-BZ0GldpT.js +0 -660
- 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 +0 -2
- package/dist/console-BPZCuSLc.cjs.map +0 -1
- package/dist/console-BeCF7n59.js +0 -82
- 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/context-storage-BjzeBSxH.cjs +0 -2
- package/dist/context-storage-BjzeBSxH.cjs.map +0 -1
- package/dist/context-storage-BzkoHzkQ.js +0 -51
- package/dist/context-storage-BzkoHzkQ.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 +0 -25
- package/dist/debug-bundle-C7UkHZ-q.js.map +0 -1
- package/dist/emergency-queue-CNTRui5t.cjs +0 -2
- package/dist/emergency-queue-CNTRui5t.cjs.map +0 -1
- package/dist/emergency-queue-Zy6lNafo.js +0 -67
- package/dist/emergency-queue-Zy6lNafo.js.map +0 -1
- package/dist/errors-Dh7kef0i.js +0 -92
- package/dist/errors-Dh7kef0i.js.map +0 -1
- package/dist/errors-tfEr48bS.cjs +0 -3
- package/dist/errors-tfEr48bS.cjs.map +0 -1
- package/dist/factory-BonqI3NL.js +0 -276
- package/dist/factory-BonqI3NL.js.map +0 -1
- package/dist/factory-CJXVYp0R.cjs +0 -2
- package/dist/factory-CJXVYp0R.cjs.map +0 -1
- package/dist/guards-Cidk71ME.js +0 -7
- package/dist/guards-Cidk71ME.js.map +0 -1
- package/dist/guards-nJ70syPt.cjs +0 -2
- package/dist/guards-nJ70syPt.cjs.map +0 -1
- package/dist/identity-Cxgj6pZX.cjs +0 -2
- 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 +0 -2
- package/dist/indexeddb-storage-CIoW21Xd.cjs.map +0 -1
- package/dist/interactions-DTgKy_6K.js.map +0 -1
- package/dist/interactions-fEN6FbVo.cjs +0 -2
- 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/keys-BHhw_0Wh.cjs +0 -2
- package/dist/keys-BHhw_0Wh.cjs.map +0 -1
- package/dist/keys-BU9j5YqW.js +0 -16
- package/dist/keys-BU9j5YqW.js.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 +0 -2
- 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 +0 -2
- 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 +0 -64
- package/dist/long-frames-Czk7IupC.js.map +0 -1
- package/dist/models/stats.d.ts +0 -11
- package/dist/network-DBNwApoF.js.map +0 -1
- package/dist/network-xbbuvG_6.cjs +0 -2
- 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 +0 -98
- package/dist/remote-rules-Cfb4K-Nl.js.map +0 -1
- package/dist/remote-rules-vzvk7aKf.cjs +0 -2
- package/dist/remote-rules-vzvk7aKf.cjs.map +0 -1
- package/dist/reports-Dk2YhKIh.cjs +0 -2
- 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 +0 -2
- package/dist/resource-timing-Cysw1S1f.cjs.map +0 -1
- package/dist/sampling-C4VV-1MS.js +0 -60
- package/dist/sampling-C4VV-1MS.js.map +0 -1
- package/dist/sampling-Ckh2yW9k.cjs +0 -2
- 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 +0 -3
- package/dist/select-ZF4by-lF.cjs.map +0 -1
- package/dist/select-xtQaenIi.js +0 -270
- package/dist/select-xtQaenIi.js.map +0 -1
- package/dist/sender-CiMHC9YG.js +0 -856
- 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/storage-BA9RqRO-.cjs +0 -2
- package/dist/storage-BA9RqRO-.cjs.map +0 -1
- package/dist/storage-DZwed89z.js +0 -16
- package/dist/storage-DZwed89z.js.map +0 -1
- package/dist/storm-CYi9Swpx.cjs +0 -2
- package/dist/storm-CYi9Swpx.cjs.map +0 -1
- package/dist/storm-VR024_QN.js +0 -9
- package/dist/storm-VR024_QN.js.map +0 -1
- package/dist/unclean-exit-CwcUhFOn.js.map +0 -1
- package/dist/unclean-exit-DFUN57wY.cjs +0 -2
- 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/utils/timer.d.ts +0 -19
- package/dist/web-socket-BWUoqBh8.cjs +0 -2
- 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 +0 -2
- 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-server-Dp5HYm4b.js +0 -83
- package/dist/worker-server-Dp5HYm4b.js.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 +0 -199
- package/dist/worker-transport-D6jtgpqN.js.map +0 -1
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
import type { Diagnostics } from "../core/diagnostics";
|
|
2
|
-
import { type LogBatch } from "../models/batch";
|
|
3
|
-
import type { GapReporter, PruneResult, StorageAdapter, StorageLimits } from "../models/storage";
|
|
4
|
-
/**
|
|
1
|
+
import type { Diagnostics } from "../core/diagnostics.js";
|
|
2
|
+
import { type LogBatch } from "../models/batch.js";
|
|
3
|
+
import type { GapReporter, PruneResult, StorageAdapter, StorageLimits } from "../models/storage.js";
|
|
4
|
+
/** StorageAdapter that keeps batches in IndexedDB. */
|
|
5
5
|
export declare class IndexedDbStorage implements StorageAdapter {
|
|
6
6
|
private readonly limits;
|
|
7
7
|
private readonly diagnostics;
|
|
8
8
|
private readonly onGap?;
|
|
9
|
-
/**
|
|
9
|
+
/** The storage strategy name. */
|
|
10
10
|
readonly name = "indexeddb";
|
|
11
|
-
/**
|
|
11
|
+
/** Holds the IndexedDB code for the batch store. */
|
|
12
12
|
private readonly db;
|
|
13
13
|
/**
|
|
14
14
|
* @param dbName Database name.
|
|
15
15
|
* @param limits Storage capacity and retention thresholds.
|
|
16
16
|
* @param diagnostics Diagnostics reporter.
|
|
17
|
-
* @param onGap Optional callback for dropped
|
|
17
|
+
* @param onGap Optional callback for reporting dropped records.
|
|
18
18
|
*/
|
|
19
19
|
constructor(dbName: string, limits: StorageLimits, diagnostics: Diagnostics, onGap?: GapReporter | undefined);
|
|
20
20
|
/**
|
|
21
|
-
* Opens the database.
|
|
22
|
-
*
|
|
21
|
+
* Opens the database. Not guarded, because the factory needs the rejection to pick the
|
|
22
|
+
* next adapter.
|
|
23
23
|
*/
|
|
24
24
|
open(): Promise<void>;
|
|
25
25
|
/**
|
|
26
|
-
* Writes a batch to IndexedDB
|
|
27
|
-
* @param batch
|
|
26
|
+
* Writes a batch to IndexedDB, then prunes the storage.
|
|
27
|
+
* @param batch The batch to store.
|
|
28
|
+
* @returns True if the batch is in the database after the prune, false if the write failed
|
|
29
|
+
* or the prune removed the batch.
|
|
28
30
|
*/
|
|
29
|
-
save(batch: LogBatch): Promise<
|
|
31
|
+
save(batch: LogBatch): Promise<boolean>;
|
|
30
32
|
/**
|
|
31
|
-
* Reads
|
|
33
|
+
* Reads one context's batches in creation order without removing them.
|
|
32
34
|
* @param id Delivery context id.
|
|
33
|
-
* @param limit Maximum batches to return.
|
|
34
|
-
* @returns
|
|
35
|
+
* @param limit Maximum number of batches to return.
|
|
36
|
+
* @returns This context's batches, oldest first.
|
|
35
37
|
*/
|
|
36
38
|
takeContext(id: string, limit: number): Promise<LogBatch[]>;
|
|
37
39
|
/**
|
|
38
|
-
* Counts stored batches
|
|
40
|
+
* Counts one context's stored batches.
|
|
39
41
|
* @param id Delivery context id.
|
|
40
|
-
* @returns
|
|
42
|
+
* @returns The number of batches in this context.
|
|
41
43
|
*/
|
|
42
44
|
countContext(id: string): Promise<number>;
|
|
43
45
|
/**
|
|
44
|
-
* Reads up to `limit` batches in FIFO order
|
|
46
|
+
* Reads up to `limit` batches in FIFO order without deleting them.
|
|
45
47
|
* @param limit Maximum number of batches to retrieve.
|
|
46
|
-
* @returns
|
|
48
|
+
* @returns The retrieved batches.
|
|
47
49
|
*/
|
|
48
50
|
take(limit: number): Promise<LogBatch[]>;
|
|
49
51
|
/**
|
|
@@ -52,37 +54,42 @@ export declare class IndexedDbStorage implements StorageAdapter {
|
|
|
52
54
|
*/
|
|
53
55
|
remove(id: string): Promise<void>;
|
|
54
56
|
/**
|
|
55
|
-
* Sets
|
|
57
|
+
* Sets a stored batch's delivery attempt count.
|
|
56
58
|
* @param id Batch identifier.
|
|
57
|
-
* @param attempts
|
|
59
|
+
* @param attempts The new absolute attempt count.
|
|
58
60
|
*/
|
|
59
61
|
bumpAttempts(id: string, attempts: number): Promise<void>;
|
|
60
62
|
/**
|
|
61
|
-
* Removes expired batches
|
|
62
|
-
* capacity limit.
|
|
63
|
+
* Removes expired batches, then the oldest batches above the capacity limit.
|
|
63
64
|
* @returns Prune summary metrics.
|
|
64
65
|
*/
|
|
65
66
|
prune(): Promise<PruneResult>;
|
|
67
|
+
/**
|
|
68
|
+
* Runs the prune and keeps the batches it deleted. A failed prune reports to diagnostics and
|
|
69
|
+
* returns what it deleted before the failure.
|
|
70
|
+
* @returns The prune summary and the deleted batches.
|
|
71
|
+
*/
|
|
72
|
+
private sweep;
|
|
66
73
|
/**
|
|
67
74
|
* Returns the number of stored batches.
|
|
68
|
-
* @returns
|
|
75
|
+
* @returns The total batch count, or 0 on failure.
|
|
69
76
|
*/
|
|
70
77
|
count(): Promise<number>;
|
|
71
|
-
/**
|
|
78
|
+
/** Deletes every stored batch from the database. */
|
|
72
79
|
clear(): Promise<void>;
|
|
73
|
-
/**
|
|
80
|
+
/** Closes the active IndexedDB connection. */
|
|
74
81
|
close(): Promise<void>;
|
|
75
82
|
/**
|
|
76
|
-
* Adds dropped batches to the prune result
|
|
77
|
-
* @param result
|
|
78
|
-
* @param reason
|
|
83
|
+
* Adds dropped batches to the prune result and reports them under their own reason.
|
|
84
|
+
* @param result The prune result across all rules.
|
|
85
|
+
* @param reason The rule that dropped the batches.
|
|
79
86
|
* @param dropped The dropped batches.
|
|
80
87
|
*/
|
|
81
88
|
private addGap;
|
|
82
89
|
/**
|
|
83
90
|
* Deletes the given number of stored batches. Batches without an action go first, oldest
|
|
84
|
-
* first
|
|
85
|
-
*
|
|
91
|
+
* first, because an action is an audit fact. Not guarded, because both callers guard it. A
|
|
92
|
+
* guard here would hide the failure and report an eviction that never happened.
|
|
86
93
|
* @param howMany Number of batches to evict.
|
|
87
94
|
* @returns The evicted batches.
|
|
88
95
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Diagnostics } from "../core/diagnostics.cjs";
|
|
2
|
+
import type { LogBatch } from "../models/batch.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* Formats a storage key with a zero-padded creation time, so the keys sort in FIFO order.
|
|
5
|
+
* Always use batch.createdAt, never Date.now(), or the key won't match the written one.
|
|
6
|
+
* @param prefix Storage key prefix.
|
|
7
|
+
* @param batch The target log batch.
|
|
8
|
+
* @returns The prefixed, timestamp-ordered storage key.
|
|
9
|
+
*/
|
|
10
|
+
export declare function batchKey(prefix: string, batch: LogBatch): string;
|
|
11
|
+
/**
|
|
12
|
+
* Returns every localStorage key that starts with the prefix, sorted.
|
|
13
|
+
* @param prefix The storage key prefix to filter by.
|
|
14
|
+
* @param diagnostics Diagnostics reporter.
|
|
15
|
+
* @returns The matching storage keys, sorted.
|
|
16
|
+
*/
|
|
17
|
+
export declare function keysWithPrefix(prefix: string, diagnostics: Diagnostics): string[];
|
package/dist/storage/keys.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { Diagnostics } from "../core/diagnostics";
|
|
2
|
-
import type { LogBatch } from "../models/batch";
|
|
1
|
+
import type { Diagnostics } from "../core/diagnostics.js";
|
|
2
|
+
import type { LogBatch } from "../models/batch.js";
|
|
3
3
|
/**
|
|
4
|
-
* Formats a storage key with a zero-padded creation time
|
|
5
|
-
* batch.createdAt, never Date.now()
|
|
4
|
+
* Formats a storage key with a zero-padded creation time, so the keys sort in FIFO order.
|
|
5
|
+
* Always use batch.createdAt, never Date.now(), or the key won't match the written one.
|
|
6
6
|
* @param prefix Storage key prefix.
|
|
7
|
-
* @param batch
|
|
8
|
-
* @returns
|
|
7
|
+
* @param batch The target log batch.
|
|
8
|
+
* @returns The prefixed, timestamp-ordered storage key.
|
|
9
9
|
*/
|
|
10
10
|
export declare function batchKey(prefix: string, batch: LogBatch): string;
|
|
11
11
|
/**
|
|
12
|
-
* Returns
|
|
13
|
-
* @param prefix
|
|
12
|
+
* Returns every localStorage key that starts with the prefix, sorted.
|
|
13
|
+
* @param prefix The storage key prefix to filter by.
|
|
14
14
|
* @param diagnostics Diagnostics reporter.
|
|
15
|
-
* @returns
|
|
15
|
+
* @returns The matching storage keys, sorted.
|
|
16
16
|
*/
|
|
17
17
|
export declare function keysWithPrefix(prefix: string, diagnostics: Diagnostics): string[];
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { Diagnostics } from "../core/diagnostics.cjs";
|
|
2
|
+
import { type LogBatch } from "../models/batch.cjs";
|
|
3
|
+
import type { GapReporter, PruneResult, StorageAdapter, StorageLimits } from "../models/storage.cjs";
|
|
4
|
+
/** StorageAdapter that keeps batches in localStorage. */
|
|
5
|
+
export declare class LocalStorageStorage implements StorageAdapter {
|
|
6
|
+
private readonly limits;
|
|
7
|
+
private readonly diagnostics;
|
|
8
|
+
private readonly onGap?;
|
|
9
|
+
private readonly prefix;
|
|
10
|
+
/** The storage strategy name. */
|
|
11
|
+
readonly name = "localstorage";
|
|
12
|
+
/**
|
|
13
|
+
* @param limits Storage capacity and retention thresholds.
|
|
14
|
+
* @param diagnostics Diagnostics reporter.
|
|
15
|
+
* @param onGap Optional callback for reporting dropped records.
|
|
16
|
+
*/
|
|
17
|
+
constructor(limits: StorageLimits, diagnostics: Diagnostics, onGap?: GapReporter | undefined, prefix?: string);
|
|
18
|
+
/**
|
|
19
|
+
* Writes a batch to localStorage, removing the oldest entries on a quota error.
|
|
20
|
+
* @param batch The batch to store.
|
|
21
|
+
* @returns True if the batch is in localStorage after the prune, false if both writes were
|
|
22
|
+
* refused or the prune removed the batch.
|
|
23
|
+
*/
|
|
24
|
+
save(batch: LogBatch): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Returns up to `limit` batches in FIFO order without deleting them.
|
|
27
|
+
* @param limit Maximum number of batches to retrieve.
|
|
28
|
+
* @returns A promise that resolves to the valid batches.
|
|
29
|
+
*/
|
|
30
|
+
take(limit: number): Promise<LogBatch[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns up to `limit` batches of one context in FIFO order without deleting them. Stops
|
|
33
|
+
* at the limit, so later entries are never parsed.
|
|
34
|
+
* @param id Delivery context id.
|
|
35
|
+
* @param limit Maximum number of batches to retrieve.
|
|
36
|
+
* @returns A promise that resolves to this context's batches.
|
|
37
|
+
*/
|
|
38
|
+
takeContext(id: string, limit: number): Promise<LogBatch[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Counts one context's stored batches. The context id isn't in the key, so every entry is
|
|
41
|
+
* read.
|
|
42
|
+
* @param id Delivery context id.
|
|
43
|
+
* @returns A promise that resolves to this context's batch count.
|
|
44
|
+
*/
|
|
45
|
+
countContext(id: string): Promise<number>;
|
|
46
|
+
/**
|
|
47
|
+
* Reads the valid batches one at a time, oldest first, and removes any corrupt entry.
|
|
48
|
+
* @yields Each valid batch.
|
|
49
|
+
*/
|
|
50
|
+
private batches;
|
|
51
|
+
/**
|
|
52
|
+
* Deletes the batch with the given ID from localStorage.
|
|
53
|
+
* @param id Batch identifier.
|
|
54
|
+
*/
|
|
55
|
+
remove(id: string): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Sets a stored batch's delivery attempt count. The key doesn't change.
|
|
58
|
+
* @param id Batch identifier.
|
|
59
|
+
* @param attempts The new absolute attempt count.
|
|
60
|
+
*/
|
|
61
|
+
bumpAttempts(id: string, attempts: number): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Deletes expired batches, then the oldest batches above the capacity limit.
|
|
64
|
+
* @returns A promise that resolves to the prune summary metrics.
|
|
65
|
+
*/
|
|
66
|
+
prune(): Promise<PruneResult>;
|
|
67
|
+
/**
|
|
68
|
+
* Runs the prune and keeps the entries it removed.
|
|
69
|
+
* @returns The prune summary and the removed entries.
|
|
70
|
+
*/
|
|
71
|
+
private sweep;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the number of stored batch keys without deserializing the batches.
|
|
74
|
+
* @returns A promise that resolves to the batch count.
|
|
75
|
+
*/
|
|
76
|
+
count(): Promise<number>;
|
|
77
|
+
/** Deletes every batch key from localStorage. */
|
|
78
|
+
clear(): Promise<void>;
|
|
79
|
+
/** Does nothing. localStorage has no connection to close. */
|
|
80
|
+
close(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Writes a batch to localStorage.
|
|
83
|
+
* @param batch The batch to store.
|
|
84
|
+
* @param context The text diagnostics reports if the write fails.
|
|
85
|
+
* @returns True if the write succeeded.
|
|
86
|
+
*/
|
|
87
|
+
private write;
|
|
88
|
+
/** Removes a quarter of the store to free quota, and counts the loss. */
|
|
89
|
+
private evictForQuota;
|
|
90
|
+
/**
|
|
91
|
+
* Picks the entries to evict. Entries without an action go first, because an action is an
|
|
92
|
+
* audit fact. A corrupt entry has no action, so it goes first too.
|
|
93
|
+
* @param keys Batch keys, oldest first.
|
|
94
|
+
* @param howMany Number of entries to evict.
|
|
95
|
+
* @returns The picked entries.
|
|
96
|
+
*/
|
|
97
|
+
private evictable;
|
|
98
|
+
/**
|
|
99
|
+
* Reads the entries one at a time. The eviction walk stops early, so later entries are
|
|
100
|
+
* never parsed.
|
|
101
|
+
* @param keys Batch keys.
|
|
102
|
+
* @yields Each key with its batch.
|
|
103
|
+
*/
|
|
104
|
+
private entries;
|
|
105
|
+
/**
|
|
106
|
+
* Removes entries and reports them under their own reason.
|
|
107
|
+
* @param result The prune result across all rules.
|
|
108
|
+
* @param reason The rule that removes the entries.
|
|
109
|
+
* @param entries The entries to remove.
|
|
110
|
+
*/
|
|
111
|
+
private drop;
|
|
112
|
+
/**
|
|
113
|
+
* Reads and validates the stored batch at a key.
|
|
114
|
+
* @param key The storage key to read.
|
|
115
|
+
* @returns The validated LogBatch, or null if it is missing or malformed.
|
|
116
|
+
*/
|
|
117
|
+
private read;
|
|
118
|
+
/**
|
|
119
|
+
* Finds the storage key that ends with the batch ID.
|
|
120
|
+
* @param id Batch identifier.
|
|
121
|
+
* @returns The matching storage key, or null.
|
|
122
|
+
*/
|
|
123
|
+
private keyOf;
|
|
124
|
+
/**
|
|
125
|
+
* Deletes a list of storage keys.
|
|
126
|
+
* @param keys Keys to delete.
|
|
127
|
+
*/
|
|
128
|
+
private evict;
|
|
129
|
+
/**
|
|
130
|
+
* Deletes one storage key inside a guard.
|
|
131
|
+
* @param key Storage key to remove.
|
|
132
|
+
*/
|
|
133
|
+
private removeKey;
|
|
134
|
+
/**
|
|
135
|
+
* Returns every batch storage key, sorted.
|
|
136
|
+
* @returns The sorted storage keys.
|
|
137
|
+
*/
|
|
138
|
+
private keys;
|
|
139
|
+
}
|
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
import type { Diagnostics } from "../core/diagnostics";
|
|
2
|
-
import { type LogBatch } from "../models/batch";
|
|
3
|
-
import type { GapReporter, PruneResult, StorageAdapter, StorageLimits } from "../models/storage";
|
|
4
|
-
/**
|
|
1
|
+
import type { Diagnostics } from "../core/diagnostics.js";
|
|
2
|
+
import { type LogBatch } from "../models/batch.js";
|
|
3
|
+
import type { GapReporter, PruneResult, StorageAdapter, StorageLimits } from "../models/storage.js";
|
|
4
|
+
/** StorageAdapter that keeps batches in localStorage. */
|
|
5
5
|
export declare class LocalStorageStorage implements StorageAdapter {
|
|
6
6
|
private readonly limits;
|
|
7
7
|
private readonly diagnostics;
|
|
8
8
|
private readonly onGap?;
|
|
9
9
|
private readonly prefix;
|
|
10
|
-
/**
|
|
10
|
+
/** The storage strategy name. */
|
|
11
11
|
readonly name = "localstorage";
|
|
12
12
|
/**
|
|
13
13
|
* @param limits Storage capacity and retention thresholds.
|
|
14
14
|
* @param diagnostics Diagnostics reporter.
|
|
15
|
-
* @param onGap Optional callback for dropped
|
|
15
|
+
* @param onGap Optional callback for reporting dropped records.
|
|
16
16
|
*/
|
|
17
17
|
constructor(limits: StorageLimits, diagnostics: Diagnostics, onGap?: GapReporter | undefined, prefix?: string);
|
|
18
18
|
/**
|
|
19
|
-
* Writes a batch to localStorage
|
|
20
|
-
* @param batch
|
|
19
|
+
* Writes a batch to localStorage, removing the oldest entries on a quota error.
|
|
20
|
+
* @param batch The batch to store.
|
|
21
|
+
* @returns True if the batch is in localStorage after the prune, false if both writes were
|
|
22
|
+
* refused or the prune removed the batch.
|
|
21
23
|
*/
|
|
22
|
-
save(batch: LogBatch): Promise<
|
|
24
|
+
save(batch: LogBatch): Promise<boolean>;
|
|
23
25
|
/**
|
|
24
|
-
* Returns up to `limit` batches in FIFO order
|
|
26
|
+
* Returns up to `limit` batches in FIFO order without deleting them.
|
|
25
27
|
* @param limit Maximum number of batches to retrieve.
|
|
26
|
-
* @returns
|
|
28
|
+
* @returns A promise that resolves to the valid batches.
|
|
27
29
|
*/
|
|
28
30
|
take(limit: number): Promise<LogBatch[]>;
|
|
29
31
|
/**
|
|
30
|
-
* Returns up to `limit` batches of one context in FIFO order
|
|
31
|
-
*
|
|
32
|
+
* Returns up to `limit` batches of one context in FIFO order without deleting them. Stops
|
|
33
|
+
* at the limit, so later entries are never parsed.
|
|
32
34
|
* @param id Delivery context id.
|
|
33
35
|
* @param limit Maximum number of batches to retrieve.
|
|
34
|
-
* @returns
|
|
36
|
+
* @returns A promise that resolves to this context's batches.
|
|
35
37
|
*/
|
|
36
38
|
takeContext(id: string, limit: number): Promise<LogBatch[]>;
|
|
37
39
|
/**
|
|
38
|
-
* Counts
|
|
40
|
+
* Counts one context's stored batches. The context id isn't in the key, so every entry is
|
|
41
|
+
* read.
|
|
39
42
|
* @param id Delivery context id.
|
|
40
|
-
* @returns
|
|
43
|
+
* @returns A promise that resolves to this context's batch count.
|
|
41
44
|
*/
|
|
42
45
|
countContext(id: string): Promise<number>;
|
|
43
46
|
/**
|
|
44
|
-
* Reads the valid batches one at a time, oldest first
|
|
47
|
+
* Reads the valid batches one at a time, oldest first, and removes any corrupt entry.
|
|
45
48
|
* @yields Each valid batch.
|
|
46
49
|
*/
|
|
47
50
|
private batches;
|
|
@@ -51,67 +54,71 @@ export declare class LocalStorageStorage implements StorageAdapter {
|
|
|
51
54
|
*/
|
|
52
55
|
remove(id: string): Promise<void>;
|
|
53
56
|
/**
|
|
54
|
-
* Sets
|
|
57
|
+
* Sets a stored batch's delivery attempt count. The key doesn't change.
|
|
55
58
|
* @param id Batch identifier.
|
|
56
|
-
* @param attempts
|
|
59
|
+
* @param attempts The new absolute attempt count.
|
|
57
60
|
*/
|
|
58
61
|
bumpAttempts(id: string, attempts: number): Promise<void>;
|
|
59
62
|
/**
|
|
60
|
-
* Deletes expired batches
|
|
61
|
-
*
|
|
62
|
-
* @returns Promise that resolves to prune summary metrics.
|
|
63
|
+
* Deletes expired batches, then the oldest batches above the capacity limit.
|
|
64
|
+
* @returns A promise that resolves to the prune summary metrics.
|
|
63
65
|
*/
|
|
64
66
|
prune(): Promise<PruneResult>;
|
|
65
67
|
/**
|
|
66
|
-
*
|
|
67
|
-
* @returns
|
|
68
|
+
* Runs the prune and keeps the entries it removed.
|
|
69
|
+
* @returns The prune summary and the removed entries.
|
|
70
|
+
*/
|
|
71
|
+
private sweep;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the number of stored batch keys without deserializing the batches.
|
|
74
|
+
* @returns A promise that resolves to the batch count.
|
|
68
75
|
*/
|
|
69
76
|
count(): Promise<number>;
|
|
70
|
-
/**
|
|
77
|
+
/** Deletes every batch key from localStorage. */
|
|
71
78
|
clear(): Promise<void>;
|
|
72
|
-
/**
|
|
79
|
+
/** Does nothing. localStorage has no connection to close. */
|
|
73
80
|
close(): Promise<void>;
|
|
74
81
|
/**
|
|
75
82
|
* Writes a batch to localStorage.
|
|
76
|
-
* @param batch
|
|
77
|
-
* @param context
|
|
83
|
+
* @param batch The batch to store.
|
|
84
|
+
* @param context The text diagnostics reports if the write fails.
|
|
78
85
|
* @returns True if the write succeeded.
|
|
79
86
|
*/
|
|
80
87
|
private write;
|
|
81
|
-
/**
|
|
88
|
+
/** Removes a quarter of the store to free quota, and counts the loss. */
|
|
82
89
|
private evictForQuota;
|
|
83
90
|
/**
|
|
84
|
-
* Picks the entries to evict. Entries without an action go first
|
|
85
|
-
* A corrupt entry has no action
|
|
91
|
+
* Picks the entries to evict. Entries without an action go first, because an action is an
|
|
92
|
+
* audit fact. A corrupt entry has no action, so it goes first too.
|
|
86
93
|
* @param keys Batch keys, oldest first.
|
|
87
94
|
* @param howMany Number of entries to evict.
|
|
88
95
|
* @returns The picked entries.
|
|
89
96
|
*/
|
|
90
97
|
private evictable;
|
|
91
98
|
/**
|
|
92
|
-
* Reads the entries one at a time. The eviction walk stops early
|
|
93
|
-
*
|
|
99
|
+
* Reads the entries one at a time. The eviction walk stops early, so later entries are
|
|
100
|
+
* never parsed.
|
|
94
101
|
* @param keys Batch keys.
|
|
95
102
|
* @yields Each key with its batch.
|
|
96
103
|
*/
|
|
97
104
|
private entries;
|
|
98
105
|
/**
|
|
99
|
-
* Removes entries
|
|
100
|
-
* @param result
|
|
101
|
-
* @param reason
|
|
102
|
-
* @param entries
|
|
106
|
+
* Removes entries and reports them under their own reason.
|
|
107
|
+
* @param result The prune result across all rules.
|
|
108
|
+
* @param reason The rule that removes the entries.
|
|
109
|
+
* @param entries The entries to remove.
|
|
103
110
|
*/
|
|
104
111
|
private drop;
|
|
105
112
|
/**
|
|
106
113
|
* Reads and validates the stored batch at a key.
|
|
107
|
-
* @param key
|
|
108
|
-
* @returns
|
|
114
|
+
* @param key The storage key to read.
|
|
115
|
+
* @returns The validated LogBatch, or null if it is missing or malformed.
|
|
109
116
|
*/
|
|
110
117
|
private read;
|
|
111
118
|
/**
|
|
112
119
|
* Finds the storage key that ends with the batch ID.
|
|
113
120
|
* @param id Batch identifier.
|
|
114
|
-
* @returns
|
|
121
|
+
* @returns The matching storage key, or null.
|
|
115
122
|
*/
|
|
116
123
|
private keyOf;
|
|
117
124
|
/**
|
|
@@ -125,8 +132,8 @@ export declare class LocalStorageStorage implements StorageAdapter {
|
|
|
125
132
|
*/
|
|
126
133
|
private removeKey;
|
|
127
134
|
/**
|
|
128
|
-
* Returns
|
|
129
|
-
* @returns
|
|
135
|
+
* Returns every batch storage key, sorted.
|
|
136
|
+
* @returns The sorted storage keys.
|
|
130
137
|
*/
|
|
131
138
|
private keys;
|
|
132
139
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type LogBatch } from "../models/batch.cjs";
|
|
2
|
+
import type { GapReporter, PruneResult, StorageAdapter, StorageLimits } from "../models/storage.cjs";
|
|
3
|
+
/** StorageAdapter that keeps batches in volatile memory. */
|
|
4
|
+
export declare class MemoryStorage implements StorageAdapter {
|
|
5
|
+
private readonly limits;
|
|
6
|
+
private readonly onGap?;
|
|
7
|
+
/** The storage strategy name. */
|
|
8
|
+
readonly name = "memory";
|
|
9
|
+
/** The batches, in FIFO order. */
|
|
10
|
+
private batches;
|
|
11
|
+
/**
|
|
12
|
+
* @param limits Storage capacity and retention thresholds.
|
|
13
|
+
* @param onGap Optional callback for reporting dropped records.
|
|
14
|
+
*/
|
|
15
|
+
constructor(limits: StorageLimits, onGap?: GapReporter | undefined);
|
|
16
|
+
/**
|
|
17
|
+
* Appends a batch and applies retention pruning.
|
|
18
|
+
* @param batch The batch to store.
|
|
19
|
+
* @returns True if the batch is still in memory after the prune.
|
|
20
|
+
*/
|
|
21
|
+
save(batch: LogBatch): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns up to `limit` batches in FIFO order without deleting them.
|
|
24
|
+
* @param limit Maximum number of batches to retrieve.
|
|
25
|
+
* @returns A promise that resolves to the batches.
|
|
26
|
+
*/
|
|
27
|
+
take(limit: number): Promise<LogBatch[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Returns up to `limit` batches of one context in FIFO order without deleting them.
|
|
30
|
+
* @param id Delivery context id.
|
|
31
|
+
* @param limit Maximum number of batches to retrieve.
|
|
32
|
+
* @returns A promise that resolves to this context's batches.
|
|
33
|
+
*/
|
|
34
|
+
takeContext(id: string, limit: number): Promise<LogBatch[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Counts one context's stored batches.
|
|
37
|
+
* @param id Delivery context id.
|
|
38
|
+
* @returns A promise that resolves to this context's batch count.
|
|
39
|
+
*/
|
|
40
|
+
countContext(id: string): Promise<number>;
|
|
41
|
+
/**
|
|
42
|
+
* Deletes the batch with the given ID.
|
|
43
|
+
* @param id Batch identifier.
|
|
44
|
+
*/
|
|
45
|
+
remove(id: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Sets a stored batch's delivery attempt count.
|
|
48
|
+
* @param id Batch identifier.
|
|
49
|
+
* @param attempts The new absolute attempt count.
|
|
50
|
+
*/
|
|
51
|
+
bumpAttempts(id: string, attempts: number): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Removes expired batches, then the oldest batches above the capacity limit.
|
|
54
|
+
* @returns A promise that resolves to the prune summary metrics.
|
|
55
|
+
*/
|
|
56
|
+
prune(): Promise<PruneResult>;
|
|
57
|
+
/**
|
|
58
|
+
* Adds dropped batches to the prune result and reports them under their own reason.
|
|
59
|
+
* @param result The prune result across all rules.
|
|
60
|
+
* @param reason The rule that dropped the batches.
|
|
61
|
+
* @param dropped The dropped batches.
|
|
62
|
+
*/
|
|
63
|
+
private report;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the number of stored batches.
|
|
66
|
+
* @returns A promise that resolves to the batch count.
|
|
67
|
+
*/
|
|
68
|
+
count(): Promise<number>;
|
|
69
|
+
/** Deletes every stored batch. */
|
|
70
|
+
clear(): Promise<void>;
|
|
71
|
+
/** Deletes every stored batch when the storage closes. */
|
|
72
|
+
close(): Promise<void>;
|
|
73
|
+
}
|
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
import { type LogBatch } from "../models/batch";
|
|
2
|
-
import type { GapReporter, PruneResult, StorageAdapter, StorageLimits } from "../models/storage";
|
|
3
|
-
/**
|
|
1
|
+
import { type LogBatch } from "../models/batch.js";
|
|
2
|
+
import type { GapReporter, PruneResult, StorageAdapter, StorageLimits } from "../models/storage.js";
|
|
3
|
+
/** StorageAdapter that keeps batches in volatile memory. */
|
|
4
4
|
export declare class MemoryStorage implements StorageAdapter {
|
|
5
5
|
private readonly limits;
|
|
6
6
|
private readonly onGap?;
|
|
7
|
-
/**
|
|
7
|
+
/** The storage strategy name. */
|
|
8
8
|
readonly name = "memory";
|
|
9
|
-
/**
|
|
9
|
+
/** The batches, in FIFO order. */
|
|
10
10
|
private batches;
|
|
11
11
|
/**
|
|
12
12
|
* @param limits Storage capacity and retention thresholds.
|
|
13
|
-
* @param onGap Optional callback for dropped
|
|
13
|
+
* @param onGap Optional callback for reporting dropped records.
|
|
14
14
|
*/
|
|
15
15
|
constructor(limits: StorageLimits, onGap?: GapReporter | undefined);
|
|
16
16
|
/**
|
|
17
17
|
* Appends a batch and applies retention pruning.
|
|
18
|
-
* @param batch
|
|
18
|
+
* @param batch The batch to store.
|
|
19
|
+
* @returns True if the batch is still in memory after the prune.
|
|
19
20
|
*/
|
|
20
|
-
save(batch: LogBatch): Promise<
|
|
21
|
+
save(batch: LogBatch): Promise<boolean>;
|
|
21
22
|
/**
|
|
22
|
-
* Returns up to `limit` batches in FIFO order
|
|
23
|
+
* Returns up to `limit` batches in FIFO order without deleting them.
|
|
23
24
|
* @param limit Maximum number of batches to retrieve.
|
|
24
|
-
* @returns
|
|
25
|
+
* @returns A promise that resolves to the batches.
|
|
25
26
|
*/
|
|
26
27
|
take(limit: number): Promise<LogBatch[]>;
|
|
27
28
|
/**
|
|
28
|
-
* Returns up to `limit` batches of one context in FIFO order
|
|
29
|
+
* Returns up to `limit` batches of one context in FIFO order without deleting them.
|
|
29
30
|
* @param id Delivery context id.
|
|
30
31
|
* @param limit Maximum number of batches to retrieve.
|
|
31
|
-
* @returns
|
|
32
|
+
* @returns A promise that resolves to this context's batches.
|
|
32
33
|
*/
|
|
33
34
|
takeContext(id: string, limit: number): Promise<LogBatch[]>;
|
|
34
35
|
/**
|
|
35
|
-
* Counts
|
|
36
|
+
* Counts one context's stored batches.
|
|
36
37
|
* @param id Delivery context id.
|
|
37
|
-
* @returns
|
|
38
|
+
* @returns A promise that resolves to this context's batch count.
|
|
38
39
|
*/
|
|
39
40
|
countContext(id: string): Promise<number>;
|
|
40
41
|
/**
|
|
@@ -43,31 +44,30 @@ export declare class MemoryStorage implements StorageAdapter {
|
|
|
43
44
|
*/
|
|
44
45
|
remove(id: string): Promise<void>;
|
|
45
46
|
/**
|
|
46
|
-
* Sets
|
|
47
|
+
* Sets a stored batch's delivery attempt count.
|
|
47
48
|
* @param id Batch identifier.
|
|
48
|
-
* @param attempts
|
|
49
|
+
* @param attempts The new absolute attempt count.
|
|
49
50
|
*/
|
|
50
51
|
bumpAttempts(id: string, attempts: number): Promise<void>;
|
|
51
52
|
/**
|
|
52
|
-
* Removes expired batches
|
|
53
|
-
*
|
|
54
|
-
* @returns Promise that resolves to prune summary metrics.
|
|
53
|
+
* Removes expired batches, then the oldest batches above the capacity limit.
|
|
54
|
+
* @returns A promise that resolves to the prune summary metrics.
|
|
55
55
|
*/
|
|
56
56
|
prune(): Promise<PruneResult>;
|
|
57
57
|
/**
|
|
58
|
-
* Adds dropped batches to the prune result
|
|
59
|
-
* @param result
|
|
60
|
-
* @param reason
|
|
58
|
+
* Adds dropped batches to the prune result and reports them under their own reason.
|
|
59
|
+
* @param result The prune result across all rules.
|
|
60
|
+
* @param reason The rule that dropped the batches.
|
|
61
61
|
* @param dropped The dropped batches.
|
|
62
62
|
*/
|
|
63
63
|
private report;
|
|
64
64
|
/**
|
|
65
65
|
* Returns the number of stored batches.
|
|
66
|
-
* @returns
|
|
66
|
+
* @returns A promise that resolves to the batch count.
|
|
67
67
|
*/
|
|
68
68
|
count(): Promise<number>;
|
|
69
|
-
/**
|
|
69
|
+
/** Deletes every stored batch. */
|
|
70
70
|
clear(): Promise<void>;
|
|
71
|
-
/**
|
|
71
|
+
/** Deletes every stored batch when the storage closes. */
|
|
72
72
|
close(): Promise<void>;
|
|
73
73
|
}
|