1 | import { Session as SessionInterface, SessionAggregates, SessionContext, SessionFlusherLike, SessionStatus, Transport } from '@sentry/types';
|
2 |
|
3 |
|
4 |
|
5 | export declare class Session implements SessionInterface {
|
6 | userAgent?: string;
|
7 | errors: number;
|
8 | release?: string;
|
9 | sid: string;
|
10 | did?: string;
|
11 | timestamp: number;
|
12 | started: number;
|
13 | duration?: number;
|
14 | status: SessionStatus;
|
15 | environment?: string;
|
16 | ipAddress?: string;
|
17 | init: boolean;
|
18 | ignoreDuration: boolean;
|
19 | constructor(context?: Omit<SessionContext, 'started' | 'status'>);
|
20 | /** JSDoc */
|
21 | update(context?: SessionContext): void;
|
22 | /** JSDoc */
|
23 | close(status?: Exclude<SessionStatus, SessionStatus.Ok>): void;
|
24 | /** JSDoc */
|
25 | toJSON(): {
|
26 | init: boolean;
|
27 | sid: string;
|
28 | did?: string;
|
29 | timestamp: string;
|
30 | started: string;
|
31 | duration?: number;
|
32 | status: SessionStatus;
|
33 | errors: number;
|
34 | attrs?: {
|
35 | release?: string;
|
36 | environment?: string;
|
37 | user_agent?: string;
|
38 | ip_address?: string;
|
39 | };
|
40 | };
|
41 | }
|
42 | declare type ReleaseHealthAttributes = {
|
43 | environment?: string;
|
44 | release: string;
|
45 | };
|
46 |
|
47 |
|
48 |
|
49 | export declare class SessionFlusher implements SessionFlusherLike {
|
50 | readonly flushTimeout: number;
|
51 | private _pendingAggregates;
|
52 | private _sessionAttrs;
|
53 | private _intervalId;
|
54 | private _isEnabled;
|
55 | private _transport;
|
56 | constructor(transport: Transport, attrs: ReleaseHealthAttributes);
|
57 | /** Sends session aggregates to Transport */
|
58 | sendSessionAggregates(sessionAggregates: SessionAggregates): void;
|
59 | /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSessions` */
|
60 | flush(): void;
|
61 | /** Massages the entries in `pendingAggregates` and returns aggregated sessions */
|
62 | getSessionAggregates(): SessionAggregates;
|
63 | /** JSDoc */
|
64 | close(): void;
|
65 | /**
|
66 | * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then
|
67 | * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to
|
68 | * `_incrementSessionStatusCount` along with the start date
|
69 | */
|
70 | incrementSessionStatusCount(): void;
|
71 | /**
|
72 | * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of
|
73 | * the session received
|
74 | */
|
75 | private _incrementSessionStatusCount;
|
76 | }
|
77 | export {};
|
78 |
|
\ | No newline at end of file |