@utk09/ui-observability 0.8.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 +59 -0
- package/README.md +52 -45
- package/dist/bus/bus.d.ts +46 -12
- 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-DPDrlUBY.js → bus-D8kH58tb.js} +128 -71
- package/dist/bus-D8kH58tb.js.map +1 -0
- package/dist/capture/interactions.d.ts +7 -6
- package/dist/capture/network.d.ts +23 -9
- package/dist/capture/types.d.ts +3 -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 +20 -9
- 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 +18 -9
- package/dist/core/record.d.ts +11 -6
- package/dist/core/remote-sampling.d.ts +1 -1
- package/dist/core/runtime.d.ts +43 -15
- package/dist/core/sender.d.ts +15 -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-Dnc-X4Ec.js → errors-DH4QJS0u.js} +39 -20
- package/dist/errors-DH4QJS0u.js.map +1 -0
- package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
- package/dist/global-scope-dp2jADRl.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.js +561 -436
- 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-uD4oaRMc.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-igKTAJvj.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-Br_T09Bn.cjs → library-request-C9uJFlbq.cjs} +2 -2
- package/dist/{library-request-Br_T09Bn.cjs.map → library-request-C9uJFlbq.cjs.map} +1 -1
- package/dist/{library-request-Dt0fXhcn.js → library-request-DvhuplAB.js} +2 -2
- package/dist/{library-request-Dt0fXhcn.js.map → library-request-DvhuplAB.js.map} +1 -1
- package/dist/{long-frames-DahhqM6u.cjs → long-frames-B8VdA_ny.cjs} +2 -2
- package/dist/{long-frames-DahhqM6u.cjs.map → long-frames-B8VdA_ny.cjs.map} +1 -1
- package/dist/{long-frames-6pnjWSSR.js → long-frames-C_7OutLs.js} +3 -3
- package/dist/{long-frames-6pnjWSSR.js.map → long-frames-C_7OutLs.js.map} +1 -1
- package/dist/models/batch.d.ts +1 -1
- package/dist/models/bus.d.ts +7 -4
- package/dist/models/config.d.ts +43 -12
- 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-D_XkVIF6.cjs → platform-D4wu1eIF.cjs} +2 -2
- package/dist/platform-D4wu1eIF.cjs.map +1 -0
- package/dist/platform-IHBZGqUe.js +48 -0
- package/dist/platform-IHBZGqUe.js.map +1 -0
- package/dist/{remote-rules-5UA23alm.js → remote-rules-Bt1XsdEQ.js} +14 -14
- package/dist/remote-rules-Bt1XsdEQ.js.map +1 -0
- package/dist/{remote-rules-rJJZKVG8.cjs → remote-rules-kuDf5gbe.cjs} +2 -2
- 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-G6v4Uqi4.js → sender-BnNj9bOX.js} +234 -176
- 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-DJkEZP_8.js → storm-BTw0J6eE.js} +2 -2
- package/dist/{storm-DJkEZP_8.js.map → storm-BTw0J6eE.js.map} +1 -1
- package/dist/{storm-BtzgLOCX.cjs → storm-Y-yuBhvv.cjs} +2 -2
- package/dist/{storm-BtzgLOCX.cjs.map → storm-Y-yuBhvv.cjs.map} +1 -1
- package/dist/transport/compression.d.ts +1 -1
- package/dist/transport/exit-flush.d.ts +21 -17
- package/dist/transport/http-transport.d.ts +61 -7
- package/dist/transport/retry-engine.d.ts +5 -5
- package/dist/transport/status-transport.d.ts +4 -2
- package/dist/utils/console.d.ts +1 -1
- package/dist/utils/error-like.d.ts +25 -0
- package/dist/utils/global-scope.d.ts +1 -1
- package/dist/utils/identity.d.ts +1 -1
- package/dist/utils/library-console.d.ts +1 -1
- package/dist/utils/library-request.d.ts +1 -1
- 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-CUXRY0JR.cjs +0 -2
- package/dist/bus-CUXRY0JR.cjs.map +0 -1
- package/dist/bus-DPDrlUBY.js.map +0 -1
- package/dist/console-CNljJict.js +0 -81
- package/dist/console-CNljJict.js.map +0 -1
- package/dist/console-PKzc-FmR.cjs +0 -2
- package/dist/console-PKzc-FmR.cjs.map +0 -1
- package/dist/constants-B28fDv2F.cjs +0 -2
- package/dist/constants-B28fDv2F.cjs.map +0 -1
- package/dist/constants-Bu49bm39.js +0 -93
- package/dist/constants-Bu49bm39.js.map +0 -1
- package/dist/errors-C78ZTjet.cjs +0 -3
- package/dist/errors-C78ZTjet.cjs.map +0 -1
- package/dist/errors-Dnc-X4Ec.js.map +0 -1
- package/dist/indexeddb-storage-D0p3iMD0.cjs +0 -2
- package/dist/indexeddb-storage-D0p3iMD0.cjs.map +0 -1
- package/dist/indexeddb-storage-uD4oaRMc.js.map +0 -1
- package/dist/interactions-CsE2y_fQ.cjs +0 -2
- package/dist/interactions-CsE2y_fQ.cjs.map +0 -1
- package/dist/interactions-igKTAJvj.js.map +0 -1
- package/dist/network-CZ0aFUsy.cjs +0 -2
- package/dist/network-CZ0aFUsy.cjs.map +0 -1
- package/dist/network-aSNbwpue.js +0 -112
- package/dist/network-aSNbwpue.js.map +0 -1
- package/dist/platform-BwbMRwHm.js +0 -48
- package/dist/platform-BwbMRwHm.js.map +0 -1
- package/dist/platform-D_XkVIF6.cjs.map +0 -1
- package/dist/remote-rules-5UA23alm.js.map +0 -1
- package/dist/remote-rules-rJJZKVG8.cjs.map +0 -1
- package/dist/sampling-E4x92Nn2.cjs +0 -2
- package/dist/sampling-E4x92Nn2.cjs.map +0 -1
- package/dist/sampling-J1eahbfT.js +0 -160
- package/dist/sampling-J1eahbfT.js.map +0 -1
- package/dist/sanitize-BMhh8ghJ.cjs +0 -2
- package/dist/sanitize-BMhh8ghJ.cjs.map +0 -1
- package/dist/sanitize-UJ-4Lb0n.js +0 -114
- package/dist/sanitize-UJ-4Lb0n.js.map +0 -1
- package/dist/sender-B6ufz26f.cjs +0 -3
- package/dist/sender-B6ufz26f.cjs.map +0 -1
- package/dist/sender-G6v4Uqi4.js.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
package/dist/constants.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare const ATTR_LOG_TYPE = "log.type";
|
|
|
72
72
|
export declare const ATTR_LOG_SEQ = "log.seq";
|
|
73
73
|
/** Logger namespace attribute key. */
|
|
74
74
|
export declare const ATTR_APP_NAMESPACE = "app.namespace";
|
|
75
|
-
/** Document URL when the
|
|
75
|
+
/** Document URL when the library built the record. */
|
|
76
76
|
export declare const ATTR_PAGE_URL = "page.url";
|
|
77
77
|
/**
|
|
78
78
|
* HTTP request URL attribute key. Network capture sets it. Do not reuse `ATTR_PAGE_URL`.
|
|
@@ -88,6 +88,10 @@ export declare const ATTR_JOURNEY_NAME = "journey.name";
|
|
|
88
88
|
export declare const ATTR_JOURNEY_PARENT_ID = "journey.parent_id";
|
|
89
89
|
/** Marks a record whose attributes failed to sanitize. */
|
|
90
90
|
export declare const ATTR_SANITIZE_FAILED = "uiobs.sanitize_failed";
|
|
91
|
+
/** Own fields of an Error reason, or the whole reason when it is not an Error. */
|
|
92
|
+
export declare const ATTR_ERROR_DATA = "error.data";
|
|
93
|
+
/** Breadcrumb history of an error record. */
|
|
94
|
+
export declare const ATTR_BREADCRUMBS = "breadcrumbs";
|
|
91
95
|
/**
|
|
92
96
|
* Marks a record when the library drops its attributes because they exceed the byte budget.
|
|
93
97
|
* @see {@link ATTR_ATTRIBUTES_BYTES}
|
|
@@ -143,7 +147,7 @@ export declare const TELEMETRY_SDK_NAME = "@utk09/ui-observability";
|
|
|
143
147
|
* Change it by hand when you change the version in package.json.
|
|
144
148
|
* @see {@link RESOURCE_TELEMETRY_SDK_VERSION}
|
|
145
149
|
*/
|
|
146
|
-
export declare const TELEMETRY_SDK_VERSION = "0.
|
|
150
|
+
export declare const TELEMETRY_SDK_VERSION = "0.9.0";
|
|
147
151
|
/**
|
|
148
152
|
* Value of `telemetry.sdk.language`.
|
|
149
153
|
* @see {@link RESOURCE_TELEMETRY_SDK_LANGUAGE}
|
|
@@ -166,7 +170,7 @@ export declare const CONTENT_TYPE_NDJSON = "application/x-ndjson";
|
|
|
166
170
|
/** Nanoseconds per millisecond. */
|
|
167
171
|
export declare const NANOS_PER_MILLI = 1000000n;
|
|
168
172
|
/**
|
|
169
|
-
* Matches a nanosecond epoch
|
|
173
|
+
* Matches a nanosecond epoch in decimal digits, for example "1755543600123000000".
|
|
170
174
|
* @see {@link NANOS_PER_MILLI}
|
|
171
175
|
*/
|
|
172
176
|
export declare const NANOS_PATTERN: RegExp;
|
|
@@ -228,9 +232,9 @@ export declare const BATCH_STORAGE_KEY_PREFIX = "ui-observability.batch.";
|
|
|
228
232
|
export declare const BATCH_KEY_TIME_WIDTH = 14;
|
|
229
233
|
/** localStorage key prefix for a batch that exit flush stores. */
|
|
230
234
|
export declare const EMERGENCY_STORAGE_KEY_PREFIX = "ui-observability.emergency.";
|
|
231
|
-
/**
|
|
235
|
+
/** Maximum number of exit batches in the emergency queue. */
|
|
232
236
|
export declare const EMERGENCY_MAX_ENTRIES = 20;
|
|
233
|
-
/** Key
|
|
237
|
+
/** Key that the library writes to test if localStorage accepts writes. */
|
|
234
238
|
export declare const STORAGE_PROBE_KEY = "ui-observability.probe";
|
|
235
239
|
/** Fraction of the store to evict on a quota error (1 in N). */
|
|
236
240
|
export declare const QUOTA_EVICTION_DIVISOR = 4;
|
|
@@ -253,7 +257,7 @@ export declare const STORAGE_NAME_INDEXEDDB = "indexeddb";
|
|
|
253
257
|
export declare const STORAGE_NAME_LOCAL = "localstorage";
|
|
254
258
|
/** In-memory adapter/strategy name. */
|
|
255
259
|
export declare const STORAGE_NAME_MEMORY = "memory";
|
|
256
|
-
/**
|
|
260
|
+
/** Name of the storage adapter that keeps nothing. */
|
|
257
261
|
export declare const STORAGE_NAME_NONE = "none";
|
|
258
262
|
/**
|
|
259
263
|
* Origin-wide lock name a drain runs under.
|
|
@@ -325,6 +329,11 @@ export declare const FNV_OFFSET_BASIS = 2166136261;
|
|
|
325
329
|
export declare const FNV_PRIME = 16777619;
|
|
326
330
|
/** Largest 32-bit unsigned value. */
|
|
327
331
|
export declare const UINT32_MAX = 4294967295;
|
|
332
|
+
/**
|
|
333
|
+
* Types that minLevel does not drop. An action is an audit fact and a metric is a measurement.
|
|
334
|
+
* The remote rate cap for records below minLevel does not apply to them.
|
|
335
|
+
*/
|
|
336
|
+
export declare const LEVEL_BYPASS_TYPES: readonly LogType[];
|
|
328
337
|
/** Record kind routed to the metric stream. */
|
|
329
338
|
export declare const LOG_TYPE_METRIC: LogType;
|
|
330
339
|
/** Protocol identifier for bus envelopes. The bus drops an envelope with a different version. */
|
|
@@ -371,7 +380,7 @@ export declare const GAP_REPORT_THROTTLE_MS = 60000;
|
|
|
371
380
|
export declare const CAPTURE_NAMESPACE = "uiobs.capture";
|
|
372
381
|
/** Default namespace for telemetry records emitted by storage subsystems. */
|
|
373
382
|
export declare const STORAGE_NAMESPACE = "uiobs.storage";
|
|
374
|
-
/**
|
|
383
|
+
/** Measurement unit that the library uses when the call gives no unit. */
|
|
375
384
|
export declare const DEFAULT_METRIC_UNIT = "count";
|
|
376
385
|
/** Default `service.name` when a consumer sets none. */
|
|
377
386
|
export declare const UNKNOWN_SERVICE_NAME = "unknown-service";
|
|
@@ -403,7 +412,7 @@ export declare const UNDEFAULTED_CONFIG_KEYS: readonly ["redact", "onDiagnostic"
|
|
|
403
412
|
* Nested config section keys.
|
|
404
413
|
* @see {@link ResolvedConfig}
|
|
405
414
|
*/
|
|
406
|
-
export declare const CONFIG_SECTIONS: readonly ["sampling", "bus", "capture"];
|
|
415
|
+
export declare const CONFIG_SECTIONS: readonly ["sampling", "bus", "journey", "capture"];
|
|
407
416
|
/**
|
|
408
417
|
* Section keys with no default, excluded from their section of `DEFAULT_CONFIG`.
|
|
409
418
|
* @see {@link UNDEFAULTED_CONFIG_KEYS}
|
|
@@ -453,7 +462,7 @@ export declare const RETRY_MAX_DELAY_MS = 60000;
|
|
|
453
462
|
export declare const RETRY_IDLE_DELAY_MS = 30000;
|
|
454
463
|
/** Max time a journey stays open, in milliseconds. Then the library treats it as abandoned. */
|
|
455
464
|
export declare const JOURNEY_MAX_AGE_MS: number;
|
|
456
|
-
/**
|
|
465
|
+
/** True if the journey ends for all contexts when the owning context closes. */
|
|
457
466
|
export declare const JOURNEY_END_ON_OWNER_CLOSE = false;
|
|
458
467
|
/** Query parameter checked at boot for a seeded journey token. */
|
|
459
468
|
export declare const JOURNEY_URL_PARAM = "__uiobs_journey";
|
|
@@ -465,6 +474,8 @@ export declare const BUS_HANDSHAKE_TIMEOUT_MS = 1500;
|
|
|
465
474
|
export declare const BUS_MAX_HANDSHAKE_ATTEMPTS = 3;
|
|
466
475
|
/** Max records a context buffers before it knows its bus role. */
|
|
467
476
|
export declare const BUS_MAX_BOOT_BUFFER_RECORDS = 500;
|
|
477
|
+
/** Max characters of an untrusted message type in a diagnostic detail. The sender sets the text. */
|
|
478
|
+
export declare const BUS_TYPE_DETAIL_MAX_CHARS = 32;
|
|
468
479
|
/** Breadcrumbs kept as context for the next error. */
|
|
469
480
|
export declare const MAX_BREADCRUMBS = 50;
|
|
470
481
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Closed set of diagnostic event codes emitted by library subsystems. */
|
|
2
|
-
export type DiagnosticCode = "config.invalid" | "config.reconfigured" | "record.sanitize_failed" | "record.truncated" | "record.dropped_by_level" | "record.dropped_by_sampling" | "record.dropped_by_ceiling" | "record.dropped_by_redact" | "record.dropped_boot_buffer_full" | "record.dropped_malformed" | "journey.expired" | "journey.adopted" | "journey.token_too_large" | "trace.otel_failed" | "bus.role_resolved" | "bus.no_owner" | "bus.handshake_timeout" | "bus.untrusted_origin" | "bus.send_failed" | "transport.http_error" | "transport.timeout" | "transport.batch_split" | "transport.throttled" | "transport.dropped_permanent" | "transport.rejected_credentials" | "transport.serialize_failed" | "storage.unavailable" | "storage.degraded" | "storage.quota_exceeded" | "storage.evicted" | "storage.dead_lettered" | "pipeline.crashed" | "capture.install_failed" | "capture.rate_limited" | "capture.header_failed" | "capture.record_failed" | "openfin.unavailable" | "platform.api_blocked" | "handler.threw";
|
|
2
|
+
export type DiagnosticCode = "config.invalid" | "config.reconfigured" | "record.sanitize_failed" | "record.truncated" | "record.dropped_by_level" | "record.dropped_by_sampling" | "record.dropped_by_ceiling" | "record.dropped_by_redact" | "record.dropped_boot_buffer_full" | "record.dropped_malformed" | "record.dropped_no_destination" | "runtime.version_mismatch" | "journey.expired" | "journey.adopted" | "journey.token_too_large" | "trace.otel_failed" | "bus.role_resolved" | "bus.no_owner" | "bus.handshake_timeout" | "bus.untrusted_origin" | "bus.send_failed" | "transport.http_error" | "transport.timeout" | "transport.batch_split" | "transport.throttled" | "transport.dropped_permanent" | "transport.rejected_credentials" | "transport.serialize_failed" | "storage.unavailable" | "storage.degraded" | "storage.quota_exceeded" | "storage.evicted" | "storage.dead_lettered" | "pipeline.crashed" | "capture.install_failed" | "capture.rate_limited" | "capture.header_failed" | "capture.record_failed" | "openfin.unavailable" | "platform.api_blocked" | "handler.threw";
|
|
3
3
|
/** Diagnostic event payload dispatched to consumer handlers. */
|
|
4
4
|
export interface DiagnosticEvent {
|
|
5
5
|
/** Diagnostic fault code. */
|
|
@@ -64,7 +64,7 @@ export declare class Diagnostics {
|
|
|
64
64
|
* @param code Diagnostic code to report on rejection.
|
|
65
65
|
* @param message ASD-STE100 sentence that states the failure. The handler gets it as the event message.
|
|
66
66
|
* @param fn Async function to execute.
|
|
67
|
-
* @returns Promise
|
|
67
|
+
* @returns Promise that resolves to the return value, or undefined on rejection.
|
|
68
68
|
*/
|
|
69
69
|
guardAsync<T>(code: DiagnosticCode, message: string, fn: () => Promise<T>): Promise<T | undefined>;
|
|
70
70
|
/**
|
package/dist/core/journey.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Diagnostics } from "./diagnostics";
|
|
|
4
4
|
export interface JourneyOptions {
|
|
5
5
|
/** Maximum open time of a journey, in milliseconds. After this time, the engine ends it. */
|
|
6
6
|
maxAgeMs: number;
|
|
7
|
-
/**
|
|
7
|
+
/** True if the journey ends for all contexts when the owning context closes. */
|
|
8
8
|
endOnOwnerClose: boolean;
|
|
9
9
|
/** Query parameter checked at boot for a seeded journey token. */
|
|
10
10
|
urlParam: string;
|
|
@@ -24,6 +24,13 @@ export interface Journey {
|
|
|
24
24
|
/** Context identifier of the document that started the journey. */
|
|
25
25
|
ownerContextId: string;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Parses and validates an unknown value into a Journey object. The value comes from
|
|
29
|
+
* sessionStorage or from a bus message of another realm.
|
|
30
|
+
* @param value Unverified parsed JSON value.
|
|
31
|
+
* @returns Validated Journey instance or null.
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseJourney(value: unknown): Journey | null;
|
|
27
34
|
/** Manages journey lifecycle, cross-window adoption, storage synchronization, and expiration. */
|
|
28
35
|
export declare class JourneyEngine {
|
|
29
36
|
private readonly options;
|
|
@@ -48,7 +55,7 @@ export declare class JourneyEngine {
|
|
|
48
55
|
/**
|
|
49
56
|
* Finds and adopts the initial journey. It checks the URL query, then sessionStorage,
|
|
50
57
|
* then OpenFin customData.
|
|
51
|
-
* @returns Promise
|
|
58
|
+
* @returns Promise that resolves when journey initialization completes.
|
|
52
59
|
*/
|
|
53
60
|
bootstrap(): Promise<void>;
|
|
54
61
|
/**
|
|
@@ -81,7 +88,7 @@ export declare class JourneyEngine {
|
|
|
81
88
|
* Validates and adopts a serialized journey token.
|
|
82
89
|
* @param token Base64url journey token.
|
|
83
90
|
* @param source Originating source description for diagnostics.
|
|
84
|
-
* @param broadcast
|
|
91
|
+
* @param broadcast True to send the adoption to the connected bus peers.
|
|
85
92
|
* @returns True if the token was valid, unexpired, and adopted.
|
|
86
93
|
*/
|
|
87
94
|
adopt(token: string, source: string, broadcast?: boolean): boolean;
|
|
@@ -120,11 +127,16 @@ export declare class JourneyEngine {
|
|
|
120
127
|
* @returns Token string or null.
|
|
121
128
|
*/
|
|
122
129
|
private readUrlToken;
|
|
130
|
+
/**
|
|
131
|
+
* Removes the journey token from the address bar after the engine adopts it.
|
|
132
|
+
* If not, a copy or a bookmark of the link starts the same journey in another session.
|
|
133
|
+
*/
|
|
134
|
+
private removeUrlToken;
|
|
123
135
|
/**
|
|
124
136
|
* Reads the journey token from the customData of the OpenFin window options.
|
|
125
137
|
* OPENFIN_OPTIONS_TIMEOUT_MS limits the wait. At the deadline, it reports
|
|
126
138
|
* openfin.unavailable and returns no token. A window without a token gives the same result.
|
|
127
|
-
* @returns Promise
|
|
139
|
+
* @returns Promise that resolves to token string or null.
|
|
128
140
|
*/
|
|
129
141
|
private readOpenFinToken;
|
|
130
142
|
}
|
package/dist/core/logger.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export declare class OneLogger {
|
|
|
10
10
|
private readonly bind;
|
|
11
11
|
readonly namespace: string;
|
|
12
12
|
private readonly options;
|
|
13
|
+
/** log.type of the level methods. It is "system" only for the namespaces of the library. */
|
|
14
|
+
private readonly levelType;
|
|
13
15
|
/**
|
|
14
16
|
* @param bind Returns the runtime for each write.
|
|
15
17
|
* A logger that exists before configure() writes to the configured runtime.
|
|
@@ -98,7 +100,7 @@ export declare class OneLogger {
|
|
|
98
100
|
* @param label Metric name prefix.
|
|
99
101
|
* @param fn Asynchronous function to time.
|
|
100
102
|
* @param attributes Optional contextual attributes.
|
|
101
|
-
* @returns Promise
|
|
103
|
+
* @returns Promise that resolves to the result of the timed function.
|
|
102
104
|
*/
|
|
103
105
|
timeAsync: <T>(label: string, fn: () => Promise<T>, attributes?: Record<string, unknown>) => Promise<T>;
|
|
104
106
|
/**
|
|
@@ -107,6 +109,7 @@ export declare class OneLogger {
|
|
|
107
109
|
* @param type Record classification.
|
|
108
110
|
* @param body Primary message.
|
|
109
111
|
* @param payload Optional contextual attributes.
|
|
112
|
+
* @param copied True when the payload is a copy that the library made. write() does not copy it.
|
|
110
113
|
*/
|
|
111
114
|
private write;
|
|
112
115
|
/**
|
|
@@ -126,10 +129,11 @@ export declare class OneLogger {
|
|
|
126
129
|
* @param payload Caller payload.
|
|
127
130
|
* @param error Error of an error call.
|
|
128
131
|
* @param record Built record, or null if the library did not build it or redact dropped it.
|
|
132
|
+
* @param dropped Reason of the drop when the builder dropped the record.
|
|
129
133
|
*/
|
|
130
134
|
private print;
|
|
131
135
|
/**
|
|
132
|
-
* Tests
|
|
136
|
+
* Tests if the console prints a level that the library does not send.
|
|
133
137
|
* @param runtime Runtime of this write.
|
|
134
138
|
* @param level Severity level.
|
|
135
139
|
* @returns True if logging is on and the console accepts the level.
|
package/dist/core/pipeline.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface StreamOptions {
|
|
|
18
18
|
* Metrics have a higher volume, and no process waits for them.
|
|
19
19
|
*/
|
|
20
20
|
export declare const STREAM_OPTIONS: Record<StreamName, StreamOptions>;
|
|
21
|
-
/** Buffers log and metric streams
|
|
21
|
+
/** Buffers the log and metric streams. It makes batches. It sends them over HTTP. */
|
|
22
22
|
export declare class LogPipeline {
|
|
23
23
|
private readonly transport;
|
|
24
24
|
private readonly storage;
|
|
@@ -30,13 +30,15 @@ export declare class LogPipeline {
|
|
|
30
30
|
private readonly unconfirmed;
|
|
31
31
|
/** Closed batches waiting for a free dispatch slot. */
|
|
32
32
|
private readonly queue;
|
|
33
|
+
/** Each batch in the queue or in flight. flushPending waits for them. destroy() resolves them. */
|
|
34
|
+
private readonly open;
|
|
33
35
|
/** Ceiling on the ERROR and FATAL records that bypass sampling. */
|
|
34
36
|
private readonly ceiling;
|
|
35
|
-
/**
|
|
37
|
+
/** Number of dispatches in flight. MAX_CONCURRENT_REQUESTS is the limit. */
|
|
36
38
|
private inFlight;
|
|
37
39
|
/** It is true when a pump is in the queue. One microtask then drains a burst. */
|
|
38
40
|
private pumpScheduled;
|
|
39
|
-
/**
|
|
41
|
+
/** True after destroy() stops the pipeline. */
|
|
40
42
|
private stopped;
|
|
41
43
|
/**
|
|
42
44
|
* @param transport HTTP transport for live batch delivery.
|
|
@@ -56,7 +58,7 @@ export declare class LogPipeline {
|
|
|
56
58
|
* An in-flight batch has its own ID and its send is not complete. If this method
|
|
57
59
|
* takes it, the pipeline sends each record again under a new ID. The server cannot
|
|
58
60
|
* deduplicate that ID.
|
|
59
|
-
* @returns Combined LogBatch or null if no records
|
|
61
|
+
* @returns Combined LogBatch, or null if the buffers hold no records.
|
|
60
62
|
*/
|
|
61
63
|
drainPending(): LogBatch | null;
|
|
62
64
|
/**
|
|
@@ -67,12 +69,19 @@ export declare class LogPipeline {
|
|
|
67
69
|
* @returns Combined LogBatch or null if no records are pending.
|
|
68
70
|
*/
|
|
69
71
|
drainForExit(): LogBatch | null;
|
|
72
|
+
/**
|
|
73
|
+
* Sends the buffered records through the normal dispatch path. Then it waits for each
|
|
74
|
+
* batch in the queue and in flight. The throttle check and the concurrency limit apply.
|
|
75
|
+
* A direct send goes around both.
|
|
76
|
+
* @returns Promise that resolves when the pipeline sends or stores each batch, or on destroy.
|
|
77
|
+
*/
|
|
78
|
+
flushPending(): Promise<void>;
|
|
70
79
|
/** Stops the flush timers and refuses further records. */
|
|
71
80
|
destroy(): void;
|
|
72
81
|
/**
|
|
73
82
|
* Wraps drained records in a batch.
|
|
74
83
|
* @param records Records taken from the buffers, in delivery order.
|
|
75
|
-
* @returns New LogBatch, or null when
|
|
84
|
+
* @returns New LogBatch, or null when the drain takes nothing.
|
|
76
85
|
*/
|
|
77
86
|
private toBatch;
|
|
78
87
|
/**
|
|
@@ -93,14 +102,14 @@ export declare class LogPipeline {
|
|
|
93
102
|
/**
|
|
94
103
|
* Queues a batch and schedules the pump on a microtask. An inline dispatch starts
|
|
95
104
|
* a fetch inside the log call of the application.
|
|
96
|
-
* @param batch Batch ready for delivery.
|
|
105
|
+
* @param batch Batch ready for delivery, or null when the drain found no records.
|
|
97
106
|
*/
|
|
98
107
|
private enqueue;
|
|
99
108
|
/** Starts queued dispatches up to the concurrency limit. */
|
|
100
109
|
private pump;
|
|
101
110
|
/**
|
|
102
|
-
* Delivers one batch
|
|
103
|
-
* @param
|
|
111
|
+
* Delivers one batch. It then frees the concurrency slot. It resolves the promise of the batch.
|
|
112
|
+
* @param pending Batch to deliver.
|
|
104
113
|
*/
|
|
105
114
|
private run;
|
|
106
115
|
/**
|
|
@@ -117,7 +126,7 @@ export declare class LogPipeline {
|
|
|
117
126
|
*/
|
|
118
127
|
private storeFailed;
|
|
119
128
|
/**
|
|
120
|
-
* Stores an undelivered batch
|
|
129
|
+
* Stores an undelivered batch. Then it starts the retry engine. A deadline limits the
|
|
121
130
|
* wait. A storage call that does not settle holds this dispatch slot. Two such calls
|
|
122
131
|
* stop the pipeline.
|
|
123
132
|
* @param batch Batch to persist.
|
package/dist/core/record.d.ts
CHANGED
|
@@ -39,11 +39,14 @@ export interface RecordLimits extends SanitizeLimits {
|
|
|
39
39
|
/** Max total attribute bytes per record. */
|
|
40
40
|
maxRecordBytes: number;
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
43
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Reason a record was not built. "malformed" means the redact hook broke the record shape
|
|
44
|
+
* or set an unknown severityText.
|
|
45
|
+
*/
|
|
46
|
+
export type DropReason = "level" | "sampling" | "redact" | "malformed";
|
|
44
47
|
/** Outcome of one build call. */
|
|
45
48
|
export interface BuildResult {
|
|
46
|
-
/** Completed record, or null when
|
|
49
|
+
/** Completed record, or null when the builder drops it. */
|
|
47
50
|
record: LogRecord | null;
|
|
48
51
|
/** Reason for the drop. It is absent when the builder built a record. */
|
|
49
52
|
dropped?: DropReason;
|
|
@@ -76,14 +79,16 @@ export declare class RecordBuilder {
|
|
|
76
79
|
invalidateResource(): void;
|
|
77
80
|
/**
|
|
78
81
|
* Checks if logging is on and the level is at or above minLevel.
|
|
82
|
+
* minLevel does not apply to an action or a metric.
|
|
79
83
|
* @param level Target log severity level.
|
|
80
|
-
* @
|
|
84
|
+
* @param type Record type. Without it, the check applies minLevel.
|
|
85
|
+
* @returns True if the library builds a record of this level and type.
|
|
81
86
|
*/
|
|
82
|
-
isEnabled(level: LogLevel): boolean;
|
|
87
|
+
isEnabled(level: LogLevel, type?: LogType): boolean;
|
|
83
88
|
/**
|
|
84
89
|
* Builds a structured LogRecord from the input. It sanitizes attributes and applies size limits.
|
|
85
90
|
* @param input Logger call input parameters.
|
|
86
|
-
* @returns The record, or null with the reason
|
|
91
|
+
* @returns The record, or null with the reason of the drop.
|
|
87
92
|
*/
|
|
88
93
|
build(input: BuildInput): BuildResult;
|
|
89
94
|
/**
|
|
@@ -54,7 +54,7 @@ export declare class RemoteSampling {
|
|
|
54
54
|
current(): RemoteRules | null;
|
|
55
55
|
/**
|
|
56
56
|
* Returns the lowest level that the library sends.
|
|
57
|
-
* @returns The remote level if it is lower than `minLevel
|
|
57
|
+
* @returns The remote level if it is lower than `minLevel`. If not, `minLevel`.
|
|
58
58
|
*/
|
|
59
59
|
minLevel(): LogLevel;
|
|
60
60
|
/**
|
package/dist/core/runtime.d.ts
CHANGED
|
@@ -14,6 +14,17 @@ import { JourneyEngine } from "./journey";
|
|
|
14
14
|
import { RecordBuilder } from "./record";
|
|
15
15
|
/** Manages subsystem lifecycles, bus coordination and record delivery. */
|
|
16
16
|
export declare class ObservabilityRuntime {
|
|
17
|
+
private readonly degraded;
|
|
18
|
+
/**
|
|
19
|
+
* Runtime of this copy of the library when another version owns the page runtime.
|
|
20
|
+
* It stays off the global key.
|
|
21
|
+
*/
|
|
22
|
+
private static local;
|
|
23
|
+
/**
|
|
24
|
+
* Library version of this runtime. Another copy reads it from the global key.
|
|
25
|
+
* Two versions with one runtime call methods that the other version does not have.
|
|
26
|
+
*/
|
|
27
|
+
readonly sdkVersion: string;
|
|
17
28
|
/** Diagnostics reporter for internal faults. */
|
|
18
29
|
readonly diagnostics: Diagnostics;
|
|
19
30
|
/** Active configuration instance. A reconfigure changes it in place. */
|
|
@@ -71,20 +82,22 @@ export declare class ObservabilityRuntime {
|
|
|
71
82
|
private bootBuffer;
|
|
72
83
|
/** Batch buffer staging records for microtask forwarding. */
|
|
73
84
|
private forwardBuffer;
|
|
74
|
-
/**
|
|
85
|
+
/** True if a microtask drain of the forward buffer is pending. */
|
|
75
86
|
private forwardScheduled;
|
|
76
|
-
/**
|
|
87
|
+
/** True if startup has decided the bus role. A sender load waits for it. */
|
|
77
88
|
private roleResolved;
|
|
78
89
|
/** Resolves when startup releases the boot records. flush() waits for it. init() sets it. */
|
|
79
90
|
private started;
|
|
80
|
-
/**
|
|
91
|
+
/** True if asynchronous initialization is complete. */
|
|
81
92
|
private ready;
|
|
82
|
-
/**
|
|
93
|
+
/** True if shutdown stopped the runtime. */
|
|
83
94
|
private destroyed;
|
|
84
95
|
/** Timestamp of the last reported storage gap warning in epoch milliseconds. */
|
|
85
96
|
private lastGapAt;
|
|
86
97
|
/**
|
|
87
98
|
* @param input Initial consumer configuration options.
|
|
99
|
+
* @param degraded True for a console-only runtime next to another version. It installs
|
|
100
|
+
* no capture.
|
|
88
101
|
*/
|
|
89
102
|
private constructor();
|
|
90
103
|
/**
|
|
@@ -94,17 +107,24 @@ export declare class ObservabilityRuntime {
|
|
|
94
107
|
*/
|
|
95
108
|
readonly busAccept: (message: BusMessage, reply: Receive) => void;
|
|
96
109
|
/**
|
|
97
|
-
* Returns the
|
|
110
|
+
* Returns the runtime on the global key of this realm. Another copy of the library can own it.
|
|
111
|
+
* @returns Pinned runtime instance or null.
|
|
112
|
+
*/
|
|
113
|
+
private static pinned;
|
|
114
|
+
/**
|
|
115
|
+
* Returns the local runtime of this copy. Without one, it returns the pinned runtime.
|
|
116
|
+
* A pinned runtime of another version gives null. A log call then starts the local runtime.
|
|
98
117
|
* @returns Active runtime instance or null.
|
|
99
118
|
*/
|
|
100
119
|
static current(): ObservabilityRuntime | null;
|
|
101
120
|
/**
|
|
102
121
|
* Returns the runtime that shutdown() stopped, until the next configure().
|
|
122
|
+
* A stopped runtime of another version gives null.
|
|
103
123
|
* @returns Stopped runtime instance or null.
|
|
104
124
|
*/
|
|
105
125
|
static stopped(): ObservabilityRuntime | null;
|
|
106
126
|
/**
|
|
107
|
-
* Tests
|
|
127
|
+
* Tests if shutdown() stopped this runtime.
|
|
108
128
|
* @returns True after destroy() starts.
|
|
109
129
|
*/
|
|
110
130
|
isDestroyed(): boolean;
|
|
@@ -114,6 +134,14 @@ export declare class ObservabilityRuntime {
|
|
|
114
134
|
* @returns Active runtime instance.
|
|
115
135
|
*/
|
|
116
136
|
static configure(input: Partial<ObservabilityConfig>): ObservabilityRuntime;
|
|
137
|
+
/**
|
|
138
|
+
* Starts a console-only runtime next to the runtime of another version. It sends nothing,
|
|
139
|
+
* joins no bus and installs no capture. The other version keeps the page runtime.
|
|
140
|
+
* @param input Consumer configuration options.
|
|
141
|
+
* @param found sdkVersion of the pinned runtime. A runtime before 0.9.0 has none.
|
|
142
|
+
* @returns The local runtime.
|
|
143
|
+
*/
|
|
144
|
+
private static startDegraded;
|
|
117
145
|
/**
|
|
118
146
|
* Updates runtime configuration and refreshes affected subsystems.
|
|
119
147
|
* @param input Partial configuration to merge.
|
|
@@ -126,7 +154,7 @@ export declare class ObservabilityRuntime {
|
|
|
126
154
|
*/
|
|
127
155
|
private keepBuiltStorage;
|
|
128
156
|
/**
|
|
129
|
-
* Refuses a change that
|
|
157
|
+
* Refuses a change that leaves the built delivery stack with no destination.
|
|
130
158
|
* Without a destination, the retry engine removes each stored batch as delivered.
|
|
131
159
|
* @param input Partial configuration to merge.
|
|
132
160
|
* @returns Input without the refused changes.
|
|
@@ -143,17 +171,17 @@ export declare class ObservabilityRuntime {
|
|
|
143
171
|
private boot;
|
|
144
172
|
/**
|
|
145
173
|
* Starts the load of the bus one time.
|
|
146
|
-
* @returns Promise
|
|
174
|
+
* @returns Promise that resolves to the started bus, or null if it did not load.
|
|
147
175
|
*/
|
|
148
176
|
private ensureBus;
|
|
149
177
|
/**
|
|
150
178
|
* Loads and constructs the bus one time. It does not call start().
|
|
151
|
-
* @returns Promise
|
|
179
|
+
* @returns Promise that resolves to the constructed bus, or null if it did not load.
|
|
152
180
|
*/
|
|
153
181
|
private constructBus;
|
|
154
182
|
/**
|
|
155
183
|
* Starts the constructed bus. It never rejects.
|
|
156
|
-
* @returns Promise
|
|
184
|
+
* @returns Promise that resolves to the started bus, or null if it did not load or start.
|
|
157
185
|
*/
|
|
158
186
|
private startBus;
|
|
159
187
|
/** Imports and constructs the bus. It never rejects. */
|
|
@@ -165,12 +193,12 @@ export declare class ObservabilityRuntime {
|
|
|
165
193
|
private role;
|
|
166
194
|
/**
|
|
167
195
|
* Loads the delivery stack if this context is the sender and has an endpoint.
|
|
168
|
-
* @returns Promise
|
|
196
|
+
* @returns Promise that resolves when the load completes, or immediately when nothing loads.
|
|
169
197
|
*/
|
|
170
198
|
private syncSender;
|
|
171
199
|
/**
|
|
172
200
|
* Starts the load of the delivery stack one time.
|
|
173
|
-
* @returns Promise
|
|
201
|
+
* @returns Promise that resolves when the load completes or fails.
|
|
174
202
|
*/
|
|
175
203
|
private loadSender;
|
|
176
204
|
/** Imports and builds the delivery stack. It then moves the held records into it. It never rejects. */
|
|
@@ -182,7 +210,7 @@ export declare class ObservabilityRuntime {
|
|
|
182
210
|
/**
|
|
183
211
|
* Imports one capture module. A failed import reports and skips that module only.
|
|
184
212
|
* @param name Capture module name.
|
|
185
|
-
* @returns Promise
|
|
213
|
+
* @returns Promise that resolves to the class, or undefined if the import failed.
|
|
186
214
|
*/
|
|
187
215
|
private loadCapture;
|
|
188
216
|
/**
|
|
@@ -238,13 +266,13 @@ export declare class ObservabilityRuntime {
|
|
|
238
266
|
private regenerateTabId;
|
|
239
267
|
/**
|
|
240
268
|
* Counts the batches held in storage after a failed or deferred delivery.
|
|
241
|
-
* @returns Promise
|
|
269
|
+
* @returns Promise that resolves to the number of stored batches. A forwarder stores
|
|
242
270
|
* nothing and reports 0.
|
|
243
271
|
*/
|
|
244
272
|
queueDepth(): Promise<number>;
|
|
245
273
|
/**
|
|
246
274
|
* Flushes all pending records in the pipeline or forward buffer.
|
|
247
|
-
* @returns Promise
|
|
275
|
+
* @returns Promise that resolves when the library sends or hands off the queued records.
|
|
248
276
|
*/
|
|
249
277
|
flush(): Promise<void>;
|
|
250
278
|
}
|
package/dist/core/sender.d.ts
CHANGED
|
@@ -17,14 +17,12 @@ export interface SenderDeps {
|
|
|
17
17
|
/** Delivery stack for one sender runtime. */
|
|
18
18
|
export declare class Sender {
|
|
19
19
|
private readonly storage;
|
|
20
|
-
private readonly transport;
|
|
21
20
|
private readonly retry;
|
|
22
21
|
private readonly pipeline;
|
|
23
22
|
private readonly exitFlush;
|
|
24
23
|
private readonly diagnostics;
|
|
25
24
|
/**
|
|
26
25
|
* @param storage Storage adapter for undelivered batches.
|
|
27
|
-
* @param transport HTTP transport for live delivery.
|
|
28
26
|
* @param retry Retry engine for stored batches.
|
|
29
27
|
* @param pipeline Pipeline that batches records.
|
|
30
28
|
* @param exitFlush Handler that sends pending records on unload.
|
|
@@ -32,9 +30,10 @@ export declare class Sender {
|
|
|
32
30
|
*/
|
|
33
31
|
private constructor();
|
|
34
32
|
/**
|
|
35
|
-
* Builds the delivery stack
|
|
33
|
+
* Builds the delivery stack and starts the retry loop. The emergency queue import runs
|
|
34
|
+
* after the start. A slow IndexedDB open then does not hold the boot buffer.
|
|
36
35
|
* @param deps Configuration, diagnostics and gap reporter.
|
|
37
|
-
* @returns Promise
|
|
36
|
+
* @returns Promise that resolves to the started sender.
|
|
38
37
|
*/
|
|
39
38
|
static create(deps: SenderDeps): Promise<Sender>;
|
|
40
39
|
/**
|
|
@@ -43,19 +42,25 @@ export declare class Sender {
|
|
|
43
42
|
*/
|
|
44
43
|
push(record: LogRecord): void;
|
|
45
44
|
/**
|
|
46
|
-
* Sends the records
|
|
47
|
-
* @returns Promise
|
|
45
|
+
* Sends the records in the stream buffers. Then it waits for each batch in flight.
|
|
46
|
+
* @returns Promise that resolves when the pipeline sends or stores each batch.
|
|
48
47
|
*/
|
|
49
48
|
flush(): Promise<void>;
|
|
50
49
|
/**
|
|
51
50
|
* Counts the batches held in storage.
|
|
52
|
-
* @returns Promise
|
|
51
|
+
* @returns Promise that resolves to the batch count, or 0 if storage fails.
|
|
53
52
|
*/
|
|
54
53
|
queueDepth(): Promise<number>;
|
|
55
54
|
/**
|
|
56
|
-
* Sends pending records
|
|
57
|
-
*
|
|
58
|
-
*
|
|
55
|
+
* Sends pending records with a normal flush, then with the exit flush. Then it stops all
|
|
56
|
+
* timers and listeners. Then it closes storage. The normal flush keeps the headers, gzip
|
|
57
|
+
* and the retry. The exit flush takes the records that the normal flush did not confirm.
|
|
58
|
+
* @returns Promise that resolves when storage closes.
|
|
59
59
|
*/
|
|
60
60
|
destroy(): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Moves the batches of the emergency queue into storage, then wakes the retry engine.
|
|
63
|
+
* The previous page load parked them during its unload.
|
|
64
|
+
*/
|
|
65
|
+
private importEmergency;
|
|
61
66
|
}
|