@openreplay/tracker 15.0.0 → 15.0.2
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/cjs/index.js +9058 -68
- package/dist/cjs/index.js.map +1 -1
- package/dist/lib/index.js +4 -4
- package/dist/lib/index.js.map +1 -1
- package/dist/types/common/interaction.d.ts +37 -0
- package/dist/types/common/messages.gen.d.ts +567 -0
- package/dist/types/main/app/canvas.d.ts +28 -0
- package/dist/types/main/app/guards.d.ts +22 -0
- package/dist/types/main/app/index.d.ts +322 -0
- package/dist/types/main/app/logger.d.ts +17 -0
- package/dist/types/main/app/messages.gen.d.ts +81 -0
- package/dist/types/main/app/nodes/index.d.ts +31 -0
- package/dist/types/main/app/nodes/maintainer.d.ts +28 -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 +29 -0
- package/dist/types/main/app/observer/shadow_root_observer.d.ts +4 -0
- package/dist/types/main/app/observer/top_observer.d.ts +31 -0
- package/dist/types/main/app/sanitizer.d.ts +48 -0
- package/dist/types/main/app/session.d.ts +57 -0
- package/dist/types/main/app/ticker.d.ts +18 -0
- package/dist/types/main/index.d.ts +111 -0
- package/dist/types/main/modules/attributeSender.d.ts +23 -0
- package/dist/types/main/modules/axiosSpy.d.ts +54 -0
- package/dist/types/main/modules/conditionsManager.d.ts +84 -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 +2 -0
- package/dist/types/main/modules/exception.d.ts +16 -0
- package/dist/types/main/modules/featureFlags.d.ts +25 -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/mouse.d.ts +31 -0
- package/dist/types/main/modules/network.d.ts +31 -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/tagWatcher.d.ts +25 -0
- package/dist/types/main/modules/timing.d.ts +8 -0
- package/dist/types/main/modules/userTesting/SignalManager.d.ts +29 -0
- package/dist/types/main/modules/userTesting/dnd.d.ts +1 -0
- package/dist/types/main/modules/userTesting/index.d.ts +45 -0
- package/dist/types/main/modules/userTesting/recorder.d.ts +24 -0
- package/dist/types/main/modules/userTesting/styles.d.ts +277 -0
- package/dist/types/main/modules/userTesting/utils.d.ts +9 -0
- package/dist/types/main/modules/viewport.d.ts +2 -0
- package/dist/types/main/utils.d.ts +30 -0
- package/package.json +9 -5
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import App from './index.js';
|
|
2
|
+
type Callback = () => void;
|
|
3
|
+
export default class Ticker {
|
|
4
|
+
private readonly app;
|
|
5
|
+
private timer;
|
|
6
|
+
private readonly callbacks;
|
|
7
|
+
constructor(app: App);
|
|
8
|
+
/**
|
|
9
|
+
* @param {Callback} callback - repeated cb
|
|
10
|
+
* @param {number} n - number of turn skips; ticker have a 30 ms cycle
|
|
11
|
+
* @param {boolean} useSafe - using safe wrapper to check if app is active
|
|
12
|
+
* @param {object} thisArg - link to <this>
|
|
13
|
+
* */
|
|
14
|
+
attach(callback: Callback, n?: number, useSafe?: boolean, thisArg?: any): void;
|
|
15
|
+
start(): void;
|
|
16
|
+
stop(): void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import App from './app/index.js';
|
|
2
|
+
export { default as App } from './app/index.js';
|
|
3
|
+
import * as _Messages from './app/messages.gen.js';
|
|
4
|
+
export declare const Messages: typeof _Messages;
|
|
5
|
+
export { SanitizeLevel } from './app/sanitizer.js';
|
|
6
|
+
import FeatureFlags, { IFeatureFlag } from './modules/featureFlags.js';
|
|
7
|
+
import type { Options as AppOptions } from './app/index.js';
|
|
8
|
+
import type { Options as ConsoleOptions } from './modules/console.js';
|
|
9
|
+
import type { Options as ExceptionOptions } from './modules/exception.js';
|
|
10
|
+
import type { Options as InputOptions } from './modules/input.js';
|
|
11
|
+
import type { Options as PerformanceOptions } from './modules/performance.js';
|
|
12
|
+
import type { Options as TimingOptions } from './modules/timing.js';
|
|
13
|
+
import type { Options as NetworkOptions } from './modules/network.js';
|
|
14
|
+
import type { MouseHandlerOptions } from './modules/mouse.js';
|
|
15
|
+
import type { SessionInfo } from './app/session.js';
|
|
16
|
+
import type { StartOptions } from './app/index.js';
|
|
17
|
+
import type { StartPromiseReturn } from './app/index.js';
|
|
18
|
+
export type Options = Partial<AppOptions & ConsoleOptions & ExceptionOptions & InputOptions & PerformanceOptions & TimingOptions> & {
|
|
19
|
+
projectID?: number;
|
|
20
|
+
projectKey: string;
|
|
21
|
+
sessionToken?: string;
|
|
22
|
+
respectDoNotTrack?: boolean;
|
|
23
|
+
autoResetOnWindowOpen?: boolean;
|
|
24
|
+
resetTabOnWindowOpen?: boolean;
|
|
25
|
+
network?: Partial<NetworkOptions>;
|
|
26
|
+
mouse?: Partial<MouseHandlerOptions>;
|
|
27
|
+
flags?: {
|
|
28
|
+
onFlagsLoad?: (flags: IFeatureFlag[]) => void;
|
|
29
|
+
};
|
|
30
|
+
__DISABLE_SECURE_MODE?: boolean;
|
|
31
|
+
};
|
|
32
|
+
export default class API {
|
|
33
|
+
private readonly options;
|
|
34
|
+
featureFlags: FeatureFlags;
|
|
35
|
+
private readonly app;
|
|
36
|
+
private readonly crossdomainMode;
|
|
37
|
+
constructor(options: Options);
|
|
38
|
+
checkDoNotTrack: () => boolean | undefined;
|
|
39
|
+
signalStartIssue: (reason: string, missingApi: string[]) => void;
|
|
40
|
+
isFlagEnabled(flagName: string): boolean;
|
|
41
|
+
onFlagsLoad(callback: (flags: IFeatureFlag[]) => void): void;
|
|
42
|
+
clearPersistFlags(): void;
|
|
43
|
+
reloadFlags(): Promise<void> | undefined;
|
|
44
|
+
getFeatureFlag(flagName: string): IFeatureFlag | undefined;
|
|
45
|
+
getAllFeatureFlags(): IFeatureFlag[] | undefined;
|
|
46
|
+
restartCanvasTracking: () => void;
|
|
47
|
+
use<T>(fn: (app: App | null, options?: Options) => T): T;
|
|
48
|
+
isActive(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Creates a named hook that expects event name, data string and msg direction (up/down),
|
|
51
|
+
* it will skip any message bigger than 5 mb or event name bigger than 255 symbols
|
|
52
|
+
* msg direction is "down" (incoming) by default
|
|
53
|
+
*
|
|
54
|
+
* @returns {(msgType: string, data: string, dir: 'up' | 'down') => void}
|
|
55
|
+
* */
|
|
56
|
+
trackWs(channelName: string): ((msgType: string, data: string, dir: "up" | "down") => void) | undefined;
|
|
57
|
+
start(startOpts?: Partial<StartOptions>): Promise<StartPromiseReturn>;
|
|
58
|
+
browserEnvCheck(): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* start buffering messages without starting the actual session, which gives user 30 seconds to "activate" and record
|
|
61
|
+
* session by calling start() on conditional trigger and we will then send buffered batch, so it won't get lost
|
|
62
|
+
* */
|
|
63
|
+
coldStart(startOpts?: Partial<StartOptions>, conditional?: boolean): Promise<never> | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Starts offline session recording. Keep in mind that only user device time will be used for timestamps.
|
|
66
|
+
* (no backend delay sync)
|
|
67
|
+
*
|
|
68
|
+
* @param {Object} startOpts - options for session start, same as .start()
|
|
69
|
+
* @param {Function} onSessionSent - callback that will be called once session is fully sent
|
|
70
|
+
* @returns methods to manipulate buffer:
|
|
71
|
+
*
|
|
72
|
+
* saveBuffer - to save it in localStorage
|
|
73
|
+
*
|
|
74
|
+
* getBuffer - returns current buffer
|
|
75
|
+
*
|
|
76
|
+
* setBuffer - replaces current buffer with given
|
|
77
|
+
* */
|
|
78
|
+
startOfflineRecording(startOpts: Partial<StartOptions>, onSessionSent: () => void): Promise<never> | {
|
|
79
|
+
saveBuffer: () => void;
|
|
80
|
+
getBuffer: () => _Messages.default[];
|
|
81
|
+
setBuffer: (buffer: _Messages.default[]) => void;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Uploads the stored session buffer to backend
|
|
85
|
+
* @returns promise that resolves once messages are loaded, it has to be awaited
|
|
86
|
+
* so the session can be uploaded properly
|
|
87
|
+
* @resolve - if messages were loaded into service worker successfully
|
|
88
|
+
* @reject {string} - error message
|
|
89
|
+
* */
|
|
90
|
+
uploadOfflineRecording(): Promise<void> | undefined;
|
|
91
|
+
stop(): string | undefined;
|
|
92
|
+
forceFlushBatch(): void;
|
|
93
|
+
getSessionToken(): string | null | undefined;
|
|
94
|
+
getSessionInfo(): SessionInfo | null;
|
|
95
|
+
getSessionID(): string | null | undefined;
|
|
96
|
+
getTabId(): string | null;
|
|
97
|
+
getUxId(): number | null;
|
|
98
|
+
sessionID(): string | null | undefined;
|
|
99
|
+
getSessionURL(options?: {
|
|
100
|
+
withCurrentTime?: boolean;
|
|
101
|
+
}): string | undefined;
|
|
102
|
+
setUserID(id: string): void;
|
|
103
|
+
userID(id: string): void;
|
|
104
|
+
setUserAnonymousID(id: string): void;
|
|
105
|
+
userAnonymousID(id: string): void;
|
|
106
|
+
setMetadata(key: string, value: string): void;
|
|
107
|
+
metadata(key: string, value: string): void;
|
|
108
|
+
event(key: string, payload?: any, issue?: boolean): void;
|
|
109
|
+
issue(key: string, payload?: any): void;
|
|
110
|
+
handleError: (e: Error | ErrorEvent | PromiseRejectionEvent, metadata?: Record<string, any>) => void;
|
|
111
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import App from '../app/index.js';
|
|
2
|
+
export declare class StringDictionary {
|
|
3
|
+
private readonly getPageNo;
|
|
4
|
+
private idx;
|
|
5
|
+
/** backwards dictionary of
|
|
6
|
+
* [repeated str:key]
|
|
7
|
+
* */
|
|
8
|
+
private backDict;
|
|
9
|
+
constructor(getPageNo: () => number | undefined);
|
|
10
|
+
getKey: (str: string) => [string, boolean];
|
|
11
|
+
}
|
|
12
|
+
export default class AttributeSender {
|
|
13
|
+
private dict;
|
|
14
|
+
private readonly app;
|
|
15
|
+
private readonly isDictDisabled;
|
|
16
|
+
constructor(options: {
|
|
17
|
+
app: App;
|
|
18
|
+
isDictDisabled: boolean;
|
|
19
|
+
});
|
|
20
|
+
sendSetAttribute: (id: number, name: string, value: string) => void;
|
|
21
|
+
private applyDict;
|
|
22
|
+
clear(): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
import type { RequestResponseData, Options } from './network.js';
|
|
3
|
+
interface RawAxiosHeaders {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
}
|
|
6
|
+
interface AxiosRequestConfig {
|
|
7
|
+
url: string;
|
|
8
|
+
method?: string;
|
|
9
|
+
baseURL?: string;
|
|
10
|
+
status?: number;
|
|
11
|
+
headers: {
|
|
12
|
+
toJSON(): RawAxiosHeaders;
|
|
13
|
+
};
|
|
14
|
+
params?: any;
|
|
15
|
+
data?: any;
|
|
16
|
+
}
|
|
17
|
+
interface InternalAxiosRequestConfig extends AxiosRequestConfig {
|
|
18
|
+
__openreplay_timing: number;
|
|
19
|
+
headers: {
|
|
20
|
+
toJSON(): RawAxiosHeaders;
|
|
21
|
+
set(name: string, value: string): void;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
interface AxiosResponse<T = any> {
|
|
25
|
+
data: T;
|
|
26
|
+
status: number;
|
|
27
|
+
statusText: string;
|
|
28
|
+
headers: {
|
|
29
|
+
toJSON(): RawAxiosHeaders;
|
|
30
|
+
};
|
|
31
|
+
config: InternalAxiosRequestConfig;
|
|
32
|
+
request?: any;
|
|
33
|
+
response?: AxiosRequestConfig;
|
|
34
|
+
}
|
|
35
|
+
export interface AxiosInstance extends Record<string, any> {
|
|
36
|
+
getUri: (config?: AxiosRequestConfig) => string;
|
|
37
|
+
interceptors: {
|
|
38
|
+
request: AxiosInterceptorManager<InternalAxiosRequestConfig>;
|
|
39
|
+
response: AxiosInterceptorManager<AxiosResponse>;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface AxiosInterceptorOptions {
|
|
43
|
+
synchronous?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface AxiosInterceptorManager<V> {
|
|
46
|
+
use(onFulfilled?: ((value: V) => V | Promise<V>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions): number;
|
|
47
|
+
eject?: (id: number) => void;
|
|
48
|
+
clear?: () => void;
|
|
49
|
+
}
|
|
50
|
+
export default function (app: App, instance: AxiosInstance, opts: Options, sanitize: (data: RequestResponseData) => RequestResponseData | null, stringify: (data: {
|
|
51
|
+
headers: Record<string, string>;
|
|
52
|
+
body: any;
|
|
53
|
+
}) => string): void;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import Message, { CustomEvent, JSException, MouseClick, NetworkRequest, SetPageLocation } from '../../common/messages.gen.js';
|
|
2
|
+
import App, { StartOptions } from '../app/index.js';
|
|
3
|
+
import { IFeatureFlag } from './featureFlags.js';
|
|
4
|
+
interface Filter {
|
|
5
|
+
filters: {
|
|
6
|
+
operator: string;
|
|
7
|
+
value: string[];
|
|
8
|
+
type: string;
|
|
9
|
+
source?: string;
|
|
10
|
+
}[];
|
|
11
|
+
operator: string;
|
|
12
|
+
value: string[];
|
|
13
|
+
type: string;
|
|
14
|
+
source?: string;
|
|
15
|
+
}
|
|
16
|
+
export default class ConditionsManager {
|
|
17
|
+
private readonly app;
|
|
18
|
+
private readonly startParams;
|
|
19
|
+
conditions: Condition[];
|
|
20
|
+
hasStarted: boolean;
|
|
21
|
+
constructor(app: App, startParams: StartOptions);
|
|
22
|
+
setConditions(conditions: Condition[]): void;
|
|
23
|
+
fetchConditions(projectId: string, token: string): Promise<void>;
|
|
24
|
+
createConditionFromFilter: (filter: Filter) => Condition | undefined;
|
|
25
|
+
trigger(conditionName: string): void;
|
|
26
|
+
processMessage(message: Message): void;
|
|
27
|
+
processFlags(flag: IFeatureFlag[]): void;
|
|
28
|
+
durationInt: ReturnType<typeof setInterval> | null;
|
|
29
|
+
processDuration(durationMs: number, condName: string): void;
|
|
30
|
+
networkRequest(message: NetworkRequest): void;
|
|
31
|
+
customEvent(message: CustomEvent): void;
|
|
32
|
+
clickEvent(message: MouseClick): void;
|
|
33
|
+
pageLocationEvent(message: SetPageLocation): void;
|
|
34
|
+
jsExceptionEvent(message: JSException): void;
|
|
35
|
+
}
|
|
36
|
+
type CommonCondition = {
|
|
37
|
+
type: 'visited_url' | 'click' | 'custom_event';
|
|
38
|
+
operator: keyof typeof operators;
|
|
39
|
+
value: string[];
|
|
40
|
+
name: string;
|
|
41
|
+
};
|
|
42
|
+
type ExceptionCondition = {
|
|
43
|
+
type: 'exception';
|
|
44
|
+
operator: 'contains' | 'startsWith' | 'endsWith';
|
|
45
|
+
value: string[];
|
|
46
|
+
name: string;
|
|
47
|
+
};
|
|
48
|
+
type FeatureFlagCondition = {
|
|
49
|
+
type: 'feature_flag';
|
|
50
|
+
operator: 'is';
|
|
51
|
+
value: string[];
|
|
52
|
+
name: string;
|
|
53
|
+
};
|
|
54
|
+
type SessionDurationCondition = {
|
|
55
|
+
type: 'session_duration';
|
|
56
|
+
value: number[];
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
type SubCondition = {
|
|
60
|
+
type: 'network_request';
|
|
61
|
+
key: 'url' | 'status' | 'method' | 'duration';
|
|
62
|
+
operator: keyof typeof operators;
|
|
63
|
+
value: string[];
|
|
64
|
+
};
|
|
65
|
+
type NetworkRequestCondition = {
|
|
66
|
+
type: 'network_request';
|
|
67
|
+
subConditions: SubCondition[];
|
|
68
|
+
name: string;
|
|
69
|
+
};
|
|
70
|
+
type Condition = CommonCondition | ExceptionCondition | FeatureFlagCondition | SessionDurationCondition | NetworkRequestCondition;
|
|
71
|
+
declare const operators: {
|
|
72
|
+
is: (val: string, target: string[]) => boolean;
|
|
73
|
+
isAny: () => boolean;
|
|
74
|
+
isNot: (val: string, target: string[]) => boolean;
|
|
75
|
+
contains: (val: string, target: string[]) => boolean;
|
|
76
|
+
notContains: (val: string, target: string[]) => boolean;
|
|
77
|
+
startsWith: (val: string, target: string[]) => boolean;
|
|
78
|
+
endsWith: (val: string, target: string[]) => boolean;
|
|
79
|
+
greaterThan: (val: number, target: number) => boolean;
|
|
80
|
+
greaterOrEqual: (val: number, target: number) => boolean;
|
|
81
|
+
lessOrEqual: (val: number, target: number) => boolean;
|
|
82
|
+
lessThan: (val: number, target: number) => boolean;
|
|
83
|
+
};
|
|
84
|
+
export {};
|
|
@@ -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
|
+
captureExceptions: 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,25 @@
|
|
|
1
|
+
import App from '../app/index.js';
|
|
2
|
+
export interface IFeatureFlag {
|
|
3
|
+
key: string;
|
|
4
|
+
is_persist: boolean;
|
|
5
|
+
value: string | boolean;
|
|
6
|
+
payload: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FetchPersistFlagsData {
|
|
9
|
+
key: string;
|
|
10
|
+
value: string | boolean;
|
|
11
|
+
}
|
|
12
|
+
export default class FeatureFlags {
|
|
13
|
+
private readonly app;
|
|
14
|
+
flags: IFeatureFlag[];
|
|
15
|
+
storageKey: string;
|
|
16
|
+
onFlagsCb: (flags: IFeatureFlag[]) => void;
|
|
17
|
+
constructor(app: App);
|
|
18
|
+
getFeatureFlag(flagName: string): IFeatureFlag | undefined;
|
|
19
|
+
isFlagEnabled(flagName: string): boolean;
|
|
20
|
+
onFlagsLoad(cb: (flags: IFeatureFlag[]) => void): void;
|
|
21
|
+
reloadFlags(token?: string): Promise<void>;
|
|
22
|
+
handleFlags(flags: IFeatureFlag[]): void;
|
|
23
|
+
clearPersistFlags(): void;
|
|
24
|
+
diffPersist(flags: IFeatureFlag[]): IFeatureFlag[];
|
|
25
|
+
}
|
|
@@ -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 obscureTextNumbers)
|
|
15
|
+
* */
|
|
16
|
+
obscureInputNumbers: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Sanitize emails from DOM input nodes.
|
|
19
|
+
*
|
|
20
|
+
* (for plain text nodes, look for obscureTextEmails)
|
|
21
|
+
* */
|
|
22
|
+
obscureInputEmails: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Sanitize dates from DOM input nodes.
|
|
25
|
+
* */
|
|
26
|
+
obscureInputDates: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Default input mode for all input nodes. Higher security level
|
|
29
|
+
* will override other settings.
|
|
30
|
+
* */
|
|
31
|
+
defaultInputMode: InputModeT;
|
|
32
|
+
}
|
|
33
|
+
export default function (app: App, opts: Partial<Options>): void;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
export interface MouseHandlerOptions {
|
|
3
|
+
disableClickmaps?: boolean;
|
|
4
|
+
/** minimum length of an optimised selector.
|
|
5
|
+
*
|
|
6
|
+
* body > div > div > p => body > p for example
|
|
7
|
+
*
|
|
8
|
+
* default 2
|
|
9
|
+
* */
|
|
10
|
+
minSelectorDepth?: number;
|
|
11
|
+
/** how many selectors to try before falling back to nth-child selectors
|
|
12
|
+
* performance expensive operation
|
|
13
|
+
*
|
|
14
|
+
* default 1000
|
|
15
|
+
* */
|
|
16
|
+
nthThreshold?: number;
|
|
17
|
+
/**
|
|
18
|
+
* how many tries to optimise and shorten the selector
|
|
19
|
+
*
|
|
20
|
+
* default 10_000
|
|
21
|
+
* */
|
|
22
|
+
maxOptimiseTries?: number;
|
|
23
|
+
/**
|
|
24
|
+
* how many ticks to wait before capturing mouse position
|
|
25
|
+
* (can affect performance)
|
|
26
|
+
* 1 tick = 30ms
|
|
27
|
+
* default 7
|
|
28
|
+
* */
|
|
29
|
+
trackingOffset?: number;
|
|
30
|
+
}
|
|
31
|
+
export default function (app: App, options?: MouseHandlerOptions): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
failuresOnly: boolean;
|
|
22
|
+
ignoreHeaders: Array<string> | boolean;
|
|
23
|
+
capturePayload: boolean;
|
|
24
|
+
captureInIframes: boolean;
|
|
25
|
+
sanitizer?: Sanitizer;
|
|
26
|
+
axiosInstances?: Array<AxiosInstance>;
|
|
27
|
+
useProxy?: boolean;
|
|
28
|
+
tokenUrlMatcher?: (url: string) => boolean;
|
|
29
|
+
}
|
|
30
|
+
export default function (app: App, opts?: Partial<Options>): void;
|
|
31
|
+
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,25 @@
|
|
|
1
|
+
export declare const WATCHED_TAGS_KEY = "__or__watched_tags__";
|
|
2
|
+
declare class TagWatcher {
|
|
3
|
+
intervals: Record<string, ReturnType<typeof setInterval>>;
|
|
4
|
+
tags: {
|
|
5
|
+
id: number;
|
|
6
|
+
selector: string;
|
|
7
|
+
}[];
|
|
8
|
+
observer: IntersectionObserver;
|
|
9
|
+
private readonly sessionStorage;
|
|
10
|
+
private readonly errLog;
|
|
11
|
+
private readonly onTag;
|
|
12
|
+
constructor(params: {
|
|
13
|
+
sessionStorage: Storage;
|
|
14
|
+
errLog: (args: any[]) => void;
|
|
15
|
+
onTag: (tag: number) => void;
|
|
16
|
+
});
|
|
17
|
+
fetchTags(ingest: string, token: string): Promise<void>;
|
|
18
|
+
setTags(tags: {
|
|
19
|
+
id: number;
|
|
20
|
+
selector: string;
|
|
21
|
+
}[]): void;
|
|
22
|
+
onTagRendered(tagId: number): void;
|
|
23
|
+
clear(): void;
|
|
24
|
+
}
|
|
25
|
+
export default TagWatcher;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type App from '../app/index.js';
|
|
2
|
+
export interface Options {
|
|
3
|
+
captureResourceTimings: boolean;
|
|
4
|
+
capturePageLoadTimings: boolean;
|
|
5
|
+
capturePageRenderTimings: boolean;
|
|
6
|
+
excludedResourceUrls?: Array<string>;
|
|
7
|
+
}
|
|
8
|
+
export default function (app: App, opts: Partial<Options>): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default class SignalManager {
|
|
2
|
+
private readonly ingestPoint;
|
|
3
|
+
private readonly getTimestamp;
|
|
4
|
+
private readonly token;
|
|
5
|
+
private readonly testId;
|
|
6
|
+
private readonly storageKey;
|
|
7
|
+
private readonly setStorageKey;
|
|
8
|
+
private readonly removeStorageKey;
|
|
9
|
+
private readonly getStorageKey;
|
|
10
|
+
private readonly getSessionId;
|
|
11
|
+
private readonly durations;
|
|
12
|
+
constructor(ingestPoint: string, getTimestamp: () => number, token: string, testId: number, storageKey: string, setStorageKey: (key: string, value: string) => void, removeStorageKey: (key: string) => void, getStorageKey: (key: string) => string | null, getSessionId: () => string | undefined);
|
|
13
|
+
getDurations: () => {
|
|
14
|
+
testStart: number;
|
|
15
|
+
tasks: {
|
|
16
|
+
taskId: number;
|
|
17
|
+
started: number;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
setDurations: (durations: {
|
|
21
|
+
testStart: number;
|
|
22
|
+
tasks: {
|
|
23
|
+
taskId: number;
|
|
24
|
+
started: number;
|
|
25
|
+
}[];
|
|
26
|
+
}) => void;
|
|
27
|
+
signalTask: (taskId: number, status: "begin" | "done" | "skipped", taskAnswer?: string) => void | Promise<Response>;
|
|
28
|
+
signalTest: (status: "begin" | "done" | "skipped") => Promise<Response>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function attachDND(element: any, dragTarget: any): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import App from '../../app/index.js';
|
|
2
|
+
export default class UserTestManager {
|
|
3
|
+
private readonly app;
|
|
4
|
+
private readonly storageKey;
|
|
5
|
+
private readonly userRecorder;
|
|
6
|
+
private readonly bg;
|
|
7
|
+
private readonly container;
|
|
8
|
+
private widgetGuidelinesVisible;
|
|
9
|
+
private widgetTasksVisible;
|
|
10
|
+
private widgetVisible;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
private descriptionSection;
|
|
13
|
+
private taskSection;
|
|
14
|
+
private endSection;
|
|
15
|
+
private stopButton;
|
|
16
|
+
private stopButtonContainer;
|
|
17
|
+
private test;
|
|
18
|
+
private testId;
|
|
19
|
+
private signalManager;
|
|
20
|
+
constructor(app: App, storageKey: string);
|
|
21
|
+
getTestId(): number | null;
|
|
22
|
+
getTest: (id: number, token: string, inProgress?: boolean) => Promise<number | void>;
|
|
23
|
+
hideTaskSection: () => boolean;
|
|
24
|
+
showTaskSection: () => boolean;
|
|
25
|
+
collapseWidget: () => boolean;
|
|
26
|
+
removeGreeting: () => boolean;
|
|
27
|
+
createGreeting(title: string, micRequired: boolean, cameraRequired: boolean): void;
|
|
28
|
+
showWidget(guidelines: string, tasks: {
|
|
29
|
+
title: string;
|
|
30
|
+
description: string;
|
|
31
|
+
task_id: number;
|
|
32
|
+
allow_typing: boolean;
|
|
33
|
+
}[], inProgress?: boolean): void;
|
|
34
|
+
createTitleSection(): HTMLElement;
|
|
35
|
+
toggleDescriptionVisibility: () => void;
|
|
36
|
+
createDescriptionSection(guidelines: string): HTMLElement;
|
|
37
|
+
currentTaskIndex: number;
|
|
38
|
+
createTasksSection(tasks: {
|
|
39
|
+
title: string;
|
|
40
|
+
description: string;
|
|
41
|
+
task_id: number;
|
|
42
|
+
allow_typing: boolean;
|
|
43
|
+
}[]): HTMLElement;
|
|
44
|
+
showEndSection(): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import App from '../../app/index.js';
|
|
2
|
+
export declare const Quality: {
|
|
3
|
+
Standard: {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
7
|
+
High: {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default class Recorder {
|
|
13
|
+
private readonly app;
|
|
14
|
+
private mediaRecorder;
|
|
15
|
+
private recordedChunks;
|
|
16
|
+
private stream;
|
|
17
|
+
private recStartTs;
|
|
18
|
+
constructor(app: App);
|
|
19
|
+
startRecording(fps: number, quality: (typeof Quality)[keyof typeof Quality], micReq: boolean, camReq: boolean): Promise<void>;
|
|
20
|
+
stopRecording(): Promise<Blob>;
|
|
21
|
+
sendToAPI(): Promise<void | Response>;
|
|
22
|
+
saveToFile(fileName?: string): Promise<void>;
|
|
23
|
+
discard(): void;
|
|
24
|
+
}
|