@oxvo/browser 7.1.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.
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/dist/cjs/common/interaction.d.ts +37 -0
- package/dist/cjs/common/messages.gen.d.ts +587 -0
- package/dist/cjs/entry.js +10678 -0
- package/dist/cjs/entry.js.map +1 -0
- package/dist/cjs/index.js +10435 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/main/app/canvas.d.ts +37 -0
- package/dist/cjs/main/app/guards.d.ts +24 -0
- package/dist/cjs/main/app/index.d.ts +314 -0
- package/dist/cjs/main/app/logger.d.ts +17 -0
- package/dist/cjs/main/app/messages.gen.d.ts +83 -0
- package/dist/cjs/main/app/nodes/idSeq.d.ts +14 -0
- package/dist/cjs/main/app/nodes/index.d.ts +32 -0
- package/dist/cjs/main/app/nodes/maintainer.d.ts +28 -0
- package/dist/cjs/main/app/observer/cssInliner.d.ts +1 -0
- package/dist/cjs/main/app/observer/iframe_observer.d.ts +6 -0
- package/dist/cjs/main/app/observer/iframe_offsets.d.ts +8 -0
- package/dist/cjs/main/app/observer/observer.d.ts +52 -0
- package/dist/cjs/main/app/observer/shadow_root_observer.d.ts +4 -0
- package/dist/cjs/main/app/observer/top_observer.d.ts +52 -0
- package/dist/cjs/main/app/sanitizer.d.ts +53 -0
- package/dist/cjs/main/app/session.d.ts +58 -0
- package/dist/cjs/main/app/ticker.d.ts +18 -0
- package/dist/cjs/main/entry.d.ts +6 -0
- package/dist/cjs/main/index.d.ts +119 -0
- package/dist/cjs/main/modules/analytics/batcher.d.ts +45 -0
- package/dist/cjs/main/modules/analytics/constantProperties.d.ts +53 -0
- package/dist/cjs/main/modules/analytics/demo.d.ts +0 -0
- package/dist/cjs/main/modules/analytics/events.d.ts +37 -0
- package/dist/cjs/main/modules/analytics/index.d.ts +73 -0
- package/dist/cjs/main/modules/analytics/people.d.ts +56 -0
- package/dist/cjs/main/modules/analytics/types.d.ts +32 -0
- package/dist/cjs/main/modules/analytics/utils.d.ts +19 -0
- package/dist/cjs/main/modules/attributeSender.d.ts +22 -0
- package/dist/cjs/main/modules/axiosSpy.d.ts +54 -0
- package/dist/cjs/main/modules/conditionsManager.d.ts +89 -0
- package/dist/cjs/main/modules/connection.d.ts +2 -0
- package/dist/cjs/main/modules/console.d.ts +6 -0
- package/dist/cjs/main/modules/constructedStyleSheets.d.ts +4 -0
- package/dist/cjs/main/modules/cssrules.d.ts +18 -0
- package/dist/cjs/main/modules/exception.d.ts +16 -0
- package/dist/cjs/main/modules/focus.d.ts +2 -0
- package/dist/cjs/main/modules/fonts.d.ts +2 -0
- package/dist/cjs/main/modules/img.d.ts +2 -0
- package/dist/cjs/main/modules/input.d.ts +34 -0
- package/dist/cjs/main/modules/longAnimationTask.d.ts +25 -0
- package/dist/cjs/main/modules/markerWatcher.d.ts +25 -0
- package/dist/cjs/main/modules/mouse.d.ts +13 -0
- package/dist/cjs/main/modules/network.d.ts +32 -0
- package/dist/cjs/main/modules/performance.d.ts +7 -0
- package/dist/cjs/main/modules/scroll.d.ts +2 -0
- package/dist/cjs/main/modules/selection.d.ts +7 -0
- package/dist/cjs/main/modules/tabs.d.ts +2 -0
- package/dist/cjs/main/modules/timing.d.ts +9 -0
- package/dist/cjs/main/modules/viewport.d.ts +13 -0
- package/dist/cjs/main/modules/webAnimations.d.ts +9 -0
- package/dist/cjs/main/singleton.d.ts +102 -0
- package/dist/cjs/main/utils.d.ts +35 -0
- package/dist/lib/common/interaction.d.ts +37 -0
- package/dist/lib/common/messages.gen.d.ts +587 -0
- package/dist/lib/entry.js +10669 -0
- package/dist/lib/entry.js.map +1 -0
- package/dist/lib/index.js +10429 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/main/app/canvas.d.ts +37 -0
- package/dist/lib/main/app/guards.d.ts +24 -0
- package/dist/lib/main/app/index.d.ts +314 -0
- package/dist/lib/main/app/logger.d.ts +17 -0
- package/dist/lib/main/app/messages.gen.d.ts +83 -0
- package/dist/lib/main/app/nodes/idSeq.d.ts +14 -0
- package/dist/lib/main/app/nodes/index.d.ts +32 -0
- package/dist/lib/main/app/nodes/maintainer.d.ts +28 -0
- package/dist/lib/main/app/observer/cssInliner.d.ts +1 -0
- package/dist/lib/main/app/observer/iframe_observer.d.ts +6 -0
- package/dist/lib/main/app/observer/iframe_offsets.d.ts +8 -0
- package/dist/lib/main/app/observer/observer.d.ts +52 -0
- package/dist/lib/main/app/observer/shadow_root_observer.d.ts +4 -0
- package/dist/lib/main/app/observer/top_observer.d.ts +52 -0
- package/dist/lib/main/app/sanitizer.d.ts +53 -0
- package/dist/lib/main/app/session.d.ts +58 -0
- package/dist/lib/main/app/ticker.d.ts +18 -0
- package/dist/lib/main/entry.d.ts +6 -0
- package/dist/lib/main/index.d.ts +119 -0
- package/dist/lib/main/modules/analytics/batcher.d.ts +45 -0
- package/dist/lib/main/modules/analytics/constantProperties.d.ts +53 -0
- package/dist/lib/main/modules/analytics/demo.d.ts +0 -0
- package/dist/lib/main/modules/analytics/events.d.ts +37 -0
- package/dist/lib/main/modules/analytics/index.d.ts +73 -0
- package/dist/lib/main/modules/analytics/people.d.ts +56 -0
- package/dist/lib/main/modules/analytics/types.d.ts +32 -0
- package/dist/lib/main/modules/analytics/utils.d.ts +19 -0
- package/dist/lib/main/modules/attributeSender.d.ts +22 -0
- package/dist/lib/main/modules/axiosSpy.d.ts +54 -0
- package/dist/lib/main/modules/conditionsManager.d.ts +89 -0
- package/dist/lib/main/modules/connection.d.ts +2 -0
- package/dist/lib/main/modules/console.d.ts +6 -0
- package/dist/lib/main/modules/constructedStyleSheets.d.ts +4 -0
- package/dist/lib/main/modules/cssrules.d.ts +18 -0
- package/dist/lib/main/modules/exception.d.ts +16 -0
- package/dist/lib/main/modules/focus.d.ts +2 -0
- package/dist/lib/main/modules/fonts.d.ts +2 -0
- package/dist/lib/main/modules/img.d.ts +2 -0
- package/dist/lib/main/modules/input.d.ts +34 -0
- package/dist/lib/main/modules/longAnimationTask.d.ts +25 -0
- package/dist/lib/main/modules/markerWatcher.d.ts +25 -0
- package/dist/lib/main/modules/mouse.d.ts +13 -0
- package/dist/lib/main/modules/network.d.ts +32 -0
- package/dist/lib/main/modules/performance.d.ts +7 -0
- package/dist/lib/main/modules/scroll.d.ts +2 -0
- package/dist/lib/main/modules/selection.d.ts +7 -0
- package/dist/lib/main/modules/tabs.d.ts +2 -0
- package/dist/lib/main/modules/timing.d.ts +9 -0
- package/dist/lib/main/modules/viewport.d.ts +13 -0
- package/dist/lib/main/modules/webAnimations.d.ts +9 -0
- package/dist/lib/main/singleton.d.ts +102 -0
- package/dist/lib/main/utils.d.ts +35 -0
- package/dist/types/common/interaction.d.ts +37 -0
- package/dist/types/common/messages.gen.d.ts +587 -0
- package/dist/types/main/app/canvas.d.ts +37 -0
- package/dist/types/main/app/guards.d.ts +24 -0
- package/dist/types/main/app/index.d.ts +314 -0
- package/dist/types/main/app/logger.d.ts +17 -0
- package/dist/types/main/app/messages.gen.d.ts +83 -0
- package/dist/types/main/app/nodes/idSeq.d.ts +14 -0
- package/dist/types/main/app/nodes/index.d.ts +32 -0
- package/dist/types/main/app/nodes/maintainer.d.ts +28 -0
- package/dist/types/main/app/observer/cssInliner.d.ts +1 -0
- package/dist/types/main/app/observer/iframe_observer.d.ts +6 -0
- package/dist/types/main/app/observer/iframe_offsets.d.ts +8 -0
- package/dist/types/main/app/observer/observer.d.ts +52 -0
- package/dist/types/main/app/observer/shadow_root_observer.d.ts +4 -0
- package/dist/types/main/app/observer/top_observer.d.ts +52 -0
- package/dist/types/main/app/sanitizer.d.ts +53 -0
- package/dist/types/main/app/session.d.ts +58 -0
- package/dist/types/main/app/ticker.d.ts +18 -0
- package/dist/types/main/entry.d.ts +6 -0
- package/dist/types/main/index.d.ts +119 -0
- package/dist/types/main/modules/analytics/batcher.d.ts +45 -0
- package/dist/types/main/modules/analytics/constantProperties.d.ts +53 -0
- package/dist/types/main/modules/analytics/demo.d.ts +0 -0
- package/dist/types/main/modules/analytics/events.d.ts +37 -0
- package/dist/types/main/modules/analytics/index.d.ts +73 -0
- package/dist/types/main/modules/analytics/people.d.ts +56 -0
- package/dist/types/main/modules/analytics/types.d.ts +32 -0
- package/dist/types/main/modules/analytics/utils.d.ts +19 -0
- package/dist/types/main/modules/attributeSender.d.ts +22 -0
- package/dist/types/main/modules/axiosSpy.d.ts +54 -0
- package/dist/types/main/modules/conditionsManager.d.ts +89 -0
- package/dist/types/main/modules/connection.d.ts +2 -0
- package/dist/types/main/modules/console.d.ts +6 -0
- package/dist/types/main/modules/constructedStyleSheets.d.ts +4 -0
- package/dist/types/main/modules/cssrules.d.ts +18 -0
- package/dist/types/main/modules/exception.d.ts +16 -0
- package/dist/types/main/modules/focus.d.ts +2 -0
- package/dist/types/main/modules/fonts.d.ts +2 -0
- package/dist/types/main/modules/img.d.ts +2 -0
- package/dist/types/main/modules/input.d.ts +34 -0
- package/dist/types/main/modules/longAnimationTask.d.ts +25 -0
- package/dist/types/main/modules/markerWatcher.d.ts +25 -0
- package/dist/types/main/modules/mouse.d.ts +13 -0
- package/dist/types/main/modules/network.d.ts +32 -0
- package/dist/types/main/modules/performance.d.ts +7 -0
- package/dist/types/main/modules/scroll.d.ts +2 -0
- package/dist/types/main/modules/selection.d.ts +7 -0
- package/dist/types/main/modules/tabs.d.ts +2 -0
- package/dist/types/main/modules/timing.d.ts +9 -0
- package/dist/types/main/modules/viewport.d.ts +13 -0
- package/dist/types/main/modules/webAnimations.d.ts +9 -0
- package/dist/types/main/singleton.d.ts +102 -0
- package/dist/types/main/utils.d.ts +35 -0
- package/package.json +87 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import Message, { CustomEvent, JSException, MouseClick, NetworkRequest, SetPageLocation } from '../../common/messages.gen.js';
|
|
2
|
+
import App, { StartOptions } from '../app/index.js';
|
|
3
|
+
export interface IFeatureFlag {
|
|
4
|
+
key: string;
|
|
5
|
+
is_persist: boolean;
|
|
6
|
+
value: string | boolean;
|
|
7
|
+
payload: string;
|
|
8
|
+
}
|
|
9
|
+
interface Filter {
|
|
10
|
+
filters: {
|
|
11
|
+
operator: string;
|
|
12
|
+
value: string[];
|
|
13
|
+
type: string;
|
|
14
|
+
source?: string;
|
|
15
|
+
}[];
|
|
16
|
+
operator: string;
|
|
17
|
+
value: string[];
|
|
18
|
+
type: string;
|
|
19
|
+
source?: string;
|
|
20
|
+
}
|
|
21
|
+
export default class ConditionsManager {
|
|
22
|
+
private readonly app;
|
|
23
|
+
private readonly startParams;
|
|
24
|
+
conditions: Condition[];
|
|
25
|
+
hasStarted: boolean;
|
|
26
|
+
constructor(app: App, startParams: StartOptions);
|
|
27
|
+
setConditions(conditions: Condition[]): void;
|
|
28
|
+
fetchConditions(projectId: string, token: string): Promise<void>;
|
|
29
|
+
createConditionFromFilter: (filter: Filter) => Condition | undefined;
|
|
30
|
+
trigger(conditionName: string): void;
|
|
31
|
+
processMessage(message: Message): void;
|
|
32
|
+
processFlags(flag: IFeatureFlag[]): void;
|
|
33
|
+
durationInt: ReturnType<typeof setInterval> | null;
|
|
34
|
+
processDuration(durationMs: number, condName: string): void;
|
|
35
|
+
networkRequest(message: NetworkRequest): void;
|
|
36
|
+
customEvent(message: CustomEvent): void;
|
|
37
|
+
clickEvent(message: MouseClick): void;
|
|
38
|
+
pageLocationEvent(message: SetPageLocation): void;
|
|
39
|
+
jsExceptionEvent(message: JSException): void;
|
|
40
|
+
}
|
|
41
|
+
type CommonCondition = {
|
|
42
|
+
type: 'visited_url' | 'click' | 'custom_event';
|
|
43
|
+
operator: keyof typeof operators;
|
|
44
|
+
value: string[];
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
47
|
+
type ExceptionCondition = {
|
|
48
|
+
type: 'exception';
|
|
49
|
+
operator: 'contains' | 'startsWith' | 'endsWith';
|
|
50
|
+
value: string[];
|
|
51
|
+
name: string;
|
|
52
|
+
};
|
|
53
|
+
type FeatureFlagCondition = {
|
|
54
|
+
type: 'feature_flag';
|
|
55
|
+
operator: 'is';
|
|
56
|
+
value: string[];
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
type SessionDurationCondition = {
|
|
60
|
+
type: 'session_duration';
|
|
61
|
+
value: number[];
|
|
62
|
+
name: string;
|
|
63
|
+
};
|
|
64
|
+
type SubCondition = {
|
|
65
|
+
type: 'network_request';
|
|
66
|
+
key: 'url' | 'status' | 'method' | 'duration';
|
|
67
|
+
operator: keyof typeof operators;
|
|
68
|
+
value: string[];
|
|
69
|
+
};
|
|
70
|
+
type NetworkRequestCondition = {
|
|
71
|
+
type: 'network_request';
|
|
72
|
+
subConditions: SubCondition[];
|
|
73
|
+
name: string;
|
|
74
|
+
};
|
|
75
|
+
type Condition = CommonCondition | ExceptionCondition | FeatureFlagCondition | SessionDurationCondition | NetworkRequestCondition;
|
|
76
|
+
declare const operators: {
|
|
77
|
+
is: (val: string, target: string[]) => boolean;
|
|
78
|
+
isAny: () => boolean;
|
|
79
|
+
isNot: (val: string, target: string[]) => boolean;
|
|
80
|
+
contains: (val: string, target: string[]) => boolean;
|
|
81
|
+
notContains: (val: string, target: string[]) => boolean;
|
|
82
|
+
startsWith: (val: string, target: string[]) => boolean;
|
|
83
|
+
endsWith: (val: string, target: string[]) => boolean;
|
|
84
|
+
greaterThan: (val: number, target: number) => boolean;
|
|
85
|
+
greaterOrEqual: (val: number, target: number) => boolean;
|
|
86
|
+
lessOrEqual: (val: number, target: number) => boolean;
|
|
87
|
+
lessThan: (val: number, target: number) => boolean;
|
|
88
|
+
};
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
export interface CssRulesOptions {
|
|
3
|
+
/** turn this on if you have issues with emotionjs created styles */
|
|
4
|
+
scanInMemoryCSS?: boolean;
|
|
5
|
+
/** how often to scan tracked stylesheets (with "empty" rules) */
|
|
6
|
+
checkCssInterval?: number;
|
|
7
|
+
/**
|
|
8
|
+
Useful for cases where you expect limited amount of mutations
|
|
9
|
+
|
|
10
|
+
i.e when sheets are hydrated on client after initial render.
|
|
11
|
+
|
|
12
|
+
if you want to observe for x seconds, do (x*1000)/checkCssInterval = checkLimit
|
|
13
|
+
|
|
14
|
+
applied to each stylesheet individually.
|
|
15
|
+
*/
|
|
16
|
+
checkLimit?: number;
|
|
17
|
+
}
|
|
18
|
+
export default function (app: App, opts: CssRulesOptions): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
import type Message from '../app/messages.gen.js';
|
|
3
|
+
export interface Options {
|
|
4
|
+
trackErrors: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface StackFrame {
|
|
7
|
+
columnNumber?: number;
|
|
8
|
+
lineNumber?: number;
|
|
9
|
+
fileName?: string;
|
|
10
|
+
functionName?: string;
|
|
11
|
+
source?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function getExceptionMessage(error: Error, fallbackStack: Array<StackFrame>, metadata?: Record<string, any>): Message;
|
|
14
|
+
export declare function getExceptionMessageFromEvent(e: ErrorEvent | PromiseRejectionEvent, context?: typeof globalThis, metadata?: Record<string, any>): Message | null;
|
|
15
|
+
export default function (app: App, opts: Partial<Options>): void;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
type TextFieldElement = HTMLInputElement | HTMLTextAreaElement;
|
|
3
|
+
export declare function getInputLabel(node: TextFieldElement): string;
|
|
4
|
+
export declare const InputMode: {
|
|
5
|
+
readonly Plain: 0;
|
|
6
|
+
readonly Obscured: 1;
|
|
7
|
+
readonly Hidden: 2;
|
|
8
|
+
};
|
|
9
|
+
export type InputModeT = (typeof InputMode)[keyof typeof InputMode];
|
|
10
|
+
export interface Options {
|
|
11
|
+
/**
|
|
12
|
+
* Sanitize numbers from DOM input nodes.
|
|
13
|
+
*
|
|
14
|
+
* (for plain text nodes, look for maskTextNumbers)
|
|
15
|
+
* */
|
|
16
|
+
maskInputNumbers: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Sanitize emails from DOM input nodes.
|
|
19
|
+
*
|
|
20
|
+
* (for plain text nodes, look for maskTextEmails)
|
|
21
|
+
* */
|
|
22
|
+
maskInputEmails: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Sanitize dates from DOM input nodes.
|
|
25
|
+
* */
|
|
26
|
+
maskInputDates: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Default input mode for all input nodes. Higher security level
|
|
29
|
+
* will override other settings.
|
|
30
|
+
* */
|
|
31
|
+
inputPrivacyMode: InputModeT;
|
|
32
|
+
}
|
|
33
|
+
export default function (app: App, opts: Partial<Options>): void;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
export interface LongAnimationTask extends PerformanceEntry {
|
|
3
|
+
name: string;
|
|
4
|
+
duration: number;
|
|
5
|
+
blockingDuration: number;
|
|
6
|
+
firstUIEventTimestamp: number;
|
|
7
|
+
startTime: number;
|
|
8
|
+
scripts: [
|
|
9
|
+
{
|
|
10
|
+
name: string;
|
|
11
|
+
duration: number;
|
|
12
|
+
invoker: string;
|
|
13
|
+
invokerType: string;
|
|
14
|
+
pauseDuration: number;
|
|
15
|
+
sourceURL: string;
|
|
16
|
+
sourceFunctionName: string;
|
|
17
|
+
sourceCharPosition: number;
|
|
18
|
+
forcedStyleAndLayoutDuration: number;
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
export interface LATOptions {
|
|
23
|
+
longTasks: boolean;
|
|
24
|
+
}
|
|
25
|
+
export default function (app: App, opts: Partial<LATOptions>): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const WATCHED_MARKERS_KEY = "__or__watched_markers__";
|
|
2
|
+
declare class MarkerWatcher {
|
|
3
|
+
interval: ReturnType<typeof setInterval> | null;
|
|
4
|
+
tags: {
|
|
5
|
+
id: number;
|
|
6
|
+
selector: string;
|
|
7
|
+
}[];
|
|
8
|
+
observer: IntersectionObserver;
|
|
9
|
+
private readonly sessionStorage;
|
|
10
|
+
private readonly errLog;
|
|
11
|
+
private readonly onMarkerHit;
|
|
12
|
+
constructor(params: {
|
|
13
|
+
sessionStorage: Storage;
|
|
14
|
+
errLog: (args: any[]) => void;
|
|
15
|
+
onMarkerHit: (markerId: number) => void;
|
|
16
|
+
});
|
|
17
|
+
fetchTags(ingest: string, token: string): Promise<void>;
|
|
18
|
+
setTags(tags: {
|
|
19
|
+
id: number;
|
|
20
|
+
selector: string;
|
|
21
|
+
}[]): void;
|
|
22
|
+
onMarkerRendered(markerId: number): void;
|
|
23
|
+
clear(): void;
|
|
24
|
+
}
|
|
25
|
+
export default MarkerWatcher;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
export interface MouseHandlerOptions {
|
|
3
|
+
disableClickmaps?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* how many ticks to wait before capturing mouse position
|
|
6
|
+
* (can affect performance)
|
|
7
|
+
* 1 tick = 30ms
|
|
8
|
+
* default 7 = 210ms
|
|
9
|
+
* */
|
|
10
|
+
trackingOffset?: number;
|
|
11
|
+
}
|
|
12
|
+
export default function (app: App, options?: MouseHandlerOptions): void;
|
|
13
|
+
export declare function getCSSPath(el: any): string | false;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
import type { AxiosInstance } from './axiosSpy.js';
|
|
3
|
+
interface RequestData {
|
|
4
|
+
body: string | null;
|
|
5
|
+
headers: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
interface ResponseData {
|
|
8
|
+
body: any;
|
|
9
|
+
headers: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
export interface RequestResponseData {
|
|
12
|
+
readonly status: number;
|
|
13
|
+
readonly method: string;
|
|
14
|
+
url: string;
|
|
15
|
+
request: RequestData;
|
|
16
|
+
response: ResponseData;
|
|
17
|
+
}
|
|
18
|
+
type Sanitizer = (data: RequestResponseData) => RequestResponseData | null;
|
|
19
|
+
export interface Options {
|
|
20
|
+
sessionTokenHeader: string | boolean;
|
|
21
|
+
errorsOnly: boolean;
|
|
22
|
+
ignoreHeaders: Array<string> | boolean;
|
|
23
|
+
captureBodies: boolean;
|
|
24
|
+
captureInIframes: boolean;
|
|
25
|
+
sanitizer?: Sanitizer;
|
|
26
|
+
axiosInstances?: Array<AxiosInstance>;
|
|
27
|
+
useProxy?: boolean;
|
|
28
|
+
tokenUrlMatcher?: (url: string) => boolean;
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
}
|
|
31
|
+
export default function (app: App, opts?: Partial<Options>): void;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
declare function selection(app: App): void;
|
|
3
|
+
export default selection;
|
|
4
|
+
/** TODO: research how to get all in-between nodes inside selection range
|
|
5
|
+
* including nodes between anchor and focus nodes and their children
|
|
6
|
+
* without recursively searching the dom tree
|
|
7
|
+
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
export interface Options {
|
|
3
|
+
trackResourceTimings: boolean;
|
|
4
|
+
capturePageLoadTimings: boolean;
|
|
5
|
+
capturePageRenderTimings: boolean;
|
|
6
|
+
excludedResourceUrls?: Array<string>;
|
|
7
|
+
resourceNameSanitizer?: (url: string) => string;
|
|
8
|
+
}
|
|
9
|
+
export default function (app: App, opts: Partial<Options>): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
export interface Options {
|
|
3
|
+
urlSanitizer?: (url: string) => string;
|
|
4
|
+
titleSanitizer?: (title: string) => string;
|
|
5
|
+
/** if present, tracker will remove hash symbol to present url as regular router url on replay level;
|
|
6
|
+
*
|
|
7
|
+
* applied BEFORE sanitizers.
|
|
8
|
+
*
|
|
9
|
+
* @example 'site.com/#/path' -> 'site.com/path'
|
|
10
|
+
*/
|
|
11
|
+
replaceHashSymbol?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export default function (app: App, options?: Options): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* this will only work for custom elements by default (because of ionic)
|
|
4
|
+
*/
|
|
5
|
+
export interface Options {
|
|
6
|
+
allElements?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function webAnimations(app: App, options?: Options): void;
|
|
9
|
+
export default webAnimations;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import Tracker, { App, Options } from './index.js';
|
|
2
|
+
import type { StartOptions, StartPromiseReturn } from './app/index.js';
|
|
3
|
+
declare class BrowserSingleton {
|
|
4
|
+
private instance;
|
|
5
|
+
private isConfigured;
|
|
6
|
+
/**
|
|
7
|
+
* Call this method once to create browser SDK configuration
|
|
8
|
+
* @param options {Object} Check available options:
|
|
9
|
+
* https://docs.oxvo.com/en/sdk/constructor/#initialization-options
|
|
10
|
+
*/
|
|
11
|
+
configure(options: Partial<Options>): void;
|
|
12
|
+
get options(): Partial<Options> | null;
|
|
13
|
+
start(startOpts?: Partial<StartOptions>): Promise<StartPromiseReturn>;
|
|
14
|
+
/**
|
|
15
|
+
* Stop the session and return sessionHash
|
|
16
|
+
* (which can be used to stitch sessions together)
|
|
17
|
+
* */
|
|
18
|
+
stop(): string | undefined;
|
|
19
|
+
identify(id: string, properties?: Record<string, any>): void;
|
|
20
|
+
get analytics(): import("./entry.js").Analytics | null;
|
|
21
|
+
/**
|
|
22
|
+
* Set metadata for the current session
|
|
23
|
+
*
|
|
24
|
+
* Keys must be configured in project settings (metadata slots)
|
|
25
|
+
*
|
|
26
|
+
* Read more: https://docs.oxvo.com/en/installation/metadata/
|
|
27
|
+
*/
|
|
28
|
+
setMetadata(key: string, value: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Returns full URL for the current session
|
|
31
|
+
*/
|
|
32
|
+
getSessionLink(options?: {
|
|
33
|
+
withCurrentTime?: boolean;
|
|
34
|
+
}): string | undefined;
|
|
35
|
+
getSessionKey(): string | null | undefined;
|
|
36
|
+
getSessionSecret(): string | null | undefined;
|
|
37
|
+
track(key: string, payload?: any, issue?: boolean): void;
|
|
38
|
+
report(key: string, payload?: any): void;
|
|
39
|
+
handleError(e: Error | ErrorEvent | PromiseRejectionEvent, metadata?: Record<string, any>): void;
|
|
40
|
+
restartCanvasTracking(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Set the anonymous user ID
|
|
43
|
+
*/
|
|
44
|
+
setVisitorID(id: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Check if the browser SDK is active
|
|
47
|
+
*/
|
|
48
|
+
isActive(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Get the underlying browser SDK instance
|
|
51
|
+
*
|
|
52
|
+
* Use when you need access to methods not exposed by the singleton
|
|
53
|
+
*/
|
|
54
|
+
getInstance(): Tracker | null;
|
|
55
|
+
/**
|
|
56
|
+
* start buffering messages without starting the actual session, which gives user 30 seconds to "activate" and record
|
|
57
|
+
* session by calling start() on conditional trigger and we will then send buffered batch, so it won't get lost
|
|
58
|
+
* */
|
|
59
|
+
coldStart(startOpts?: Partial<StartOptions>, conditional?: boolean): Promise<never> | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a named hook that expects event name, data string and msg direction (up/down),
|
|
62
|
+
* it will skip any message bigger than 5 mb or event name bigger than 255 symbols
|
|
63
|
+
* msg direction is "down" (incoming) by default
|
|
64
|
+
*
|
|
65
|
+
* @returns {(msgType: string, data: string, dir: 'up' | 'down') => void}
|
|
66
|
+
* */
|
|
67
|
+
trackWs(channelName: string): ((msgType: string, data: string, dir: 'up' | 'down') => void) | undefined;
|
|
68
|
+
private ensureConfigured;
|
|
69
|
+
use<T>(fn: (app: App | null, options?: Partial<Options>) => T): T;
|
|
70
|
+
/**
|
|
71
|
+
* Starts offline session recording. Keep in mind that only user device time will be used for timestamps.
|
|
72
|
+
* (no backend delay sync)
|
|
73
|
+
*
|
|
74
|
+
* @param {Object} startOpts - options for session start, same as .start()
|
|
75
|
+
* @param {Function} onSessionSent - callback that will be called once session is fully sent
|
|
76
|
+
* @returns methods to manipulate buffer:
|
|
77
|
+
*
|
|
78
|
+
* saveBuffer - to save it in localStorage
|
|
79
|
+
*
|
|
80
|
+
* getBuffer - returns current buffer
|
|
81
|
+
*
|
|
82
|
+
* setBuffer - replaces current buffer with given
|
|
83
|
+
* */
|
|
84
|
+
startOfflineRecording(...args: Parameters<Tracker['startOfflineRecording']>): Promise<never> | {
|
|
85
|
+
saveBuffer: () => void;
|
|
86
|
+
getBuffer: () => import("./app/messages.gen.js").default[];
|
|
87
|
+
setBuffer: (buffer: import("./app/messages.gen.js").default[]) => void;
|
|
88
|
+
} | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Uploads the stored session buffer to backend
|
|
91
|
+
* @returns promise that resolves once messages are loaded, it has to be awaited
|
|
92
|
+
* so the session can be uploaded properly
|
|
93
|
+
* @resolve - if messages were loaded into service worker successfully
|
|
94
|
+
* @reject {string} - error message
|
|
95
|
+
* */
|
|
96
|
+
uploadOfflineRecording(): Promise<void> | undefined;
|
|
97
|
+
forceFlushBatch(): void;
|
|
98
|
+
getSessionMeta(): import("./app/session.js").SessionInfo | null;
|
|
99
|
+
getTabId(): string | null;
|
|
100
|
+
}
|
|
101
|
+
declare const browser: BrowserSingleton;
|
|
102
|
+
export default browser;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const IN_BROWSER: boolean;
|
|
2
|
+
export declare const IS_FIREFOX: false | RegExpMatchArray | null;
|
|
3
|
+
export declare const MAX_STR_LEN = 100000;
|
|
4
|
+
export declare function adjustTimeOrigin(): void;
|
|
5
|
+
export declare function getTimeOrigin(): number;
|
|
6
|
+
export declare const now: () => number;
|
|
7
|
+
export declare const stars: (str: string) => string;
|
|
8
|
+
export declare function normSpaces(str: string): string;
|
|
9
|
+
export declare function isURL(s: string): boolean;
|
|
10
|
+
export declare const DOCS_HOST = "https://docs.oxvo.com";
|
|
11
|
+
export declare function isLoopbackHost(hostname: string): boolean;
|
|
12
|
+
export declare function canUseTrackerOrigin(protocol: string, hostname: string, devAllowInsecure?: boolean): boolean;
|
|
13
|
+
export declare function deprecationWarn(nameOfFeature: string, useInstead: string, docsPath?: string): void;
|
|
14
|
+
export declare function getLabelAttribute(e: Element): string | null;
|
|
15
|
+
export declare function hasOxvoSessionsAttribute(e: Element, attr: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* checks if iframe is accessible
|
|
18
|
+
**/
|
|
19
|
+
export declare function canAccessIframe(iframe: HTMLIFrameElement): boolean;
|
|
20
|
+
export declare function canAccessTarget(target: EventTarget): boolean;
|
|
21
|
+
export declare function generateRandomId(len?: number): string;
|
|
22
|
+
export declare function inIframe(): boolean | null;
|
|
23
|
+
/**
|
|
24
|
+
* Because angular devs decided that its a good idea to override a browser apis
|
|
25
|
+
* we need to use this to achieve safe behavior
|
|
26
|
+
* */
|
|
27
|
+
export declare function ngSafeBrowserMethod(method: string): string;
|
|
28
|
+
export declare function createMutationObserver(cb: MutationCallback, forceNgOff?: boolean): MutationObserver;
|
|
29
|
+
export declare function createEventListener(target: EventTarget, event: string, cb: EventListenerOrEventListenerObject, capture?: boolean, forceNgOff?: boolean): void;
|
|
30
|
+
export declare function deleteEventListener(target: EventTarget, event: string, cb: EventListenerOrEventListenerObject, capture?: boolean, forceNgOff?: boolean): void;
|
|
31
|
+
export declare function requestIdleCb(callback: () => void): void;
|
|
32
|
+
export declare function simpleMerge<T>(defaultObj: T, givenObj: Partial<T>): T;
|
|
33
|
+
export declare function throttleWithTrailing<K, Args extends any[]>(fn: (key: K, ...args: Args) => void, interval: number): ((key: K, ...args: Args) => void) & {
|
|
34
|
+
clear: () => void;
|
|
35
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oxvo/browser",
|
|
3
|
+
"description": "OxvoSessions Browser SDK for session replay and frontend observability.",
|
|
4
|
+
"version": "7.1.0",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"browser-sdk",
|
|
7
|
+
"session-replay",
|
|
8
|
+
"frontend-monitoring",
|
|
9
|
+
"oxvosessions"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"require": "./dist/cjs/entry.js",
|
|
16
|
+
"import": "./dist/lib/entry.js",
|
|
17
|
+
"types": "./dist/lib/main/entry.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./class": {
|
|
20
|
+
"require": "./dist/cjs/index.js",
|
|
21
|
+
"import": "./dist/lib/index.js",
|
|
22
|
+
"types": "./dist/lib/main/index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./cjs": {
|
|
25
|
+
"require": "./dist/cjs/entry.js",
|
|
26
|
+
"types": "./dist/cjs/main/entry.d.ts"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist/lib/**/*",
|
|
31
|
+
"dist/cjs/**/*",
|
|
32
|
+
"dist/types/**/*"
|
|
33
|
+
],
|
|
34
|
+
"main": "./dist/cjs/entry.js",
|
|
35
|
+
"module": "./dist/lib/entry.js",
|
|
36
|
+
"types": "./dist/lib/main/entry.d.ts",
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"lint": "eslint src --ext .ts,.js --fix --quiet",
|
|
42
|
+
"clean": "rm -Rf build && rm -Rf dist",
|
|
43
|
+
"build:common": "tsc -b src/common",
|
|
44
|
+
"compile": "tsc --project src/main/tsconfig.json",
|
|
45
|
+
"create-types": "mkdir dist/lib/ dist/cjs && cp -r dist/types/* dist/lib/ && cp -r dist/types/* dist/cjs/",
|
|
46
|
+
"build": "bun run clean && bun compile && bun create-types && rollup --config rollup.config.js",
|
|
47
|
+
"test": "jest --coverage=false",
|
|
48
|
+
"test:ci": "jest --coverage=true",
|
|
49
|
+
"postversion": "bun run build",
|
|
50
|
+
"prepublishOnly": "bun run test && bun run build"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@oxvo/network-instrumentation": "file:../../networkProxy",
|
|
54
|
+
"@babel/core": "^7.28.5",
|
|
55
|
+
"@jest/globals": "^29.7.0",
|
|
56
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
57
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
58
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
59
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
60
|
+
"@rollup/plugin-terser": "0.4.4",
|
|
61
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^8.45.0",
|
|
63
|
+
"@typescript-eslint/parser": "^8.45.0",
|
|
64
|
+
"eslint": "^9.37.0",
|
|
65
|
+
"eslint-config-prettier": "^9.1.0",
|
|
66
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
67
|
+
"jest": "^30.2.0",
|
|
68
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
69
|
+
"prettier": "^3.7.4",
|
|
70
|
+
"replace-in-files": "^2.0.3",
|
|
71
|
+
"rollup": "^4.55.1",
|
|
72
|
+
"semver": "^6.3.0",
|
|
73
|
+
"ts-jest": "^29.4.6",
|
|
74
|
+
"tslib": "^2.8.1",
|
|
75
|
+
"typescript": "^5.9.3"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"error-stack-parser": "^2.1.4",
|
|
79
|
+
"error-stack-parser-es": "^0.1.5",
|
|
80
|
+
"fflate": "^0.8.2",
|
|
81
|
+
"web-vitals": "^5.1.0"
|
|
82
|
+
},
|
|
83
|
+
"engines": {
|
|
84
|
+
"node": ">=14.0"
|
|
85
|
+
},
|
|
86
|
+
"packageManager": "bun@1.2.7"
|
|
87
|
+
}
|