@brainfish-ai/web-tracker 0.0.12 → 0.0.13
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/dist/index.cjs.js +13 -13
- package/dist/index.cjs.js.gz +0 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +973 -931
- package/dist/index.js.gz +0 -0
- package/dist/index.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/record/index.d.ts +9 -1
- package/dist/src/record/recordingManager.d.ts +1 -0
- package/dist/src/session/sessionManager.d.ts +7 -6
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as Sender } from './sender';
|
|
2
2
|
import { default as RecordingManager } from './recordingManager';
|
|
3
3
|
import { default as Timer } from './timer';
|
|
4
|
+
import { default as SessionManager } from '../session/sessionManager';
|
|
4
5
|
export default class Agent {
|
|
5
6
|
recordingManager: RecordingManager;
|
|
6
7
|
sender: Sender;
|
|
@@ -8,18 +9,25 @@ export default class Agent {
|
|
|
8
9
|
MAX_IDLE_TIME: any;
|
|
9
10
|
timer: Timer | undefined;
|
|
10
11
|
sendEvents: ((events: any[]) => Promise<void>) | undefined;
|
|
12
|
+
sendScreenViewEvent: ((props: any) => void) | undefined;
|
|
11
13
|
recordingBlocklist: string[];
|
|
12
14
|
_allowLocalhostRecording?: boolean;
|
|
13
15
|
_allowScreenRecording?: boolean;
|
|
16
|
+
private sessionCreationPromise;
|
|
17
|
+
private static _sessionManager;
|
|
18
|
+
get sessionManager(): SessionManager;
|
|
14
19
|
constructor();
|
|
15
|
-
start({ endpoint, sendEvents, recordingBlocklist, _allowLocalhostRecording, _allowScreenRecording, }: {
|
|
20
|
+
start({ endpoint, sendEvents, sendScreenViewEvent, recordingBlocklist, _allowLocalhostRecording, _allowScreenRecording, }: {
|
|
16
21
|
endpoint: string;
|
|
17
22
|
sendEvents: (events: any[]) => Promise<void>;
|
|
23
|
+
sendScreenViewEvent: (props: any) => void;
|
|
18
24
|
recordingBlocklist: string[];
|
|
19
25
|
_allowLocalhostRecording?: boolean;
|
|
20
26
|
_allowScreenRecording?: boolean;
|
|
21
27
|
}): Promise<void>;
|
|
22
28
|
handleTimeout(): void;
|
|
29
|
+
handleActivityDuringIdle(): void;
|
|
23
30
|
takeFullSnapshot(): void;
|
|
24
31
|
static handleCustomEvent(customEventType: string): void;
|
|
32
|
+
private createSession;
|
|
25
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type SessionCallbacks = {
|
|
2
|
-
|
|
2
|
+
takeFullSnapshot?: () => void;
|
|
3
3
|
};
|
|
4
4
|
/**
|
|
5
5
|
* Manages session state and transitions for the tracker
|
|
@@ -9,7 +9,8 @@ export type SessionCallbacks = {
|
|
|
9
9
|
export declare class SessionManager {
|
|
10
10
|
private static instance;
|
|
11
11
|
private sessionId;
|
|
12
|
-
private
|
|
12
|
+
private lastScreenViewEventTime;
|
|
13
|
+
isIdle: boolean;
|
|
13
14
|
static getInstance(): SessionManager;
|
|
14
15
|
/**
|
|
15
16
|
* Determines the current session state based on previous and current session IDs
|
|
@@ -24,10 +25,10 @@ export declare class SessionManager {
|
|
|
24
25
|
* @param newSessionId The new session ID from the server
|
|
25
26
|
* @param callbacks Optional callbacks for session state changes
|
|
26
27
|
*/
|
|
27
|
-
updateSession(newSessionId: string, callbacks?: SessionCallbacks): void;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
updateSession(newSessionId: string | null, callbacks?: SessionCallbacks): void;
|
|
29
|
+
updateLastScreenViewEventTime(): void;
|
|
30
|
+
updateIdleStatus(isIdle: boolean): void;
|
|
31
|
+
getLastScreenViewEventTime(): number;
|
|
31
32
|
getCurrentSessionId(): string | null;
|
|
32
33
|
}
|
|
33
34
|
export default SessionManager;
|