@utk09/ui-observability 0.12.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 +420 -0
- package/README.md +72 -839
- package/dist/{batch-BjQUwjA6.js → batch-CXmPmTse.js} +4 -4
- package/dist/{batch-BjQUwjA6.js.map → batch-CXmPmTse.js.map} +1 -1
- package/dist/{batch-D5LlU4Q9.cjs → batch-mmPigCpi.cjs} +2 -2
- package/dist/{batch-D5LlU4Q9.cjs.map → batch-mmPigCpi.cjs.map} +1 -1
- package/dist/bus/bus.d.cts +331 -0
- package/dist/bus/bus.d.ts +60 -10
- package/dist/bus/links.d.cts +132 -0
- package/dist/bus/links.d.ts +18 -3
- package/dist/bus/validation.d.cts +16 -0
- package/dist/bus/validation.d.ts +10 -1
- package/dist/{bus-ecxUNTja.js → bus-C39wspFV.js} +308 -193
- 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 +1 -1
- package/dist/capture/errors.d.cts +32 -0
- package/dist/capture/errors.d.ts +1 -1
- package/dist/capture/interactions.d.cts +48 -0
- package/dist/capture/interactions.d.ts +1 -1
- package/dist/capture/lifecycle.d.cts +20 -0
- package/dist/capture/lifecycle.d.ts +1 -1
- package/dist/capture/long-frames.d.cts +31 -0
- package/dist/capture/long-frames.d.ts +1 -1
- package/dist/capture/network.d.cts +57 -0
- package/dist/capture/network.d.ts +1 -1
- package/dist/capture/profiler-frames.d.cts +44 -0
- package/dist/capture/profiler-frames.d.ts +1 -1
- package/dist/capture/replay-buffer.d.cts +45 -0
- package/dist/capture/replay-buffer.d.ts +9 -10
- package/dist/capture/replay-upload.d.cts +79 -0
- package/dist/capture/replay-upload.d.ts +7 -2
- package/dist/capture/replay.d.cts +114 -0
- package/dist/capture/replay.d.ts +1 -1
- package/dist/capture/reports.d.cts +17 -0
- package/dist/capture/reports.d.ts +1 -1
- package/dist/capture/resource-timing.d.cts +14 -0
- package/dist/capture/resource-timing.d.ts +1 -1
- package/dist/capture/server-timing.d.cts +19 -0
- package/dist/capture/storm.d.cts +13 -0
- package/dist/capture/storm.d.ts +5 -5
- package/dist/capture/types.d.cts +128 -0
- package/dist/capture/types.d.ts +10 -9
- package/dist/capture/unclean-exit.d.cts +31 -0
- package/dist/capture/unclean-exit.d.ts +1 -1
- package/dist/capture/user-timing.d.cts +22 -0
- package/dist/capture/user-timing.d.ts +2 -2
- package/dist/capture/web-socket.d.cts +40 -0
- package/dist/capture/web-socket.d.ts +3 -3
- package/dist/capture/web-vitals.d.cts +40 -0
- package/dist/capture/web-vitals.d.ts +1 -1
- package/dist/{compression-lD9abCcO.cjs → compression-CvED_Jel.cjs} +2 -2
- package/dist/{compression-lD9abCcO.cjs.map → compression-CvED_Jel.cjs.map} +1 -1
- package/dist/{compression-AJJCMBOa.js → compression-tVtXwVjX.js} +2 -2
- package/dist/{compression-AJJCMBOa.js.map → compression-tVtXwVjX.js.map} +1 -1
- 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 +88 -20
- package/dist/core/breadcrumbs.d.cts +54 -0
- package/dist/core/breadcrumbs.d.ts +5 -0
- package/dist/core/config.d.cts +45 -0
- package/dist/core/config.d.ts +30 -2
- package/dist/core/context.d.cts +24 -0
- package/dist/core/context.d.ts +3 -8
- package/dist/core/debug-buffer.d.cts +34 -0
- package/dist/core/debug-buffer.d.ts +3 -3
- package/dist/core/debug-bundle.d.cts +12 -0
- package/dist/core/debug-bundle.d.ts +3 -3
- package/dist/core/deferred.d.cts +7 -0
- package/dist/core/deferred.d.ts +2 -2
- package/dist/core/diagnostics.d.cts +86 -0
- package/dist/core/diagnostics.d.ts +1 -1
- package/dist/core/drops.d.cts +39 -0
- package/dist/core/drops.d.ts +16 -6
- 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 +7 -7
- package/dist/core/logger.d.cts +141 -0
- package/dist/core/logger.d.ts +23 -30
- package/dist/core/measure.d.cts +30 -0
- package/dist/core/measure.d.ts +14 -3
- package/dist/core/meter.d.cts +78 -0
- package/dist/core/meter.d.ts +14 -8
- package/dist/core/pipeline.d.cts +227 -0
- package/dist/core/pipeline.d.ts +73 -10
- package/dist/core/profile-buckets.d.cts +31 -0
- package/dist/core/profiler.d.cts +218 -0
- package/dist/core/profiler.d.ts +2 -2
- package/dist/core/record.d.cts +190 -0
- package/dist/core/record.d.ts +44 -12
- package/dist/core/remote-rules.d.cts +17 -0
- package/dist/core/remote-rules.d.ts +3 -3
- package/dist/core/remote-sampling.d.cts +74 -0
- package/dist/core/remote-sampling.d.ts +3 -3
- 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 +245 -70
- package/dist/core/sampling.d.cts +86 -0
- package/dist/core/sampling.d.ts +5 -5
- package/dist/core/sender.d.cts +161 -0
- package/dist/core/sender.d.ts +59 -15
- package/dist/core/spans.d.cts +39 -0
- package/dist/core/spans.d.ts +1 -1
- 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 +5 -2
- package/dist/doctor.js +121 -89
- package/dist/doctor.js.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/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-BrQp_5J5.js → identity-DdhKgrpk.js} +20 -24
- 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 +89 -98
- package/dist/index.js +1173 -1506
- 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-DLXQzAGh.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-B6z2I4tU.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-35yCMNFo.js → journey-D2_sia57.js} +45 -48
- package/dist/journey-D2_sia57.js.map +1 -0
- package/dist/{library-console-Dl_Ly6DQ.js → library-console-Btrzt814.js} +2 -2
- package/dist/{library-console-Dl_Ly6DQ.js.map → library-console-Btrzt814.js.map} +1 -1
- package/dist/{library-console-BFWEuQsl.cjs → library-console-CPW6bvZH.cjs} +2 -2
- package/dist/{library-console-BFWEuQsl.cjs.map → library-console-CPW6bvZH.cjs.map} +1 -1
- package/dist/{library-request-nI6pvI6I.js → library-request-BJ9PLRaD.js} +2 -2
- package/dist/{library-request-nI6pvI6I.js.map → library-request-BJ9PLRaD.js.map} +1 -1
- package/dist/{library-request-Da-CHKzT.cjs → library-request-D7OvTxZV.cjs} +2 -2
- package/dist/{library-request-Da-CHKzT.cjs.map → library-request-D7OvTxZV.cjs.map} +1 -1
- package/dist/{lifecycle-CZ6RRXc6.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-DIA6McNr.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-430_85Da.js → long-frames-DNFaRnC3.js} +18 -22
- package/dist/long-frames-DNFaRnC3.js.map +1 -0
- package/dist/models/batch.d.cts +57 -0
- package/dist/models/batch.d.ts +2 -2
- package/dist/models/bus.d.cts +158 -0
- package/dist/models/bus.d.ts +22 -2
- package/dist/models/config.d.cts +1540 -0
- package/dist/models/config.d.ts +360 -259
- package/dist/models/drop.d.cts +54 -0
- package/dist/models/drop.d.ts +16 -3
- package/dist/models/health.d.cts +148 -0
- package/dist/models/health.d.ts +108 -12
- package/dist/models/log-record.d.cts +61 -0
- package/dist/models/metric.d.cts +139 -0
- package/dist/models/metric.d.ts +13 -2
- package/dist/models/plugin.d.cts +47 -0
- package/dist/models/plugin.d.ts +3 -3
- package/dist/models/replay.d.cts +60 -0
- package/dist/models/serializer.d.cts +23 -0
- package/dist/models/serializer.d.ts +1 -1
- package/dist/models/storage.d.cts +95 -0
- package/dist/models/storage.d.ts +7 -5
- package/dist/network-CGMLQ-mA.cjs +2 -0
- package/dist/network-CGMLQ-mA.cjs.map +1 -0
- package/dist/{network-C7SkLf4v.js → network-on2zZT6H.js} +51 -51
- package/dist/network-on2zZT6H.js.map +1 -0
- package/dist/{otlp-2MCrC3kd.cjs → otlp-BENHf3g9.cjs} +2 -2
- package/dist/{otlp-2MCrC3kd.cjs.map → otlp-BENHf3g9.cjs.map} +1 -1
- package/dist/{otlp-COq033e3.js → otlp-DimfrRor.js} +12 -12
- package/dist/{otlp-COq033e3.js.map → otlp-DimfrRor.js.map} +1 -1
- package/dist/{platform-CVewe4wQ.js → platform-BaaFIPCU.js} +10 -10
- package/dist/{platform-CVewe4wQ.js.map → platform-BaaFIPCU.js.map} +1 -1
- package/dist/{platform-12uR7kBQ.cjs → platform-CfA3-7sJ.cjs} +2 -2
- package/dist/{platform-12uR7kBQ.cjs.map → platform-CfA3-7sJ.cjs.map} +1 -1
- package/dist/{profiler-BVWIOgnq.js → profiler-BAZoh7A4.js} +89 -107
- 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-CLXlT_xL.js → profiler-frames-cJMx9wNM.js} +29 -37
- 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-BuXekPOS.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-CXGHwFRD.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-CNmsD9r3.js → sanitize-Ba0KqU06.js} +2 -2
- package/dist/sanitize-Ba0KqU06.js.map +1 -0
- package/dist/{sanitize-ChLn97Ch.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 +5 -5
- package/dist/storage/emergency-queue.d.cts +27 -0
- package/dist/storage/emergency-queue.d.ts +4 -4
- package/dist/storage/eviction.d.cts +40 -0
- package/dist/storage/eviction.d.ts +1 -1
- package/dist/storage/factory.d.cts +21 -0
- package/dist/storage/factory.d.ts +3 -3
- package/dist/storage/gap.d.cts +20 -0
- package/dist/storage/gap.d.ts +3 -3
- package/dist/storage/idb-driver.d.cts +93 -0
- package/dist/storage/idb-driver.d.ts +1 -1
- package/dist/storage/indexeddb-storage.d.cts +97 -0
- package/dist/storage/indexeddb-storage.d.ts +12 -4
- package/dist/storage/keys.d.cts +17 -0
- package/dist/storage/keys.d.ts +2 -2
- package/dist/storage/local-storage.d.cts +139 -0
- package/dist/storage/local-storage.d.ts +11 -4
- package/dist/storage/memory-storage.d.cts +73 -0
- package/dist/storage/memory-storage.d.ts +4 -3
- package/dist/storage/persistence.d.cts +8 -0
- package/dist/storage/persistence.d.ts +2 -2
- 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/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/exit-flush.d.cts +135 -0
- package/dist/transport/exit-flush.d.ts +30 -13
- package/dist/transport/headers.d.cts +8 -0
- package/dist/transport/headers.d.ts +2 -2
- package/dist/transport/http-transport.d.cts +116 -0
- package/dist/transport/http-transport.d.ts +20 -8
- package/dist/transport/memory-transport.d.cts +30 -0
- package/dist/transport/memory-transport.d.ts +2 -2
- 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 +27 -9
- package/dist/transport/serializers/ecs.d.cts +3 -0
- package/dist/transport/serializers/ecs.d.ts +1 -1
- package/dist/transport/serializers/otlp-metrics.d.cts +3 -0
- package/dist/transport/serializers/otlp-metrics.d.ts +1 -1
- package/dist/transport/serializers/otlp-traces.d.cts +3 -0
- package/dist/transport/serializers/otlp-traces.d.ts +1 -1
- package/dist/transport/serializers/otlp.d.cts +47 -0
- package/dist/transport/serializers/otlp.d.ts +2 -2
- package/dist/transport/serializers/select.d.cts +38 -0
- package/dist/transport/serializers/select.d.ts +5 -5
- package/dist/transport/status-transport.d.cts +129 -0
- package/dist/transport/status-transport.d.ts +25 -8
- 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 +4 -2
- 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-Cob_jyTv.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/{user-timing-DgHubxCI.js → user-timing-BePqb1uN.js} +15 -17
- 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 +4 -4
- package/dist/utils/deadline.d.cts +14 -0
- package/dist/utils/error-like.d.cts +25 -0
- package/dist/utils/fixed-window.d.cts +25 -0
- package/dist/utils/global-scope.d.cts +20 -0
- package/dist/utils/guards.d.cts +14 -0
- package/dist/utils/guards.d.ts +8 -0
- package/dist/utils/identity.d.cts +109 -0
- package/dist/utils/identity.d.ts +3 -4
- package/dist/utils/library-console.d.cts +11 -0
- package/dist/utils/library-request.d.cts +24 -0
- package/dist/utils/lock.d.cts +24 -0
- package/dist/utils/lock.d.ts +1 -1
- package/dist/utils/openfin.d.cts +48 -0
- package/dist/utils/patch.d.cts +9 -0
- package/dist/utils/platform.d.cts +62 -0
- package/dist/utils/platform.d.ts +2 -2
- package/dist/utils/sanitize.d.cts +52 -0
- package/dist/utils/sanitize.d.ts +1 -1
- package/dist/utils/sequence.d.cts +10 -0
- package/dist/utils/tracing.d.cts +158 -0
- package/dist/utils/tracing.d.ts +11 -4
- package/dist/utils/unref.d.cts +9 -0
- package/dist/web-socket-CoIUBM3C.cjs +2 -0
- package/dist/{web-socket-DthJuSAg.js.map → web-socket-CoIUBM3C.cjs.map} +1 -1
- package/dist/{web-socket-DthJuSAg.js → web-socket-DSHgDiZ6.js} +23 -28
- package/dist/web-socket-DSHgDiZ6.js.map +1 -0
- package/dist/{web-vitals-CsGCWnUr.js → web-vitals-4pWACwaR.js} +15 -21
- 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-B0_8rWy5.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 +54 -46
- package/dist/bus-D_7pd7RN.cjs +0 -2
- package/dist/bus-D_7pd7RN.cjs.map +0 -1
- package/dist/bus-ecxUNTja.js.map +0 -1
- package/dist/console-CLz_PvFn.cjs +0 -2
- package/dist/console-CLz_PvFn.cjs.map +0 -1
- package/dist/console-cwgHKXvM.js +0 -82
- package/dist/console-cwgHKXvM.js.map +0 -1
- package/dist/constants-Bwl_YtQi.js +0 -349
- package/dist/constants-Bwl_YtQi.js.map +0 -1
- package/dist/constants-DakMxVB2.cjs +0 -2
- package/dist/constants-DakMxVB2.cjs.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/debug-bundle-BOdYmCeV.js +0 -32
- package/dist/debug-bundle-BOdYmCeV.js.map +0 -1
- package/dist/debug-bundle-Ex4L_LSP.cjs +0 -2
- package/dist/debug-bundle-Ex4L_LSP.cjs.map +0 -1
- package/dist/emergency-queue-B9WZxanZ.js +0 -67
- package/dist/emergency-queue-B9WZxanZ.js.map +0 -1
- package/dist/emergency-queue-HBpL5r3V.cjs +0 -2
- package/dist/emergency-queue-HBpL5r3V.cjs.map +0 -1
- package/dist/errors-D6bwgJtO.js +0 -92
- package/dist/errors-D6bwgJtO.js.map +0 -1
- package/dist/errors-DCOCRdSi.cjs +0 -3
- package/dist/errors-DCOCRdSi.cjs.map +0 -1
- package/dist/factory-DLFDjdLv.cjs +0 -2
- package/dist/factory-DLFDjdLv.cjs.map +0 -1
- package/dist/factory-e9Qo3K0z.js +0 -276
- package/dist/factory-e9Qo3K0z.js.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-BlvlgjrU.cjs +0 -2
- package/dist/identity-BlvlgjrU.cjs.map +0 -1
- package/dist/identity-BrQp_5J5.js.map +0 -1
- package/dist/indexeddb-storage-CtLvZH1r.cjs +0 -2
- package/dist/indexeddb-storage-CtLvZH1r.cjs.map +0 -1
- package/dist/indexeddb-storage-DLXQzAGh.js.map +0 -1
- package/dist/interactions-B6z2I4tU.js.map +0 -1
- package/dist/interactions-P6pz08Jn.cjs +0 -2
- package/dist/interactions-P6pz08Jn.cjs.map +0 -1
- package/dist/journey-35yCMNFo.js.map +0 -1
- package/dist/journey-DAGh5h9k.cjs +0 -2
- package/dist/journey-DAGh5h9k.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/lifecycle-BGGOcN4N.cjs +0 -2
- package/dist/lifecycle-BGGOcN4N.cjs.map +0 -1
- package/dist/lifecycle-CZ6RRXc6.js.map +0 -1
- package/dist/log-record-D7bA1RPb.cjs +0 -2
- package/dist/log-record-D7bA1RPb.cjs.map +0 -1
- package/dist/log-record-DIA6McNr.js.map +0 -1
- package/dist/long-frames-430_85Da.js.map +0 -1
- package/dist/long-frames-Dd8tsi2U.cjs +0 -2
- package/dist/long-frames-Dd8tsi2U.cjs.map +0 -1
- package/dist/models/stats.d.ts +0 -11
- package/dist/network-C7SkLf4v.js.map +0 -1
- package/dist/network-pEX3PAJv.cjs +0 -2
- package/dist/network-pEX3PAJv.cjs.map +0 -1
- package/dist/profiler-BVWIOgnq.js.map +0 -1
- package/dist/profiler-eVCknCzS.cjs +0 -2
- package/dist/profiler-eVCknCzS.cjs.map +0 -1
- package/dist/profiler-frames-CLXlT_xL.js.map +0 -1
- package/dist/profiler-frames-Dg2OebB2.cjs +0 -2
- package/dist/profiler-frames-Dg2OebB2.cjs.map +0 -1
- package/dist/remote-rules-BJGDJGwA.js +0 -98
- package/dist/remote-rules-BJGDJGwA.js.map +0 -1
- package/dist/remote-rules-CJD3ToVk.cjs +0 -2
- package/dist/remote-rules-CJD3ToVk.cjs.map +0 -1
- package/dist/replay-0zAJv9T3.js +0 -338
- package/dist/replay-0zAJv9T3.js.map +0 -1
- package/dist/replay-DomJpXqW.cjs +0 -2
- package/dist/replay-DomJpXqW.cjs.map +0 -1
- package/dist/reports-BsbqmP8h.cjs +0 -2
- package/dist/reports-BsbqmP8h.cjs.map +0 -1
- package/dist/reports-BuXekPOS.js.map +0 -1
- package/dist/resource-timing-CXGHwFRD.js.map +0 -1
- package/dist/resource-timing-DkycFGDa.cjs +0 -2
- package/dist/resource-timing-DkycFGDa.cjs.map +0 -1
- package/dist/sampling-Dd0wllyq.cjs +0 -2
- package/dist/sampling-Dd0wllyq.cjs.map +0 -1
- package/dist/sampling-UUDbi3K0.js +0 -60
- package/dist/sampling-UUDbi3K0.js.map +0 -1
- package/dist/sanitize-CNmsD9r3.js.map +0 -1
- package/dist/sanitize-ChLn97Ch.cjs.map +0 -1
- package/dist/select-CTk-K5mG.cjs +0 -3
- package/dist/select-CTk-K5mG.cjs.map +0 -1
- package/dist/select-DPv_j6wq.js +0 -270
- package/dist/select-DPv_j6wq.js.map +0 -1
- package/dist/sender-15zEsZpr.js +0 -857
- package/dist/sender-15zEsZpr.js.map +0 -1
- package/dist/sender-Bfpv9tad.cjs +0 -2
- package/dist/sender-Bfpv9tad.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-BTSNTIWI.js +0 -9
- package/dist/storm-BTSNTIWI.js.map +0 -1
- package/dist/storm-D0_qZOEg.cjs +0 -2
- package/dist/storm-D0_qZOEg.cjs.map +0 -1
- package/dist/unclean-exit-ClGzrc2A.cjs +0 -2
- package/dist/unclean-exit-ClGzrc2A.cjs.map +0 -1
- package/dist/unclean-exit-Cob_jyTv.js.map +0 -1
- package/dist/user-timing-CdYqx3PF.cjs +0 -2
- package/dist/user-timing-CdYqx3PF.cjs.map +0 -1
- package/dist/user-timing-DgHubxCI.js.map +0 -1
- package/dist/utils/timer.d.ts +0 -19
- package/dist/web-socket-BTuvYoJI.cjs +0 -2
- package/dist/web-socket-BTuvYoJI.cjs.map +0 -1
- package/dist/web-vitals-Ch5BpDmo.cjs +0 -2
- package/dist/web-vitals-Ch5BpDmo.cjs.map +0 -1
- package/dist/web-vitals-CsGCWnUr.js.map +0 -1
- package/dist/worker-protocol-B0_8rWy5.js.map +0 -1
- package/dist/worker-protocol-BjzFORfq.cjs +0 -2
- package/dist/worker-protocol-BjzFORfq.cjs.map +0 -1
- package/dist/worker-server-4en-Lt-3.cjs +0 -2
- package/dist/worker-server-4en-Lt-3.cjs.map +0 -1
- package/dist/worker-server-Cne9MX9I.js +0 -83
- package/dist/worker-server-Cne9MX9I.js.map +0 -1
- package/dist/worker-transport-B-GF4Aqn.cjs +0 -2
- package/dist/worker-transport-B-GF4Aqn.cjs.map +0 -1
- package/dist/worker-transport-C3SjJAEC.js +0 -200
- package/dist/worker-transport-C3SjJAEC.js.map +0 -1
|
@@ -1,37 +1,65 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
1
|
+
import { A as e, M as t, Mn as n, N as r, O as i, Vn as a, it as o, k as s, un as c } from "./constants-CUyd9cTZ.js";
|
|
2
|
+
import { r as l } from "./journey-D2_sia57.js";
|
|
3
|
+
import { n as u, t as d } from "./remote-rules-Dz9MRAsB.js";
|
|
4
|
+
import { n as f, t as p } from "./log-record-BNiLfqtL.js";
|
|
5
|
+
import { n as m } from "./guards-BlYGRK4l.js";
|
|
6
|
+
import { i as h } from "./identity-DdhKgrpk.js";
|
|
7
|
+
import { t as g } from "./openfin-Bxelt0yg.js";
|
|
8
|
+
import { n as _, t as v } from "./fixed-window-Dq3MLUUv.js";
|
|
9
|
+
import { t as y } from "./unref-DgHPQeWv.js";
|
|
10
|
+
import { t as b } from "./defineProperty-s2S8BXUc.js";
|
|
8
11
|
// src/bus/validation.ts
|
|
9
|
-
|
|
12
|
+
var x = [
|
|
13
|
+
"complete",
|
|
14
|
+
"timeout",
|
|
15
|
+
"inactive"
|
|
16
|
+
];
|
|
17
|
+
function S(e) {
|
|
10
18
|
if (typeof e != "object" || !e) return !1;
|
|
11
|
-
let
|
|
12
|
-
if (typeof
|
|
13
|
-
let
|
|
14
|
-
switch (
|
|
15
|
-
case
|
|
16
|
-
case
|
|
17
|
-
case
|
|
18
|
-
case
|
|
19
|
-
case
|
|
20
|
-
case
|
|
21
|
-
case
|
|
22
|
-
case
|
|
23
|
-
case
|
|
19
|
+
let t = e;
|
|
20
|
+
if (typeof t.from != "string" || !t.from || typeof t.t != "string") return !1;
|
|
21
|
+
let n = (e) => typeof t[e] == "string";
|
|
22
|
+
switch (t.t) {
|
|
23
|
+
case r.hello:
|
|
24
|
+
case r.tab: return n("tabId");
|
|
25
|
+
case r.welcome: return n("to") && n("tabId") && (t.routingContextId === void 0 || n("routingContextId"));
|
|
26
|
+
case r.journeyRequest:
|
|
27
|
+
case r.samplingRequest: return !0;
|
|
28
|
+
case r.securityContext: return n("id") && t.id !== "";
|
|
29
|
+
case r.journey: return (t.to === void 0 || n("to")) && "journey" in t;
|
|
30
|
+
case r.sampling: return n("to") && "rules" in t;
|
|
31
|
+
case r.flushRequest: return n("id") && typeof t.timeoutMs == "number";
|
|
32
|
+
case r.flushResult: return n("id") && "result" in t;
|
|
33
|
+
case r.records: return Array.isArray(t.records) && (t.routingContextId === void 0 || n("routingContextId")) && t.records.every((e) => !f(e) || !p(e.severityText) ? !1 : !Array.isArray(e.attributes) && !Array.isArray(e.resource) && /^\d+$/.test(e.timeUnixNano) && (e.observedTimeUnixNano === void 0 || /^\d+$/.test(e.observedTimeUnixNano)) && typeof e.traceId == "string" && /^(?:[a-f\d]{32})?$/.test(e.traceId) && typeof e.spanId == "string" && /^(?:[a-f\d]{16})?$/.test(e.spanId) && Number.isInteger(e.traceFlags) && e.traceFlags >= 0 && e.traceFlags <= 255 && e.severityNumber === a[e.severityText]);
|
|
24
34
|
default: return !1;
|
|
25
35
|
}
|
|
26
36
|
}
|
|
37
|
+
function C(e) {
|
|
38
|
+
if (!m(e)) return null;
|
|
39
|
+
let { status: t, accepted: n, stored: r, dropped: i, forwarded: a, pending: o } = e;
|
|
40
|
+
return ![
|
|
41
|
+
n,
|
|
42
|
+
r,
|
|
43
|
+
i,
|
|
44
|
+
a,
|
|
45
|
+
o
|
|
46
|
+
].every((e) => Number.isSafeInteger(e) && e >= 0) || !x.includes(t) || t === "complete" && o !== 0 ? null : {
|
|
47
|
+
status: t,
|
|
48
|
+
accepted: n,
|
|
49
|
+
stored: r,
|
|
50
|
+
dropped: i,
|
|
51
|
+
forwarded: a,
|
|
52
|
+
pending: o
|
|
53
|
+
};
|
|
54
|
+
}
|
|
27
55
|
// src/models/bus.ts
|
|
28
|
-
function
|
|
56
|
+
function w(e) {
|
|
29
57
|
return {
|
|
30
|
-
p:
|
|
58
|
+
p: t,
|
|
31
59
|
m: e
|
|
32
60
|
};
|
|
33
61
|
}
|
|
34
|
-
function
|
|
62
|
+
function T(e) {
|
|
35
63
|
if (typeof e != "object" || !e) return null;
|
|
36
64
|
let t = e;
|
|
37
65
|
if (t.p !== "ui-observability/2" || typeof t.m != "object" || t.m === null) return null;
|
|
@@ -39,62 +67,88 @@ function v(e) {
|
|
|
39
67
|
return typeof n.t == "string" ? n : null;
|
|
40
68
|
}
|
|
41
69
|
// src/bus/links.ts
|
|
42
|
-
var
|
|
43
|
-
function
|
|
44
|
-
return e ===
|
|
70
|
+
var E = Symbol.for(n), D = "null", O = "ui-observability/2";
|
|
71
|
+
function k(e, t) {
|
|
72
|
+
return e === D ? `The bus ignored ${t} from a sandboxed frame. The frame has an opaque origin. Set bus.mode: "sender" in the frame. Add allow-same-origin to the sandbox attribute only for content that you trust.` : `The bus ignored ${t} from ${e}. If you own this origin, add it to bus.trustedOrigins.`;
|
|
45
73
|
}
|
|
46
|
-
function
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
74
|
+
function A(e) {
|
|
75
|
+
let t = location.ancestorOrigins;
|
|
76
|
+
return t && t.length > 0 ? t.item(0) : j() ?? M(e);
|
|
77
|
+
}
|
|
78
|
+
function j() {
|
|
79
|
+
let e = document.referrer;
|
|
80
|
+
if (e === "") return null;
|
|
51
81
|
try {
|
|
52
|
-
return new URL(
|
|
82
|
+
return new URL(e).origin;
|
|
53
83
|
} catch {
|
|
54
84
|
return null;
|
|
55
85
|
}
|
|
56
86
|
}
|
|
57
|
-
function
|
|
87
|
+
function M(e) {
|
|
88
|
+
let t;
|
|
89
|
+
try {
|
|
90
|
+
t = window.parent.origin;
|
|
91
|
+
} catch {
|
|
92
|
+
return e.count("platform.api_blocked"), null;
|
|
93
|
+
}
|
|
94
|
+
return typeof t != "string" || t === D ? null : t;
|
|
95
|
+
}
|
|
96
|
+
function N() {
|
|
97
|
+
if (location.origin !== D) return location.origin;
|
|
98
|
+
let e = globalThis.origin;
|
|
99
|
+
return typeof e == "string" ? e : D;
|
|
100
|
+
}
|
|
101
|
+
function P(e, n) {
|
|
58
102
|
if (typeof window > "u" || window.parent === window) return null;
|
|
59
|
-
let
|
|
103
|
+
let r;
|
|
60
104
|
try {
|
|
61
|
-
|
|
105
|
+
r = window.parent[E];
|
|
62
106
|
} catch {
|
|
63
107
|
return null;
|
|
64
108
|
}
|
|
65
|
-
if (typeof
|
|
66
|
-
let r =
|
|
109
|
+
if (typeof r?.busAccept != "function") return null;
|
|
110
|
+
let i = r.protocol, a = r.busCanAccept, o = typeof a == "function", s = i === void 0 && o ? O : i;
|
|
111
|
+
if (s !== "ui-observability/2") {
|
|
112
|
+
let e = typeof s == "string" ? s.slice(0, 48) : "none";
|
|
113
|
+
return n.report("bus.protocol_mismatch", "The same-origin parent runtime uses another bus protocol. This context tries a message link instead of a direct call.", {
|
|
114
|
+
found: e,
|
|
115
|
+
own: t
|
|
116
|
+
}), null;
|
|
117
|
+
}
|
|
118
|
+
let c = N();
|
|
119
|
+
if (o && !a.call(r, window, c)) return null;
|
|
120
|
+
let l = r, u = !0;
|
|
67
121
|
return {
|
|
68
122
|
kind: "direct",
|
|
69
|
-
post(
|
|
70
|
-
|
|
71
|
-
|
|
123
|
+
post(t) {
|
|
124
|
+
u && n.guard("bus.send_failed", "The direct call into the parent runtime failed.", () => {
|
|
125
|
+
l.busAccept(t, e, window);
|
|
72
126
|
});
|
|
73
127
|
},
|
|
74
128
|
close() {
|
|
75
|
-
|
|
129
|
+
u = !1;
|
|
76
130
|
}
|
|
77
131
|
};
|
|
78
132
|
}
|
|
79
|
-
function
|
|
133
|
+
function F(e, t, n) {
|
|
80
134
|
if (typeof window > "u" || window.parent === window) return null;
|
|
81
|
-
let r =
|
|
82
|
-
if (r ===
|
|
135
|
+
let r = N();
|
|
136
|
+
if (r === D) return n.report("bus.untrusted_origin", "This frame reports the origin \"null\". No parent can trust that origin. This context sends its own records. A frame that is sandboxed without allow-same-origin has this origin. Set bus.mode: \"sender\" in the frame. Add allow-same-origin to the sandbox attribute only for content that you trust.", {
|
|
83
137
|
origin: r,
|
|
84
138
|
type: "parent"
|
|
85
139
|
}), null;
|
|
86
|
-
let i = /* @__PURE__ */ new Set([r, ...t]), a =
|
|
140
|
+
let i = /* @__PURE__ */ new Set([r, ...t]), a = A(n);
|
|
87
141
|
if (a === null || !i.has(a)) return n.report("bus.untrusted_origin", a === null ? "The origin of the parent frame is unknown. This context sends its own records." : `The parent frame is on ${a}. This origin is not in bus.trustedOrigins. This context sends its own records.`, {
|
|
88
142
|
origin: a ?? "",
|
|
89
143
|
type: "parent"
|
|
90
144
|
}), null;
|
|
91
145
|
let o = /* @__PURE__ */ new Set(), s = (t) => {
|
|
92
|
-
let r =
|
|
146
|
+
let r = T(t.data);
|
|
93
147
|
r && t.source === window.parent && (i.has(t.origin) ? e(r, {
|
|
94
148
|
link: "parent",
|
|
95
149
|
origin: t.origin,
|
|
96
150
|
peer: t.source
|
|
97
|
-
}) : o.has(t.origin) || (o.add(t.origin), n.report("bus.untrusted_origin",
|
|
151
|
+
}) : o.has(t.origin) || (o.add(t.origin), n.report("bus.untrusted_origin", k(t.origin, "a message"), {
|
|
98
152
|
origin: t.origin,
|
|
99
153
|
type: r.t.slice(0, 48)
|
|
100
154
|
})));
|
|
@@ -103,7 +157,7 @@ function w(e, t, n) {
|
|
|
103
157
|
kind: "parent",
|
|
104
158
|
post(e) {
|
|
105
159
|
n.guard("bus.send_failed", "The postMessage call to the parent failed.", () => {
|
|
106
|
-
window.parent.postMessage(
|
|
160
|
+
window.parent.postMessage(w(e), a);
|
|
107
161
|
});
|
|
108
162
|
},
|
|
109
163
|
close() {
|
|
@@ -111,10 +165,10 @@ function w(e, t, n) {
|
|
|
111
165
|
}
|
|
112
166
|
};
|
|
113
167
|
}
|
|
114
|
-
function
|
|
168
|
+
function I(e, t, n, r, i) {
|
|
115
169
|
if (typeof window > "u") return null;
|
|
116
170
|
let a = /* @__PURE__ */ new Set([location.origin, ...t]);
|
|
117
|
-
a.delete(
|
|
171
|
+
a.delete(D);
|
|
118
172
|
let o = /* @__PURE__ */ new Map(), s = (e, t, a) => {
|
|
119
173
|
if (r && !r(e, t)) {
|
|
120
174
|
o.delete(e);
|
|
@@ -123,13 +177,13 @@ function T(e, t, n, r, i) {
|
|
|
123
177
|
if (i && !i(a, e)) return;
|
|
124
178
|
let s = e;
|
|
125
179
|
s.closed ? o.delete(e) : n.guard("bus.send_failed", "The postMessage call to a child frame failed.", () => {
|
|
126
|
-
s.postMessage(
|
|
180
|
+
s.postMessage(w(a), t);
|
|
127
181
|
});
|
|
128
182
|
}, c = (t) => {
|
|
129
|
-
let i =
|
|
183
|
+
let i = T(t.data);
|
|
130
184
|
if (!i || window.parent !== window && t.source === window.parent) return;
|
|
131
185
|
if (!r && !a.has(t.origin)) {
|
|
132
|
-
n.report("bus.untrusted_origin",
|
|
186
|
+
n.report("bus.untrusted_origin", k(t.origin, "a message"), {
|
|
133
187
|
origin: t.origin,
|
|
134
188
|
type: i.t.slice(0, 48)
|
|
135
189
|
});
|
|
@@ -156,12 +210,12 @@ function T(e, t, n, r, i) {
|
|
|
156
210
|
}
|
|
157
211
|
};
|
|
158
212
|
}
|
|
159
|
-
function
|
|
213
|
+
function L(e, t, n) {
|
|
160
214
|
let r = globalThis.BroadcastChannel;
|
|
161
215
|
if (r === void 0) return null;
|
|
162
216
|
let i = n.guard("bus.send_failed", "The library could not open the BroadcastChannel.", () => new r(e));
|
|
163
217
|
return i ? (i.onmessage = (e) => {
|
|
164
|
-
let n =
|
|
218
|
+
let n = T(e.data);
|
|
165
219
|
n && t(n, {
|
|
166
220
|
link: "broadcast",
|
|
167
221
|
origin: "same-origin"
|
|
@@ -170,7 +224,7 @@ function E(e, t, n) {
|
|
|
170
224
|
kind: "broadcast",
|
|
171
225
|
post(e) {
|
|
172
226
|
n.guard("bus.send_failed", "The BroadcastChannel.postMessage call failed.", () => {
|
|
173
|
-
i.postMessage(
|
|
227
|
+
i.postMessage(w(e));
|
|
174
228
|
});
|
|
175
229
|
},
|
|
176
230
|
close() {
|
|
@@ -180,13 +234,13 @@ function E(e, t, n) {
|
|
|
180
234
|
}
|
|
181
235
|
}) : null;
|
|
182
236
|
}
|
|
183
|
-
function
|
|
184
|
-
let i =
|
|
237
|
+
function R(e, t, n, r) {
|
|
238
|
+
let i = g()?.InterApplicationBus;
|
|
185
239
|
if (!i) return null;
|
|
186
240
|
if (!t) return r.report("openfin.unavailable", "OpenFin gives no application uuid. The InterApplicationBus link stays closed."), null;
|
|
187
241
|
let a = `${e}.${t}`;
|
|
188
242
|
return r.guardAsync("bus.send_failed", "The InterApplicationBus.subscribe call failed.", () => i.subscribe({ uuid: t }, a, (e, t, r) => {
|
|
189
|
-
let i =
|
|
243
|
+
let i = T(e);
|
|
190
244
|
i && n(i, {
|
|
191
245
|
link: "openfin",
|
|
192
246
|
origin: "openfin",
|
|
@@ -195,15 +249,15 @@ function D(e, t, n, r) {
|
|
|
195
249
|
})), {
|
|
196
250
|
kind: "openfin",
|
|
197
251
|
post(e) {
|
|
198
|
-
r.guardAsync("bus.send_failed", "The InterApplicationBus.publish call failed.", () => i.publish(a,
|
|
252
|
+
r.guardAsync("bus.send_failed", "The InterApplicationBus.publish call failed.", () => i.publish(a, w(e)));
|
|
199
253
|
},
|
|
200
254
|
close() {}
|
|
201
255
|
};
|
|
202
256
|
}
|
|
203
|
-
function
|
|
257
|
+
function z(e, t) {
|
|
204
258
|
let n = globalThis, r = n.postMessage;
|
|
205
259
|
return n.WorkerGlobalScope === void 0 || !r ? null : (n.addEventListener?.("message", (t) => {
|
|
206
|
-
let n =
|
|
260
|
+
let n = T(t.data);
|
|
207
261
|
n && e(n, {
|
|
208
262
|
link: "owner",
|
|
209
263
|
origin: "same-origin"
|
|
@@ -212,15 +266,15 @@ function O(e, t) {
|
|
|
212
266
|
kind: "owner",
|
|
213
267
|
post(e) {
|
|
214
268
|
t.guard("bus.send_failed", "The postMessage call of the worker failed.", () => {
|
|
215
|
-
r(
|
|
269
|
+
r(w(e));
|
|
216
270
|
});
|
|
217
271
|
},
|
|
218
272
|
close() {}
|
|
219
273
|
});
|
|
220
274
|
}
|
|
221
|
-
function
|
|
275
|
+
function B(e, t, n) {
|
|
222
276
|
let r = (n) => {
|
|
223
|
-
let r =
|
|
277
|
+
let r = T(n.data);
|
|
224
278
|
r && t(r, {
|
|
225
279
|
link: "worker",
|
|
226
280
|
origin: "same-origin",
|
|
@@ -231,7 +285,7 @@ function k(e, t, n) {
|
|
|
231
285
|
kind: "worker",
|
|
232
286
|
post(t) {
|
|
233
287
|
n.guard("bus.send_failed", "The postMessage call to a worker failed.", () => {
|
|
234
|
-
e.postMessage(
|
|
288
|
+
e.postMessage(w(t));
|
|
235
289
|
});
|
|
236
290
|
},
|
|
237
291
|
close() {
|
|
@@ -240,28 +294,17 @@ function k(e, t, n) {
|
|
|
240
294
|
};
|
|
241
295
|
}
|
|
242
296
|
// src/bus/bus.ts
|
|
243
|
-
var
|
|
244
|
-
timeoutMs:
|
|
297
|
+
var V = {
|
|
298
|
+
timeoutMs: e,
|
|
245
299
|
maxAttempts: 3
|
|
246
|
-
},
|
|
300
|
+
}, H = [
|
|
247
301
|
"children",
|
|
248
302
|
"direct",
|
|
249
303
|
"worker"
|
|
250
|
-
],
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
contextId;
|
|
255
|
-
tabId;
|
|
256
|
-
handlers;
|
|
257
|
-
handshakeOptions;
|
|
258
|
-
sources = /* @__PURE__ */ new Map();
|
|
259
|
-
rates = /* @__PURE__ */ new WeakMap();
|
|
260
|
-
channelRates = /* @__PURE__ */ new Map();
|
|
261
|
-
directReplies = /* @__PURE__ */ new Map();
|
|
262
|
-
mayPost(e, n) {
|
|
263
|
-
let r = this.sources.get(n)?.permissions;
|
|
264
|
-
return r ? e.t === t.journey ? r.includes("journey:read") : e.t === t.journeyRequest ? r.includes("journey:write") : e.t !== t.sampling || r.includes("sampling:read") : this.config.bus.sourcePolicy === "trusted-origin";
|
|
304
|
+
], U = class {
|
|
305
|
+
mayPost(e, t) {
|
|
306
|
+
let n = this.sources.get(t)?.permissions;
|
|
307
|
+
return n ? e.t === r.journey ? n.includes("journey:read") : e.t === r.journeyRequest ? n.includes("journey:write") : e.t !== r.sampling || n.includes("sampling:read") : this.config.bus.sourcePolicy === "trusted-origin";
|
|
265
308
|
}
|
|
266
309
|
registerFrame(e, t) {
|
|
267
310
|
let n = typeof HTMLIFrameElement > "u" ? void 0 : HTMLIFrameElement, r = n && e instanceof n ? e.contentWindow : e;
|
|
@@ -277,27 +320,28 @@ var A = {
|
|
|
277
320
|
isRegistered(e, t) {
|
|
278
321
|
if (!e) return !1;
|
|
279
322
|
let n = this.sources.get(e);
|
|
280
|
-
return n ? n.origin === t : this.config.bus.sourcePolicy !== "registered" && t !== "null" && (t ===
|
|
323
|
+
return n ? n.origin === t : this.config.bus.sourcePolicy !== "registered" && t !== "null" && (t === N() || this.config.bus.trustedOrigins.includes(t));
|
|
281
324
|
}
|
|
282
325
|
rotateContext() {
|
|
283
326
|
this.passContext(this.role === "sender");
|
|
284
327
|
}
|
|
285
328
|
passContext(e) {
|
|
286
|
-
let
|
|
287
|
-
t:
|
|
329
|
+
let t = {
|
|
330
|
+
t: r.securityContext,
|
|
288
331
|
from: this.contextId,
|
|
289
332
|
id: this.config.securityContext.id
|
|
290
333
|
};
|
|
291
|
-
this.postOver("children",
|
|
334
|
+
this.postOver("children", t), this.postOver("worker", t), this.postToDirectChildren(t), e && this.postOver("openfin", t);
|
|
292
335
|
}
|
|
293
336
|
postToDirectChildren(e) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
337
|
+
let t = N();
|
|
338
|
+
for (let [n, r] of this.directReplies) {
|
|
339
|
+
let i = r.deref();
|
|
340
|
+
!i || n.closed || !this.isRegistered(n, t) ? this.directReplies.delete(n) : this.diagnostics.guard("bus.send_failed", "The reply to a direct child failed.", () => {
|
|
341
|
+
i(e, {
|
|
298
342
|
link: "direct",
|
|
299
343
|
origin: "same-origin",
|
|
300
|
-
peer:
|
|
344
|
+
peer: n
|
|
301
345
|
});
|
|
302
346
|
});
|
|
303
347
|
}
|
|
@@ -306,18 +350,11 @@ var A = {
|
|
|
306
350
|
for (let e of this.directReplies.keys()) e.closed && this.directReplies.delete(e);
|
|
307
351
|
this.directReplies.set(e, new WeakRef(t));
|
|
308
352
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
rulesPoll;
|
|
315
|
-
destroyed = !1;
|
|
316
|
-
ownerId = null;
|
|
317
|
-
ownerPeer;
|
|
318
|
-
awaitingWelcome = null;
|
|
319
|
-
constructor(e, t, n, r, i, a, o = A) {
|
|
320
|
-
this.config = e, this.diagnostics = t, this.platform = n, this.contextId = r, this.tabId = i, this.handlers = a, this.handshakeOptions = o;
|
|
353
|
+
constructor(e, t, n, r, i, a, o = V) {
|
|
354
|
+
b(this, "config", void 0), b(this, "diagnostics", void 0), b(this, "platform", void 0), b(this, "contextId", void 0), b(this, "tabId", void 0), b(this, "handlers", void 0), b(this, "handshakeOptions", void 0), b(this, "sources", /* @__PURE__ */ new Map()), b(this, "rates", /* @__PURE__ */ new WeakMap()), b(this, "channelRates", /* @__PURE__ */ new Map()), b(this, "directReplies", /* @__PURE__ */ new Map()), b(this, "role", "sender"), b(this, "upstream", null), b(this, "links", []), b(this, "openFinLink", null), b(this, "isOpenFinProvider", !1), b(this, "rulesPoll", void 0), b(this, "destroyed", !1), b(this, "ownerId", null), b(this, "ownerPeer", void 0), b(this, "awaitingWelcome", null), b(this, "flushAnswers", /* @__PURE__ */ new Map()), b(this, "flushQueue", []), b(this, "flushing", !1), b(this, "flushedAt", 0), b(this, "receive", (e, t) => {
|
|
355
|
+
let n = t.link === "children" || t.link === "worker";
|
|
356
|
+
this.acceptsMessage(e, t, n) && this.routeMessage(e, t);
|
|
357
|
+
}), this.config = e, this.diagnostics = t, this.platform = n, this.contextId = r, this.tabId = i, this.handlers = a, this.handshakeOptions = o;
|
|
321
358
|
}
|
|
322
359
|
getRole() {
|
|
323
360
|
return this.role;
|
|
@@ -327,7 +364,7 @@ var A = {
|
|
|
327
364
|
if (e.mode === "off") return this.role = "sender", this.role;
|
|
328
365
|
if (this.isOpenFinProvider = this.resolveOpenFinProvider(), e.mode === "sender" || e.mode === "forwarder") return this.role = e.mode, this.openControlLinks(), this.role === "forwarder" && (this.upstream = this.candidateUpstream(), this.upstream || this.diagnostics.report("bus.no_owner", "bus.mode is \"forwarder\". No owner exists. The library drops the records of this context.")), this.announce(), this.role;
|
|
329
366
|
this.openControlLinks();
|
|
330
|
-
let t =
|
|
367
|
+
let t = P(this.receive, this.diagnostics);
|
|
331
368
|
if (t) return this.role = "forwarder", this.upstream = t, await this.handshake(t), this.diagnostics.report("bus.role_resolved", "This context attached directly to the runtime of its same-origin parent.", {
|
|
332
369
|
role: "forwarder",
|
|
333
370
|
via: "direct"
|
|
@@ -345,36 +382,54 @@ var A = {
|
|
|
345
382
|
}), this.announce(), this.role;
|
|
346
383
|
}
|
|
347
384
|
sendRecords(e) {
|
|
348
|
-
let { maxRecordsPerMessage:
|
|
349
|
-
t:
|
|
385
|
+
let { maxRecordsPerMessage: t, maxMessageBytes: n } = this.config.bus, i = new TextEncoder(), a = (e) => n === null ? 0 : i.encode(JSON.stringify(e)).length, o = (e) => ({
|
|
386
|
+
t: r.records,
|
|
350
387
|
from: this.contextId,
|
|
351
388
|
records: e,
|
|
352
389
|
routingContextId: this.config.securityContext.id || void 0
|
|
353
|
-
}), s = a(o([])), c = [], l = s;
|
|
354
|
-
for (let
|
|
355
|
-
let e = a(
|
|
356
|
-
if (
|
|
357
|
-
this.diagnostics.count("bus.rejected_message")
|
|
390
|
+
}), s = a(o([])), c = [], l = s, u = 0;
|
|
391
|
+
for (let r of e) {
|
|
392
|
+
let e = a(r);
|
|
393
|
+
if (n !== null && s + e > n) {
|
|
394
|
+
this.diagnostics.count("bus.rejected_message"), u++;
|
|
358
395
|
continue;
|
|
359
396
|
}
|
|
360
397
|
let i = +(c.length > 0);
|
|
361
|
-
(
|
|
398
|
+
(t !== null && c.length >= t || n !== null && l + i + e > n) && (this.upstream?.post(o(c)), c = [], l = s), l += +(c.length > 0) + e, c.push(r);
|
|
362
399
|
}
|
|
363
|
-
c.length > 0 && this.upstream?.post(o(c));
|
|
400
|
+
return c.length > 0 && this.upstream?.post(o(c)), this.upstream ? e.length - u : 0;
|
|
364
401
|
}
|
|
365
|
-
|
|
402
|
+
async requestFlush(e, t) {
|
|
403
|
+
let { upstream: n } = this;
|
|
404
|
+
if (!n) return null;
|
|
405
|
+
let i = h(this.diagnostics), a, o = new Promise((e) => {
|
|
406
|
+
a = e;
|
|
407
|
+
});
|
|
408
|
+
this.flushAnswers.set(i, a), n.post({
|
|
409
|
+
t: r.flushRequest,
|
|
410
|
+
from: this.contextId,
|
|
411
|
+
id: i,
|
|
412
|
+
timeoutMs: e
|
|
413
|
+
});
|
|
414
|
+
try {
|
|
415
|
+
return await Promise.race([o, t.then(() => null)]);
|
|
416
|
+
} finally {
|
|
417
|
+
this.flushAnswers.delete(i);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
acceptDirect(e, t, n) {
|
|
366
421
|
let i = {
|
|
367
422
|
link: "direct",
|
|
368
423
|
origin: "same-origin",
|
|
369
|
-
peer:
|
|
424
|
+
peer: n
|
|
370
425
|
}, a = {
|
|
371
426
|
...i,
|
|
372
427
|
reply: (e) => {
|
|
373
|
-
|
|
428
|
+
t(e, i);
|
|
374
429
|
}
|
|
375
430
|
};
|
|
376
|
-
this.acceptsMessage(e, a, !0) && e.from !== this.contextId && (
|
|
377
|
-
t:
|
|
431
|
+
this.acceptsMessage(e, a, !0) && e.from !== this.contextId && (n && this.keepDirectReply(n, t), e.t === r.samplingRequest ? t(this.rulesAnswer(e.from), i) : (e.t === r.records && !this.awaitingWelcome && e.routingContextId !== this.config.securityContext.id && t({
|
|
432
|
+
t: r.securityContext,
|
|
378
433
|
from: this.contextId,
|
|
379
434
|
id: this.config.securityContext.id
|
|
380
435
|
}, i), this.routeMessage(e, a)));
|
|
@@ -385,7 +440,14 @@ var A = {
|
|
|
385
440
|
permissions: [...t.permissions ?? ["records"]]
|
|
386
441
|
};
|
|
387
442
|
this.sources.set(e, n);
|
|
388
|
-
let r =
|
|
443
|
+
let r = B(e, (e, t) => {
|
|
444
|
+
this.receive(e, {
|
|
445
|
+
...t,
|
|
446
|
+
reply: (e) => {
|
|
447
|
+
i.post(e);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
}, this.diagnostics), i = {
|
|
389
451
|
...r,
|
|
390
452
|
post: (t) => {
|
|
391
453
|
this.mayPost(t, e) && r.post(t);
|
|
@@ -399,13 +461,13 @@ var A = {
|
|
|
399
461
|
}
|
|
400
462
|
broadcastJourney(e) {
|
|
401
463
|
this.postJourney({
|
|
402
|
-
t:
|
|
464
|
+
t: r.journey,
|
|
403
465
|
from: this.contextId,
|
|
404
466
|
journey: e
|
|
405
467
|
});
|
|
406
468
|
}
|
|
407
469
|
destroy() {
|
|
408
|
-
this.sources.clear(), this.directReplies.clear(), this.destroyed = !0, clearInterval(this.rulesPoll), this.rulesPoll = void 0;
|
|
470
|
+
this.sources.clear(), this.directReplies.clear(), this.flushQueue = [], this.destroyed = !0, clearInterval(this.rulesPoll), this.rulesPoll = void 0;
|
|
409
471
|
for (let e of this.allLinks()) e.close();
|
|
410
472
|
this.links.length = 0, this.upstream = null, this.ownerId = null, this.openFinLink = null;
|
|
411
473
|
}
|
|
@@ -418,10 +480,6 @@ var A = {
|
|
|
418
480
|
postJourney(e) {
|
|
419
481
|
for (let t of this.allLinks()) this.journeyLink(t.kind) && t.post(e);
|
|
420
482
|
}
|
|
421
|
-
receive = (e, t) => {
|
|
422
|
-
let n = t.link === "children" || t.link === "worker";
|
|
423
|
-
this.acceptsMessage(e, t, n) && this.routeMessage(e, t);
|
|
424
|
-
};
|
|
425
483
|
acceptsMessage(e, t, n) {
|
|
426
484
|
if (this.destroyed) return !1;
|
|
427
485
|
let r;
|
|
@@ -432,82 +490,139 @@ var A = {
|
|
|
432
490
|
}
|
|
433
491
|
return r || this.diagnostics.count("bus.rejected_message"), r;
|
|
434
492
|
}
|
|
435
|
-
passesChecks(e,
|
|
436
|
-
let { bus: i } = this.config, a = typeof
|
|
437
|
-
if (
|
|
438
|
-
let o = typeof
|
|
493
|
+
passesChecks(e, t, n) {
|
|
494
|
+
let { bus: i } = this.config, a = typeof t.peer == "object" ? this.sources.get(t.peer) : void 0;
|
|
495
|
+
if (n && i.sourcePolicy === "registered" && !a) return !1;
|
|
496
|
+
let o = typeof t.peer == "object" ? t.peer : void 0, s = typeof t.peer == "string" ? t.peer : t.link, c = Date.now(), l = (o ? this.rates.get(o) : this.channelRates.get(s)) ?? {
|
|
439
497
|
start: c,
|
|
440
498
|
count: 0
|
|
441
499
|
};
|
|
442
500
|
if (o) this.rates.set(o, l);
|
|
443
501
|
else {
|
|
444
|
-
for (let [e, t] of this.channelRates)
|
|
445
|
-
if (
|
|
502
|
+
for (let [e, t] of this.channelRates) _(t, 1e3, c) && this.channelRates.delete(e);
|
|
503
|
+
if (this.channelRates.size >= 256 && !this.channelRates.has(s)) return !1;
|
|
446
504
|
this.channelRates.set(s, l);
|
|
447
505
|
}
|
|
448
|
-
if (!
|
|
506
|
+
if (!v(l, i.maxMessagesPerSecond ?? Infinity, 1e3)) return !1;
|
|
449
507
|
let u = JSON.stringify(e, (e, t) => {
|
|
450
|
-
if (
|
|
508
|
+
if (typeof t == "number" && !Number.isFinite(t)) throw Error("Non-finite value");
|
|
451
509
|
return t;
|
|
452
510
|
});
|
|
453
|
-
if (i.maxMessageBytes && new TextEncoder().encode(u).length > i.maxMessageBytes ||
|
|
511
|
+
if (i.maxMessageBytes !== null && new TextEncoder().encode(u).length > i.maxMessageBytes || !S(e) || e.t === r.records && i.maxRecordsPerMessage !== null && e.records.length > i.maxRecordsPerMessage) return !1;
|
|
454
512
|
if (a) {
|
|
455
|
-
let
|
|
456
|
-
if (
|
|
513
|
+
let t = e.t === r.records || e.t === r.flushRequest ? "records" : e.t === r.journey ? "journey:write" : e.t === r.journeyRequest ? "journey:read" : e.t === r.samplingRequest ? "sampling:read" : void 0;
|
|
514
|
+
if (t && !a.permissions?.includes(t)) return !1;
|
|
457
515
|
}
|
|
458
|
-
return
|
|
516
|
+
return n && (e.t === r.sampling || e.t === r.securityContext || e.t === r.flushResult) || t.link === "broadcast" && e.t === r.flushRequest ? !1 : i.sourcePolicy !== "registered" || t.link !== "broadcast" || e.t !== r.records;
|
|
459
517
|
}
|
|
460
|
-
routeMessage(e,
|
|
518
|
+
routeMessage(e, t) {
|
|
461
519
|
if (e.from !== this.contextId) switch (e.t) {
|
|
462
|
-
case
|
|
463
|
-
this.canOwn(
|
|
464
|
-
t:
|
|
520
|
+
case r.hello:
|
|
521
|
+
this.canOwn(t.link) && this.answer(t, {
|
|
522
|
+
t: r.welcome,
|
|
465
523
|
from: this.contextId,
|
|
466
524
|
to: e.from,
|
|
467
525
|
tabId: this.tabId,
|
|
468
526
|
routingContextId: this.awaitingWelcome ? void 0 : this.config.securityContext.id || void 0
|
|
469
527
|
});
|
|
470
528
|
break;
|
|
471
|
-
case
|
|
529
|
+
case r.welcome:
|
|
472
530
|
if (e.to !== this.contextId) break;
|
|
473
|
-
if (this.awaitingWelcome?.link ===
|
|
474
|
-
this.ownerId = e.from, this.ownerPeer =
|
|
475
|
-
let
|
|
531
|
+
if (this.awaitingWelcome?.link === t.link || this.upstream?.kind === t.link && this.ownerId === null) {
|
|
532
|
+
this.ownerId = e.from, this.ownerPeer = t.peer;
|
|
533
|
+
let n = this.config.securityContext.id;
|
|
476
534
|
if (e.routingContextId && this.handlers.onSecurityContext?.(e.routingContextId) === !1) break;
|
|
477
|
-
this.config.securityContext.id !==
|
|
535
|
+
this.config.securityContext.id !== n && this.passContext(!1), this.awaitingWelcome?.settle(!0);
|
|
478
536
|
}
|
|
479
537
|
break;
|
|
480
|
-
case
|
|
538
|
+
case r.records:
|
|
481
539
|
if (this.config.securityContext.isolation && this.config.securityContext.id && e.routingContextId !== this.config.securityContext.id) {
|
|
482
540
|
this.diagnostics.count("security.context_mismatch");
|
|
483
541
|
break;
|
|
484
542
|
}
|
|
485
|
-
this.role === "sender" ? this.handlers.onRecords(e.records) : this.upstream && this.canRelay(
|
|
543
|
+
this.role === "sender" || this.handlers.paused?.() && this.canRelay(t.link) ? this.handlers.onRecords(e.records) : this.upstream && this.canRelay(t.link) && this.upstream.post(e);
|
|
486
544
|
break;
|
|
487
|
-
case
|
|
488
|
-
|
|
545
|
+
case r.securityContext:
|
|
546
|
+
t.link === this.upstream?.kind && this.ownerId === e.from && this.ownerPeer === t.peer && this.handlers.onSecurityContext?.(e.id) !== !1 && this.rotateContext();
|
|
489
547
|
break;
|
|
490
|
-
case
|
|
491
|
-
this.acceptsJourney(e,
|
|
548
|
+
case r.journey:
|
|
549
|
+
this.acceptsJourney(e, t) && this.applyJourney(e.journey);
|
|
492
550
|
break;
|
|
493
|
-
case
|
|
494
|
-
let
|
|
495
|
-
|
|
496
|
-
t:
|
|
551
|
+
case r.journeyRequest: {
|
|
552
|
+
let n = this.handlers.onJourneyRequest();
|
|
553
|
+
n && this.journeyLink(t.link) && this.answer(t, {
|
|
554
|
+
t: r.journey,
|
|
497
555
|
from: this.contextId,
|
|
498
556
|
to: e.from,
|
|
499
|
-
journey:
|
|
557
|
+
journey: n
|
|
500
558
|
});
|
|
501
559
|
break;
|
|
502
560
|
}
|
|
503
|
-
case
|
|
504
|
-
(this.role === "forwarder" ?
|
|
561
|
+
case r.samplingRequest:
|
|
562
|
+
(this.role === "forwarder" ? t.link !== this.upstream?.kind : this.canOwn(t.link)) && this.answer(t, this.rulesAnswer(e.from));
|
|
563
|
+
break;
|
|
564
|
+
case r.sampling:
|
|
565
|
+
this.acceptsRules(e.to, t) && this.applyRules(e.rules);
|
|
505
566
|
break;
|
|
506
|
-
case
|
|
507
|
-
this.
|
|
567
|
+
case r.flushRequest:
|
|
568
|
+
(this.role === "sender" || this.canRelay(t.link)) && this.queueFlush(e, t);
|
|
508
569
|
break;
|
|
509
|
-
case
|
|
570
|
+
case r.flushResult:
|
|
571
|
+
this.settleFlush(e, t);
|
|
572
|
+
break;
|
|
573
|
+
case r.tab: t.link === "broadcast" && e.tabId === this.tabId && this.contextId > e.from && this.handlers.onTabConflict();
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
queueFlush(e, t) {
|
|
577
|
+
let n = t.peer ?? t.link, i = this.flushQueue.filter((e) => e.source === n).length;
|
|
578
|
+
if (this.flushQueue.length >= 100 || i >= 4) {
|
|
579
|
+
this.diagnostics.count("bus.rejected_message");
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
let a = Math.min(Math.max(e.timeoutMs, 0), o);
|
|
583
|
+
this.flushQueue.push({
|
|
584
|
+
source: n,
|
|
585
|
+
ends: Date.now() + a,
|
|
586
|
+
answer: (n) => {
|
|
587
|
+
this.answer(t, {
|
|
588
|
+
t: r.flushResult,
|
|
589
|
+
from: this.contextId,
|
|
590
|
+
id: e.id,
|
|
591
|
+
result: n
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
}), this.flushing || this.runFlushes();
|
|
595
|
+
}
|
|
596
|
+
async runFlushes() {
|
|
597
|
+
this.flushing = !0;
|
|
598
|
+
try {
|
|
599
|
+
for (; this.flushQueue.length > 0;) {
|
|
600
|
+
let e = this.flushedAt + s - Date.now();
|
|
601
|
+
if (e > 0 && await new Promise((t) => {
|
|
602
|
+
y(setTimeout(t, e));
|
|
603
|
+
}), this.flushQueue.length === 0) return;
|
|
604
|
+
this.flushedAt = Date.now();
|
|
605
|
+
let t = this.flushQueue;
|
|
606
|
+
this.flushQueue = [];
|
|
607
|
+
let n = Math.max(...t.map((e) => e.ends)), r = await this.diagnostics.guardAsync("pipeline.crashed", "The flush that a child context asked for failed. The child gets no answer.", async () => this.handlers.onFlush?.(Math.max(0, n - Date.now())));
|
|
608
|
+
if (r && !this.destroyed) for (let e of t) this.diagnostics.guard("bus.send_failed", "The answer to a flush request failed.", () => {
|
|
609
|
+
e.answer(r);
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
} finally {
|
|
613
|
+
this.flushing = !1;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
settleFlush(e, t) {
|
|
617
|
+
let n = this.flushAnswers.get(e.id), r = this.ownerPeer === void 0 ? t.link !== "openfin" : this.ownerPeer === t.peer;
|
|
618
|
+
if (!n || !r || !this.fromOwner(e.from, t.link)) return;
|
|
619
|
+
let i;
|
|
620
|
+
try {
|
|
621
|
+
i = C(e.result);
|
|
622
|
+
} catch {
|
|
623
|
+
i = null;
|
|
510
624
|
}
|
|
625
|
+
i ? n(i) : this.diagnostics.count("bus.rejected_message");
|
|
511
626
|
}
|
|
512
627
|
answer(e, t) {
|
|
513
628
|
e.reply ? e.reply(t) : this.postOver(e.link, t);
|
|
@@ -516,13 +631,13 @@ var A = {
|
|
|
516
631
|
return e === "direct" || e !== this.upstream?.kind;
|
|
517
632
|
}
|
|
518
633
|
canOwn(e) {
|
|
519
|
-
return this.role !== "sender" && this.ownerId === null ? !1 : e === "openfin" ? this.role === "sender" && this.isOpenFinProvider :
|
|
634
|
+
return this.role !== "sender" && this.ownerId === null ? !1 : e === "openfin" ? this.role === "sender" && this.isOpenFinProvider : H.includes(e);
|
|
520
635
|
}
|
|
521
636
|
resolveOpenFinProvider() {
|
|
522
637
|
let e = this.config.bus.openFinRole;
|
|
523
638
|
if (e !== "auto") return e === "provider";
|
|
524
639
|
if (this.platform.platform !== "openfin" && this.platform.platform !== "openfin_web") return !1;
|
|
525
|
-
let t =
|
|
640
|
+
let t = g()?.me;
|
|
526
641
|
return !t?.identity || t.isView ? !1 : !!(t.identity.name && t.identity.name === t.identity.uuid);
|
|
527
642
|
}
|
|
528
643
|
orphanPolicy() {
|
|
@@ -537,21 +652,21 @@ var A = {
|
|
|
537
652
|
}
|
|
538
653
|
}
|
|
539
654
|
candidateUpstream() {
|
|
540
|
-
return this.platform.isWorker ?
|
|
655
|
+
return this.platform.isWorker ? z(this.receive, this.diagnostics) : this.platform.isTopLevelDocument ? this.platform.platform === "openfin" && !this.isOpenFinProvider ? this.ensureOpenFinLink() : null : F(this.receive, this.config.bus.trustedOrigins, this.diagnostics);
|
|
541
656
|
}
|
|
542
657
|
openControlLinks() {
|
|
543
658
|
let e = (e) => {
|
|
544
659
|
e && this.links.push(e);
|
|
545
660
|
};
|
|
546
|
-
this.platform.isWorker || this.ensureChildrenLink(), this.platform.isTopLevelDocument && e(
|
|
661
|
+
this.platform.isWorker || this.ensureChildrenLink(), this.platform.isTopLevelDocument && e(L(i, this.receive, this.diagnostics)), (this.platform.platform === "openfin" || this.platform.platform === "openfin_web") && e(this.ensureOpenFinLink());
|
|
547
662
|
}
|
|
548
663
|
ensureChildrenLink() {
|
|
549
664
|
if (this.links.some((e) => e.kind === "children")) return;
|
|
550
|
-
let e =
|
|
665
|
+
let e = I(this.receive, this.config.bus.trustedOrigins, this.diagnostics, (e, t) => {
|
|
551
666
|
let n = this.isRegistered(e, t);
|
|
552
667
|
if (!n) {
|
|
553
668
|
this.diagnostics.count("bus.rejected_message");
|
|
554
|
-
let n = e !== null && this.sources.has(e), r = t ===
|
|
669
|
+
let n = e !== null && this.sources.has(e), r = t === N() || this.config.bus.trustedOrigins.includes(t);
|
|
555
670
|
(n || !r) && this.diagnostics.report("bus.untrusted_origin", "The bus rejected a message from an untrusted origin.");
|
|
556
671
|
}
|
|
557
672
|
return n;
|
|
@@ -559,12 +674,12 @@ var A = {
|
|
|
559
674
|
e && this.links.push(e);
|
|
560
675
|
}
|
|
561
676
|
ensureOpenFinLink() {
|
|
562
|
-
return this.openFinLink ??=
|
|
677
|
+
return this.openFinLink ??= R(i, this.platform.openfinUuid, this.receive, this.diagnostics), this.openFinLink;
|
|
563
678
|
}
|
|
564
679
|
handshake(e) {
|
|
565
|
-
return new Promise((
|
|
566
|
-
let
|
|
567
|
-
|
|
680
|
+
return new Promise((t) => {
|
|
681
|
+
let n = !1, i = (e) => {
|
|
682
|
+
n || (n = !0, this.awaitingWelcome = null, clearTimeout(a), t(e));
|
|
568
683
|
};
|
|
569
684
|
this.awaitingWelcome = {
|
|
570
685
|
link: e.kind,
|
|
@@ -573,8 +688,8 @@ var A = {
|
|
|
573
688
|
let a = setTimeout(() => {
|
|
574
689
|
i(!1);
|
|
575
690
|
}, this.handshakeOptions.timeoutMs);
|
|
576
|
-
|
|
577
|
-
t:
|
|
691
|
+
y(a), e.post({
|
|
692
|
+
t: r.hello,
|
|
578
693
|
from: this.contextId,
|
|
579
694
|
tabId: this.tabId
|
|
580
695
|
});
|
|
@@ -582,15 +697,15 @@ var A = {
|
|
|
582
697
|
}
|
|
583
698
|
announce() {
|
|
584
699
|
this.postOver("broadcast", {
|
|
585
|
-
t:
|
|
700
|
+
t: r.tab,
|
|
586
701
|
from: this.contextId,
|
|
587
702
|
tabId: this.tabId
|
|
588
703
|
}), this.upstream && this.ownerId === null && this.upstream.post({
|
|
589
|
-
t:
|
|
704
|
+
t: r.hello,
|
|
590
705
|
from: this.contextId,
|
|
591
706
|
tabId: this.tabId
|
|
592
707
|
}), this.postJourney({
|
|
593
|
-
t:
|
|
708
|
+
t: r.journeyRequest,
|
|
594
709
|
from: this.contextId
|
|
595
710
|
}), this.pollRules(), this.passContext(!1);
|
|
596
711
|
}
|
|
@@ -615,46 +730,46 @@ var A = {
|
|
|
615
730
|
this.handlers.onJourney(null);
|
|
616
731
|
return;
|
|
617
732
|
}
|
|
618
|
-
let t =
|
|
733
|
+
let t = l(e);
|
|
619
734
|
t === null ? this.diagnostics.report("record.dropped_malformed", "The bus dropped a journey message. Its payload is not a journey.", { type: "journey" }) : this.handlers.onJourney(t);
|
|
620
735
|
}
|
|
621
736
|
rulesAnswer(e) {
|
|
622
|
-
let
|
|
737
|
+
let t = this.handlers.remote.sampling?.wire() ?? null;
|
|
623
738
|
return {
|
|
624
|
-
t:
|
|
739
|
+
t: r.sampling,
|
|
625
740
|
from: this.contextId,
|
|
626
741
|
to: e,
|
|
627
|
-
rules:
|
|
742
|
+
rules: t
|
|
628
743
|
};
|
|
629
744
|
}
|
|
630
745
|
acceptsRules(e, t) {
|
|
631
746
|
if (this.role !== "forwarder" || e !== this.contextId || t.link !== this.upstream?.kind) return !1;
|
|
632
747
|
let { origin: n } = t;
|
|
633
|
-
return t.link === "parent" && n !==
|
|
748
|
+
return t.link === "parent" && n !== N() && !this.config.bus.trustedOrigins.includes(n) ? (this.diagnostics.report("bus.untrusted_origin", `The bus ignored sampling rules from ${n}. If you own this origin, add it to bus.trustedOrigins.`, {
|
|
634
749
|
origin: n,
|
|
635
750
|
type: "sampling"
|
|
636
751
|
}), !1) : this.ownerPeer === void 0 || this.ownerPeer === t.peer;
|
|
637
752
|
}
|
|
638
753
|
applyRules(e) {
|
|
639
754
|
if (e === null) {
|
|
640
|
-
|
|
755
|
+
d(this.handlers.remote, this.config, null);
|
|
641
756
|
return;
|
|
642
757
|
}
|
|
643
|
-
let t =
|
|
644
|
-
t &&
|
|
758
|
+
let t = u(e, this.diagnostics);
|
|
759
|
+
t && d(this.handlers.remote, this.config, t);
|
|
645
760
|
}
|
|
646
761
|
pollRules() {
|
|
647
762
|
let { upstream: e } = this;
|
|
648
763
|
if (this.destroyed || this.role !== "forwarder" || !e) return;
|
|
649
|
-
let
|
|
764
|
+
let t = () => {
|
|
650
765
|
this.config.sampling.remote && e.post({
|
|
651
|
-
t:
|
|
766
|
+
t: r.samplingRequest,
|
|
652
767
|
from: this.contextId
|
|
653
768
|
});
|
|
654
769
|
};
|
|
655
|
-
|
|
770
|
+
t(), this.rulesPoll = setInterval(t, c), y(this.rulesPoll);
|
|
656
771
|
}
|
|
657
772
|
};
|
|
658
|
-
export {
|
|
773
|
+
export { U as Bus };
|
|
659
774
|
|
|
660
|
-
//# sourceMappingURL=bus-
|
|
775
|
+
//# sourceMappingURL=bus-C39wspFV.js.map
|