@utk09/ui-observability 0.10.0 → 0.11.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 +16 -1
- package/README.md +50 -11
- package/dist/{batch-BHXypM1j.cjs → batch-C8OcWR2L.cjs} +2 -2
- package/dist/{batch-BHXypM1j.cjs.map → batch-C8OcWR2L.cjs.map} +1 -1
- package/dist/{batch-BMdT9mKm.js → batch-CL9uWYY3.js} +4 -5
- package/dist/{batch-BMdT9mKm.js.map → batch-CL9uWYY3.js.map} +1 -1
- package/dist/{bus-DKfBaica.js → bus-BZ0GldpT.js} +23 -27
- package/dist/{bus-DKfBaica.js.map → bus-BZ0GldpT.js.map} +1 -1
- package/dist/{bus-Dea9rVhy.cjs → bus-VWlmM5xs.cjs} +2 -2
- package/dist/{bus-Dea9rVhy.cjs.map → bus-VWlmM5xs.cjs.map} +1 -1
- package/dist/console-BPZCuSLc.cjs +2 -0
- package/dist/{console-DZEcs7FL.cjs.map → console-BPZCuSLc.cjs.map} +1 -1
- package/dist/{console-BX_0UCV7.js → console-BeCF7n59.js} +14 -15
- package/dist/{console-BX_0UCV7.js.map → console-BeCF7n59.js.map} +1 -1
- package/dist/{constants-CL0ZdI2f.cjs → constants-DqKJH_MP.cjs} +2 -2
- package/dist/{constants-CL0ZdI2f.cjs.map → constants-DqKJH_MP.cjs.map} +1 -1
- package/dist/{constants-CU60FG4w.js → constants-zyrqveN4.js} +3 -4
- package/dist/{constants-CU60FG4w.js.map → constants-zyrqveN4.js.map} +1 -1
- package/dist/context-storage-BjzeBSxH.cjs.map +1 -1
- package/dist/{context-storage-DxZf4Gfh.js → context-storage-BzkoHzkQ.js} +2 -3
- package/dist/{context-storage-DxZf4Gfh.js.map → context-storage-BzkoHzkQ.js.map} +1 -1
- package/dist/{deadline-5_PecIl5.js → deadline-BOjOxNHj.js} +3 -5
- package/dist/{deadline-5_PecIl5.js.map → deadline-BOjOxNHj.js.map} +1 -1
- package/dist/deadline-XSnm95pg.cjs.map +1 -1
- package/dist/{debug-bundle-yRkrU1ny.cjs → debug-bundle-BzJNpbF0.cjs} +2 -2
- package/dist/{debug-bundle-yRkrU1ny.cjs.map → debug-bundle-BzJNpbF0.cjs.map} +1 -1
- package/dist/{debug-bundle-CZZ6SQQh.js → debug-bundle-C7UkHZ-q.js} +5 -6
- package/dist/{debug-bundle-CZZ6SQQh.js.map → debug-bundle-C7UkHZ-q.js.map} +1 -1
- package/dist/doctor.cjs +1 -1
- package/dist/doctor.cjs.map +1 -1
- package/dist/doctor.js +3 -4
- package/dist/{emergency-queue-CQ-9acZf.cjs → emergency-queue-CNTRui5t.cjs} +2 -2
- package/dist/{emergency-queue-CQ-9acZf.cjs.map → emergency-queue-CNTRui5t.cjs.map} +1 -1
- package/dist/{emergency-queue-Cs8-i2xw.js → emergency-queue-Zy6lNafo.js} +15 -17
- package/dist/{emergency-queue-Cs8-i2xw.js.map → emergency-queue-Zy6lNafo.js.map} +1 -1
- package/dist/{error-like-Ywo5uRHo.js → error-like-B11pB4aL.js} +2 -3
- package/dist/{error-like-Ywo5uRHo.js.map → error-like-B11pB4aL.js.map} +1 -1
- package/dist/error-like-gGRx2s36.cjs.map +1 -1
- package/dist/{errors-oyxrpHjY.js → errors-Dh7kef0i.js} +5 -6
- package/dist/{errors-oyxrpHjY.js.map → errors-Dh7kef0i.js.map} +1 -1
- package/dist/{errors-CigX45pL.cjs → errors-tfEr48bS.cjs} +2 -2
- package/dist/{errors-CigX45pL.cjs.map → errors-tfEr48bS.cjs.map} +1 -1
- package/dist/{factory-Bgsky_e0.js → factory-BonqI3NL.js} +9 -13
- package/dist/{factory-Bgsky_e0.js.map → factory-BonqI3NL.js.map} +1 -1
- package/dist/{factory-BkjNzPYL.cjs → factory-CJXVYp0R.cjs} +2 -2
- package/dist/{factory-BkjNzPYL.cjs.map → factory-CJXVYp0R.cjs.map} +1 -1
- package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
- package/dist/{fixed-window-CtaFHanJ.js → fixed-window-Dq3MLUUv.js} +2 -3
- package/dist/{fixed-window-CtaFHanJ.js.map → fixed-window-Dq3MLUUv.js.map} +1 -1
- package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
- package/dist/{global-scope-dp2jADRl.js → global-scope-D9I8s-oN.js} +2 -3
- package/dist/{global-scope-dp2jADRl.js.map → global-scope-D9I8s-oN.js.map} +1 -1
- package/dist/{guards-CpvOpJL6.js → guards-Cidk71ME.js} +2 -3
- package/dist/{guards-CpvOpJL6.js.map → guards-Cidk71ME.js.map} +1 -1
- package/dist/guards-nJ70syPt.cjs.map +1 -1
- package/dist/{identity-BMlKGHUM.cjs → identity-Cxgj6pZX.cjs} +2 -2
- package/dist/{identity-BMlKGHUM.cjs.map → identity-Cxgj6pZX.cjs.map} +1 -1
- package/dist/{identity-DOaHdfhT.js → identity-DT5VmvXy.js} +3 -4
- package/dist/{identity-DOaHdfhT.js.map → identity-DT5VmvXy.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -56
- package/dist/index.js.map +1 -1
- package/dist/{indexeddb-storage-D-lUW_5P.js → indexeddb-storage-BJVtiQKm.js} +5 -6
- package/dist/{indexeddb-storage-D-lUW_5P.js.map → indexeddb-storage-BJVtiQKm.js.map} +1 -1
- package/dist/{indexeddb-storage-CaXGJqDD.cjs → indexeddb-storage-CIoW21Xd.cjs} +2 -2
- package/dist/{indexeddb-storage-CaXGJqDD.cjs.map → indexeddb-storage-CIoW21Xd.cjs.map} +1 -1
- package/dist/{interactions-CqDNrtIR.js → interactions-DTgKy_6K.js} +10 -11
- package/dist/{interactions-CqDNrtIR.js.map → interactions-DTgKy_6K.js.map} +1 -1
- package/dist/{interactions-8DgxtmgO.cjs → interactions-fEN6FbVo.cjs} +2 -2
- package/dist/{interactions-8DgxtmgO.cjs.map → interactions-fEN6FbVo.cjs.map} +1 -1
- package/dist/{journey-DgIjhrIc.js → journey-CuJrHzEg.js} +9 -10
- package/dist/{journey-DgIjhrIc.js.map → journey-CuJrHzEg.js.map} +1 -1
- package/dist/{journey-5tcxEbnG.cjs → journey-pffMVMfa.cjs} +2 -2
- package/dist/{journey-5tcxEbnG.cjs.map → journey-pffMVMfa.cjs.map} +1 -1
- package/dist/keys-BHhw_0Wh.cjs.map +1 -1
- package/dist/{keys-D5r_GH9q.js → keys-BU9j5YqW.js} +2 -3
- package/dist/{keys-D5r_GH9q.js.map → keys-BU9j5YqW.js.map} +1 -1
- package/dist/library-console-C1m6g1BR.js +13 -0
- package/dist/{library-console-CabK2j2-.js.map → library-console-C1m6g1BR.js.map} +1 -1
- package/dist/{library-console-g_VU-wzP.cjs → library-console-D2GY9Or6.cjs} +2 -2
- package/dist/{library-console-g_VU-wzP.cjs.map → library-console-D2GY9Or6.cjs.map} +1 -1
- package/dist/{library-request-FQaiWjCP.cjs → library-request-1BX_UlaX.cjs} +2 -2
- package/dist/{library-request-FQaiWjCP.cjs.map → library-request-1BX_UlaX.cjs.map} +1 -1
- package/dist/{library-request-CyC-9IOk.js → library-request-BQBT9N9Q.js} +4 -5
- package/dist/{library-request-CyC-9IOk.js.map → library-request-BQBT9N9Q.js.map} +1 -1
- package/dist/{lifecycle-C2z_d8OX.cjs → lifecycle-2EtUaRpo.cjs} +2 -2
- package/dist/{lifecycle-C2z_d8OX.cjs.map → lifecycle-2EtUaRpo.cjs.map} +1 -1
- package/dist/{lifecycle-BLC4VU7c.js → lifecycle-BaKx_-32.js} +3 -4
- package/dist/{lifecycle-BLC4VU7c.js.map → lifecycle-BaKx_-32.js.map} +1 -1
- package/dist/{log-record-CndanC-p.js → log-record-CAoGBBf3.js} +3 -4
- package/dist/{log-record-CndanC-p.js.map → log-record-CAoGBBf3.js.map} +1 -1
- package/dist/{log-record-DKvo-B-d.cjs → log-record-i9zOTkpQ.cjs} +2 -2
- package/dist/{log-record-DKvo-B-d.cjs.map → log-record-i9zOTkpQ.cjs.map} +1 -1
- package/dist/{long-frames-CV5ZG2cx.cjs → long-frames-BVg4i5SC.cjs} +2 -2
- package/dist/{long-frames-CV5ZG2cx.cjs.map → long-frames-BVg4i5SC.cjs.map} +1 -1
- package/dist/{long-frames-BQef9rXR.js → long-frames-Czk7IupC.js} +4 -5
- package/dist/{long-frames-BQef9rXR.js.map → long-frames-Czk7IupC.js.map} +1 -1
- package/dist/{network-CvkvYzRU.js → network-DBNwApoF.js} +22 -24
- package/dist/{network-CvkvYzRU.js.map → network-DBNwApoF.js.map} +1 -1
- package/dist/{network-CqnQOqon.cjs → network-xbbuvG_6.cjs} +2 -2
- package/dist/{network-CqnQOqon.cjs.map → network-xbbuvG_6.cjs.map} +1 -1
- package/dist/openfin-Bxelt0yg.js +7 -0
- package/dist/{openfin-BwEN0uj4.js.map → openfin-Bxelt0yg.js.map} +1 -1
- package/dist/openfin-DtH2f7zX.cjs.map +1 -1
- package/dist/{otlp-RVbkNQRh.cjs → otlp-BDvFrLnc.cjs} +2 -2
- package/dist/{otlp-RVbkNQRh.cjs.map → otlp-BDvFrLnc.cjs.map} +1 -1
- package/dist/{otlp-CYIL7MOE.js → otlp-BTJdIa6F.js} +4 -6
- package/dist/{otlp-CYIL7MOE.js.map → otlp-BTJdIa6F.js.map} +1 -1
- package/dist/patch-BX8KrPCT.cjs.map +1 -1
- package/dist/{patch-CCWfuEY7.js → patch-UdPz1ea8.js} +2 -3
- package/dist/{patch-CCWfuEY7.js.map → patch-UdPz1ea8.js.map} +1 -1
- package/dist/{platform-KMWkoI-v.cjs → platform-C2Ez5kDc.cjs} +2 -2
- package/dist/{platform-KMWkoI-v.cjs.map → platform-C2Ez5kDc.cjs.map} +1 -1
- package/dist/{platform-wcAkkv9F.js → platform-DkcuXwe-.js} +4 -5
- package/dist/{platform-wcAkkv9F.js.map → platform-DkcuXwe-.js.map} +1 -1
- package/dist/{remote-rules-CH_7PphT.js → remote-rules-Cfb4K-Nl.js} +5 -6
- package/dist/{remote-rules-CH_7PphT.js.map → remote-rules-Cfb4K-Nl.js.map} +1 -1
- package/dist/{remote-rules-BL8km4xk.cjs → remote-rules-vzvk7aKf.cjs} +2 -2
- package/dist/{remote-rules-BL8km4xk.cjs.map → remote-rules-vzvk7aKf.cjs.map} +1 -1
- package/dist/{reports-Bh_-KpZ2.cjs → reports-Dk2YhKIh.cjs} +2 -2
- package/dist/{reports-Bh_-KpZ2.cjs.map → reports-Dk2YhKIh.cjs.map} +1 -1
- package/dist/{reports-BOKyY3_A.js → reports-TA-zInnq.js} +4 -5
- package/dist/{reports-BOKyY3_A.js.map → reports-TA-zInnq.js.map} +1 -1
- package/dist/{resource-timing-BROnEJ0E.js → resource-timing-BLv3EA2A.js} +6 -7
- package/dist/{resource-timing-BROnEJ0E.js.map → resource-timing-BLv3EA2A.js.map} +1 -1
- package/dist/{resource-timing-CbgwNpog.cjs → resource-timing-Cysw1S1f.cjs} +2 -2
- package/dist/{resource-timing-CbgwNpog.cjs.map → resource-timing-Cysw1S1f.cjs.map} +1 -1
- package/dist/{sampling-BLO_pcV4.js → sampling-C4VV-1MS.js} +4 -5
- package/dist/{sampling-BLO_pcV4.js.map → sampling-C4VV-1MS.js.map} +1 -1
- package/dist/{sampling-ECGVYiDD.cjs → sampling-Ckh2yW9k.cjs} +2 -2
- package/dist/{sampling-ECGVYiDD.cjs.map → sampling-Ckh2yW9k.cjs.map} +1 -1
- package/dist/{sanitize-DS0G4_ea.js → sanitize-6ymPlVvP.js} +4 -5
- package/dist/{sanitize-DS0G4_ea.js.map → sanitize-6ymPlVvP.js.map} +1 -1
- package/dist/{sanitize-Bsn8HQWC.cjs → sanitize-BAWzkZt0.cjs} +2 -2
- package/dist/{sanitize-Bsn8HQWC.cjs.map → sanitize-BAWzkZt0.cjs.map} +1 -1
- package/dist/{select-DWO0-w8_.cjs → select-ZF4by-lF.cjs} +2 -2
- package/dist/{select-DWO0-w8_.cjs.map → select-ZF4by-lF.cjs.map} +1 -1
- package/dist/{select-wqt9Wxio.js → select-xtQaenIi.js} +7 -10
- package/dist/{select-wqt9Wxio.js.map → select-xtQaenIi.js.map} +1 -1
- package/dist/{sender-BkAVt-Rq.js → sender-CiMHC9YG.js} +92 -96
- package/dist/{sender-BkAVt-Rq.js.map → sender-CiMHC9YG.js.map} +1 -1
- package/dist/{sender-D82PxlCY.cjs → sender-D5wBoXA8.cjs} +2 -2
- package/dist/{sender-D82PxlCY.cjs.map → sender-D5wBoXA8.cjs.map} +1 -1
- package/dist/storage-BA9RqRO-.cjs.map +1 -1
- package/dist/{storage-w7Tslvlq.js → storage-DZwed89z.js} +2 -3
- package/dist/{storage-w7Tslvlq.js.map → storage-DZwed89z.js.map} +1 -1
- package/dist/{storm-DCEsqViG.cjs → storm-CYi9Swpx.cjs} +2 -2
- package/dist/{storm-DCEsqViG.cjs.map → storm-CYi9Swpx.cjs.map} +1 -1
- package/dist/{storm-DD4cUkoL.js → storm-VR024_QN.js} +4 -5
- package/dist/{storm-DD4cUkoL.js.map → storm-VR024_QN.js.map} +1 -1
- package/dist/{types-BR9t_w28.js → types-BAerHgCq.js} +2 -3
- package/dist/{types-BR9t_w28.js.map → types-BAerHgCq.js.map} +1 -1
- package/dist/types-C7WNpnG1.cjs.map +1 -1
- package/dist/{unclean-exit-BYZ5yaSI.js → unclean-exit-CwcUhFOn.js} +3 -4
- package/dist/{unclean-exit-BYZ5yaSI.js.map → unclean-exit-CwcUhFOn.js.map} +1 -1
- package/dist/{unclean-exit-CwdpbUDg.cjs → unclean-exit-DFUN57wY.cjs} +2 -2
- package/dist/{unclean-exit-CwdpbUDg.cjs.map → unclean-exit-DFUN57wY.cjs.map} +1 -1
- package/dist/{user-timing-C1kB3JEg.cjs → user-timing-C9kfRq3J.cjs} +2 -2
- package/dist/{user-timing-C1kB3JEg.cjs.map → user-timing-C9kfRq3J.cjs.map} +1 -1
- package/dist/{user-timing-Di2ra5DB.js → user-timing-_jZIhDKI.js} +4 -5
- package/dist/{user-timing-Di2ra5DB.js.map → user-timing-_jZIhDKI.js.map} +1 -1
- package/dist/{web-socket-DwBNhgre.cjs → web-socket-BWUoqBh8.cjs} +2 -2
- package/dist/{web-socket-DwBNhgre.cjs.map → web-socket-BWUoqBh8.cjs.map} +1 -1
- package/dist/{web-socket-B-5qqPy7.js → web-socket-CV7yIMnm.js} +14 -15
- package/dist/{web-socket-B-5qqPy7.js.map → web-socket-CV7yIMnm.js.map} +1 -1
- package/dist/{web-vitals-Bflr5jSA.js → web-vitals-Bq4WFHQo.js} +2 -3
- package/dist/{web-vitals-Bflr5jSA.js.map → web-vitals-Bq4WFHQo.js.map} +1 -1
- package/dist/web-vitals-DFuoTQbZ.cjs.map +1 -1
- package/dist/{worker-protocol-DXekoADQ.cjs → worker-protocol-Bai7GAIA.cjs} +2 -2
- package/dist/{worker-protocol-DXekoADQ.cjs.map → worker-protocol-Bai7GAIA.cjs.map} +1 -1
- package/dist/{worker-protocol-0HMf4-kY.js → worker-protocol-CrsdSDLn.js} +6 -7
- package/dist/{worker-protocol-0HMf4-kY.js.map → worker-protocol-CrsdSDLn.js.map} +1 -1
- package/dist/worker-server-BrIYkfoa.cjs +2 -0
- package/dist/{worker-server-BQK5z2yl.cjs.map → worker-server-BrIYkfoa.cjs.map} +1 -1
- package/dist/{worker-server-CKcmX5m5.js → worker-server-Dp5HYm4b.js} +25 -26
- package/dist/{worker-server-CKcmX5m5.js.map → worker-server-Dp5HYm4b.js.map} +1 -1
- package/dist/{worker-transport-Dj2yCQN5.cjs → worker-transport-Bwej4N2e.cjs} +2 -2
- package/dist/{worker-transport-Dj2yCQN5.cjs.map → worker-transport-Bwej4N2e.cjs.map} +1 -1
- package/dist/{worker-transport-2220ghFZ.js → worker-transport-D6jtgpqN.js} +9 -11
- package/dist/{worker-transport-2220ghFZ.js.map → worker-transport-D6jtgpqN.js.map} +1 -1
- package/package.json +27 -41
- package/dist/console-DZEcs7FL.cjs +0 -2
- package/dist/library-console-CabK2j2-.js +0 -14
- package/dist/openfin-BwEN0uj4.js +0 -8
- package/dist/worker-server-BQK5z2yl.cjs +0 -2
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import { B as e, Cn as t, Ht as n, Ut as r, Y as i, ct as a, dt as o, ft as s, g as c, l, lt as u, ot as d, st as f, tt as p, ut as m } from "./constants-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
1
|
+
import { B as e, Cn as t, Ht as n, Ut as r, Y as i, ct as a, dt as o, ft as s, g as c, l, lt as u, ot as d, st as f, tt as p, ut as m } from "./constants-zyrqveN4.js";
|
|
2
|
+
import { storageLimits as h } from "./storage-DZwed89z.js";
|
|
3
|
+
import { clearEmergencyContext as g, drainEmergencyQueue as _, n as v, saveToEmergencyQueue as y, t as b } from "./emergency-queue-Zy6lNafo.js";
|
|
4
|
+
import { createStorage as ee, storageName as te } from "./factory-BonqI3NL.js";
|
|
5
|
+
import { ContextStorage as x } from "./context-storage-BzkoHzkQ.js";
|
|
6
|
+
import { n as S, r as C, t as w } from "./deadline-BOjOxNHj.js";
|
|
7
|
+
import { i as T, r as E } from "./library-request-BQBT9N9Q.js";
|
|
8
|
+
import { t as D } from "./openfin-Bxelt0yg.js";
|
|
9
|
+
import { t as O } from "./sanitize-6ymPlVvP.js";
|
|
10
|
+
import { n as k } from "./library-console-C1m6g1BR.js";
|
|
11
|
+
import { c as A, n as j, r as M, s as N, t as P } from "./select-xtQaenIi.js";
|
|
12
|
+
import { r as F } from "./platform-DkcuXwe-.js";
|
|
13
|
+
import { a as ne } from "./otlp-BTJdIa6F.js";
|
|
14
|
+
import { a as re } from "./batch-CL9uWYY3.js";
|
|
15
|
+
import { r as ie } from "./log-record-CAoGBBf3.js";
|
|
16
|
+
import { i as ae } from "./identity-DT5VmvXy.js";
|
|
17
|
+
import { t as oe } from "./sampling-C4VV-1MS.js";
|
|
18
|
+
import { n as I, t as L } from "./remote-rules-Cfb4K-Nl.js";
|
|
19
|
+
// src/storage/persistence.ts
|
|
20
20
|
async function R(e) {
|
|
21
21
|
let t = globalThis.navigator?.storage;
|
|
22
22
|
return typeof t?.persist == "function" ? await e.guardAsync("storage.unavailable", "The browser rejected the request for persistent storage.", () => t.persist()) === !0 ? "granted" : "denied" : "unsupported";
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
//#region src/transport/status-transport.ts
|
|
24
|
+
// src/transport/status-transport.ts
|
|
26
25
|
function z(e) {
|
|
27
26
|
let t = typeof e == "string" ? Date.parse(e) : NaN;
|
|
28
27
|
return Number.isNaN(t) ? void 0 : Math.round(t + 500 - Date.now());
|
|
@@ -38,13 +37,13 @@ var B = class {
|
|
|
38
37
|
this.cancellation.abort();
|
|
39
38
|
}
|
|
40
39
|
assertContext(e) {
|
|
41
|
-
if (this.cancellation.signal.aborted || this.config.securityContext.isolation && this.config.securityContext.id && e.routingContextId !== this.config.securityContext.id) throw this.diagnostics.count("security.context_mismatch"), new
|
|
40
|
+
if (this.cancellation.signal.aborted || this.config.securityContext.isolation && this.config.securityContext.id && e.routingContextId !== this.config.securityContext.id) throw this.diagnostics.count("security.context_mismatch"), new N("permanent", "The delivery context is inactive or does not match the batch.");
|
|
42
41
|
}
|
|
43
42
|
async untilCancelled(e) {
|
|
44
|
-
if (this.cancellation.signal.aborted) throw new
|
|
43
|
+
if (this.cancellation.signal.aborted) throw new N("permanent", "The delivery context retired.");
|
|
45
44
|
let t, n = new Promise((e, n) => {
|
|
46
45
|
t = () => {
|
|
47
|
-
n(new
|
|
46
|
+
n(new N("permanent", "The delivery context retired."));
|
|
48
47
|
}, this.cancellation.signal.addEventListener("abort", t, { once: !0 });
|
|
49
48
|
});
|
|
50
49
|
try {
|
|
@@ -63,13 +62,13 @@ var B = class {
|
|
|
63
62
|
this.config = e, this.diagnostics = t, this.onSampling = n, this.onLoss = r, this.onClock = i;
|
|
64
63
|
}
|
|
65
64
|
throttledForMs(e) {
|
|
66
|
-
return Math.max(0, this.throttledUntil[
|
|
65
|
+
return Math.max(0, this.throttledUntil[P(e, this.config)] - Date.now());
|
|
67
66
|
}
|
|
68
67
|
lastSendAt() {
|
|
69
68
|
return this.acceptedAt;
|
|
70
69
|
}
|
|
71
70
|
serialize(e) {
|
|
72
|
-
let t =
|
|
71
|
+
let t = M(this.config, e, this.diagnostics, "The serializer threw an error. The library dropped the batch.");
|
|
73
72
|
return t || this.onLoss("unserializable", e.records, [e.id]), t;
|
|
74
73
|
}
|
|
75
74
|
accept(e, t, n) {
|
|
@@ -83,22 +82,21 @@ var B = class {
|
|
|
83
82
|
let t = r.advice === void 0 ? "" : ` ${r.advice}`;
|
|
84
83
|
return this.diagnostics.report("transport.rejected_credentials", `The server returned ${i}.${t}`, {
|
|
85
84
|
status: e,
|
|
86
|
-
endpoint:
|
|
87
|
-
}), new
|
|
85
|
+
endpoint: j(n, this.config)
|
|
86
|
+
}), new N("permanent", `The server rejected the batch with ${i}.`, e);
|
|
88
87
|
}
|
|
89
|
-
if (e === 413) return new
|
|
88
|
+
if (e === 413) return new N("too_large", "The payload is too large.", e, void 0, r.maxBytes);
|
|
90
89
|
if (e === 429 || e === 503) {
|
|
91
90
|
let t = e === 429, i = r.retryAfterMs === void 0 ? void 0 : Math.min(r.retryAfterMs, this.config.delivery.retryMaxDelayMs);
|
|
92
|
-
return this.throttledUntil[n] = Date.now() + (i ?? this.config.delivery.retryBaseDelayMs), t && this.diagnostics.report("transport.throttled", "The server throttles the requests.", { retryAfterMs: i }), new
|
|
91
|
+
return this.throttledUntil[n] = Date.now() + (i ?? this.config.delivery.retryBaseDelayMs), t && this.diagnostics.report("transport.throttled", "The server throttles the requests.", { retryAfterMs: i }), new N("throttled", t ? "The server throttles the requests." : "The service is not available.", e, i);
|
|
93
92
|
}
|
|
94
|
-
return e === 408 || e >= 500 ? new
|
|
93
|
+
return e === 408 || e >= 500 ? new N("transient", `The server returned the error ${i}.`, e) : (this.diagnostics.report("transport.dropped_permanent", `The server rejected the batch with ${i}. The library dropped it.`, {
|
|
95
94
|
batchId: t,
|
|
96
95
|
status: e
|
|
97
|
-
}), new
|
|
96
|
+
}), new N("permanent", `The server rejected the batch with ${i}.`, e));
|
|
98
97
|
}
|
|
99
98
|
};
|
|
100
|
-
|
|
101
|
-
//#region src/transport/custom-transport.ts
|
|
99
|
+
// src/transport/custom-transport.ts
|
|
102
100
|
function V(e, t, n) {
|
|
103
101
|
return {
|
|
104
102
|
kind: n,
|
|
@@ -125,16 +123,16 @@ var W = class extends B {
|
|
|
125
123
|
if (!t || e.records.length === 0) return;
|
|
126
124
|
let n = this.serialize(e);
|
|
127
125
|
if (!n) return;
|
|
128
|
-
let r =
|
|
126
|
+
let r = P(e, this.config), i = V(e, n, r);
|
|
129
127
|
i.signal = this.cancellation.signal;
|
|
130
128
|
let a;
|
|
131
129
|
try {
|
|
132
|
-
a = await
|
|
130
|
+
a = await S(this.untilCancelled(T(() => E(() => k(() => t(i))))), this.config.delivery.requestTimeoutMs);
|
|
133
131
|
} catch (e) {
|
|
134
|
-
let t = e instanceof
|
|
135
|
-
throw new
|
|
132
|
+
let t = e instanceof w ? e : void 0, n = t ? "timeout" : "transient", r = t?.message ?? "The custom transport failed.";
|
|
133
|
+
throw new N(n, r, void 0, void 0, void 0, e);
|
|
136
134
|
}
|
|
137
|
-
if (this.assertContext(e), !H(a)) throw this.diagnostics.report("transport.http_error", "The custom transport returned no valid status. The library sends the batch again later.", { batchId: e.id }), new
|
|
135
|
+
if (this.assertContext(e), !H(a)) throw this.diagnostics.report("transport.http_error", "The custom transport returned no valid status. The library sends the batch again later.", { batchId: e.id }), new N("transient", "The custom transport returned no valid status.");
|
|
138
136
|
let { status: o } = a;
|
|
139
137
|
if (o >= 200 && o < 300) this.accept(r, a.sampling, a.date);
|
|
140
138
|
else throw this.reject(o, e.id, r, {
|
|
@@ -164,7 +162,7 @@ var W = class extends B {
|
|
|
164
162
|
install() {
|
|
165
163
|
if (this.installed || typeof addEventListener > "u") return;
|
|
166
164
|
this.installed = !0, typeof document < "u" && (document.addEventListener("visibilitychange", this.onVisibility), document.addEventListener("freeze", this.onFreeze)), addEventListener("pagehide", this.onPageHide);
|
|
167
|
-
let e =
|
|
165
|
+
let e = D()?.me;
|
|
168
166
|
this.deps.diagnostics.guard("openfin.unavailable", "The library could not subscribe to close-requested.", () => {
|
|
169
167
|
e?.on?.("close-requested", this.onOpenFinClose);
|
|
170
168
|
});
|
|
@@ -172,7 +170,7 @@ var W = class extends B {
|
|
|
172
170
|
uninstall() {
|
|
173
171
|
if (!this.installed) return;
|
|
174
172
|
this.installed = !1, typeof document < "u" && (document.removeEventListener("visibilitychange", this.onVisibility), document.removeEventListener("freeze", this.onFreeze)), removeEventListener("pagehide", this.onPageHide);
|
|
175
|
-
let e =
|
|
173
|
+
let e = D()?.me;
|
|
176
174
|
this.deps.diagnostics.guard("openfin.unavailable", "The library could not unsubscribe from close-requested.", () => {
|
|
177
175
|
e?.removeListener?.("close-requested", this.onOpenFinClose);
|
|
178
176
|
});
|
|
@@ -193,7 +191,7 @@ var W = class extends B {
|
|
|
193
191
|
if (r !== null) {
|
|
194
192
|
this.keepaliveBytes = 0;
|
|
195
193
|
for (let i of this.deps.drainForExit()) {
|
|
196
|
-
let a =
|
|
194
|
+
let a = P(i, t), o = a === "logs" ? r.href : j(a, t);
|
|
197
195
|
o ? this.flushBatch(i, e, new URL(o)) : n.count("record.dropped_no_destination");
|
|
198
196
|
}
|
|
199
197
|
}
|
|
@@ -203,7 +201,7 @@ var W = class extends B {
|
|
|
203
201
|
if (t.records.length === 0) return;
|
|
204
202
|
let s = this.serialize(t, i);
|
|
205
203
|
if (!s) return;
|
|
206
|
-
if (
|
|
204
|
+
if (O(s.body) > 6e4) {
|
|
207
205
|
this.park(t);
|
|
208
206
|
return;
|
|
209
207
|
}
|
|
@@ -236,16 +234,16 @@ var W = class extends B {
|
|
|
236
234
|
for (let i of this.deps.drainForExit()) {
|
|
237
235
|
let a = this.serialize(i, e);
|
|
238
236
|
if (!a) continue;
|
|
239
|
-
let o = V(i, a,
|
|
240
|
-
(t === void 0 || r.guard("transport.http_error", "The transportOnExit hook threw an error.", () =>
|
|
237
|
+
let o = V(i, a, P(i, n));
|
|
238
|
+
(t === void 0 || r.guard("transport.http_error", "The transportOnExit hook threw an error.", () => E(() => t(o))) !== !0) && this.park(i);
|
|
241
239
|
}
|
|
242
240
|
}
|
|
243
241
|
park(e) {
|
|
244
242
|
let { config: t, diagnostics: n, onLoss: r } = this.deps;
|
|
245
|
-
t.storage === "memory" || t.storage === "none" ? r?.("not_stored", e.records, [e.id]) :
|
|
243
|
+
t.storage === "memory" || t.storage === "none" ? r?.("not_stored", e.records, [e.id]) : y(e, n, r);
|
|
246
244
|
}
|
|
247
245
|
serialize(e, t) {
|
|
248
|
-
let n =
|
|
246
|
+
let n = M(this.deps.config, e, this.deps.diagnostics, `The ${t} exit flush could not serialize its batch.`);
|
|
249
247
|
return n || this.deps.onLoss?.("unserializable", e.records, [e.id]), n;
|
|
250
248
|
}
|
|
251
249
|
endpointUrl() {
|
|
@@ -261,7 +259,7 @@ var W = class extends B {
|
|
|
261
259
|
keepaliveFetch(e, t, n, r, i) {
|
|
262
260
|
let { config: a, diagnostics: o } = this.deps, s = () => {
|
|
263
261
|
this.park(t);
|
|
264
|
-
}, c =
|
|
262
|
+
}, c = O(n);
|
|
265
263
|
this.keepaliveBytes + c > 6e4 ? s() : (this.keepaliveBytes += c, o.guard("transport.http_error", "The keepalive fetch failed.", () => (fetch(e, {
|
|
266
264
|
method: "POST",
|
|
267
265
|
body: n,
|
|
@@ -296,12 +294,11 @@ async function q(e, t, n) {
|
|
|
296
294
|
function J(e) {
|
|
297
295
|
K.delete(e);
|
|
298
296
|
}
|
|
299
|
-
|
|
300
|
-
//#region src/transport/http-transport.ts
|
|
297
|
+
// src/transport/http-transport.ts
|
|
301
298
|
var Y = "In a cross-origin iframe, the session cookie is a third-party cookie. The browser often blocks it. Forward the records to the platform document. As an alternative, issue the cookie with the Partitioned attribute.", X = class extends B {
|
|
302
299
|
async send(e, t) {
|
|
303
300
|
this.assertContext(e);
|
|
304
|
-
let { config: n } = this, r =
|
|
301
|
+
let { config: n } = this, r = P(e, n), i = j(r, n);
|
|
305
302
|
i ? e.records.length !== 0 && await this.post(e, r, i, t) : this.diagnostics.count("record.dropped_no_destination");
|
|
306
303
|
}
|
|
307
304
|
lastHeaders() {
|
|
@@ -316,7 +313,7 @@ var Y = "In a cross-origin iframe, the session cookie is a third-party cookie. T
|
|
|
316
313
|
this.accept(t, e.get(s), e.get(m));
|
|
317
314
|
return;
|
|
318
315
|
}
|
|
319
|
-
let c = a.status, l =
|
|
316
|
+
let c = a.status, l = A(a.headers.get(o)), u = c === 413 ? await this.readMaxBytes(a) : void 0;
|
|
320
317
|
throw this.reject(c, e.id, t, {
|
|
321
318
|
retryAfterMs: l,
|
|
322
319
|
maxBytes: u,
|
|
@@ -336,18 +333,18 @@ var Y = "In a cross-origin iframe, the session cookie is a third-party cookie. T
|
|
|
336
333
|
}
|
|
337
334
|
async before(e, t, n) {
|
|
338
335
|
try {
|
|
339
|
-
return await
|
|
336
|
+
return await S(this.untilCancelled(e), Math.max(0, t - Date.now()));
|
|
340
337
|
} catch {
|
|
341
|
-
throw this.cancellation.signal.aborted ? new
|
|
338
|
+
throw this.cancellation.signal.aborted ? new N("permanent", "The delivery context retired.") : this.timeout(n);
|
|
342
339
|
}
|
|
343
340
|
}
|
|
344
341
|
timeout(e) {
|
|
345
342
|
let t = `The request took longer than ${String(this.config.delivery.requestTimeoutMs)} ms.`;
|
|
346
|
-
return this.diagnostics.report("transport.timeout", t, { endpoint: e }), new
|
|
343
|
+
return this.diagnostics.report("transport.timeout", t, { endpoint: e }), new N("timeout", t);
|
|
347
344
|
}
|
|
348
345
|
async encodeBody(e) {
|
|
349
346
|
let { config: t } = this;
|
|
350
|
-
return t.compression !== "gzip" ||
|
|
347
|
+
return t.compression !== "gzip" || O(e) < 1024 ? e : await this.diagnostics.guardAsync("transport.http_error", "The library could not compress the payload.", () => ne(e)) ?? e;
|
|
351
348
|
}
|
|
352
349
|
async dispatch(e, t, n, r, i) {
|
|
353
350
|
let { config: a } = this, o = new AbortController(), s = () => {
|
|
@@ -357,9 +354,9 @@ var Y = "In a cross-origin iframe, the session cookie is a third-party cookie. T
|
|
|
357
354
|
let c = setTimeout(() => {
|
|
358
355
|
o.abort();
|
|
359
356
|
}, Math.max(0, r - Date.now()));
|
|
360
|
-
|
|
357
|
+
C(c);
|
|
361
358
|
try {
|
|
362
|
-
return await
|
|
359
|
+
return await E(() => fetch(e, {
|
|
363
360
|
method: "POST",
|
|
364
361
|
headers: t,
|
|
365
362
|
body: n,
|
|
@@ -370,13 +367,13 @@ var Y = "In a cross-origin iframe, the session cookie is a third-party cookie. T
|
|
|
370
367
|
priority: i ? "auto" : a.delivery.priority
|
|
371
368
|
}));
|
|
372
369
|
} catch {
|
|
373
|
-
throw this.cancellation.signal.aborted ? new
|
|
370
|
+
throw this.cancellation.signal.aborted ? new N("permanent", "The delivery context retired.") : o.signal.aborted ? this.timeout(e) : new N(F() ? "transient" : "offline", "A network error occurred.");
|
|
374
371
|
} finally {
|
|
375
372
|
this.cancellation.signal.removeEventListener("abort", s), clearTimeout(c);
|
|
376
373
|
}
|
|
377
374
|
}
|
|
378
375
|
keepalive(e) {
|
|
379
|
-
let t = globalThis.document?.visibilityState === "hidden", n = typeof e == "string" ?
|
|
376
|
+
let t = globalThis.document?.visibilityState === "hidden", n = typeof e == "string" ? O(e) : e.byteLength;
|
|
380
377
|
return t && n <= 6e4;
|
|
381
378
|
}
|
|
382
379
|
async readMaxBytes(e) {
|
|
@@ -404,7 +401,7 @@ var Y = "In a cross-origin iframe, the session cookie is a third-party cookie. T
|
|
|
404
401
|
this.attempt = 0, this.schedule(0);
|
|
405
402
|
};
|
|
406
403
|
constructor(e, t, n, r, i, a = () => void 0) {
|
|
407
|
-
this.storage = e, this.transport = t, this.diagnostics = n, this.config = r, this.batchesPerDrain = i, this.onLoss = a, this.maxAttempts =
|
|
404
|
+
this.storage = e, this.transport = t, this.diagnostics = n, this.config = r, this.batchesPerDrain = i, this.onLoss = a, this.maxAttempts = h(r.retention).maxAttempts;
|
|
408
405
|
}
|
|
409
406
|
start() {
|
|
410
407
|
this.stopped = !1, typeof addEventListener < "u" && addEventListener("online", this.onOnline), this.schedule(this.config.delivery.retryIdleDelayMs);
|
|
@@ -434,10 +431,10 @@ var Y = "In a cross-origin iframe, the session cookie is a third-party cookie. T
|
|
|
434
431
|
let t = setTimeout(() => {
|
|
435
432
|
this.drain();
|
|
436
433
|
}, e);
|
|
437
|
-
this.timer = t,
|
|
434
|
+
this.timer = t, C(t);
|
|
438
435
|
}
|
|
439
436
|
bounded(e) {
|
|
440
|
-
return
|
|
437
|
+
return S(e, t);
|
|
441
438
|
}
|
|
442
439
|
clearTimer() {
|
|
443
440
|
this.timer !== null && (clearTimeout(this.timer), this.timer = null);
|
|
@@ -450,8 +447,8 @@ var Y = "In a cross-origin iframe, the session cookie is a third-party cookie. T
|
|
|
450
447
|
if (!this.draining) {
|
|
451
448
|
this.draining = !0;
|
|
452
449
|
try {
|
|
453
|
-
let e =
|
|
454
|
-
await
|
|
450
|
+
let e = b(i, this.config.persistence.namespace);
|
|
451
|
+
await v(e, this.diagnostics, () => this.drainLocked()) !== !0 && this.schedule(this.config.delivery.retryIdleDelayMs);
|
|
455
452
|
} finally {
|
|
456
453
|
this.draining = !1;
|
|
457
454
|
}
|
|
@@ -459,13 +456,13 @@ var Y = "In a cross-origin iframe, the session cookie is a third-party cookie. T
|
|
|
459
456
|
}
|
|
460
457
|
async drainLocked() {
|
|
461
458
|
try {
|
|
462
|
-
if (!
|
|
459
|
+
if (!F()) return this.schedule(this.config.delivery.retryIdleDelayMs), !0;
|
|
463
460
|
let e = await this.bounded(this.storage.take(this.batchesPerDrain ?? this.config.delivery.batchesPerDrain));
|
|
464
461
|
if (e.length === 0) return this.schedule(this.config.delivery.retryIdleDelayMs), !0;
|
|
465
462
|
let t = /* @__PURE__ */ new Set(), n = 0;
|
|
466
463
|
for (let r of e) {
|
|
467
464
|
if (this.stopped) return !0;
|
|
468
|
-
let e =
|
|
465
|
+
let e = P(r, this.config);
|
|
469
466
|
if (t.has(e)) continue;
|
|
470
467
|
let i = await this.deliver(r);
|
|
471
468
|
if (i === "stop") return !0;
|
|
@@ -485,7 +482,7 @@ var Y = "In a cross-origin iframe, the session cookie is a third-party cookie. T
|
|
|
485
482
|
return await this.transport.send(e), await this.bounded(this.storage.remove(e.id)), this.attempt = 0, "next";
|
|
486
483
|
} catch (t) {
|
|
487
484
|
if (this.stopped) return "stop";
|
|
488
|
-
let n = t instanceof
|
|
485
|
+
let n = t instanceof N ? t : void 0;
|
|
489
486
|
return n?.kind === "permanent" || n?.kind === "too_large" ? (await this.replaceStored(e, t), "next") : n?.kind === "offline" ? (this.schedule(this.config.delivery.retryIdleDelayMs), "stop") : n?.kind === "throttled" ? (this.attempt++, n.retryAfterMs ?? this.backoffMs()) : (await this.bounded(this.storage.bumpAttempts(e.id, e.attempts + 1)), this.attempt++, n?.retryAfterMs ?? this.backoffMs());
|
|
490
487
|
}
|
|
491
488
|
}
|
|
@@ -495,10 +492,10 @@ var Y = "In a cross-origin iframe, the session cookie is a third-party cookie. T
|
|
|
495
492
|
for (let e of n) await this.bounded(this.storage.save(e));
|
|
496
493
|
}
|
|
497
494
|
toStorable(e, t) {
|
|
498
|
-
let n = t instanceof
|
|
495
|
+
let n = t instanceof N ? t : void 0;
|
|
499
496
|
if (n?.kind === "permanent") return this.onLoss("rejected", e.records, [e.id]), [];
|
|
500
497
|
if (n?.kind !== "too_large") return [e];
|
|
501
|
-
let r =
|
|
498
|
+
let r = re(e, this.diagnostics);
|
|
502
499
|
return r ? (this.diagnostics.report("transport.batch_split", "The server refused the batch because it is too large.", {
|
|
503
500
|
from: e.records.length,
|
|
504
501
|
to: r[0].records.length,
|
|
@@ -544,7 +541,7 @@ var $ = class {
|
|
|
544
541
|
let e = setTimeout(() => {
|
|
545
542
|
this.timer = null, this.onFlush(this);
|
|
546
543
|
}, this.options.flushIntervalMs);
|
|
547
|
-
this.timer = e,
|
|
544
|
+
this.timer = e, C(e);
|
|
548
545
|
}
|
|
549
546
|
clearTimer() {
|
|
550
547
|
this.timer !== null && (clearTimeout(this.timer), this.timer = null);
|
|
@@ -562,7 +559,7 @@ var $ = class {
|
|
|
562
559
|
unconfirmed = /* @__PURE__ */ new Map();
|
|
563
560
|
queue = [];
|
|
564
561
|
open = /* @__PURE__ */ new Set();
|
|
565
|
-
ceiling = new
|
|
562
|
+
ceiling = new oe();
|
|
566
563
|
inFlight = 0;
|
|
567
564
|
pumpScheduled = !1;
|
|
568
565
|
stopped = !1;
|
|
@@ -585,7 +582,7 @@ var $ = class {
|
|
|
585
582
|
if (!this.policy) return !0;
|
|
586
583
|
let { maxPendingRecords: t, maxPendingBytes: n, overflow: r } = this.policy.buffering, i;
|
|
587
584
|
try {
|
|
588
|
-
i =
|
|
585
|
+
i = O(JSON.stringify(e));
|
|
589
586
|
} catch {
|
|
590
587
|
return this.onLoss("unserializable", [e]), !1;
|
|
591
588
|
}
|
|
@@ -620,7 +617,7 @@ var $ = class {
|
|
|
620
617
|
}
|
|
621
618
|
push(e) {
|
|
622
619
|
if (this.stopped) return;
|
|
623
|
-
e.observedTimeUnixNano =
|
|
620
|
+
e.observedTimeUnixNano = ie();
|
|
624
621
|
let t = { ...e };
|
|
625
622
|
this.admit(t) && this.route(t);
|
|
626
623
|
}
|
|
@@ -652,7 +649,7 @@ var $ = class {
|
|
|
652
649
|
}
|
|
653
650
|
toBatch(e) {
|
|
654
651
|
return e.length === 0 ? null : {
|
|
655
|
-
id:
|
|
652
|
+
id: ae(this.diagnostics),
|
|
656
653
|
records: e,
|
|
657
654
|
createdAt: Date.now(),
|
|
658
655
|
attempts: 0,
|
|
@@ -688,7 +685,7 @@ var $ = class {
|
|
|
688
685
|
}),
|
|
689
686
|
resolve: t
|
|
690
687
|
};
|
|
691
|
-
this.unconfirmed.set(e.id, e), this.open.add(n), this.queue.push(n),
|
|
688
|
+
this.unconfirmed.set(e.id, e), this.open.add(n), this.queue.push(n), this.pumpScheduled || (this.pumpScheduled = !0, queueMicrotask(() => {
|
|
692
689
|
this.pumpScheduled = !1, this.pump();
|
|
693
690
|
}));
|
|
694
691
|
}
|
|
@@ -745,7 +742,7 @@ var $ = class {
|
|
|
745
742
|
}
|
|
746
743
|
async store(e) {
|
|
747
744
|
await this.diagnostics.guardAsync("storage.degraded", "The library could not store an undelivered batch.", async () => {
|
|
748
|
-
await
|
|
745
|
+
await S(this.storage.save(e), t), this.retry.nudge();
|
|
749
746
|
});
|
|
750
747
|
}
|
|
751
748
|
}, ue = class e {
|
|
@@ -761,14 +758,14 @@ var $ = class {
|
|
|
761
758
|
this.storage = e, this.retry = t, this.pipeline = n, this.exitFlush = r, this.diagnostics = i, this.transport = a;
|
|
762
759
|
}
|
|
763
760
|
static async create(t) {
|
|
764
|
-
let { config: n, diagnostics: r } = t, i = t.storage ?? await
|
|
761
|
+
let { config: n, diagnostics: r } = t, i = t.storage ?? await ee(n.storage, te(n.persistence.namespace), h(n.retention), r, t.onGap, n.persistence.namespace);
|
|
765
762
|
t.onStorage?.(i), n.persistence.requestPersistent && (i.name === "indexeddb" || i.name === "localstorage") && (t.onPersistence?.("pending"), R(r).then(t.onPersistence));
|
|
766
|
-
let a = new
|
|
767
|
-
let i =
|
|
768
|
-
i &&
|
|
763
|
+
let a = new x(i, n.securityContext, n.persistence.namespace), o = (e) => {
|
|
764
|
+
let i = I(e, r);
|
|
765
|
+
i && L(t.remote, n, i);
|
|
769
766
|
}, s, c = (e) => {
|
|
770
767
|
s = e;
|
|
771
|
-
}, { onLoss: l } = t, u = !n.transport && n.transportWorker ? await r.guardAsync("transport.http_error", "The transport worker module did not load. The library uses HTTP.", async () => (await import("./worker-transport-
|
|
768
|
+
}, { onLoss: l } = t, u = !n.transport && n.transportWorker ? await r.guardAsync("transport.http_error", "The transport worker module did not load. The library uses HTTP.", async () => (await import("./worker-transport-D6jtgpqN.js")).createWorkerTransport(n, r, o, l, c)) : void 0, d = n.transport !== void 0 || u !== void 0 ? void 0 : new X(n, r, o, l, c), f = u?.transport ?? d ?? new W(n, r, o, l, c), p = new ce(a, f, r, n, void 0, l), { batching: m } = n, g = new le(f, a, p, r, {
|
|
772
769
|
logs: {
|
|
773
770
|
flushIntervalMs: m.logFlushIntervalMs,
|
|
774
771
|
batchSize: m.logBatchSize
|
|
@@ -781,22 +778,22 @@ var $ = class {
|
|
|
781
778
|
flushIntervalMs: m.logFlushIntervalMs,
|
|
782
779
|
batchSize: m.logBatchSize
|
|
783
780
|
}
|
|
784
|
-
}, () => n.securityContext.id || void 0, n, l, () => n.metadata.clockOffset ? s : void 0),
|
|
781
|
+
}, () => n.securityContext.id || void 0, n, l, () => n.metadata.clockOffset ? s : void 0), _ = new G({
|
|
785
782
|
config: n,
|
|
786
783
|
diagnostics: r,
|
|
787
|
-
drainForExit: () =>
|
|
788
|
-
flushAlive: () =>
|
|
784
|
+
drainForExit: () => g.drainForExit(),
|
|
785
|
+
flushAlive: () => g.flushPending(),
|
|
789
786
|
exitHeaders: () => u ? u.exitHeaders() : d?.lastHeaders(),
|
|
790
787
|
onLoss: l,
|
|
791
788
|
beforeExit: t.beforeExit
|
|
792
|
-
}),
|
|
789
|
+
}), v = !1;
|
|
793
790
|
try {
|
|
794
|
-
|
|
791
|
+
_.install(), p.start(), v = !0;
|
|
795
792
|
} finally {
|
|
796
|
-
|
|
793
|
+
v || (_.uninstall(), p.stop());
|
|
797
794
|
}
|
|
798
|
-
let
|
|
799
|
-
return
|
|
795
|
+
let y = new e(a, p, g, _, r, f);
|
|
796
|
+
return y.emergencyImport = y.importEmergency(), y;
|
|
800
797
|
}
|
|
801
798
|
push(e) {
|
|
802
799
|
this.pipeline.push(e);
|
|
@@ -805,7 +802,7 @@ var $ = class {
|
|
|
805
802
|
await this.pipeline.flushPending();
|
|
806
803
|
}
|
|
807
804
|
async clearPersisted(e, t) {
|
|
808
|
-
e === "namespace" ? await this.storage.clearNamespace() : await this.storage.clear(),
|
|
805
|
+
e === "namespace" ? await this.storage.clearNamespace() : await this.storage.clear(), g(t, this.diagnostics, this.storage.namespace, e === "namespace");
|
|
809
806
|
}
|
|
810
807
|
async queueDepth() {
|
|
811
808
|
return await this.diagnostics.guardAsync("storage.degraded", "The library could not count the batches in storage.", () => this.storage.count()) ?? 0;
|
|
@@ -821,7 +818,7 @@ var $ = class {
|
|
|
821
818
|
}
|
|
822
819
|
async retire(e, t, n) {
|
|
823
820
|
if (this.retired = !0, this.exitFlush.uninstall(), this.retry.stop(), e === "flush") try {
|
|
824
|
-
await
|
|
821
|
+
await S(Promise.all([this.flush(), this.retry.flush()]), t);
|
|
825
822
|
} catch (e) {
|
|
826
823
|
this.diagnostics.report("transport.timeout", "The flush of the old security context did not complete before its time limit.", void 0, e);
|
|
827
824
|
}
|
|
@@ -835,7 +832,7 @@ var $ = class {
|
|
|
835
832
|
persistenceNamespace: this.storage.namespace
|
|
836
833
|
});
|
|
837
834
|
let o = e === "discard" || e === "flush";
|
|
838
|
-
return await this.storage.retire(o), o &&
|
|
835
|
+
return await this.storage.retire(o), o && g(n, this.diagnostics, this.storage.namespace), {
|
|
839
836
|
buffered: i,
|
|
840
837
|
stored: a
|
|
841
838
|
};
|
|
@@ -850,11 +847,10 @@ var $ = class {
|
|
|
850
847
|
e.length > 0 && this.retry.nudge();
|
|
851
848
|
}
|
|
852
849
|
async importEmergency() {
|
|
853
|
-
let e = await this.diagnostics.guardAsync("storage.degraded", "The emergency import failed.", () =>
|
|
850
|
+
let e = await this.diagnostics.guardAsync("storage.degraded", "The emergency import failed.", () => _(this.storage, this.diagnostics, (e) => this.storage.accepts(e), this.storage.namespace));
|
|
854
851
|
!this.retired && e !== void 0 && e > 0 && this.retry.nudge();
|
|
855
852
|
}
|
|
856
853
|
};
|
|
857
|
-
//#endregion
|
|
858
854
|
export { ue as Sender, B as a, q as i, X as n, J as r, Y as t };
|
|
859
855
|
|
|
860
|
-
//# sourceMappingURL=sender-
|
|
856
|
+
//# sourceMappingURL=sender-CiMHC9YG.js.map
|