@dev-2-dev/websdk-plugin-session-tracker 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.
@@ -0,0 +1,57 @@
1
+ import { IPlugin, IPluginContext, SdkConfig } from '@dev-2-dev/websdk';
2
+
3
+ type WebSessionConfig = {
4
+ recordCanvas: boolean;
5
+ maskAllInputs: boolean;
6
+ maskInputOptions: {
7
+ password: boolean;
8
+ email: boolean;
9
+ text: boolean;
10
+ };
11
+ blockClass: string;
12
+ };
13
+ declare class D2DWebSessionTracker implements IPlugin {
14
+ name: string;
15
+ version: string;
16
+ private context;
17
+ private config;
18
+ private userConfig;
19
+ private sessionStartTime;
20
+ private isActive;
21
+ private stopRecording;
22
+ private sessionEvents;
23
+ private sessionId;
24
+ private currentSessionSize;
25
+ private lastBatchTime;
26
+ private activeBatchCount;
27
+ private pendingEvents;
28
+ private sentEventCount;
29
+ private delayedS3Url;
30
+ private delayedUrlTtl;
31
+ private delayedUrlRefreshTimer;
32
+ constructor(config?: WebSessionConfig);
33
+ init(context: IPluginContext, config?: SdkConfig): void;
34
+ start(): void;
35
+ private handleRecordingStart;
36
+ stop(): void;
37
+ destroy(): void;
38
+ onEvent(eventCode: string, _bundle: any): void;
39
+ onUserChange(_userId: string): void;
40
+ onFocus(): void;
41
+ onBlur(): void;
42
+ onBeforeUnload(): void;
43
+ onTrackingChange(isTracking: boolean): void;
44
+ onSessionStart(): void;
45
+ onSessionEnd(): void;
46
+ private startSessionRecording;
47
+ private checkBatchLimits;
48
+ private sendBatchToBackend;
49
+ private fetchDelayedUrl;
50
+ private scheduleDelayedUrlRefresh;
51
+ private sendFinalBatch;
52
+ private uploadToS3;
53
+ private sendRequest;
54
+ }
55
+
56
+ export { D2DWebSessionTracker, D2DWebSessionTracker as default };
57
+ export type { WebSessionConfig };