@utk09/ui-observability 0.7.0 → 0.9.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 +79 -1
- package/README.md +170 -41
- package/dist/bus/bus.d.ts +75 -11
- package/dist/bus/links.d.ts +6 -3
- package/dist/bus-CtJWf9QN.cjs +2 -0
- package/dist/bus-CtJWf9QN.cjs.map +1 -0
- package/dist/{bus-DfAbg_pg.js → bus-D8kH58tb.js} +176 -73
- package/dist/bus-D8kH58tb.js.map +1 -0
- package/dist/capture/console.d.ts +37 -0
- package/dist/capture/errors.d.ts +2 -4
- package/dist/capture/interactions.d.ts +7 -6
- package/dist/capture/long-frames.d.ts +31 -0
- package/dist/capture/network.d.ts +23 -9
- package/dist/capture/storm.d.ts +17 -0
- package/dist/capture/types.d.ts +5 -3
- package/dist/console-BpHfWstv.cjs +2 -0
- package/dist/console-BpHfWstv.cjs.map +1 -0
- package/dist/console-DjLbryED.js +82 -0
- package/dist/console-DjLbryED.js.map +1 -0
- package/dist/constants-Br3b89Wg.cjs +2 -0
- package/dist/constants-Br3b89Wg.cjs.map +1 -0
- package/dist/constants-DM94FjVX.js +96 -0
- package/dist/constants-DM94FjVX.js.map +1 -0
- package/dist/constants.d.ts +51 -10
- package/dist/core/breadcrumbs.d.ts +1 -1
- package/dist/core/diagnostics.d.ts +2 -2
- package/dist/core/journey.d.ts +16 -4
- package/dist/core/logger.d.ts +6 -2
- package/dist/core/pipeline.d.ts +20 -11
- package/dist/core/record.d.ts +14 -6
- package/dist/core/remote-rules.d.ts +17 -0
- package/dist/core/remote-sampling.d.ts +65 -0
- package/dist/core/runtime.d.ts +52 -18
- package/dist/core/sampling.d.ts +5 -2
- package/dist/core/sender.d.ts +18 -10
- package/dist/deadline-B5DINjD5.js +111 -0
- package/dist/deadline-B5DINjD5.js.map +1 -0
- package/dist/deadline-Cbg2cbUw.cjs +2 -0
- package/dist/deadline-Cbg2cbUw.cjs.map +1 -0
- package/dist/error-like-Ywo5uRHo.js +19 -0
- package/dist/error-like-Ywo5uRHo.js.map +1 -0
- package/dist/error-like-gGRx2s36.cjs +2 -0
- package/dist/error-like-gGRx2s36.cjs.map +1 -0
- package/dist/errors-CpGRhhIf.cjs +3 -0
- package/dist/errors-CpGRhhIf.cjs.map +1 -0
- package/dist/{errors-4MQyjZVj.js → errors-DH4QJS0u.js} +38 -20
- package/dist/errors-DH4QJS0u.js.map +1 -0
- package/dist/global-scope-BN-Io_yv.cjs +2 -0
- package/dist/global-scope-BN-Io_yv.cjs.map +1 -0
- package/dist/global-scope-dp2jADRl.js +19 -0
- package/dist/global-scope-dp2jADRl.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +13 -5
- package/dist/index.js +633 -463
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-storage-DNdf1fmL.cjs +2 -0
- package/dist/indexeddb-storage-DNdf1fmL.cjs.map +1 -0
- package/dist/{indexeddb-storage-0LtUALBg.js → indexeddb-storage-n1qkFBGA.js} +17 -17
- package/dist/indexeddb-storage-n1qkFBGA.js.map +1 -0
- package/dist/interactions-31eHGwEQ.cjs +2 -0
- package/dist/interactions-31eHGwEQ.cjs.map +1 -0
- package/dist/{interactions-BaCmoGLB.js → interactions-OU94MPXs.js} +22 -19
- package/dist/interactions-OU94MPXs.js.map +1 -0
- package/dist/journey-CE2EcwHW.cjs +2 -0
- package/dist/journey-CE2EcwHW.cjs.map +1 -0
- package/dist/journey-CeJ1QoT2.js +162 -0
- package/dist/journey-CeJ1QoT2.js.map +1 -0
- package/dist/library-request-C9uJFlbq.cjs +2 -0
- package/dist/library-request-C9uJFlbq.cjs.map +1 -0
- package/dist/library-request-DvhuplAB.js +14 -0
- package/dist/library-request-DvhuplAB.js.map +1 -0
- package/dist/long-frames-B8VdA_ny.cjs +2 -0
- package/dist/long-frames-B8VdA_ny.cjs.map +1 -0
- package/dist/long-frames-C_7OutLs.js +65 -0
- package/dist/long-frames-C_7OutLs.js.map +1 -0
- package/dist/models/batch.d.ts +1 -1
- package/dist/models/bus.d.ts +23 -4
- package/dist/models/config.d.ts +132 -11
- package/dist/models/log-record.d.ts +12 -6
- package/dist/network-BAV7ipyn.cjs +2 -0
- package/dist/network-BAV7ipyn.cjs.map +1 -0
- package/dist/network-D_lloS5t.js +174 -0
- package/dist/network-D_lloS5t.js.map +1 -0
- package/dist/patch-BX8KrPCT.cjs +2 -0
- package/dist/patch-BX8KrPCT.cjs.map +1 -0
- package/dist/patch-CCWfuEY7.js +9 -0
- package/dist/patch-CCWfuEY7.js.map +1 -0
- package/dist/{platform-ByQllE_W.cjs → platform-D4wu1eIF.cjs} +2 -2
- package/dist/platform-D4wu1eIF.cjs.map +1 -0
- package/dist/{platform-YuByH8A5.js → platform-IHBZGqUe.js} +9 -9
- package/dist/platform-IHBZGqUe.js.map +1 -0
- package/dist/remote-rules-Bt1XsdEQ.js +86 -0
- package/dist/remote-rules-Bt1XsdEQ.js.map +1 -0
- package/dist/remote-rules-kuDf5gbe.cjs +2 -0
- package/dist/remote-rules-kuDf5gbe.cjs.map +1 -0
- package/dist/sampling-BI15ds9D.cjs +2 -0
- package/dist/sampling-BI15ds9D.cjs.map +1 -0
- package/dist/sampling-o0VY1mqQ.js +63 -0
- package/dist/sampling-o0VY1mqQ.js.map +1 -0
- package/dist/sanitize-B9UheVKc.js +123 -0
- package/dist/sanitize-B9UheVKc.js.map +1 -0
- package/dist/sanitize-DSIP7amZ.cjs +2 -0
- package/dist/sanitize-DSIP7amZ.cjs.map +1 -0
- package/dist/{sender-BIob8eZz.js → sender-BnNj9bOX.js} +415 -272
- package/dist/sender-BnNj9bOX.js.map +1 -0
- package/dist/sender-D0OsyB1c.cjs +3 -0
- package/dist/sender-D0OsyB1c.cjs.map +1 -0
- package/dist/storage/emergency-queue.d.ts +1 -1
- package/dist/storage/factory.d.ts +1 -1
- package/dist/storage/idb-driver.d.ts +1 -1
- package/dist/storage/local-storage.d.ts +3 -3
- package/dist/storage/memory-storage.d.ts +3 -3
- package/dist/storm-BTw0J6eE.js +10 -0
- package/dist/storm-BTw0J6eE.js.map +1 -0
- package/dist/storm-Y-yuBhvv.cjs +2 -0
- package/dist/storm-Y-yuBhvv.cjs.map +1 -0
- package/dist/transport/compression.d.ts +1 -1
- package/dist/transport/custom-transport.d.ts +20 -0
- package/dist/transport/errors.d.ts +2 -1
- package/dist/transport/exit-flush.d.ts +32 -13
- package/dist/transport/http-transport.d.ts +57 -25
- package/dist/transport/memory-transport.d.ts +30 -0
- package/dist/transport/retry-engine.d.ts +7 -7
- package/dist/transport/serializers/select.d.ts +12 -1
- package/dist/transport/status-transport.d.ts +74 -0
- package/dist/utils/console.d.ts +1 -1
- package/dist/utils/deadline.d.ts +7 -0
- package/dist/utils/error-like.d.ts +25 -0
- package/dist/utils/global-scope.d.ts +20 -0
- package/dist/utils/identity.d.ts +1 -1
- package/dist/utils/library-console.d.ts +11 -0
- package/dist/utils/library-request.d.ts +12 -0
- package/dist/utils/patch.d.ts +9 -0
- package/dist/utils/platform.d.ts +3 -3
- package/dist/utils/sequence.d.ts +0 -5
- package/dist/utils/timer.d.ts +1 -1
- package/dist/utils/tracing.d.ts +3 -3
- package/dist/utils/unref.d.ts +2 -2
- package/dist/{web-vitals-DHZ0yA_H.js → web-vitals-Bflr5jSA.js} +4 -2
- package/dist/web-vitals-Bflr5jSA.js.map +1 -0
- package/dist/web-vitals-DFuoTQbZ.cjs +2 -0
- package/dist/web-vitals-DFuoTQbZ.cjs.map +1 -0
- package/package.json +2 -2
- package/dist/bus-DeZzr2bx.cjs +0 -2
- package/dist/bus-DeZzr2bx.cjs.map +0 -1
- package/dist/bus-DfAbg_pg.js.map +0 -1
- package/dist/constants-C8nZQBmQ.js +0 -86
- package/dist/constants-C8nZQBmQ.js.map +0 -1
- package/dist/constants-IBL_jd5R.cjs +0 -2
- package/dist/constants-IBL_jd5R.cjs.map +0 -1
- package/dist/errors-4MQyjZVj.js.map +0 -1
- package/dist/errors-CUdShXe7.cjs +0 -3
- package/dist/errors-CUdShXe7.cjs.map +0 -1
- package/dist/indexeddb-storage-0LtUALBg.js.map +0 -1
- package/dist/indexeddb-storage-CcEJlq2l.cjs +0 -2
- package/dist/indexeddb-storage-CcEJlq2l.cjs.map +0 -1
- package/dist/interactions-BMNPQ3WH.cjs +0 -2
- package/dist/interactions-BMNPQ3WH.cjs.map +0 -1
- package/dist/interactions-BaCmoGLB.js.map +0 -1
- package/dist/network-DBNvxCE3.cjs +0 -2
- package/dist/network-DBNvxCE3.cjs.map +0 -1
- package/dist/network-jQ2t8rU4.js +0 -111
- package/dist/network-jQ2t8rU4.js.map +0 -1
- package/dist/platform-ByQllE_W.cjs.map +0 -1
- package/dist/platform-YuByH8A5.js.map +0 -1
- package/dist/sampling-CbYySsZ1.js +0 -251
- package/dist/sampling-CbYySsZ1.js.map +0 -1
- package/dist/sampling-Cs50xsZl.cjs +0 -2
- package/dist/sampling-Cs50xsZl.cjs.map +0 -1
- package/dist/sender-BIob8eZz.js.map +0 -1
- package/dist/sender-iOjzcueM.cjs +0 -3
- package/dist/sender-iOjzcueM.cjs.map +0 -1
- package/dist/unref-16maCyKA.js +0 -8
- package/dist/unref-16maCyKA.js.map +0 -1
- package/dist/unref-CU9Nyz_9.cjs +0 -2
- package/dist/unref-CU9Nyz_9.cjs.map +0 -1
- package/dist/web-vitals-B2FYsEAU.cjs +0 -2
- package/dist/web-vitals-B2FYsEAU.cjs.map +0 -1
- package/dist/web-vitals-DHZ0yA_H.js.map +0 -1
|
@@ -1,44 +1,72 @@
|
|
|
1
|
-
import type { Diagnostics } from "../core/diagnostics";
|
|
2
1
|
import type { LogBatch } from "../models/batch";
|
|
3
|
-
import
|
|
2
|
+
import { StatusTransport } from "./status-transport";
|
|
4
3
|
/**
|
|
5
4
|
* This class sends serialized log batches over HTTP. It resolves headers, applies gzip
|
|
6
5
|
* compression and classifies errors.
|
|
7
6
|
*/
|
|
8
|
-
export declare class HttpTransport {
|
|
9
|
-
private readonly config;
|
|
10
|
-
private readonly diagnostics;
|
|
11
|
-
/** This field holds the epoch time in milliseconds when the server throttle ends. */
|
|
12
|
-
private throttledUntil;
|
|
7
|
+
export declare class HttpTransport extends StatusTransport {
|
|
13
8
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
9
|
+
* Headers that the headers() function gave last. The exit flush sends them only while that
|
|
10
|
+
* function and the endpoint are in force. A tenant switch must not send the old token to the
|
|
11
|
+
* new endpoint.
|
|
16
12
|
*/
|
|
17
|
-
|
|
13
|
+
private cachedHeaders;
|
|
18
14
|
/**
|
|
19
15
|
* Sends one log batch over HTTP.
|
|
20
16
|
* @param batch Batch to send.
|
|
17
|
+
* @param onKeepalive Runs when a request of the batch starts with keepalive.
|
|
21
18
|
* @throws TransportError on transient, throttled, 413, or permanent network failures.
|
|
22
19
|
*/
|
|
23
|
-
send(batch: LogBatch): Promise<void>;
|
|
20
|
+
send(batch: LogBatch, onKeepalive?: () => void): Promise<void>;
|
|
24
21
|
/**
|
|
25
|
-
*
|
|
26
|
-
* @returns
|
|
22
|
+
* Gives the headers for the exit flush. A closing document cannot await headers().
|
|
23
|
+
* @returns The static headers, the headers that the function in force gave last, or undefined.
|
|
27
24
|
*/
|
|
28
|
-
|
|
25
|
+
lastHeaders(): Record<string, string> | undefined;
|
|
29
26
|
/**
|
|
30
27
|
* Serializes, encodes and sends a batch. It throws a classified TransportError
|
|
31
28
|
* on failure.
|
|
32
29
|
* @param batch Batch to deliver.
|
|
33
30
|
* @param endpoint Ingest URL. The caller reads it one time. A reconfigure during the send
|
|
34
31
|
* cannot change it.
|
|
32
|
+
* @param onKeepalive Runs when a request of the batch starts with keepalive.
|
|
35
33
|
*/
|
|
36
34
|
private post;
|
|
37
35
|
/**
|
|
38
|
-
*
|
|
36
|
+
* Tests if a status rejects the credentials.
|
|
37
|
+
* @param status HTTP status code.
|
|
38
|
+
* @returns True for 401 and 403.
|
|
39
|
+
*/
|
|
40
|
+
private rejectsCredentials;
|
|
41
|
+
/**
|
|
42
|
+
* Resolves the headers, encodes the body and sends one request. One deadline covers the
|
|
43
|
+
* three steps. Without it, a headers() that never settles holds a dispatch slot forever.
|
|
44
|
+
* @param batch Batch to deliver.
|
|
45
|
+
* @param endpoint Ingest URL.
|
|
46
|
+
* @param serialized Serialized batch.
|
|
47
|
+
* @param onKeepalive Runs when the request starts with keepalive.
|
|
48
|
+
* @returns Promise that resolves to the HTTP Response.
|
|
49
|
+
* @throws TransportError on timeout or network failure.
|
|
50
|
+
*/
|
|
51
|
+
private attempt;
|
|
52
|
+
/**
|
|
53
|
+
* Waits for a step until the deadline.
|
|
54
|
+
* @param work Step to wait for. It does not reject. Only the deadline rejects here.
|
|
55
|
+
* @param deadline Epoch time in milliseconds at which the request times out.
|
|
56
|
+
* @returns Promise that resolves to the value of the step.
|
|
57
|
+
* @throws TransportError of kind "timeout" at the deadline.
|
|
58
|
+
*/
|
|
59
|
+
private before;
|
|
60
|
+
/**
|
|
61
|
+
* Reports a timeout and builds its error.
|
|
62
|
+
* @returns TransportError of kind "timeout".
|
|
63
|
+
*/
|
|
64
|
+
private timeout;
|
|
65
|
+
/**
|
|
66
|
+
* Compresses the serialized payload when the config sets gzip. The payload size must
|
|
39
67
|
* be at or above the threshold.
|
|
40
68
|
* @param text Serialized payload string.
|
|
41
|
-
* @returns Promise
|
|
69
|
+
* @returns Promise that resolves to original string or compressed byte array.
|
|
42
70
|
*/
|
|
43
71
|
private encodeBody;
|
|
44
72
|
/**
|
|
@@ -47,26 +75,30 @@ export declare class HttpTransport {
|
|
|
47
75
|
* @param endpoint Ingest URL.
|
|
48
76
|
* @param headers HTTP request headers.
|
|
49
77
|
* @param body Request body string or byte array.
|
|
50
|
-
* @
|
|
78
|
+
* @param deadline Epoch time in milliseconds at which the request times out.
|
|
79
|
+
* @param keepalive True if the request continues after unload.
|
|
80
|
+
* @returns Promise that resolves to the HTTP Response.
|
|
51
81
|
* @throws TransportError on network failure, timeout, or offline status.
|
|
52
82
|
*/
|
|
53
83
|
private dispatch;
|
|
54
84
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* @param
|
|
58
|
-
* @returns
|
|
85
|
+
* Tests if a send uses keepalive. A mobile OS can stop a hidden page with no pagehide.
|
|
86
|
+
* A keepalive request continues after that. The browser limits the keepalive bodies in flight.
|
|
87
|
+
* @param body Request body string or byte array.
|
|
88
|
+
* @returns True for a hidden document and a body of BEACON_LIMIT_BYTES or less.
|
|
59
89
|
*/
|
|
60
|
-
private
|
|
90
|
+
private keepalive;
|
|
61
91
|
/**
|
|
62
92
|
* Reads the optional maxBytes limit from a 413 response body.
|
|
63
93
|
* @param response HTTP 413 Response instance.
|
|
64
|
-
* @returns Promise
|
|
94
|
+
* @returns Promise that resolves to maximum byte limit or undefined.
|
|
65
95
|
*/
|
|
66
96
|
private readMaxBytes;
|
|
67
97
|
/**
|
|
68
|
-
* Resolves the configured static or dynamic request headers.
|
|
69
|
-
*
|
|
98
|
+
* Resolves the configured static or dynamic request headers. It keeps the headers that
|
|
99
|
+
* headers() gave, for the exit flush.
|
|
100
|
+
* @param endpoint Ingest URL of the send.
|
|
101
|
+
* @returns Promise that resolves to resolved header map.
|
|
70
102
|
*/
|
|
71
103
|
private resolveHeaders;
|
|
72
104
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Transport, TransportRequest } from "../models/config";
|
|
2
|
+
import type { LogRecord } from "../models/log-record";
|
|
3
|
+
/** A transport that keeps each batch in memory, for tests. */
|
|
4
|
+
export interface MemoryTransport {
|
|
5
|
+
/** Pass this function as `transport` to `configure()`. */
|
|
6
|
+
transport: Transport;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the records of each accepted batch, in send order.
|
|
9
|
+
* @returns The accepted records.
|
|
10
|
+
*/
|
|
11
|
+
records(): LogRecord[];
|
|
12
|
+
/**
|
|
13
|
+
* Returns each request, accepted or refused, in send order.
|
|
14
|
+
* @returns The requests.
|
|
15
|
+
*/
|
|
16
|
+
batches(): TransportRequest[];
|
|
17
|
+
/** Forgets each batch. The answer that respondWith set stays. */
|
|
18
|
+
clear(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Sets the answer for each later batch. The default answer is 200.
|
|
21
|
+
* @param status Status code to answer with, for example 413, 429 or 500.
|
|
22
|
+
* @param retryAfterMs Delay to answer with, for 429 and 503.
|
|
23
|
+
*/
|
|
24
|
+
respondWith(status: number, retryAfterMs?: number): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates a transport that keeps each batch in memory. Use it in tests, with `configure()`.
|
|
28
|
+
* @returns The memory transport.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createMemoryTransport(): MemoryTransport;
|
|
@@ -2,7 +2,7 @@ import type { Diagnostics } from "../core/diagnostics";
|
|
|
2
2
|
import { type LogBatch } from "../models/batch";
|
|
3
3
|
import type { ResolvedConfig } from "../models/config";
|
|
4
4
|
import type { StorageAdapter } from "../models/storage";
|
|
5
|
-
import type {
|
|
5
|
+
import type { BatchTransport } from "./status-transport";
|
|
6
6
|
/**
|
|
7
7
|
* This class sends persisted offline batches again on a timer. It uses backoff, a cross-tab
|
|
8
8
|
* drain lock and batch splitting.
|
|
@@ -13,13 +13,13 @@ export declare class RetryEngine {
|
|
|
13
13
|
private readonly diagnostics;
|
|
14
14
|
private readonly config;
|
|
15
15
|
private readonly batchesPerDrain;
|
|
16
|
-
/** This field holds the active retry timer handle. It is null when no timer
|
|
16
|
+
/** This field holds the active retry timer handle. It is null when no timer runs. */
|
|
17
17
|
private timer;
|
|
18
18
|
/** This field counts consecutive failed deliveries. The backoff calculation uses it. */
|
|
19
19
|
private attempt;
|
|
20
20
|
/** This flag is true while a storage drain runs. */
|
|
21
21
|
private draining;
|
|
22
|
-
/** This flag is true
|
|
22
|
+
/** This flag is true after stop(). */
|
|
23
23
|
private stopped;
|
|
24
24
|
/** This listener runs on the online event. It resets the attempt count and starts a drain. */
|
|
25
25
|
private readonly onOnline;
|
|
@@ -30,7 +30,7 @@ export declare class RetryEngine {
|
|
|
30
30
|
* @param config Active configuration instance.
|
|
31
31
|
* @param batchesPerDrain Maximum batches processed per drain tick.
|
|
32
32
|
*/
|
|
33
|
-
constructor(storage: StorageAdapter, transport:
|
|
33
|
+
constructor(storage: StorageAdapter, transport: BatchTransport, diagnostics: Diagnostics, config: ResolvedConfig, batchesPerDrain?: number);
|
|
34
34
|
/** This method starts the engine. It listens for online events and arms the first timer. */
|
|
35
35
|
start(): void;
|
|
36
36
|
/** This method schedules an earlier retry when storage receives a new offline batch. */
|
|
@@ -71,12 +71,12 @@ export declare class RetryEngine {
|
|
|
71
71
|
/**
|
|
72
72
|
* Processes batches while it holds the Web Lock. It schedules the next tick.
|
|
73
73
|
* It always resolves. A throw leaves the engine idle with no armed timer.
|
|
74
|
-
* @returns Promise
|
|
74
|
+
* @returns Promise that resolves to true on completion.
|
|
75
75
|
*/
|
|
76
76
|
private drainLocked;
|
|
77
77
|
/**
|
|
78
|
-
* Tries to deliver one batch. It removes the batch on success.
|
|
79
|
-
*
|
|
78
|
+
* Tries to deliver one batch. It removes the batch on success. On failure, it applies the
|
|
79
|
+
* rule for the failure kind.
|
|
80
80
|
* @param batch Log batch to deliver.
|
|
81
81
|
* @returns True to continue with the next batch. False to stop the current drain.
|
|
82
82
|
*/
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
import type { Diagnostics } from "../../core/diagnostics";
|
|
2
|
+
import type { LogBatch } from "../../models/batch";
|
|
1
3
|
import type { SerializerChoice } from "../../models/config";
|
|
2
|
-
import type { LogSerializer } from "../../models/serializer";
|
|
4
|
+
import type { LogSerializer, SerializedBatch } from "../../models/serializer";
|
|
3
5
|
/**
|
|
4
6
|
* Returns the implementation for a resolved serializer option.
|
|
5
7
|
* @param choice Serializer name, or a custom implementation.
|
|
6
8
|
* @returns Serializer implementation.
|
|
7
9
|
*/
|
|
8
10
|
export declare function serializerFor(choice: SerializerChoice): LogSerializer;
|
|
11
|
+
/**
|
|
12
|
+
* Serializes a batch. It reports a serializer that throws, and the caller drops the batch.
|
|
13
|
+
* @param choice Serializer name, or a custom implementation.
|
|
14
|
+
* @param batch Batch to serialize.
|
|
15
|
+
* @param diagnostics Diagnostics reporter.
|
|
16
|
+
* @param message ASD-STE100 sentence for the report.
|
|
17
|
+
* @returns The serialized batch, or undefined if the serializer threw.
|
|
18
|
+
*/
|
|
19
|
+
export declare function serializeBatch(choice: SerializerChoice, batch: LogBatch, diagnostics: Diagnostics, message: string): SerializedBatch | undefined;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Diagnostics } from "../core/diagnostics";
|
|
2
|
+
import type { LogBatch } from "../models/batch";
|
|
3
|
+
import type { ResolvedConfig } from "../models/config";
|
|
4
|
+
import type { SerializedBatch } from "../models/serializer";
|
|
5
|
+
import { TransportError } from "./errors";
|
|
6
|
+
/** The two operations that the pipeline and the retry engine use. */
|
|
7
|
+
export interface BatchTransport {
|
|
8
|
+
/**
|
|
9
|
+
* Sends one batch.
|
|
10
|
+
* @param batch Batch to send.
|
|
11
|
+
* @param onKeepalive Runs when a request of the batch starts with keepalive.
|
|
12
|
+
* @throws TransportError when the batch is not accepted.
|
|
13
|
+
*/
|
|
14
|
+
send(batch: LogBatch, onKeepalive?: () => void): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the remaining throttle delay.
|
|
17
|
+
* @returns Milliseconds until the throttle ends, or 0.
|
|
18
|
+
*/
|
|
19
|
+
throttledForMs(): number;
|
|
20
|
+
}
|
|
21
|
+
/** Hints that come with a rejected batch. */
|
|
22
|
+
export interface RejectHints {
|
|
23
|
+
/** Delay that the server asks for, in milliseconds. */
|
|
24
|
+
retryAfterMs?: number;
|
|
25
|
+
/** Largest payload that the server accepts, from a 413 answer. */
|
|
26
|
+
maxBytes?: number;
|
|
27
|
+
/** Extra advice for a 401 or a 403 answer. */
|
|
28
|
+
advice?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Base class of the HTTP transport and the custom transport. */
|
|
31
|
+
export declare abstract class StatusTransport implements BatchTransport {
|
|
32
|
+
protected readonly config: ResolvedConfig;
|
|
33
|
+
protected readonly diagnostics: Diagnostics;
|
|
34
|
+
private readonly onSampling;
|
|
35
|
+
/** Epoch time in milliseconds when the server throttle ends. */
|
|
36
|
+
private throttledUntil;
|
|
37
|
+
/**
|
|
38
|
+
* @param config Active configuration instance.
|
|
39
|
+
* @param diagnostics Diagnostics reporter.
|
|
40
|
+
* @param onSampling Receives the sampling rules of an accepted batch, before validation.
|
|
41
|
+
*/
|
|
42
|
+
constructor(config: ResolvedConfig, diagnostics: Diagnostics, onSampling?: (raw: unknown) => void);
|
|
43
|
+
/**
|
|
44
|
+
* Sends one batch.
|
|
45
|
+
* @param batch Batch to send.
|
|
46
|
+
* @param onKeepalive Runs when a request of the batch starts with keepalive.
|
|
47
|
+
* @throws TransportError when the batch is not accepted.
|
|
48
|
+
*/
|
|
49
|
+
abstract send(batch: LogBatch, onKeepalive?: () => void): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the remaining throttle delay in milliseconds.
|
|
52
|
+
* @returns Milliseconds remaining in throttle window, or 0 if unthrottled.
|
|
53
|
+
*/
|
|
54
|
+
throttledForMs(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Serializes a batch with the configured serializer. It reports a serializer that throws.
|
|
57
|
+
* @param batch Batch to serialize.
|
|
58
|
+
* @returns The serialized batch, or undefined if the serializer threw.
|
|
59
|
+
*/
|
|
60
|
+
protected serialize(batch: LogBatch): SerializedBatch | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Records an accepted batch. It ends a server throttle.
|
|
63
|
+
* @param sampling Sampling rules of the answer, as text or as an object.
|
|
64
|
+
*/
|
|
65
|
+
protected accept(sampling: unknown): void;
|
|
66
|
+
/**
|
|
67
|
+
* Converts a status code that is not 2xx into a classified TransportError.
|
|
68
|
+
* @param status Status code of the answer.
|
|
69
|
+
* @param batchId Identifier of the rejected batch.
|
|
70
|
+
* @param hints Delay, size limit and advice that come with the answer.
|
|
71
|
+
* @returns Classified TransportError instance.
|
|
72
|
+
*/
|
|
73
|
+
protected reject(status: number, batchId: string, hints: RejectHints): TransportError;
|
|
74
|
+
}
|
package/dist/utils/console.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare class ConsoleSink {
|
|
|
16
16
|
*/
|
|
17
17
|
update(settings: ResolvedConsole): void;
|
|
18
18
|
/**
|
|
19
|
-
* Tests
|
|
19
|
+
* Tests if a level clears the console threshold.
|
|
20
20
|
* @param level Severity level of the record.
|
|
21
21
|
* @returns True if the sink prints this level.
|
|
22
22
|
*/
|
package/dist/utils/deadline.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/** Error of a promise that did not settle before its deadline. */
|
|
2
|
+
export declare class DeadlineError extends Error {
|
|
3
|
+
/**
|
|
4
|
+
* @param ms Deadline in milliseconds.
|
|
5
|
+
*/
|
|
6
|
+
constructor(ms: number);
|
|
7
|
+
}
|
|
1
8
|
/**
|
|
2
9
|
* Rejects when a promise does not settle within a deadline.
|
|
3
10
|
* @param work Promise to bound.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Standard fields of an error. The library writes the other own fields as error data. */
|
|
2
|
+
export declare const ERROR_OWN_KEYS: ReadonlySet<string>;
|
|
3
|
+
/**
|
|
4
|
+
* Tests if a value is a field that error data keeps. An object field, for example the
|
|
5
|
+
* config of an AxiosError, holds credentials and request bodies.
|
|
6
|
+
* @param value Field value.
|
|
7
|
+
* @returns True for a string, a number or a boolean.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isDataField(value: unknown): boolean;
|
|
10
|
+
/** The fields of an error that the library reads. */
|
|
11
|
+
export interface ErrorLike {
|
|
12
|
+
/** Error class name, for example "TypeError". */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Error message. */
|
|
15
|
+
message: string;
|
|
16
|
+
/** Stack trace text. */
|
|
17
|
+
stack?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Tests if a value has the shape of an error.
|
|
21
|
+
* A getter on a hostile value can throw. Call this function inside a diagnostics guard.
|
|
22
|
+
* @param value Value to test.
|
|
23
|
+
* @returns True for an object with a string name, a string message and a string or no stack.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isErrorLike(value: unknown): value is ErrorLike;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Scope that a function runs inside. */
|
|
2
|
+
export interface GlobalScope {
|
|
3
|
+
/**
|
|
4
|
+
* Runs a function inside the scope. The scope covers only the synchronous part of the function.
|
|
5
|
+
* @param fn Function to run.
|
|
6
|
+
* @returns The return value of the function.
|
|
7
|
+
*/
|
|
8
|
+
run<T>(fn: () => T): T;
|
|
9
|
+
/**
|
|
10
|
+
* Tests if a scope is open.
|
|
11
|
+
* @returns True while a function runs inside the scope.
|
|
12
|
+
*/
|
|
13
|
+
open(): boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Makes a scope whose count is on a global symbol.
|
|
17
|
+
* @param key Key of the global symbol.
|
|
18
|
+
* @returns The scope.
|
|
19
|
+
*/
|
|
20
|
+
export declare function globalScope(key: string): GlobalScope;
|
package/dist/utils/identity.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare const BROWSER_STORES: IdentityStores;
|
|
|
44
44
|
export declare function memoryStores(): IdentityStores;
|
|
45
45
|
/**
|
|
46
46
|
* Generates a random lowercase hexadecimal string of the specified byte length.
|
|
47
|
-
* It uses crypto.getRandomValues when it is available.
|
|
47
|
+
* It uses crypto.getRandomValues when it is available. If not, it uses Math.random.
|
|
48
48
|
* @param byteLength Number of random bytes to generate.
|
|
49
49
|
* @returns Hexadecimal string of length byteLength * 2.
|
|
50
50
|
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a function inside the library console scope.
|
|
3
|
+
* @param fn Function that writes to the console.
|
|
4
|
+
* @returns The return value of the function.
|
|
5
|
+
*/
|
|
6
|
+
export declare function runAsLibraryConsole<T>(fn: () => T): T;
|
|
7
|
+
/**
|
|
8
|
+
* Tests if a library console scope is open.
|
|
9
|
+
* @returns True while the library writes to the console.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isLibraryConsole(): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a function inside the library request scope. The scope covers only the synchronous part
|
|
3
|
+
* of the function. A request that starts after an await is outside the scope.
|
|
4
|
+
* @param fn Function that starts the request.
|
|
5
|
+
* @returns The return value of the function.
|
|
6
|
+
*/
|
|
7
|
+
export declare function runAsLibraryRequest<T>(fn: () => T): T;
|
|
8
|
+
/**
|
|
9
|
+
* Tests if a library request scope is open.
|
|
10
|
+
* @returns True while the library starts a request.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isLibraryRequest(): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replaces `target[key]` with a wrapper of the current value.
|
|
3
|
+
* @param target Object that holds the function, for example `console` or `globalThis`.
|
|
4
|
+
* @param key Property to replace.
|
|
5
|
+
* @param wrap Makes the wrapper from the original value.
|
|
6
|
+
* @returns Restore function. It writes the original back only if the property still holds
|
|
7
|
+
* the wrapper. It then returns true. If not, it changes nothing. It returns false.
|
|
8
|
+
*/
|
|
9
|
+
export declare function patch<T extends object, K extends keyof T>(target: T, key: K, wrap: (original: T[K]) => T[K]): () => boolean;
|
package/dist/utils/platform.d.ts
CHANGED
|
@@ -11,9 +11,9 @@ export interface PlatformMetadata {
|
|
|
11
11
|
openfinName?: string;
|
|
12
12
|
/** Raw navigator user agent string or empty string if unavailable. */
|
|
13
13
|
userAgent: string;
|
|
14
|
-
/**
|
|
14
|
+
/** True if the code runs in a worker realm. */
|
|
15
15
|
isWorker: boolean;
|
|
16
|
-
/**
|
|
16
|
+
/** True if this context is the top-level document rather than an iframe. */
|
|
17
17
|
isTopLevelDocument: boolean;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
@@ -23,7 +23,7 @@ export interface PlatformMetadata {
|
|
|
23
23
|
*/
|
|
24
24
|
export declare function detectPlatform(diagnostics: Diagnostics): PlatformMetadata;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Tests if the current window is the top-level browsing context.
|
|
27
27
|
* @param diagnostics Diagnostics reporter. It counts a blocked read of window.top.
|
|
28
28
|
* @returns True if top-level, false if framed or inaccessible due to cross-origin boundaries.
|
|
29
29
|
*/
|
package/dist/utils/sequence.d.ts
CHANGED
|
@@ -7,9 +7,4 @@ export declare class Sequence {
|
|
|
7
7
|
* @returns Next sequence number.
|
|
8
8
|
*/
|
|
9
9
|
next(): number;
|
|
10
|
-
/**
|
|
11
|
-
* Resets the sequence counter to zero when the runtime gets a new configuration.
|
|
12
|
-
* A continued count shows a false link to the previous run.
|
|
13
|
-
*/
|
|
14
|
-
reset(): void;
|
|
15
10
|
}
|
package/dist/utils/timer.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ export declare function timeSync<T>(logger: CaptureLogger, label: string, fn: ()
|
|
|
14
14
|
* @param label Metric name prefix.
|
|
15
15
|
* @param fn Asynchronous function to execute.
|
|
16
16
|
* @param attributes Optional contextual attributes.
|
|
17
|
-
* @returns Promise
|
|
17
|
+
* @returns Promise that resolves to the result of the wrapped function.
|
|
18
18
|
*/
|
|
19
19
|
export declare function timeAsync<T>(logger: CaptureLogger, label: string, fn: () => Promise<T>, attributes?: Record<string, unknown>): Promise<T>;
|
package/dist/utils/tracing.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface TraceContext {
|
|
|
9
9
|
/** Bitfield byte containing W3C trace flags. */
|
|
10
10
|
traceFlags: number;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/** Cause of a rotation of the ambient trace context. */
|
|
13
13
|
export type RotateReason = "start" | "interaction" | "navigation" | "explicit" | "maxAge";
|
|
14
14
|
/**
|
|
15
15
|
* Generates a random 32-character hex string in the W3C trace ID format.
|
|
@@ -45,7 +45,7 @@ export declare class TraceEngine {
|
|
|
45
45
|
/**
|
|
46
46
|
* Loads the OpenTelemetry API. Until the load completes, records use the ambient trace.
|
|
47
47
|
* If there is no loader or the load fails, all records use the ambient trace.
|
|
48
|
-
* @returns Promise
|
|
48
|
+
* @returns Promise that resolves when the attempt settles.
|
|
49
49
|
*/
|
|
50
50
|
loadOtel(): Promise<void>;
|
|
51
51
|
/**
|
|
@@ -54,7 +54,7 @@ export declare class TraceEngine {
|
|
|
54
54
|
*/
|
|
55
55
|
resolve(): TraceContext;
|
|
56
56
|
/**
|
|
57
|
-
* Reads the
|
|
57
|
+
* Reads the active span of the host if the peer module loaded and a span runs.
|
|
58
58
|
* @returns Trace context of the active span, or undefined.
|
|
59
59
|
*/
|
|
60
60
|
private activeSpanContext;
|
package/dist/utils/unref.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Timer handle. It is a number in a browser and a Timeout object in Node. */
|
|
2
2
|
export type TimerHandle = number | {
|
|
3
3
|
unref?: () => void;
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
|
-
* Unreferences a timer handle
|
|
6
|
+
* Unreferences a timer handle. A pending timer then does not keep a Node.js process alive.
|
|
7
7
|
* @param timer Timer handle returned by setTimeout.
|
|
8
8
|
*/
|
|
9
9
|
export declare function unrefTimer(timer: TimerHandle): void;
|
|
@@ -9,7 +9,7 @@ var e = class {
|
|
|
9
9
|
install() {
|
|
10
10
|
if (this.installed || (this.installed = !0, this.reportNavigationTiming(), this.ctx.once.webVitals)) return;
|
|
11
11
|
let e = this.ctx.config.capture.webVitalsLoader;
|
|
12
|
-
e ?
|
|
12
|
+
e ? this.loadWebVitals(e) : this.ctx.diagnostics.report("config.invalid", "capture.webVitals needs capture.webVitalsLoader. LCP, CLS and INP are off. Navigation timing continues.");
|
|
13
13
|
}
|
|
14
14
|
uninstall() {
|
|
15
15
|
this.installed = !1;
|
|
@@ -20,6 +20,8 @@ var e = class {
|
|
|
20
20
|
this.ctx.diagnostics.report("capture.install_failed", "The web-vitals module is not available. LCP, CLS and INP are off. Navigation timing continues.");
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
+
if (this.ctx.once.webVitals) return;
|
|
24
|
+
this.ctx.once.webVitals = !0;
|
|
23
25
|
let n = (e, t) => (n) => {
|
|
24
26
|
this.ctx.logger.logMetric(`web_vitals.${e}`, Math.round(n.value * 1e3) / 1e3, t, "gauge", {
|
|
25
27
|
"metric.rating": n.rating,
|
|
@@ -48,4 +50,4 @@ var e = class {
|
|
|
48
50
|
//#endregion
|
|
49
51
|
export { e as WebVitalsCapture };
|
|
50
52
|
|
|
51
|
-
//# sourceMappingURL=web-vitals-
|
|
53
|
+
//# sourceMappingURL=web-vitals-Bflr5jSA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-vitals-Bflr5jSA.js","names":["WebVitalsCapture","ctx","loader","module","send","name","metric","unit","nav","metrics","value"],"sources":["../src/capture/web-vitals.ts"],"sourcesContent":["// src/capture/web-vitals.ts\n//\n// Captures browser navigation timing and Core Web Vitals metrics through an optional peer.\n\nimport type { WebVitalsMetric, WebVitalsModule, WebVitalsReporter } from \"../models/config\";\nimport type { Capture, CaptureContext } from \"./types\";\n\n/** Captures browser navigation timing benchmarks and Core Web Vitals. */\nexport class WebVitalsCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"web-vitals\";\n\n /** Prevents duplicate listener registration. */\n private installed = false;\n\n /**\n * @param ctx Capture context containing configuration, diagnostics, and logger.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Reports navigation timing and starts to load web-vitals. */\n install(): void {\n if (this.installed) {\n return;\n }\n this.installed = true;\n\n this.reportNavigationTiming();\n\n if (this.ctx.once.webVitals) {\n return;\n }\n\n // Do not import the peer by name. The Vite dev server fails if the peer is not installed.\n // Do not set `once` here. A later configure() call with a loader must subscribe.\n const loader = this.ctx.config.capture.webVitalsLoader;\n if (!loader) {\n this.ctx.diagnostics.report(\n \"config.invalid\",\n \"capture.webVitals needs capture.webVitalsLoader. LCP, CLS and INP are off. Navigation timing continues.\",\n );\n return;\n }\n\n // Set the flag after a successful load, not before. A failed load then gets a new\n // attempt on a later install.\n void this.loadWebVitals(loader);\n }\n\n /**\n * Marks the module as uninstalled. The web-vitals reporters stay subscribed\n * because the package has no unsubscribe. `ctx.once` prevents a second set.\n */\n uninstall(): void {\n this.installed = false;\n }\n\n /**\n * Loads the web-vitals module and registers metric reporters.\n * @param loader Loader that the consumer supplies.\n */\n private async loadWebVitals(loader: () => Promise<WebVitalsModule>): Promise<void> {\n const module = await this.ctx.diagnostics.guardAsync(\n \"capture.install_failed\",\n \"The library could not load web-vitals.\",\n loader,\n );\n\n if (!module) {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n \"The web-vitals module is not available. LCP, CLS and INP are off. Navigation timing continues.\",\n );\n return;\n }\n\n // Two installs in one turn both load the module. Only the first subscribes.\n // web-vitals has no unsubscribe, and a second set reports each metric two times.\n if (this.ctx.once.webVitals) {\n return;\n }\n this.ctx.once.webVitals = true;\n\n const send =\n (name: string, unit: string): WebVitalsReporter =>\n (metric: WebVitalsMetric): void => {\n this.ctx.logger.logMetric(\n `web_vitals.${name}`,\n // Keep three decimals. CLS is a small fraction. An integer value\n // reports each layout shift as zero.\n Math.round(metric.value * 1000) / 1000,\n unit,\n \"gauge\",\n { \"metric.rating\": metric.rating, \"metric.id\": metric.id },\n );\n };\n\n module.onLCP(send(\"lcp\", \"ms\"));\n module.onCLS(send(\"cls\", \"1\"));\n module.onINP(send(\"inp\", \"ms\"));\n module.onFCP(send(\"fcp\", \"ms\"));\n module.onTTFB(send(\"ttfb\", \"ms\"));\n }\n\n /** Extracts and logs PerformanceNavigationTiming benchmarks one time for each document. */\n private reportNavigationTiming(): void {\n // The entry describes the one navigation of this document. A second report after a\n // reconfigure duplicates the seven metrics.\n if (this.ctx.once.navigationTiming) {\n return;\n }\n this.ctx.once.navigationTiming = true;\n\n this.ctx.diagnostics.guard(\n \"capture.install_failed\",\n \"The library could not read the navigation timing.\",\n () => {\n const nav = performance.getEntriesByType(\"navigation\")[0] as\n PerformanceNavigationTiming | undefined;\n if (!nav) {\n return;\n }\n\n const metrics: Record<string, number> = {\n \"navigation.dns_ms\": nav.domainLookupEnd - nav.domainLookupStart,\n \"navigation.tcp_ms\": nav.connectEnd - nav.connectStart,\n \"navigation.ttfb_ms\": nav.responseStart - nav.requestStart,\n \"navigation.response_ms\": nav.responseEnd - nav.responseStart,\n \"navigation.dom_interactive_ms\": nav.domInteractive,\n \"navigation.dom_complete_ms\": nav.domComplete,\n \"navigation.load_ms\": nav.loadEventEnd,\n };\n\n for (const [name, value] of Object.entries(metrics)) {\n // Filters unrecorded or negative timings to avoid false zero readings.\n if (Number.isFinite(value) && value >= 0) {\n this.ctx.logger.logMetric(name, Math.round(value), \"ms\", \"gauge\", {\n \"navigation.type\": nav.type,\n });\n }\n }\n },\n );\n }\n}\n"],"mappings":";AAQA,IAAaA,IAAb,MAAiD;CAUlB;CAR7B,OAAgB;CAGhB,YAAoB;CAKpB,YAAY,GAAsC;EAArB,KAAA,MAAAC;CAAsB;CAGnD,UAAgB;EAQd,IAPI,KAAK,cAGT,KAAK,YAAY,IAEjB,KAAK,uBAAuB,GAExB,KAAK,IAAI,KAAK,YAChB;EAKF,IAAMC,IAAS,KAAK,IAAI,OAAO,QAAQ;EACvC,AAAKA,IAUL,KAAU,cAAcA,CAAM,IAT5B,KAAK,IAAI,YAAY,OACnB,kBACA,yGACF;CAOJ;CAMA,YAAkB;EAChB,KAAK,YAAY;CACnB;CAMA,MAAc,cAAc,GAAuD;EACjF,IAAMC,IAAS,MAAM,KAAK,IAAI,YAAY,WACxC,0BACA,0CACAD,CACF;EAEA,IAAI,CAACC,GAAQ;GACX,KAAK,IAAI,YAAY,OACnB,0BACA,gGACF;GACA;EACF;EAIA,IAAI,KAAK,IAAI,KAAK,WAChB;EAEF,KAAK,IAAI,KAAK,YAAY;EAE1B,IAAMC,KACH,GAAc,OACd,MAAkC;GACjC,KAAK,IAAI,OAAO,UACd,cAAcC,KAGd,KAAK,MAAMC,EAAO,QAAQ,GAAI,IAAI,KAClCC,GACA,SACA;IAAE,iBAAiBD,EAAO;IAAQ,aAAaA,EAAO;GAAG,CAC3D;EACF;EAMF,AAJAH,EAAO,MAAMC,EAAK,OAAO,IAAI,CAAC,GAC9BD,EAAO,MAAMC,EAAK,OAAO,GAAG,CAAC,GAC7BD,EAAO,MAAMC,EAAK,OAAO,IAAI,CAAC,GAC9BD,EAAO,MAAMC,EAAK,OAAO,IAAI,CAAC,GAC9BD,EAAO,OAAOC,EAAK,QAAQ,IAAI,CAAC;CAClC;CAGA,yBAAuC;EAGrC,AAAI,KAAK,IAAI,KAAK,qBAGlB,KAAK,IAAI,KAAK,mBAAmB,IAEjC,KAAK,IAAI,YAAY,MACnB,0BACA,2DACM;GACJ,IAAMI,IAAM,YAAY,iBAAiB,YAAY,CAAC,CAAC;GAEvD,IAAI,CAACA,GACH;GAGF,IAAMC,IAAkC;IACtC,qBAAqBD,EAAI,kBAAkBA,EAAI;IAC/C,qBAAqBA,EAAI,aAAaA,EAAI;IAC1C,sBAAsBA,EAAI,gBAAgBA,EAAI;IAC9C,0BAA0BA,EAAI,cAAcA,EAAI;IAChD,iCAAiCA,EAAI;IACrC,8BAA8BA,EAAI;IAClC,sBAAsBA,EAAI;GAC5B;GAEA,KAAK,IAAM,CAACH,GAAMK,MAAU,OAAO,QAAQD,CAAO,GAEhD,AAAI,OAAO,SAASC,CAAK,KAAKA,KAAS,KACrC,KAAK,IAAI,OAAO,UAAUL,GAAM,KAAK,MAAMK,CAAK,GAAG,MAAM,SAAS,EAChE,mBAAmBF,EAAI,KACzB,CAAC;EAGP,CACF;CACF;AACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=class{ctx;name=`web-vitals`;installed=!1;constructor(e){this.ctx=e}install(){if(this.installed||(this.installed=!0,this.reportNavigationTiming(),this.ctx.once.webVitals))return;let e=this.ctx.config.capture.webVitalsLoader;e?this.loadWebVitals(e):this.ctx.diagnostics.report(`config.invalid`,`capture.webVitals needs capture.webVitalsLoader. LCP, CLS and INP are off. Navigation timing continues.`)}uninstall(){this.installed=!1}async loadWebVitals(e){let t=await this.ctx.diagnostics.guardAsync(`capture.install_failed`,`The library could not load web-vitals.`,e);if(!t){this.ctx.diagnostics.report(`capture.install_failed`,`The web-vitals module is not available. LCP, CLS and INP are off. Navigation timing continues.`);return}if(this.ctx.once.webVitals)return;this.ctx.once.webVitals=!0;let n=(e,t)=>n=>{this.ctx.logger.logMetric(`web_vitals.${e}`,Math.round(n.value*1e3)/1e3,t,`gauge`,{"metric.rating":n.rating,"metric.id":n.id})};t.onLCP(n(`lcp`,`ms`)),t.onCLS(n(`cls`,`1`)),t.onINP(n(`inp`,`ms`)),t.onFCP(n(`fcp`,`ms`)),t.onTTFB(n(`ttfb`,`ms`))}reportNavigationTiming(){this.ctx.once.navigationTiming||(this.ctx.once.navigationTiming=!0,this.ctx.diagnostics.guard(`capture.install_failed`,`The library could not read the navigation timing.`,()=>{let e=performance.getEntriesByType(`navigation`)[0];if(!e)return;let t={"navigation.dns_ms":e.domainLookupEnd-e.domainLookupStart,"navigation.tcp_ms":e.connectEnd-e.connectStart,"navigation.ttfb_ms":e.responseStart-e.requestStart,"navigation.response_ms":e.responseEnd-e.responseStart,"navigation.dom_interactive_ms":e.domInteractive,"navigation.dom_complete_ms":e.domComplete,"navigation.load_ms":e.loadEventEnd};for(let[n,r]of Object.entries(t))Number.isFinite(r)&&r>=0&&this.ctx.logger.logMetric(n,Math.round(r),`ms`,`gauge`,{"navigation.type":e.type})}))}};exports.WebVitalsCapture=e;
|
|
2
|
+
//# sourceMappingURL=web-vitals-DFuoTQbZ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-vitals-DFuoTQbZ.cjs","names":["WebVitalsCapture","ctx","loader","module","send","name","metric","unit","nav","metrics","value"],"sources":["../src/capture/web-vitals.ts"],"sourcesContent":["// src/capture/web-vitals.ts\n//\n// Captures browser navigation timing and Core Web Vitals metrics through an optional peer.\n\nimport type { WebVitalsMetric, WebVitalsModule, WebVitalsReporter } from \"../models/config\";\nimport type { Capture, CaptureContext } from \"./types\";\n\n/** Captures browser navigation timing benchmarks and Core Web Vitals. */\nexport class WebVitalsCapture implements Capture {\n /** Capture module identifier. */\n readonly name = \"web-vitals\";\n\n /** Prevents duplicate listener registration. */\n private installed = false;\n\n /**\n * @param ctx Capture context containing configuration, diagnostics, and logger.\n */\n constructor(private readonly ctx: CaptureContext) {}\n\n /** Reports navigation timing and starts to load web-vitals. */\n install(): void {\n if (this.installed) {\n return;\n }\n this.installed = true;\n\n this.reportNavigationTiming();\n\n if (this.ctx.once.webVitals) {\n return;\n }\n\n // Do not import the peer by name. The Vite dev server fails if the peer is not installed.\n // Do not set `once` here. A later configure() call with a loader must subscribe.\n const loader = this.ctx.config.capture.webVitalsLoader;\n if (!loader) {\n this.ctx.diagnostics.report(\n \"config.invalid\",\n \"capture.webVitals needs capture.webVitalsLoader. LCP, CLS and INP are off. Navigation timing continues.\",\n );\n return;\n }\n\n // Set the flag after a successful load, not before. A failed load then gets a new\n // attempt on a later install.\n void this.loadWebVitals(loader);\n }\n\n /**\n * Marks the module as uninstalled. The web-vitals reporters stay subscribed\n * because the package has no unsubscribe. `ctx.once` prevents a second set.\n */\n uninstall(): void {\n this.installed = false;\n }\n\n /**\n * Loads the web-vitals module and registers metric reporters.\n * @param loader Loader that the consumer supplies.\n */\n private async loadWebVitals(loader: () => Promise<WebVitalsModule>): Promise<void> {\n const module = await this.ctx.diagnostics.guardAsync(\n \"capture.install_failed\",\n \"The library could not load web-vitals.\",\n loader,\n );\n\n if (!module) {\n this.ctx.diagnostics.report(\n \"capture.install_failed\",\n \"The web-vitals module is not available. LCP, CLS and INP are off. Navigation timing continues.\",\n );\n return;\n }\n\n // Two installs in one turn both load the module. Only the first subscribes.\n // web-vitals has no unsubscribe, and a second set reports each metric two times.\n if (this.ctx.once.webVitals) {\n return;\n }\n this.ctx.once.webVitals = true;\n\n const send =\n (name: string, unit: string): WebVitalsReporter =>\n (metric: WebVitalsMetric): void => {\n this.ctx.logger.logMetric(\n `web_vitals.${name}`,\n // Keep three decimals. CLS is a small fraction. An integer value\n // reports each layout shift as zero.\n Math.round(metric.value * 1000) / 1000,\n unit,\n \"gauge\",\n { \"metric.rating\": metric.rating, \"metric.id\": metric.id },\n );\n };\n\n module.onLCP(send(\"lcp\", \"ms\"));\n module.onCLS(send(\"cls\", \"1\"));\n module.onINP(send(\"inp\", \"ms\"));\n module.onFCP(send(\"fcp\", \"ms\"));\n module.onTTFB(send(\"ttfb\", \"ms\"));\n }\n\n /** Extracts and logs PerformanceNavigationTiming benchmarks one time for each document. */\n private reportNavigationTiming(): void {\n // The entry describes the one navigation of this document. A second report after a\n // reconfigure duplicates the seven metrics.\n if (this.ctx.once.navigationTiming) {\n return;\n }\n this.ctx.once.navigationTiming = true;\n\n this.ctx.diagnostics.guard(\n \"capture.install_failed\",\n \"The library could not read the navigation timing.\",\n () => {\n const nav = performance.getEntriesByType(\"navigation\")[0] as\n PerformanceNavigationTiming | undefined;\n if (!nav) {\n return;\n }\n\n const metrics: Record<string, number> = {\n \"navigation.dns_ms\": nav.domainLookupEnd - nav.domainLookupStart,\n \"navigation.tcp_ms\": nav.connectEnd - nav.connectStart,\n \"navigation.ttfb_ms\": nav.responseStart - nav.requestStart,\n \"navigation.response_ms\": nav.responseEnd - nav.responseStart,\n \"navigation.dom_interactive_ms\": nav.domInteractive,\n \"navigation.dom_complete_ms\": nav.domComplete,\n \"navigation.load_ms\": nav.loadEventEnd,\n };\n\n for (const [name, value] of Object.entries(metrics)) {\n // Filters unrecorded or negative timings to avoid false zero readings.\n if (Number.isFinite(value) && value >= 0) {\n this.ctx.logger.logMetric(name, Math.round(value), \"ms\", \"gauge\", {\n \"navigation.type\": nav.type,\n });\n }\n }\n },\n );\n }\n}\n"],"mappings":"AAQA,IAAaA,EAAb,KAAiD,CAUlB,IAR7B,KAAgB,aAGhB,UAAoB,GAKpB,YAAY,EAAsC,CAArB,KAAA,IAAAC,CAAsB,CAGnD,SAAgB,CAQd,GAPI,KAAK,YAGT,KAAK,UAAY,GAEjB,KAAK,uBAAuB,EAExB,KAAK,IAAI,KAAK,WAChB,OAKF,IAAMC,EAAS,KAAK,IAAI,OAAO,QAAQ,gBAClCA,EAUL,KAAU,cAAcA,CAAM,EAT5B,KAAK,IAAI,YAAY,OACnB,iBACA,yGACF,CAOJ,CAMA,WAAkB,CAChB,KAAK,UAAY,EACnB,CAMA,MAAc,cAAc,EAAuD,CACjF,IAAMC,EAAS,MAAM,KAAK,IAAI,YAAY,WACxC,yBACA,yCACAD,CACF,EAEA,GAAI,CAACC,EAAQ,CACX,KAAK,IAAI,YAAY,OACnB,yBACA,gGACF,EACA,MACF,CAIA,GAAI,KAAK,IAAI,KAAK,UAChB,OAEF,KAAK,IAAI,KAAK,UAAY,GAE1B,IAAMC,GACH,EAAc,IACd,GAAkC,CACjC,KAAK,IAAI,OAAO,UACd,cAAcC,IAGd,KAAK,MAAMC,EAAO,MAAQ,GAAI,EAAI,IAClCC,EACA,QACA,CAAE,gBAAiBD,EAAO,OAAQ,YAAaA,EAAO,EAAG,CAC3D,CACF,EAEFH,EAAO,MAAMC,EAAK,MAAO,IAAI,CAAC,EAC9BD,EAAO,MAAMC,EAAK,MAAO,GAAG,CAAC,EAC7BD,EAAO,MAAMC,EAAK,MAAO,IAAI,CAAC,EAC9BD,EAAO,MAAMC,EAAK,MAAO,IAAI,CAAC,EAC9BD,EAAO,OAAOC,EAAK,OAAQ,IAAI,CAAC,CAClC,CAGA,wBAAuC,CAGjC,KAAK,IAAI,KAAK,mBAGlB,KAAK,IAAI,KAAK,iBAAmB,GAEjC,KAAK,IAAI,YAAY,MACnB,yBACA,wDACM,CACJ,IAAMI,EAAM,YAAY,iBAAiB,YAAY,CAAC,CAAC,GAEvD,GAAI,CAACA,EACH,OAGF,IAAMC,EAAkC,CACtC,oBAAqBD,EAAI,gBAAkBA,EAAI,kBAC/C,oBAAqBA,EAAI,WAAaA,EAAI,aAC1C,qBAAsBA,EAAI,cAAgBA,EAAI,aAC9C,yBAA0BA,EAAI,YAAcA,EAAI,cAChD,gCAAiCA,EAAI,eACrC,6BAA8BA,EAAI,YAClC,qBAAsBA,EAAI,YAC5B,EAEA,IAAK,GAAM,CAACH,EAAMK,KAAU,OAAO,QAAQD,CAAO,EAE5C,OAAO,SAASC,CAAK,GAAKA,GAAS,GACrC,KAAK,IAAI,OAAO,UAAUL,EAAM,KAAK,MAAMK,CAAK,EAAG,KAAM,QAAS,CAChE,kBAAmBF,EAAI,IACzB,CAAC,CAGP,CACF,EACF,CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utk09/ui-observability",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "UI observability and logging for browser, OpenFin and webview applications",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"check:peers": "node tools/check-peer-imports.mjs",
|
|
78
78
|
"check:size": "node tools/check-size.mjs",
|
|
79
79
|
"check:dev": "node tools/check-dev-server.mjs",
|
|
80
|
-
"verify": "npm run format:check && npm run check:version && npm run typecheck && npm run
|
|
80
|
+
"verify": "npm run format:check && npm run check:version && npm run typecheck && npm run build && npm run lint && npm run check:peers && npm run check:size && npm run check:dev && npm run test:coverage",
|
|
81
81
|
"prepublishOnly": "npm run verify"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
package/dist/bus-DeZzr2bx.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require("./constants-IBL_jd5R.cjs"),t=require("./unref-CU9Nyz_9.cjs");function n(t){return{p:e.S,m:t}}function r(e){if(typeof e!=`object`||!e)return null;let t=e;if(t.p!==`ui-observability/1`||typeof t.m!=`object`||t.m===null)return null;let n=t.m;return typeof n.t==`string`?n:null}var i=Symbol.for(e.Rt);function a(e,t){if(typeof window>`u`||window.parent===window)return null;let n;try{n=window.parent[i]}catch{return null}if(typeof n?.busAccept!=`function`)return null;let r=n,a=!0;return{kind:`direct`,post(n){a&&t.guard(`bus.send_failed`,`The direct call into the parent runtime failed.`,()=>{r.busAccept(n,e)})},close(){a=!1}}}function o(e,t){if(typeof window>`u`||window.parent===window)return null;let i=t=>{let n=r(t.data);n&&t.source===window.parent&&e(n,{link:`parent`,origin:t.origin})};return addEventListener(`message`,i),{kind:`parent`,post(e){t.guard(`bus.send_failed`,`The postMessage call to the parent failed.`,()=>{window.parent.postMessage(n(e),`*`)})},close(){removeEventListener(`message`,i)}}}function s(e,t,i){if(typeof window>`u`)return null;let a=new Set([window.location.origin,...t]),o=new Map,s=t=>{let n=r(t.data);n&&(a.has(t.origin)?(t.source&&o.set(t.source,t.origin),e(n,{link:`children`,origin:t.origin})):i.report(`bus.untrusted_origin`,`The bus ignored a message from ${t.origin}. If you own this origin, add it to bus.trustedOrigins.`,{origin:t.origin,type:n.t}))};return addEventListener(`message`,s),{kind:`children`,post(e){for(let[t,r]of o){let a=t;a.closed?o.delete(t):i.guard(`bus.send_failed`,`The postMessage call to a child frame failed.`,()=>{a.postMessage(n(e),r)})}},close(){removeEventListener(`message`,s),o.clear()}}}function c(e,t,i){let a=globalThis.BroadcastChannel;if(a===void 0)return null;let o=i.guard(`bus.send_failed`,`The library could not open the BroadcastChannel.`,()=>new a(e));return o?(o.onmessage=e=>{let n=r(e.data);n&&t(n,{link:`broadcast`,origin:`same-origin`})},{kind:`broadcast`,post(e){i.guard(`bus.send_failed`,`The BroadcastChannel.postMessage call failed.`,()=>{o.postMessage(n(e))})},close(){i.guard(`bus.send_failed`,`The library could not close the BroadcastChannel.`,()=>{o.close()})}}):null}function l(e,t,i,a){let o=globalThis.fin?.InterApplicationBus;if(!o)return null;if(!t)return a.report(`openfin.unavailable`,`OpenFin gives no application uuid. The InterApplicationBus link stays closed.`),null;let s=`${e}.${t}`;return a.guardAsync(`bus.send_failed`,`The InterApplicationBus.subscribe call failed.`,()=>o.subscribe({uuid:t},s,e=>{let t=r(e);t&&i(t,{link:`openfin`,origin:`openfin`})})),{kind:`openfin`,post(e){a.guardAsync(`bus.send_failed`,`The InterApplicationBus.publish call failed.`,()=>o.publish(s,n(e)))},close(){}}}function u(e,t){let i=globalThis,a=i.postMessage;return i.WorkerGlobalScope===void 0||!a?null:(i.addEventListener?.(`message`,t=>{let n=r(t.data);n&&e(n,{link:`owner`,origin:`same-origin`})}),{kind:`owner`,post(e){t.guard(`bus.send_failed`,`The postMessage call of the worker failed.`,()=>{a(n(e))})},close(){}})}function d(e,t,i){let a=e=>{let n=r(e.data);n&&t(n,{link:`worker`,origin:`same-origin`})};return e.addEventListener(`message`,a),e.start?.(),{kind:`worker`,post(t){i.guard(`bus.send_failed`,`The postMessage call to a worker failed.`,()=>{e.postMessage(n(t))})},close(){e.removeEventListener(`message`,a)}}}var f={timeoutMs:e.x,maxAttempts:3},p=[`children`,`direct`,`worker`],m=class{config;diagnostics;platform;contextId;tabId;handlers;handshakeOptions;role=`sender`;upstream=null;links=[];openFinLink=null;isOpenFinProvider=!1;resolved=!1;awaitingWelcome=null;constructor(e,t,n,r,i,a,o=f){this.config=e,this.diagnostics=t,this.platform=n,this.contextId=r,this.tabId=i,this.handlers=a,this.handshakeOptions=o}getRole(){return this.role}isResolved(){return this.resolved}async start(){let{bus:e}=this.config;if(e.mode===`off`)return this.role=`sender`,this.resolved=!0,this.role;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.resolved=!0,this.announce(),this.role;this.openControlLinks();let t=a(this.receive,this.diagnostics);if(t)return this.role=`forwarder`,this.upstream=t,this.resolved=!0,this.diagnostics.report(`bus.role_resolved`,`This context attached directly to the runtime of its same-origin parent.`,{role:`forwarder`,via:`direct`}),this.announce(),this.role;let n=this.candidateUpstream();if(!n)return this.role=`sender`,this.resolved=!0,this.diagnostics.report(`bus.role_resolved`,`No owner exists. This context sends its own records.`,{role:`sender`}),this.announce(),this.role;let r=this.orphanPolicy()===`retry`?this.handshakeOptions.maxAttempts:1,i=!1;for(let e=0;e<r&&!i;e++)i=await this.handshake(n);return this.role=i?`forwarder`:`sender`,this.upstream=i?n:null,i||(n!==this.openFinLink&&n.close(),this.diagnostics.report(`bus.handshake_timeout`,`No owner answered after ${String(r)} attempt(s) of ${String(this.handshakeOptions.timeoutMs)} ms. This context becomes the sender.`,{via:n.kind,crossOrigin:this.isCrossOriginFrame()})),this.diagnostics.report(`bus.role_resolved`,`The bus role is ${this.role}.`,{role:this.role,via:i?n.kind:`none`}),this.resolved=!0,this.announce(),this.role}sendRecords(e){this.upstream?.post({t:`records`,from:this.contextId,records:e})}acceptDirect(e,t){if(e.from===this.contextId)return;let n={link:`direct`,origin:`same-origin`};if(e.t===`hello`)this.canOwn(`direct`)&&t({t:`welcome`,from:this.contextId,to:e.from,tabId:this.tabId},n);else if(e.t===`journey?`){let e=this.handlers.onJourneyRequest();e&&t({t:`journey`,from:this.contextId,journey:e},n)}else this.receive(e,n)}attachWorker(e){this.links.push(d(e,this.receive,this.diagnostics))}broadcastJourney(e){this.post({t:`journey`,from:this.contextId,journey:e})}destroy(){for(let e of this.allLinks())e.close();this.links.length=0,this.upstream=null,this.openFinLink=null}allLinks(){return!this.upstream||this.links.includes(this.upstream)?this.links:[...this.links,this.upstream]}post(e){for(let t of this.allLinks())t.post(e)}postOver(e,t){for(let n of this.allLinks())n.kind===e&&n.post(t)}receive=(e,t)=>{if(e.from!==this.contextId)switch(e.t){case`hello`:this.canOwn(t.link)&&this.postOver(t.link,{t:`welcome`,from:this.contextId,to:e.from,tabId:this.tabId});break;case`welcome`:if(e.to!==this.contextId)break;this.awaitingWelcome?.link===t.link&&this.awaitingWelcome.settle(!0);break;case`records`:this.role===`sender`?this.handlers.onRecords(e.records):this.upstream&&this.canRelay(t.link)&&this.upstream.post(e);break;case`journey`:this.handlers.onJourney(e.journey);break;case`journey?`:{let e=this.handlers.onJourneyRequest();e&&this.postOver(t.link,{t:`journey`,from:this.contextId,journey:e});break}case`tab`:t.link===`broadcast`&&e.tabId===this.tabId&&this.contextId>e.from&&this.handlers.onTabConflict()}};canRelay(e){return e===`direct`||e!==this.upstream?.kind}canOwn(e){return this.role===`sender`?e===`openfin`?this.isOpenFinProvider:p.includes(e):!1}resolveOpenFinProvider(){let e=this.config.bus.openFinRole;if(e!==`auto`)return e===`provider`;if(this.platform.platform!==`openfin`&&this.platform.platform!==`openfin_web`)return!1;let t=globalThis.fin?.me;return!t?.identity||t.isView?!1:!!(t.identity.name&&t.identity.name===t.identity.uuid)}orphanPolicy(){return this.isCrossOriginFrame()?`retry`:`promote`}isCrossOriginFrame(){if(typeof window>`u`||window.parent===window)return!1;try{return Reflect.get(window.parent,`location`),!1}catch{return!0}}candidateUpstream(){return this.platform.isWorker?u(this.receive,this.diagnostics):this.platform.isTopLevelDocument?this.platform.platform===`openfin`&&!this.isOpenFinProvider?this.ensureOpenFinLink():null:o(this.receive,this.diagnostics)}openControlLinks(){let t=e=>{e&&this.links.push(e)};this.platform.isTopLevelDocument&&(t(s(this.receive,this.config.bus.trustedOrigins,this.diagnostics)),t(c(e.b,this.receive,this.diagnostics))),(this.platform.platform===`openfin`||this.platform.platform===`openfin_web`)&&t(this.ensureOpenFinLink())}ensureOpenFinLink(){return this.openFinLink??=l(e.b,this.platform.openfinUuid,this.receive,this.diagnostics),this.openFinLink}handshake(e){return new Promise(n=>{let r=!1,i=e=>{r||(r=!0,this.awaitingWelcome=null,clearTimeout(a),n(e))};this.awaitingWelcome={link:e.kind,settle:i};let a=setTimeout(()=>{i(!1)},this.handshakeOptions.timeoutMs);t.t(a),e.post({t:`hello`,from:this.contextId,tabId:this.tabId})})}announce(){this.postOver(`broadcast`,{t:`tab`,from:this.contextId,tabId:this.tabId}),this.post({t:`journey?`,from:this.contextId})}};exports.Bus=m;
|
|
2
|
-
//# sourceMappingURL=bus-DeZzr2bx.cjs.map
|