@clue-ai/browser-sdk 0.0.1
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 +100 -0
- package/dist/authoring/overlay.d.ts +12 -0
- package/dist/authoring/overlay.js +468 -0
- package/dist/authoring/recording.d.ts +125 -0
- package/dist/authoring/recording.js +481 -0
- package/dist/authoring/service-logo.d.ts +1 -0
- package/dist/authoring/service-logo.generated.d.ts +1 -0
- package/dist/authoring/service-logo.generated.js +3 -0
- package/dist/authoring/service-logo.js +1 -0
- package/dist/authoring/session.d.ts +23 -0
- package/dist/authoring/session.js +127 -0
- package/dist/authoring/surface.d.ts +11 -0
- package/dist/authoring/surface.js +63 -0
- package/dist/authoring/toolbar-constants.d.ts +23 -0
- package/dist/authoring/toolbar-constants.js +42 -0
- package/dist/authoring/toolbar-drag.d.ts +29 -0
- package/dist/authoring/toolbar-drag.js +270 -0
- package/dist/authoring/toolbar-view.d.ts +21 -0
- package/dist/authoring/toolbar-view.js +2584 -0
- package/dist/capture/action.d.ts +2 -0
- package/dist/capture/action.js +62 -0
- package/dist/capture/dom.d.ts +23 -0
- package/dist/capture/dom.js +329 -0
- package/dist/capture/drag.d.ts +2 -0
- package/dist/capture/drag.js +75 -0
- package/dist/capture/error.d.ts +2 -0
- package/dist/capture/error.js +193 -0
- package/dist/capture/form.d.ts +2 -0
- package/dist/capture/form.js +137 -0
- package/dist/capture/frustration.d.ts +2 -0
- package/dist/capture/frustration.js +171 -0
- package/dist/capture/input.d.ts +2 -0
- package/dist/capture/input.js +109 -0
- package/dist/capture/location.d.ts +10 -0
- package/dist/capture/location.js +42 -0
- package/dist/capture/navigation.d.ts +2 -0
- package/dist/capture/navigation.js +100 -0
- package/dist/capture/network.d.ts +13 -0
- package/dist/capture/network.js +903 -0
- package/dist/capture/page.d.ts +2 -0
- package/dist/capture/page.js +78 -0
- package/dist/capture/performance.d.ts +2 -0
- package/dist/capture/performance.js +268 -0
- package/dist/context/account.d.ts +12 -0
- package/dist/context/account.js +129 -0
- package/dist/context/environment.d.ts +42 -0
- package/dist/context/environment.js +208 -0
- package/dist/context/identity.d.ts +14 -0
- package/dist/context/identity.js +123 -0
- package/dist/context/session.d.ts +28 -0
- package/dist/context/session.js +155 -0
- package/dist/context/tab.d.ts +22 -0
- package/dist/context/tab.js +142 -0
- package/dist/context/trace.d.ts +32 -0
- package/dist/context/trace.js +65 -0
- package/dist/core/config.d.ts +4 -0
- package/dist/core/config.js +199 -0
- package/dist/core/constants.d.ts +43 -0
- package/dist/core/constants.js +109 -0
- package/dist/core/contracts.d.ts +58 -0
- package/dist/core/contracts.js +53 -0
- package/dist/core/sdk.d.ts +2 -0
- package/dist/core/sdk.js +831 -0
- package/dist/core/types.d.ts +413 -0
- package/dist/core/types.js +1 -0
- package/dist/core/usage-governor.d.ts +7 -0
- package/dist/core/usage-governor.js +127 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +36 -0
- package/dist/integrations/next-router.d.ts +16 -0
- package/dist/integrations/next-router.js +18 -0
- package/dist/integrations/react-router.d.ts +7 -0
- package/dist/integrations/react-router.js +37 -0
- package/dist/internal/metrics.d.ts +9 -0
- package/dist/internal/metrics.js +38 -0
- package/dist/normalize/builders.d.ts +15 -0
- package/dist/normalize/builders.js +786 -0
- package/dist/normalize/canonical.d.ts +13 -0
- package/dist/normalize/canonical.js +77 -0
- package/dist/normalize/event-id.d.ts +8 -0
- package/dist/normalize/event-id.js +39 -0
- package/dist/normalize/path-template.d.ts +1 -0
- package/dist/normalize/path-template.js +33 -0
- package/dist/privacy/local-minimization.d.ts +29 -0
- package/dist/privacy/local-minimization.js +88 -0
- package/dist/privacy/mask.d.ts +7 -0
- package/dist/privacy/mask.js +60 -0
- package/dist/privacy/parameter-snapshot.d.ts +14 -0
- package/dist/privacy/parameter-snapshot.js +206 -0
- package/dist/privacy/sanitize.d.ts +11 -0
- package/dist/privacy/sanitize.js +145 -0
- package/dist/privacy/schema-evidence.d.ts +20 -0
- package/dist/privacy/schema-evidence.js +238 -0
- package/dist/transport/batch.d.ts +37 -0
- package/dist/transport/batch.js +182 -0
- package/dist/transport/client.d.ts +61 -0
- package/dist/transport/client.js +267 -0
- package/dist/transport/queue.d.ts +22 -0
- package/dist/transport/queue.js +56 -0
- package/dist/transport/retry.d.ts +14 -0
- package/dist/transport/retry.js +46 -0
- package/package.json +38 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type InternalMetricKey = "enqueue_count" | "sent_count" | "send_failure_count" | "dropped_count" | "events_summarized_count" | "sampling_dropped_count" | "oversized_event_count" | "oversized_event_dropped_count" | "snapshot_truncated_count" | "retry_count" | "batch_flush_count" | "payload_size_bytes" | "masking_error_count" | "capture_error_count" | "transport_failed_count" | "transport_retry_count" | "parameter_snapshot_oversized_dropped";
|
|
2
|
+
export type InternalMetricsSnapshot = Record<InternalMetricKey, number>;
|
|
3
|
+
export declare class InternalMetricsStore {
|
|
4
|
+
private values;
|
|
5
|
+
constructor();
|
|
6
|
+
increment(key: InternalMetricKey, by?: number): void;
|
|
7
|
+
getSnapshot(): InternalMetricsSnapshot;
|
|
8
|
+
reset(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const createInitialSnapshot = () => {
|
|
2
|
+
return {
|
|
3
|
+
enqueue_count: 0,
|
|
4
|
+
sent_count: 0,
|
|
5
|
+
send_failure_count: 0,
|
|
6
|
+
dropped_count: 0,
|
|
7
|
+
events_summarized_count: 0,
|
|
8
|
+
sampling_dropped_count: 0,
|
|
9
|
+
oversized_event_count: 0,
|
|
10
|
+
oversized_event_dropped_count: 0,
|
|
11
|
+
snapshot_truncated_count: 0,
|
|
12
|
+
retry_count: 0,
|
|
13
|
+
batch_flush_count: 0,
|
|
14
|
+
payload_size_bytes: 0,
|
|
15
|
+
masking_error_count: 0,
|
|
16
|
+
capture_error_count: 0,
|
|
17
|
+
transport_failed_count: 0,
|
|
18
|
+
transport_retry_count: 0,
|
|
19
|
+
parameter_snapshot_oversized_dropped: 0,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export class InternalMetricsStore {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.values = createInitialSnapshot();
|
|
25
|
+
}
|
|
26
|
+
increment(key, by = 1) {
|
|
27
|
+
if (!Number.isFinite(by)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this.values[key] += by;
|
|
31
|
+
}
|
|
32
|
+
getSnapshot() {
|
|
33
|
+
return { ...this.values };
|
|
34
|
+
}
|
|
35
|
+
reset() {
|
|
36
|
+
this.values = createInitialSnapshot();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CanonicalBaseEvent, ClueContext, RawCapturedEvent } from "../core/types";
|
|
2
|
+
type BuilderOptions = {
|
|
3
|
+
context: ClueContext;
|
|
4
|
+
deniedKeys: string[];
|
|
5
|
+
allowedValuePaths?: string[];
|
|
6
|
+
onMaskingError?: (error: unknown) => void;
|
|
7
|
+
};
|
|
8
|
+
export type EventDegradationStage = "parameter_snapshot_truncated";
|
|
9
|
+
export type DegradedCanonicalCandidate = {
|
|
10
|
+
stage: EventDegradationStage;
|
|
11
|
+
event: CanonicalBaseEvent;
|
|
12
|
+
};
|
|
13
|
+
export declare const buildDegradedCanonicalCandidates: (event: CanonicalBaseEvent) => DegradedCanonicalCandidate[];
|
|
14
|
+
export declare const buildCanonicalEvent: (raw: RawCapturedEvent, options: BuilderOptions) => CanonicalBaseEvent | null;
|
|
15
|
+
export {};
|