@genn-inc/cluebase-frontend-sdk 0.0.3 → 0.0.8
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/README.md +21 -0
- package/dist/_generated/correlation-attribute-keys.d.ts +3 -0
- package/dist/_generated/correlation-attribute-keys.js +34 -0
- package/dist/_generated/diagnostic-codes.d.ts +4 -0
- package/dist/_generated/diagnostic-codes.js +48 -0
- package/dist/_generated/drop-reasons.d.ts +2 -0
- package/dist/_generated/drop-reasons.js +25 -0
- package/dist/_generated/{identity-pii-policy.d.ts → identity-pii-policy-text-contains.d.ts} +1 -1
- package/dist/_generated/{identity-pii-policy.js → identity-pii-policy-text-contains.js} +1 -1
- package/dist/_generated/identity-pii-policy-whole-value.d.ts +37 -0
- package/dist/_generated/identity-pii-policy-whole-value.js +106 -0
- package/dist/_generated/ingest-routes.d.ts +5 -0
- package/dist/_generated/ingest-routes.js +12 -0
- package/dist/_generated/otel-span-conversion.js +1 -9
- package/dist/context/browser-storage.js +1 -2
- package/dist/context/environment.js +5 -3
- package/dist/context/identity.js +5 -9
- package/dist/context/organization.d.ts +1 -1
- package/dist/context/organization.js +6 -8
- package/dist/context/session.js +6 -8
- package/dist/context/tab.js +8 -12
- package/dist/context/trace.js +4 -5
- package/dist/exporter/batch.d.ts +26 -27
- package/dist/exporter/batch.js +248 -294
- package/dist/exporter/browser-outbox-records.d.ts +8 -25
- package/dist/exporter/browser-outbox-records.js +21 -100
- package/dist/exporter/browser-outbox.d.ts +23 -25
- package/dist/exporter/browser-outbox.js +106 -181
- package/dist/exporter/client.d.ts +25 -35
- package/dist/exporter/client.js +107 -335
- package/dist/exporter/delivery-pipeline.d.ts +71 -0
- package/dist/exporter/delivery-pipeline.js +196 -0
- package/dist/exporter/delivery-response-contract.d.ts +1 -81
- package/dist/exporter/delivery-response-contract.js +0 -118
- package/dist/exporter/delivery-response.d.ts +9 -4
- package/dist/exporter/delivery-response.js +59 -122
- package/dist/exporter/diagnostics.d.ts +3 -2
- package/dist/exporter/diagnostics.js +5 -26
- package/dist/exporter/event-id.d.ts +1 -0
- package/dist/exporter/event-id.js +4 -3
- package/dist/exporter/frontend-resource.js +5 -4
- package/dist/exporter/observation-source-event-exporter.d.ts +2 -1
- package/dist/exporter/observation-source-event-exporter.js +7 -4
- package/dist/exporter/path-template.js +3 -1
- package/dist/exporter/raw-event-to-source-signal.js +4 -2
- package/dist/exporter/sanitize.d.ts +3 -2
- package/dist/exporter/sanitize.js +4 -3
- package/dist/exporter/sdk-core-delivery.d.ts +225 -0
- package/dist/exporter/sdk-core-delivery.js +97 -0
- package/dist/exporter/sdk-core-wasm.d.ts +11 -0
- package/dist/exporter/sdk-core-wasm.js +39 -0
- package/dist/exporter/source-event.d.ts +3 -0
- package/dist/exporter/source-event.js +17 -0
- package/dist/exporter/span-to-source-signal.d.ts +2 -2
- package/dist/exporter/span-to-source-signal.js +45 -125
- package/dist/index.d.ts +5 -4
- package/dist/index.js +18 -6
- package/dist/instrumentation/action.js +9 -8
- package/dist/instrumentation/dom.js +13 -21
- package/dist/instrumentation/drag.js +0 -3
- package/dist/instrumentation/error.js +3 -1
- package/dist/instrumentation/form.js +5 -6
- package/dist/instrumentation/input.js +4 -8
- package/dist/instrumentation/location.js +3 -1
- package/dist/instrumentation/network-request.js +1 -1
- package/dist/instrumentation/network-span-attributes.js +2 -2
- package/dist/instrumentation/network.d.ts +1 -1
- package/dist/instrumentation/network.js +24 -3
- package/dist/instrumentation/performance.js +1 -2
- package/dist/internal/internal-log.js +2 -1
- package/dist/provider/_version.d.ts +1 -1
- package/dist/provider/_version.js +1 -1
- package/dist/provider/config.js +16 -4
- package/dist/provider/constants.d.ts +1 -1
- package/dist/provider/constants.js +0 -2
- package/dist/provider/lifecycle-event-dedup.d.ts +7 -0
- package/dist/provider/lifecycle-event-dedup.js +31 -0
- package/dist/provider/sdk-event-pipeline.d.ts +3 -4
- package/dist/provider/sdk-event-pipeline.js +5 -17
- package/dist/provider/sdk-input-normalization.js +2 -2
- package/dist/provider/sdk-otel-pipeline.d.ts +2 -1
- package/dist/provider/sdk-otel-pipeline.js +7 -15
- package/dist/provider/sdk-runtime-surfaces.d.ts +17 -13
- package/dist/provider/sdk-runtime-surfaces.js +15 -13
- package/dist/provider/sdk.js +137 -48
- package/dist/provider/types.d.ts +18 -24
- package/dist/wasm/pkg-web/cluebase_sdk_core_wasm.d.ts +44 -0
- package/dist/wasm/pkg-web/cluebase_sdk_core_wasm.js +355 -0
- package/dist/wasm/pkg-web/cluebase_sdk_core_wasm_bg.wasm +0 -0
- package/dist/wasm/pkg-web/cluebase_sdk_core_wasm_bg.wasm.d.ts +11 -0
- package/dist/wasm/pkg-web/package.json +15 -0
- package/package.json +62 -53
- package/dist/provider/usage-governor.d.ts +0 -7
- package/dist/provider/usage-governor.js +0 -114
package/dist/exporter/batch.d.ts
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import type { InternalMetricsStore } from "../internal/metrics.js";
|
|
2
|
-
import type { CluebaseConsentState
|
|
3
|
-
import { type CollectionPermit } from "./browser-outbox.js";
|
|
4
|
-
import { DiagnosticStore, type DiagnosticsSnapshot } from "./diagnostics.js";
|
|
2
|
+
import type { CluebaseConsentState } from "../provider/types.js";
|
|
5
3
|
import type { IngestClient } from "./client.js";
|
|
4
|
+
import { DiagnosticStore, type DiagnosticsSnapshot } from "./diagnostics.js";
|
|
5
|
+
import type { CollectionPermit } from "./sdk-core-delivery.js";
|
|
6
6
|
import type { BrowserSourceEvent } from "./source-event.js";
|
|
7
|
-
export type BatchIngestClient = Pick<IngestClient, "
|
|
7
|
+
export type BatchIngestClient = Pick<IngestClient, "perform" | "abortAttempt" | "ensureDeliveryToken" | "hasUsableBrowserToken" | "createBatchEnvelopeMetadata" | "measurePayloadBytes" | "stringifyPayload" | "diagnosticCanonicalPayload">;
|
|
8
8
|
export type BatchTransportOptions = {
|
|
9
9
|
enabled: boolean;
|
|
10
10
|
flushIntervalMs: number;
|
|
11
11
|
maxPayloadBytes: number;
|
|
12
12
|
flushThresholdBytes?: number;
|
|
13
|
+
maxSize?: number;
|
|
13
14
|
client: BatchIngestClient;
|
|
14
15
|
metrics?: InternalMetricsStore;
|
|
15
16
|
queueMaxBytes?: number;
|
|
16
17
|
queueMaxItems?: number;
|
|
17
18
|
projectKey?: string;
|
|
19
|
+
endpoint: string;
|
|
20
|
+
sdkVersion: string;
|
|
21
|
+
sourceSchemaVersion: string;
|
|
22
|
+
sdkRequest: string;
|
|
23
|
+
requestTimeoutMs?: number;
|
|
18
24
|
initialConsent?: CluebaseConsentState;
|
|
19
25
|
diagnostics?: DiagnosticStore;
|
|
20
|
-
onGovernorFeedback?: (feedback: IngestUsageGovernorFeedback) => void;
|
|
21
26
|
};
|
|
22
27
|
export type FlushDeadline = {
|
|
23
28
|
readonly signal: AbortSignal;
|
|
@@ -25,31 +30,28 @@ export type FlushDeadline = {
|
|
|
25
30
|
};
|
|
26
31
|
export declare class BatchTransport {
|
|
27
32
|
private readonly outbox;
|
|
33
|
+
private readonly pipeline;
|
|
28
34
|
private readonly client;
|
|
29
35
|
private readonly enabled;
|
|
30
36
|
private readonly flushIntervalMs;
|
|
31
37
|
private readonly maxPayloadBytes;
|
|
32
38
|
private readonly flushThresholdBytes;
|
|
39
|
+
private readonly maxSize;
|
|
33
40
|
private readonly metrics;
|
|
34
41
|
private readonly diagnostics;
|
|
35
|
-
private readonly onGovernorFeedback;
|
|
36
42
|
private idleHandle;
|
|
37
43
|
private flushing;
|
|
38
44
|
private flushAgainAfterCurrent;
|
|
39
|
-
private activeSendController;
|
|
40
|
-
private closeDeadlineController;
|
|
41
|
-
private closeDeadlineTimer;
|
|
42
45
|
private closeDeadlineAt;
|
|
43
|
-
private
|
|
44
|
-
private
|
|
45
|
-
private
|
|
46
|
-
private flushDeadlineAt;
|
|
46
|
+
private clearedAt;
|
|
47
|
+
private disposed;
|
|
48
|
+
private closeDeadlineTimer;
|
|
47
49
|
private lifecycle;
|
|
48
50
|
private closeHadTerminalDisposition;
|
|
51
|
+
private restored;
|
|
52
|
+
private tokenRefusedForGood;
|
|
49
53
|
private activeFlushPromise;
|
|
50
54
|
private enqueueTail;
|
|
51
|
-
private readonly seenEventIds;
|
|
52
|
-
private static readonly DEDUP_CAPACITY;
|
|
53
55
|
constructor(options: BatchTransportOptions);
|
|
54
56
|
getDiagnostics(): DiagnosticsSnapshot;
|
|
55
57
|
start(): void;
|
|
@@ -59,24 +61,21 @@ export declare class BatchTransport {
|
|
|
59
61
|
capturePermit(): CollectionPermit;
|
|
60
62
|
setConsent(consent: CluebaseConsentState): void;
|
|
61
63
|
enqueue(event: BrowserSourceEvent, permit?: CollectionPermit): void;
|
|
62
|
-
|
|
63
|
-
beginFlushDeadline(): FlushDeadline | null;
|
|
64
|
-
endFlushDeadline(deadline: FlushDeadline | null | undefined): void;
|
|
65
|
-
flush(deadline?: FlushDeadline | null): Promise<void>;
|
|
64
|
+
flush(): Promise<void>;
|
|
66
65
|
private runFlushUntilIdle;
|
|
67
|
-
beginClose():
|
|
66
|
+
beginClose(): void;
|
|
68
67
|
close(): Promise<void>;
|
|
69
|
-
private runFlushCycle;
|
|
70
|
-
private sendBatchWhilePermitted;
|
|
71
|
-
private applyDeliveryResult;
|
|
72
|
-
private applyFailedDelivery;
|
|
73
|
-
private applySuccessfulDelivery;
|
|
74
68
|
flushOnUnload(): void;
|
|
75
69
|
clear(): void;
|
|
70
|
+
private runFlushCycle;
|
|
71
|
+
private serializeBatch;
|
|
72
|
+
private applyObservation;
|
|
73
|
+
private adoptStoredRecords;
|
|
74
|
+
private ensureDeliveryToken;
|
|
75
|
+
private envelopeOverheadBytes;
|
|
76
|
+
private scheduleFlushDeadline;
|
|
76
77
|
private abortActiveSendForConsent;
|
|
77
78
|
private recordPendingBatchCount;
|
|
78
79
|
private clearCloseDeadline;
|
|
79
|
-
private currentDeadline;
|
|
80
80
|
private queueOutboxMutation;
|
|
81
|
-
private shouldRetainFailedBatch;
|
|
82
81
|
}
|