@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
package/bin/uiobs.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as n } from "./identity-
|
|
1
|
+
import { Nt as e, g as t } from "./constants-CUyd9cTZ.js";
|
|
2
|
+
import { i as n } from "./identity-DdhKgrpk.js";
|
|
3
3
|
// src/models/batch.ts
|
|
4
4
|
function r(e) {
|
|
5
5
|
if (typeof e != "object" || !e) return !1;
|
|
@@ -32,4 +32,4 @@ function s(e) {
|
|
|
32
32
|
}
|
|
33
33
|
export { i as a, r as i, s as n, o as r, a as t };
|
|
34
34
|
|
|
35
|
-
//# sourceMappingURL=batch-
|
|
35
|
+
//# sourceMappingURL=batch-CXmPmTse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-CXmPmTse.js","names":["LOG_TYPE_ACTION","ATTR_LOG_TYPE","newId","isLogBatch","value","id","createdAt","attempts","records","splitBatch","batch","middle","halve","diagnostics","attributeOf","record","attributes","key","isActionRecord","countRecords","batches","total"],"sources":["../src/models/batch.ts"],"sourcesContent":["// src/models/batch.ts\n//\n// A batch of log records for delivery to the ingest endpoint.\n\nimport { ATTR_LOG_TYPE, LOG_TYPE_ACTION } from \"../constants\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport { newId } from \"../utils/identity\";\nimport type { LogRecord } from \"./log-record\";\n\n/**\n * A batch of records with a stable id used for server-side deduplication across retries.\n * @see {@link splitBatch}\n */\nexport interface LogBatch {\n /** Application namespace that owns this stored batch. */\n readonly persistenceNamespace?: string;\n /** Delivery context id. Never changes. With isolation, a batch without one stays stored. */\n readonly routingContextId?: string;\n /** Deduplication key. Stays the same across retries and reloads. */\n id: string;\n /** Records to deliver, in log order. */\n records: LogRecord[];\n /** Batch creation time, in epoch milliseconds. */\n createdAt: number;\n /** Delivery attempts so far. */\n attempts: number;\n}\n\n/**\n * Checks whether a value from storage has every field of a batch. `keyOf` can't match an entry\n * without `id` after delivery, so that entry would be retried forever and block every batch\n * behind it. An entry without `attempts` counts as NaN, which never reaches `maxAttempts`, so\n * it would never be dropped as a dead letter.\n * @param value Parsed storage entry.\n * @returns True when every required field is present and has the correct type.\n */\nexport function isLogBatch(value: unknown): value is LogBatch {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n const id: unknown = Reflect.get(value, \"id\");\n const createdAt: unknown = Reflect.get(value, \"createdAt\");\n const attempts: unknown = Reflect.get(value, \"attempts\");\n const records: unknown = Reflect.get(value, \"records\");\n\n return (\n typeof id === \"string\" &&\n typeof createdAt === \"number\" &&\n typeof attempts === \"number\" &&\n Array.isArray(records)\n );\n}\n\n/**\n * Splits a batch that the server rejected as too large into two halves. Each half gets a new\n * id but keeps the original batch's age and attempts.\n * @param batch The rejected batch.\n * @param diagnostics Diagnostics reporter for the new batch ids.\n * @returns Two batches, or `null` if a single record is already over the limit.\n */\nexport function splitBatch(batch: LogBatch, diagnostics: Diagnostics): [LogBatch, LogBatch] | null {\n if (batch.records.length < 2) {\n return null;\n }\n\n const middle = Math.floor(batch.records.length / 2);\n const halve = (records: LogRecord[]): LogBatch => ({\n id: newId(diagnostics),\n records,\n createdAt: batch.createdAt,\n attempts: batch.attempts,\n routingContextId: batch.routingContextId,\n persistenceNamespace: batch.persistenceNamespace,\n });\n\n return [halve(batch.records.slice(0, middle)), halve(batch.records.slice(middle))];\n}\n\n/**\n * Reads one attribute of a record. A record from storage can be corrupt, either null or\n * missing its attributes.\n * @param record Record to read.\n * @param key Attribute key.\n * @returns The attribute value, or undefined for a corrupt record.\n */\nexport function attributeOf(record: LogRecord, key: string): unknown {\n const value: unknown = record;\n if (typeof value !== \"object\" || value === null) {\n return undefined;\n }\n\n const attributes: unknown = Reflect.get(value, \"attributes\");\n if (typeof attributes !== \"object\" || attributes === null) {\n return undefined;\n }\n\n return Reflect.get(attributes, key);\n}\n\n/**\n * Checks whether a record is an action. A corrupt record from storage is not an action.\n * @param record Record to check.\n * @returns True for an action record.\n */\nexport function isActionRecord(record: LogRecord): boolean {\n return attributeOf(record, ATTR_LOG_TYPE) === LOG_TYPE_ACTION;\n}\n\n/**\n * Counts the records across all batches.\n * @param batches Batches to measure.\n * @returns Total record count.\n */\nexport function countRecords(batches: readonly LogBatch[]): number {\n return batches.reduce((total, batch) => total + batch.records.length, 0);\n}\n"],"mappings":";;;AAoCA,SAAgBG,EAAW,GAAmC;CAC5D,IAAI,OAAOC,KAAU,aAAYA,GAC/B,OAAO;CAGT,IAAMC,IAAc,QAAQ,IAAID,GAAO,IAAI,GACrCE,IAAqB,QAAQ,IAAIF,GAAO,WAAW,GACnDG,IAAoB,QAAQ,IAAIH,GAAO,UAAU,GACjDI,IAAmB,QAAQ,IAAIJ,GAAO,SAAS;CAErD,OACE,OAAOC,KAAO,YACd,OAAOC,KAAc,YACrB,OAAOC,KAAa,YACpB,MAAM,QAAQC,CAAO;AAEzB;AASA,SAAgBC,EAAW,GAAiB,GAAuD;CACjG,IAAIC,EAAM,QAAQ,SAAS,GACzB,OAAO;CAGT,IAAMC,IAAS,KAAK,MAAMD,EAAM,QAAQ,SAAS,CAAC,GAC5CE,KAAS,OAAoC;EACjD,IAAIV,EAAMW,CAAW;EACrB;EACA,WAAWH,EAAM;EACjB,UAAUA,EAAM;EAChB,kBAAkBA,EAAM;EACxB,sBAAsBA,EAAM;CAC9B;CAEA,OAAO,CAACE,EAAMF,EAAM,QAAQ,MAAM,GAAGC,CAAM,CAAC,GAAGC,EAAMF,EAAM,QAAQ,MAAMC,CAAM,CAAC,CAAC;AACnF;AASA,SAAgBG,EAAY,GAAmB,GAAsB;CACnE,IAAMV,IAAiBW;CACvB,IAAI,OAAOX,KAAU,aAAYA,GAC/B;CAGF,IAAMY,IAAsB,QAAQ,IAAIZ,GAAO,YAAY;CAC3D,IAAI,OAAOY,KAAe,YAAYA,GAItC,OAAO,QAAQ,IAAIA,GAAYC,CAAG;AACpC;AAOA,SAAgBC,EAAe,GAA4B;CACzD,OAAOJ,EAAYC,GAAQd,CAAa,MAAMD;AAChD;AAOA,SAAgBmB,EAAa,GAAsC;CACjE,OAAOC,EAAQ,QAAQ,GAAO,MAAUC,IAAQX,EAAM,QAAQ,QAAQ,CAAC;AACzE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./constants-
|
|
2
|
-
//# sourceMappingURL=batch-
|
|
1
|
+
const e=require("./constants-CqdJhTxH.cjs"),t=require("./identity-DlWRIuwy.cjs");function n(e){if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`id`),n=Reflect.get(e,`createdAt`),r=Reflect.get(e,`attempts`),i=Reflect.get(e,`records`);return typeof t==`string`&&typeof n==`number`&&typeof r==`number`&&Array.isArray(i)}function r(e,n){if(e.records.length<2)return null;let r=Math.floor(e.records.length/2),i=r=>({id:t.i(n),records:r,createdAt:e.createdAt,attempts:e.attempts,routingContextId:e.routingContextId,persistenceNamespace:e.persistenceNamespace});return[i(e.records.slice(0,r)),i(e.records.slice(r))]}function i(e,t){let n=e;if(typeof n!=`object`||!n)return;let r=Reflect.get(n,`attributes`);if(typeof r==`object`&&r)return Reflect.get(r,t)}function a(t){return i(t,e.g)===e.Nt}function o(e){return e.reduce((e,t)=>e+t.records.length,0)}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
|
2
|
+
//# sourceMappingURL=batch-mmPigCpi.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-mmPigCpi.cjs","names":["newId","ATTR_LOG_TYPE","LOG_TYPE_ACTION","require_constants","require_identity","isLogBatch","value","id","createdAt","attempts","records","splitBatch","batch","middle","halve","diagnostics","attributeOf","record","attributes","key","isActionRecord","countRecords","batches","total"],"sources":["../src/models/batch.ts"],"sourcesContent":["// src/models/batch.ts\n//\n// A batch of log records for delivery to the ingest endpoint.\n\nimport { ATTR_LOG_TYPE, LOG_TYPE_ACTION } from \"../constants\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport { newId } from \"../utils/identity\";\nimport type { LogRecord } from \"./log-record\";\n\n/**\n * A batch of records with a stable id used for server-side deduplication across retries.\n * @see {@link splitBatch}\n */\nexport interface LogBatch {\n /** Application namespace that owns this stored batch. */\n readonly persistenceNamespace?: string;\n /** Delivery context id. Never changes. With isolation, a batch without one stays stored. */\n readonly routingContextId?: string;\n /** Deduplication key. Stays the same across retries and reloads. */\n id: string;\n /** Records to deliver, in log order. */\n records: LogRecord[];\n /** Batch creation time, in epoch milliseconds. */\n createdAt: number;\n /** Delivery attempts so far. */\n attempts: number;\n}\n\n/**\n * Checks whether a value from storage has every field of a batch. `keyOf` can't match an entry\n * without `id` after delivery, so that entry would be retried forever and block every batch\n * behind it. An entry without `attempts` counts as NaN, which never reaches `maxAttempts`, so\n * it would never be dropped as a dead letter.\n * @param value Parsed storage entry.\n * @returns True when every required field is present and has the correct type.\n */\nexport function isLogBatch(value: unknown): value is LogBatch {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n const id: unknown = Reflect.get(value, \"id\");\n const createdAt: unknown = Reflect.get(value, \"createdAt\");\n const attempts: unknown = Reflect.get(value, \"attempts\");\n const records: unknown = Reflect.get(value, \"records\");\n\n return (\n typeof id === \"string\" &&\n typeof createdAt === \"number\" &&\n typeof attempts === \"number\" &&\n Array.isArray(records)\n );\n}\n\n/**\n * Splits a batch that the server rejected as too large into two halves. Each half gets a new\n * id but keeps the original batch's age and attempts.\n * @param batch The rejected batch.\n * @param diagnostics Diagnostics reporter for the new batch ids.\n * @returns Two batches, or `null` if a single record is already over the limit.\n */\nexport function splitBatch(batch: LogBatch, diagnostics: Diagnostics): [LogBatch, LogBatch] | null {\n if (batch.records.length < 2) {\n return null;\n }\n\n const middle = Math.floor(batch.records.length / 2);\n const halve = (records: LogRecord[]): LogBatch => ({\n id: newId(diagnostics),\n records,\n createdAt: batch.createdAt,\n attempts: batch.attempts,\n routingContextId: batch.routingContextId,\n persistenceNamespace: batch.persistenceNamespace,\n });\n\n return [halve(batch.records.slice(0, middle)), halve(batch.records.slice(middle))];\n}\n\n/**\n * Reads one attribute of a record. A record from storage can be corrupt, either null or\n * missing its attributes.\n * @param record Record to read.\n * @param key Attribute key.\n * @returns The attribute value, or undefined for a corrupt record.\n */\nexport function attributeOf(record: LogRecord, key: string): unknown {\n const value: unknown = record;\n if (typeof value !== \"object\" || value === null) {\n return undefined;\n }\n\n const attributes: unknown = Reflect.get(value, \"attributes\");\n if (typeof attributes !== \"object\" || attributes === null) {\n return undefined;\n }\n\n return Reflect.get(attributes, key);\n}\n\n/**\n * Checks whether a record is an action. A corrupt record from storage is not an action.\n * @param record Record to check.\n * @returns True for an action record.\n */\nexport function isActionRecord(record: LogRecord): boolean {\n return attributeOf(record, ATTR_LOG_TYPE) === LOG_TYPE_ACTION;\n}\n\n/**\n * Counts the records across all batches.\n * @param batches Batches to measure.\n * @returns Total record count.\n */\nexport function countRecords(batches: readonly LogBatch[]): number {\n return batches.reduce((total, batch) => total + batch.records.length, 0);\n}\n"],"mappings":"A,iFAoCA,SAAgBK,EAAW,EAAmC,CAC5D,GAAI,OAAOC,GAAU,WAAYA,EAC/B,MAAO,GAGT,IAAMC,EAAc,QAAQ,IAAID,EAAO,IAAI,EACrCE,EAAqB,QAAQ,IAAIF,EAAO,WAAW,EACnDG,EAAoB,QAAQ,IAAIH,EAAO,UAAU,EACjDI,EAAmB,QAAQ,IAAIJ,EAAO,SAAS,EAErD,OACE,OAAOC,GAAO,UACd,OAAOC,GAAc,UACrB,OAAOC,GAAa,UACpB,MAAM,QAAQC,CAAO,CAEzB,CASA,SAAgBC,EAAW,EAAiB,EAAuD,CACjG,GAAIC,EAAM,QAAQ,OAAS,EACzB,OAAO,KAGT,IAAMC,EAAS,KAAK,MAAMD,EAAM,QAAQ,OAAS,CAAC,EAC5CE,EAAS,IAAoC,CACjD,GAAId,EAAAA,EAAMe,CAAW,EACrB,UACA,UAAWH,EAAM,UACjB,SAAUA,EAAM,SAChB,iBAAkBA,EAAM,iBACxB,qBAAsBA,EAAM,oBAC9B,GAEA,MAAO,CAACE,EAAMF,EAAM,QAAQ,MAAM,EAAGC,CAAM,CAAC,EAAGC,EAAMF,EAAM,QAAQ,MAAMC,CAAM,CAAC,CAAC,CACnF,CASA,SAAgBG,EAAY,EAAmB,EAAsB,CACnE,IAAMV,EAAiBW,EACvB,GAAI,OAAOX,GAAU,WAAYA,EAC/B,OAGF,IAAMY,EAAsB,QAAQ,IAAIZ,EAAO,YAAY,EAC3D,GAAI,OAAOY,GAAe,UAAYA,EAItC,OAAO,QAAQ,IAAIA,EAAYC,CAAG,CACpC,CAOA,SAAgBC,EAAe,EAA4B,CACzD,OAAOJ,EAAYC,EAAQhB,EAAAA,CAAa,IAAMC,EAAAA,EAChD,CAOA,SAAgBmB,EAAa,EAAsC,CACjE,OAAOC,EAAQ,QAAQ,EAAO,IAAUC,EAAQX,EAAM,QAAQ,OAAQ,CAAC,CACzE,C"}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import type { Diagnostics } from "../core/diagnostics.cjs";
|
|
2
|
+
import { type Journey } from "../core/journey.cjs";
|
|
3
|
+
import type { RemoteSlot } from "../core/remote-sampling.cjs";
|
|
4
|
+
import type { BusMessage, BusRole } from "../models/bus.cjs";
|
|
5
|
+
import type { SourceOptions, FrameOptions } from "../models/bus.cjs";
|
|
6
|
+
import type { ResolvedConfig } from "../models/config.cjs";
|
|
7
|
+
import type { FlushResult } from "../models/health.cjs";
|
|
8
|
+
import type { LogRecord } from "../models/log-record.cjs";
|
|
9
|
+
import type { PlatformMetadata } from "../utils/platform.cjs";
|
|
10
|
+
import { type Receive, type WorkerLike } from "./links.cjs";
|
|
11
|
+
/** Handshake timing for a forwarder waiting on an owner. */
|
|
12
|
+
export interface HandshakeOptions {
|
|
13
|
+
/** How long a forwarder waits for an owner to answer, in milliseconds. */
|
|
14
|
+
timeoutMs: number;
|
|
15
|
+
/** Attempts allowed before a cross-origin forwarder promotes itself to sender. */
|
|
16
|
+
maxAttempts: number;
|
|
17
|
+
}
|
|
18
|
+
/** Default handshake timing. Tests build a bus with shorter values. */
|
|
19
|
+
export declare const HANDSHAKE_OPTIONS: HandshakeOptions;
|
|
20
|
+
/** Callbacks for handling records and journey events from connected realms. */
|
|
21
|
+
export interface BusHandlers {
|
|
22
|
+
/** Adopts the owner's delivery context. Returning false refuses a different identity. */
|
|
23
|
+
onSecurityContext?: (id: string) => boolean;
|
|
24
|
+
/** Processes records forwarded from child contexts. */
|
|
25
|
+
onRecords: (records: LogRecord[]) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Returns true while the runtime is paused. A paused forwarder hands a child's records to
|
|
28
|
+
* onRecords, which drops them, instead of relaying them upstream.
|
|
29
|
+
*/
|
|
30
|
+
paused?: () => boolean;
|
|
31
|
+
/** Applies journey updates received from the control bus. */
|
|
32
|
+
onJourney: (journey: Journey | null) => void;
|
|
33
|
+
/** Returns the active journey to a child context that requests it. */
|
|
34
|
+
onJourneyRequest: () => Journey | null;
|
|
35
|
+
/** Runs when two windows use the same tab identifier. */
|
|
36
|
+
onTabConflict: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* Runs this context's own flush for a child that asked, with the child's time limit. Without
|
|
39
|
+
* it, the bus answers no flush request.
|
|
40
|
+
* @param timeoutMs How long the flush waits, in milliseconds, already in range.
|
|
41
|
+
* @returns The flush result.
|
|
42
|
+
*/
|
|
43
|
+
onFlush?: (timeoutMs: number) => Promise<FlushResult>;
|
|
44
|
+
/** The runtime's slot for the remote sampling rules. The bus both reads and fills it. */
|
|
45
|
+
remote: RemoteSlot;
|
|
46
|
+
}
|
|
47
|
+
/** Coordinates cross-realm communication, role resolution, and message dispatch. */
|
|
48
|
+
export declare class Bus {
|
|
49
|
+
private readonly config;
|
|
50
|
+
private readonly diagnostics;
|
|
51
|
+
private readonly platform;
|
|
52
|
+
private readonly contextId;
|
|
53
|
+
private readonly tabId;
|
|
54
|
+
private readonly handlers;
|
|
55
|
+
private readonly handshakeOptions;
|
|
56
|
+
/** Window and worker registrations with their permissions. */
|
|
57
|
+
private readonly sources;
|
|
58
|
+
/** Message counts for each window and worker in the current rate window. */
|
|
59
|
+
private readonly rates;
|
|
60
|
+
/** Message counts for each named source or link in the current rate window. */
|
|
61
|
+
private readonly channelRates;
|
|
62
|
+
/** Each same-origin direct child's reply. Held weakly so a navigated frame can be freed. */
|
|
63
|
+
private readonly directReplies;
|
|
64
|
+
/**
|
|
65
|
+
* Checks whether this source may receive a control message. A window can read a message
|
|
66
|
+
* even when it is addressed to another window.
|
|
67
|
+
* @param message Control message to send.
|
|
68
|
+
* @param peer Window or worker that receives the message.
|
|
69
|
+
* @returns True if the source has the required permission.
|
|
70
|
+
*/
|
|
71
|
+
private mayPost;
|
|
72
|
+
/**
|
|
73
|
+
* Registers one child window and its permissions.
|
|
74
|
+
* @param frame Frame element or window to register.
|
|
75
|
+
* @param options Expected origin and source permissions.
|
|
76
|
+
* @returns Function that removes this registration.
|
|
77
|
+
*/
|
|
78
|
+
registerFrame(frame: HTMLIFrameElement | Window, options: FrameOptions): () => void;
|
|
79
|
+
/**
|
|
80
|
+
* Checks if a source is permitted at the given origin.
|
|
81
|
+
* @param source Window or port that sent the message.
|
|
82
|
+
* @param origin Origin supplied by the transport.
|
|
83
|
+
* @returns True if the current source policy permits this source.
|
|
84
|
+
*/
|
|
85
|
+
isRegistered(source: object | null, origin: string): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Sends the new context id to child frames, workers and OpenFin views. Other tabs keep their
|
|
88
|
+
* own context.
|
|
89
|
+
*/
|
|
90
|
+
rotateContext(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Sends the context id to child frames and workers.
|
|
93
|
+
* @param openFin True to send it to OpenFin views too.
|
|
94
|
+
*/
|
|
95
|
+
private passContext;
|
|
96
|
+
/**
|
|
97
|
+
* Sends a security context message to every same-origin child on the direct link, dropping
|
|
98
|
+
* any child that is closed, freed or no longer permitted.
|
|
99
|
+
* @param message Security context message.
|
|
100
|
+
*/
|
|
101
|
+
private postToDirectChildren;
|
|
102
|
+
/**
|
|
103
|
+
* Keeps a direct child's reply callback for the next context id. Closed children are dropped
|
|
104
|
+
* along the way, so a removed frame doesn't keep its document in memory.
|
|
105
|
+
* @param peer The child's window.
|
|
106
|
+
* @param reply The child's reply callback.
|
|
107
|
+
*/
|
|
108
|
+
private keepDirectReply;
|
|
109
|
+
/** Current bus role. Defaults to "sender". */
|
|
110
|
+
private role;
|
|
111
|
+
/** Upstream forwarding link, or null when acting as sender. */
|
|
112
|
+
private upstream;
|
|
113
|
+
/** Open control plane links. */
|
|
114
|
+
private readonly links;
|
|
115
|
+
/** Shared OpenFin InterApplicationBus link instance. */
|
|
116
|
+
private openFinLink;
|
|
117
|
+
/** True if this context is the OpenFin platform provider. */
|
|
118
|
+
private isOpenFinProvider;
|
|
119
|
+
/** Timer that asks the upstream owner for the remote sampling rules. */
|
|
120
|
+
private rulesPoll;
|
|
121
|
+
/** True after destroy(), so a handshake that finishes later doesn't start a timer. */
|
|
122
|
+
private destroyed;
|
|
123
|
+
/** Context id of the owner that answered the handshake. Null if there was no handshake. */
|
|
124
|
+
private ownerId;
|
|
125
|
+
/** The owner's transport identity, taken from the handshake. */
|
|
126
|
+
private ownerPeer?;
|
|
127
|
+
/** Active handshake state awaiting welcome response. */
|
|
128
|
+
private awaitingWelcome;
|
|
129
|
+
/** This forwarder's flush requests that wait for an answer, by request id. */
|
|
130
|
+
private readonly flushAnswers;
|
|
131
|
+
/** Children's flush requests that wait for the flush after the one that runs. */
|
|
132
|
+
private flushQueue;
|
|
133
|
+
/** True while a flush that a child asked for runs, or waits for its gap. */
|
|
134
|
+
private flushing;
|
|
135
|
+
/** Epoch time in milliseconds when the last flush for a child started. */
|
|
136
|
+
private flushedAt;
|
|
137
|
+
/**
|
|
138
|
+
* @param config Active configuration instance.
|
|
139
|
+
* @param diagnostics Diagnostics reporter.
|
|
140
|
+
* @param platform Platform runtime metadata.
|
|
141
|
+
* @param contextId Unique context identifier for loop prevention.
|
|
142
|
+
* @param tabId Tab identifier announced on broadcast channels.
|
|
143
|
+
* @param handlers Callbacks for routed bus events.
|
|
144
|
+
*/
|
|
145
|
+
constructor(config: ResolvedConfig, diagnostics: Diagnostics, platform: PlatformMetadata, contextId: string, tabId: string, handlers: BusHandlers, handshakeOptions?: HandshakeOptions);
|
|
146
|
+
/** Returns the resolved bus role. */
|
|
147
|
+
getRole(): BusRole;
|
|
148
|
+
/**
|
|
149
|
+
* Resolves bus role and establishes control links.
|
|
150
|
+
* @returns Resolved role.
|
|
151
|
+
*/
|
|
152
|
+
start(): Promise<BusRole>;
|
|
153
|
+
/**
|
|
154
|
+
* Forwards records to the upstream owner if configured.
|
|
155
|
+
* @param records Batch of log records to send.
|
|
156
|
+
* @returns How many records went upstream. A record above the size limit doesn't go.
|
|
157
|
+
*/
|
|
158
|
+
sendRecords(records: LogRecord[]): number;
|
|
159
|
+
/**
|
|
160
|
+
* Asks the upstream sender to flush, then waits for its answer. The records that went before
|
|
161
|
+
* the request on the same link are in the sender's snapshot, because a link keeps its order.
|
|
162
|
+
* @param timeoutMs The time this context has left, in milliseconds. The sender uses it as its
|
|
163
|
+
* own limit.
|
|
164
|
+
* @param expired Resolves when this context stops waiting.
|
|
165
|
+
* @returns The sender's result, or null when no valid answer came in time.
|
|
166
|
+
*/
|
|
167
|
+
requestFlush(timeoutMs: number, expired: Promise<void>): Promise<FlushResult | null>;
|
|
168
|
+
/**
|
|
169
|
+
* Synchronously processes direct messages from same-origin child contexts.
|
|
170
|
+
* @param message Received bus message.
|
|
171
|
+
* @param reply Direct response callback.
|
|
172
|
+
*/
|
|
173
|
+
acceptDirect(message: BusMessage, reply: Receive, peer?: Window): void;
|
|
174
|
+
/**
|
|
175
|
+
* Connects a worker instance to the bus control plane.
|
|
176
|
+
* @param worker Worker instance.
|
|
177
|
+
*/
|
|
178
|
+
attachWorker(worker: WorkerLike, options?: SourceOptions): () => void;
|
|
179
|
+
/**
|
|
180
|
+
* Sends journey state changes over every link in the journey scope.
|
|
181
|
+
* @param journey Active journey or null if ended.
|
|
182
|
+
*/
|
|
183
|
+
broadcastJourney(journey: Journey | null): void;
|
|
184
|
+
/** Closes all open links and clears internal state. */
|
|
185
|
+
destroy(): void;
|
|
186
|
+
/** Returns all unique active links including upstream. */
|
|
187
|
+
private allLinks;
|
|
188
|
+
/** Sends a message only over links of the given kind. */
|
|
189
|
+
private postOver;
|
|
190
|
+
/** Sends a journey message over every link in the journey scope. */
|
|
191
|
+
private postJourney;
|
|
192
|
+
/** Routes incoming messages to registered handlers or upstream targets. */
|
|
193
|
+
private readonly receive;
|
|
194
|
+
/**
|
|
195
|
+
* Checks the source, the message limits and the message shape before delivery.
|
|
196
|
+
* @param message Message from the source.
|
|
197
|
+
* @param source Link and identity of the source.
|
|
198
|
+
* @param child True if the source is a child of this context.
|
|
199
|
+
* @returns True if the bus can accept the message.
|
|
200
|
+
*/
|
|
201
|
+
private acceptsMessage;
|
|
202
|
+
/**
|
|
203
|
+
* Runs the source, budget, shape and permission checks. A failed check returns false instead
|
|
204
|
+
* of throwing, so a flood of rejected messages builds no stack traces. Only the JSON encoding
|
|
205
|
+
* can throw, and acceptsMessage catches that.
|
|
206
|
+
* @param message Message from the source.
|
|
207
|
+
* @param source Link and identity of the source.
|
|
208
|
+
* @param child True if the source is a child of this context.
|
|
209
|
+
* @returns True if the message passes every check.
|
|
210
|
+
*/
|
|
211
|
+
private passesChecks;
|
|
212
|
+
/**
|
|
213
|
+
* Hands an accepted message to its handler or to the upstream link.
|
|
214
|
+
* @param message Message that passed the source and shape checks.
|
|
215
|
+
* @param source Link and identity of the source.
|
|
216
|
+
*/
|
|
217
|
+
private routeMessage;
|
|
218
|
+
/**
|
|
219
|
+
* Queues a child's flush request. The first request runs its flush alone, and the requests
|
|
220
|
+
* that arrive meanwhile share one flush after it, so a flood has one flush running at most.
|
|
221
|
+
* @param message The request.
|
|
222
|
+
* @param source Link and identity of the child, which gets the answer.
|
|
223
|
+
*/
|
|
224
|
+
private queueFlush;
|
|
225
|
+
/**
|
|
226
|
+
* Runs one flush for the waiting requests, and one more while new requests wait. Two flushes
|
|
227
|
+
* start at least BUS_FLUSH_GAP_MS apart, and a request in the gap joins the next one.
|
|
228
|
+
*/
|
|
229
|
+
private runFlushes;
|
|
230
|
+
/**
|
|
231
|
+
* Hands a flush answer to the request that waits for it. Only the upstream owner can answer,
|
|
232
|
+
* because a sibling on a shared link can read the request's id.
|
|
233
|
+
* @param message The answer.
|
|
234
|
+
* @param source Link and identity of the sender of the answer.
|
|
235
|
+
*/
|
|
236
|
+
private settleFlush;
|
|
237
|
+
/**
|
|
238
|
+
* Answers whoever sent a message. A link that can address a single source sends to it only.
|
|
239
|
+
* @param source Link and identity of the source.
|
|
240
|
+
* @param message Answer to send.
|
|
241
|
+
*/
|
|
242
|
+
private answer;
|
|
243
|
+
/**
|
|
244
|
+
* Checks whether records from a link can go upstream. Records sent back out on the link
|
|
245
|
+
* they arrived on would return to their sender. A direct link is the exception, because
|
|
246
|
+
* each one is a single call into one parent, so two direct links in a chain are
|
|
247
|
+
* different links.
|
|
248
|
+
* @param link Kind of the link the records arrived on.
|
|
249
|
+
* @returns True if the relay is safe.
|
|
250
|
+
*/
|
|
251
|
+
private canRelay;
|
|
252
|
+
/** Checks whether this context can own the given link type. */
|
|
253
|
+
private canOwn;
|
|
254
|
+
/** Works out whether this context is the OpenFin platform provider. */
|
|
255
|
+
private resolveOpenFinProvider;
|
|
256
|
+
/** Resolves the handshake orphan policy for the current platform context. */
|
|
257
|
+
private orphanPolicy;
|
|
258
|
+
/** Checks whether a cross-origin boundary blocks access to the parent window. */
|
|
259
|
+
private isCrossOriginFrame;
|
|
260
|
+
/** Identifies the candidate upstream link based on platform hierarchy. */
|
|
261
|
+
private candidateUpstream;
|
|
262
|
+
/** Opens control links supported by the current runtime environment. */
|
|
263
|
+
private openControlLinks;
|
|
264
|
+
/** Opens the link to child frames if it is not already open. */
|
|
265
|
+
private ensureChildrenLink;
|
|
266
|
+
/** Returns the singleton OpenFin InterApplicationBus link. */
|
|
267
|
+
private ensureOpenFinLink;
|
|
268
|
+
/**
|
|
269
|
+
* Runs a hello/welcome handshake over the candidate link.
|
|
270
|
+
* @param candidate Upstream link candidate.
|
|
271
|
+
* @returns True if the welcome arrived before the timeout.
|
|
272
|
+
*/
|
|
273
|
+
private handshake;
|
|
274
|
+
/** Broadcasts tab claim and queries existing journey state. */
|
|
275
|
+
private announce;
|
|
276
|
+
/**
|
|
277
|
+
* Resolves the journey scope. "auto" becomes "origin" in OpenFin and "tab" in a browser.
|
|
278
|
+
* @returns The scope in effect.
|
|
279
|
+
*/
|
|
280
|
+
private journeyScope;
|
|
281
|
+
/**
|
|
282
|
+
* Checks whether a link carries journey messages in the current scope.
|
|
283
|
+
* Only "origin" uses the broadcast link, which reaches every tab on the origin.
|
|
284
|
+
* @param link Link kind.
|
|
285
|
+
* @returns True if the link carries journey messages.
|
|
286
|
+
*/
|
|
287
|
+
private journeyLink;
|
|
288
|
+
/**
|
|
289
|
+
* Checks whether this context adopts a journey message.
|
|
290
|
+
* @param message Journey message.
|
|
291
|
+
* @param source Link and origin of the message.
|
|
292
|
+
* @returns True for a message on a journey link, addressed to this context, from an accepted
|
|
293
|
+
* sender. In "tab" scope, the only accepted sender is a forwarder's owner.
|
|
294
|
+
*/
|
|
295
|
+
private acceptsJourney;
|
|
296
|
+
/**
|
|
297
|
+
* Checks whether a message comes from this forwarder's upstream owner.
|
|
298
|
+
* @param from Context id of the sender.
|
|
299
|
+
* @param link Link kind of the message.
|
|
300
|
+
* @returns True for the upstream link and, after a handshake, the owner that answered it.
|
|
301
|
+
*/
|
|
302
|
+
private fromOwner;
|
|
303
|
+
/**
|
|
304
|
+
* Parses a journey payload from another realm and hands it to the runtime.
|
|
305
|
+
* @param payload Journey, or null when the journey ended.
|
|
306
|
+
*/
|
|
307
|
+
private applyJourney;
|
|
308
|
+
/**
|
|
309
|
+
* Builds the answer to a sampling question. Null rules clear the forwarder's copy.
|
|
310
|
+
* @param to Context id of the forwarder that asked.
|
|
311
|
+
* @returns The answer.
|
|
312
|
+
*/
|
|
313
|
+
private rulesAnswer;
|
|
314
|
+
/**
|
|
315
|
+
* Checks whether this context accepts sampling rules from a source.
|
|
316
|
+
* @param to Context id that the answer names.
|
|
317
|
+
* @param source Link and origin of the answer.
|
|
318
|
+
* @returns True only for an answer from the upstream owner to this context.
|
|
319
|
+
*/
|
|
320
|
+
private acceptsRules;
|
|
321
|
+
/**
|
|
322
|
+
* Applies the rules from an answer, ignoring any that are invalid.
|
|
323
|
+
* @param raw The answer's rules, or null when the upstream has none.
|
|
324
|
+
*/
|
|
325
|
+
private applyRules;
|
|
326
|
+
/**
|
|
327
|
+
* Asks the upstream owner for the remote sampling rules now, then on every poll interval.
|
|
328
|
+
* A direct link can't push the rules to a child, but a poll works on every link kind.
|
|
329
|
+
*/
|
|
330
|
+
private pollRules;
|
|
331
|
+
}
|