@purespectrum1/purescore-client 0.7.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/README.md +55 -0
- package/lib/application/auto-init.d.ts +44 -0
- package/lib/application/auto-init.js +245 -0
- package/lib/application/device-identifier.d.ts +116 -0
- package/lib/application/device-identifier.js +169 -0
- package/lib/domain/models/crosscutting/device-intelligence.d.ts +11 -0
- package/lib/domain/models/crosscutting/device-intelligence.js +18 -0
- package/lib/domain/models/crosscutting/index.d.ts +1 -0
- package/lib/domain/models/crosscutting/index.js +17 -0
- package/lib/domain/protocols/cache/get-storage.d.ts +8 -0
- package/lib/domain/protocols/cache/get-storage.js +2 -0
- package/lib/domain/protocols/cache/index.d.ts +3 -0
- package/lib/domain/protocols/cache/index.js +19 -0
- package/lib/domain/protocols/cache/remove-storage.d.ts +6 -0
- package/lib/domain/protocols/cache/remove-storage.js +2 -0
- package/lib/domain/protocols/cache/set-storage.d.ts +7 -0
- package/lib/domain/protocols/cache/set-storage.js +2 -0
- package/lib/domain/protocols/http/http-client.d.ts +23 -0
- package/lib/domain/protocols/http/http-client.js +13 -0
- package/lib/domain/protocols/services/behavioural-biometrics/cursor-behavior.d.ts +63 -0
- package/lib/domain/protocols/services/behavioural-biometrics/cursor-behavior.js +2 -0
- package/lib/domain/protocols/services/behavioural-biometrics/index.d.ts +3 -0
- package/lib/domain/protocols/services/behavioural-biometrics/index.js +19 -0
- package/lib/domain/protocols/services/behavioural-biometrics/keystorke-metrics.d.ts +35 -0
- package/lib/domain/protocols/services/behavioural-biometrics/keystorke-metrics.js +2 -0
- package/lib/domain/protocols/services/behavioural-biometrics/touch-behavior.d.ts +88 -0
- package/lib/domain/protocols/services/behavioural-biometrics/touch-behavior.js +2 -0
- package/lib/domain/protocols/services/device-fingerprint/display.d.ts +22 -0
- package/lib/domain/protocols/services/device-fingerprint/display.js +2 -0
- package/lib/domain/protocols/services/device-fingerprint/index.d.ts +3 -0
- package/lib/domain/protocols/services/device-fingerprint/index.js +19 -0
- package/lib/domain/protocols/services/device-fingerprint/navigator.d.ts +63 -0
- package/lib/domain/protocols/services/device-fingerprint/navigator.js +2 -0
- package/lib/domain/protocols/services/device-fingerprint/utils.d.ts +40 -0
- package/lib/domain/protocols/services/device-fingerprint/utils.js +2 -0
- package/lib/domain/protocols/services/device-identifier.d.ts +96 -0
- package/lib/domain/protocols/services/device-identifier.js +2 -0
- package/lib/domain/protocols/services/device-intelligence.d.ts +5 -0
- package/lib/domain/protocols/services/device-intelligence.js +2 -0
- package/lib/domain/protocols/services/listeners.d.ts +9 -0
- package/lib/domain/protocols/services/listeners.js +2 -0
- package/lib/domain/protocols/services/single-script-injection/auto-init.d.ts +120 -0
- package/lib/domain/protocols/services/single-script-injection/auto-init.js +2 -0
- package/lib/domain/protocols/services/single-script-injection/index.d.ts +1 -0
- package/lib/domain/protocols/services/single-script-injection/index.js +17 -0
- package/lib/domain/services/behavioural-biometrics/collector.d.ts +94 -0
- package/lib/domain/services/behavioural-biometrics/collector.js +229 -0
- package/lib/domain/services/behavioural-biometrics/cursor-behavior.d.ts +87 -0
- package/lib/domain/services/behavioural-biometrics/cursor-behavior.js +369 -0
- package/lib/domain/services/behavioural-biometrics/index.d.ts +4 -0
- package/lib/domain/services/behavioural-biometrics/index.js +20 -0
- package/lib/domain/services/behavioural-biometrics/keystroke-metrics.d.ts +60 -0
- package/lib/domain/services/behavioural-biometrics/keystroke-metrics.js +213 -0
- package/lib/domain/services/behavioural-biometrics/touch-behavior.d.ts +125 -0
- package/lib/domain/services/behavioural-biometrics/touch-behavior.js +413 -0
- package/lib/domain/services/device-fingerprint/audio.d.ts +14 -0
- package/lib/domain/services/device-fingerprint/audio.js +109 -0
- package/lib/domain/services/device-fingerprint/canvas.d.ts +10 -0
- package/lib/domain/services/device-fingerprint/canvas.js +33 -0
- package/lib/domain/services/device-fingerprint/display.d.ts +49 -0
- package/lib/domain/services/device-fingerprint/display.js +88 -0
- package/lib/domain/services/device-fingerprint/hash.d.ts +14 -0
- package/lib/domain/services/device-fingerprint/hash.js +60 -0
- package/lib/domain/services/device-fingerprint/index.d.ts +8 -0
- package/lib/domain/services/device-fingerprint/index.js +24 -0
- package/lib/domain/services/device-fingerprint/navigator.d.ts +110 -0
- package/lib/domain/services/device-fingerprint/navigator.js +213 -0
- package/lib/domain/services/device-fingerprint/pointer-capability.d.ts +14 -0
- package/lib/domain/services/device-fingerprint/pointer-capability.js +42 -0
- package/lib/domain/services/device-fingerprint/storage.d.ts +44 -0
- package/lib/domain/services/device-fingerprint/storage.js +64 -0
- package/lib/domain/services/device-fingerprint/utils.d.ts +42 -0
- package/lib/domain/services/device-fingerprint/utils.js +95 -0
- package/lib/domain/services/device-intelligence.d.ts +10 -0
- package/lib/domain/services/device-intelligence.js +59 -0
- package/lib/domain/services/single-script-injection/checkpoint-scheduler.d.ts +37 -0
- package/lib/domain/services/single-script-injection/checkpoint-scheduler.js +94 -0
- package/lib/domain/services/single-script-injection/index.d.ts +3 -0
- package/lib/domain/services/single-script-injection/index.js +19 -0
- package/lib/domain/services/single-script-injection/response-delivery.d.ts +47 -0
- package/lib/domain/services/single-script-injection/response-delivery.js +115 -0
- package/lib/domain/services/single-script-injection/schedule-store.d.ts +69 -0
- package/lib/domain/services/single-script-injection/schedule-store.js +146 -0
- package/lib/domain/services/snapshot-store.d.ts +19 -0
- package/lib/domain/services/snapshot-store.js +36 -0
- package/lib/domain/services/spa-navigation.d.ts +15 -0
- package/lib/domain/services/spa-navigation.js +40 -0
- package/lib/index.d.ts +19 -0
- package/lib/index.js +27 -0
- package/lib/infra/cache/index.d.ts +3 -0
- package/lib/infra/cache/index.js +19 -0
- package/lib/infra/cache/local-storage-adapter.d.ts +8 -0
- package/lib/infra/cache/local-storage-adapter.js +14 -0
- package/lib/infra/cache/session-storage-adapter.d.ts +8 -0
- package/lib/infra/cache/session-storage-adapter.js +14 -0
- package/lib/infra/cache/web-storage-adapter.d.ts +13 -0
- package/lib/infra/cache/web-storage-adapter.js +33 -0
- package/lib/infra/http/axios-http-client.d.ts +4 -0
- package/lib/infra/http/axios-http-client.js +39 -0
- package/lib/validation/builder.d.ts +43 -0
- package/lib/validation/builder.js +85 -0
- package/lib/validation/composite.d.ts +13 -0
- package/lib/validation/composite.js +23 -0
- package/lib/validation/errors/index.d.ts +2 -0
- package/lib/validation/errors/index.js +18 -0
- package/lib/validation/errors/invalid-field-error.d.ts +7 -0
- package/lib/validation/errors/invalid-field-error.js +14 -0
- package/lib/validation/errors/required-field-error.d.ts +3 -0
- package/lib/validation/errors/required-field-error.js +10 -0
- package/lib/validation/index.d.ts +5 -0
- package/lib/validation/index.js +21 -0
- package/lib/validation/protocols/index.d.ts +1 -0
- package/lib/validation/protocols/index.js +17 -0
- package/lib/validation/protocols/validator.d.ts +11 -0
- package/lib/validation/protocols/validator.js +2 -0
- package/lib/validation/validators/behavioural-signal.d.ts +27 -0
- package/lib/validation/validators/behavioural-signal.js +56 -0
- package/lib/validation/validators/country-code.d.ts +14 -0
- package/lib/validation/validators/country-code.js +24 -0
- package/lib/validation/validators/global-function.d.ts +14 -0
- package/lib/validation/validators/global-function.js +29 -0
- package/lib/validation/validators/index.d.ts +9 -0
- package/lib/validation/validators/index.js +25 -0
- package/lib/validation/validators/interpolated-template.d.ts +14 -0
- package/lib/validation/validators/interpolated-template.js +28 -0
- package/lib/validation/validators/json-object.d.ts +14 -0
- package/lib/validation/validators/json-object.js +33 -0
- package/lib/validation/validators/language-code.d.ts +13 -0
- package/lib/validation/validators/language-code.js +23 -0
- package/lib/validation/validators/positive-number.d.ts +13 -0
- package/lib/validation/validators/positive-number.js +24 -0
- package/lib/validation/validators/required-string.d.ts +10 -0
- package/lib/validation/validators/required-string.js +19 -0
- package/lib/validation/validators/schedule-record.d.ts +26 -0
- package/lib/validation/validators/schedule-record.js +33 -0
- package/package.json +51 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./device-intelligence"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./get-storage"), exports);
|
|
18
|
+
__exportStar(require("./set-storage"), exports);
|
|
19
|
+
__exportStar(require("./remove-storage"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type HttpRequest = {
|
|
2
|
+
url: string;
|
|
3
|
+
method: HttpMethod;
|
|
4
|
+
body?: any;
|
|
5
|
+
headers?: any;
|
|
6
|
+
};
|
|
7
|
+
export interface HttpClient<R = any> {
|
|
8
|
+
request: (data: HttpRequest) => Promise<HttpResponse<R>>;
|
|
9
|
+
}
|
|
10
|
+
export type HttpMethod = 'post' | 'get' | 'patch' | 'delete' | 'put';
|
|
11
|
+
export declare enum HttpStatusCode {
|
|
12
|
+
ok = 200,
|
|
13
|
+
noContent = 204,
|
|
14
|
+
badRequest = 400,
|
|
15
|
+
unauthorized = 401,
|
|
16
|
+
forbidden = 403,
|
|
17
|
+
notFound = 404,
|
|
18
|
+
serverError = 500
|
|
19
|
+
}
|
|
20
|
+
export type HttpResponse<T = any> = {
|
|
21
|
+
statusCode: HttpStatusCode;
|
|
22
|
+
body?: T;
|
|
23
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpStatusCode = void 0;
|
|
4
|
+
var HttpStatusCode;
|
|
5
|
+
(function (HttpStatusCode) {
|
|
6
|
+
HttpStatusCode[HttpStatusCode["ok"] = 200] = "ok";
|
|
7
|
+
HttpStatusCode[HttpStatusCode["noContent"] = 204] = "noContent";
|
|
8
|
+
HttpStatusCode[HttpStatusCode["badRequest"] = 400] = "badRequest";
|
|
9
|
+
HttpStatusCode[HttpStatusCode["unauthorized"] = 401] = "unauthorized";
|
|
10
|
+
HttpStatusCode[HttpStatusCode["forbidden"] = 403] = "forbidden";
|
|
11
|
+
HttpStatusCode[HttpStatusCode["notFound"] = 404] = "notFound";
|
|
12
|
+
HttpStatusCode[HttpStatusCode["serverError"] = 500] = "serverError";
|
|
13
|
+
})(HttpStatusCode || (exports.HttpStatusCode = HttpStatusCode = {}));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface MousePoint {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
timestamp: number;
|
|
5
|
+
}
|
|
6
|
+
export interface MouseVelocity {
|
|
7
|
+
vx: number;
|
|
8
|
+
vy: number;
|
|
9
|
+
speed: number;
|
|
10
|
+
}
|
|
11
|
+
export interface MouseAcceleration {
|
|
12
|
+
ax: number;
|
|
13
|
+
ay: number;
|
|
14
|
+
magnitude: number;
|
|
15
|
+
}
|
|
16
|
+
export interface MouseTrajectory {
|
|
17
|
+
angle: number;
|
|
18
|
+
curvature: number;
|
|
19
|
+
straightness: number;
|
|
20
|
+
jerkiness: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ScrollEvent {
|
|
23
|
+
deltaX: number;
|
|
24
|
+
deltaY: number;
|
|
25
|
+
timestamp: number;
|
|
26
|
+
velocity: number;
|
|
27
|
+
type: 'wheel' | 'drag';
|
|
28
|
+
}
|
|
29
|
+
interface MovementMetrics {
|
|
30
|
+
averageSpeed: number | null;
|
|
31
|
+
maxSpeed: number | null;
|
|
32
|
+
minSpeed: number | null;
|
|
33
|
+
speedStdDev: number | null;
|
|
34
|
+
}
|
|
35
|
+
interface AccelerationMetrics {
|
|
36
|
+
averageAcceleration: number | null;
|
|
37
|
+
maxAcceleration: number | null;
|
|
38
|
+
decelerationCount: number;
|
|
39
|
+
accelerationCount: number;
|
|
40
|
+
}
|
|
41
|
+
interface TrajectoryMetrics {
|
|
42
|
+
averageCurvature: number | null;
|
|
43
|
+
straightLinePercentage: number | null;
|
|
44
|
+
averageJerkiness: number | null;
|
|
45
|
+
angleChanges: number;
|
|
46
|
+
}
|
|
47
|
+
interface ScrollMetrics {
|
|
48
|
+
totalScrollDistance: number;
|
|
49
|
+
averageScrollVelocity: number | null;
|
|
50
|
+
wheelScrollCount: number;
|
|
51
|
+
dragScrollCount: number;
|
|
52
|
+
}
|
|
53
|
+
interface SessionInfo {
|
|
54
|
+
totalMovements: number;
|
|
55
|
+
}
|
|
56
|
+
export interface CursorBehaviorMetrics {
|
|
57
|
+
movementMetrics: MovementMetrics;
|
|
58
|
+
accelerationMetrics: AccelerationMetrics;
|
|
59
|
+
trajectoryMetrics: TrajectoryMetrics;
|
|
60
|
+
scrollMetrics: ScrollMetrics;
|
|
61
|
+
sessionInfo: SessionInfo;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cursor-behavior"), exports);
|
|
18
|
+
__exportStar(require("./keystorke-metrics"), exports);
|
|
19
|
+
__exportStar(require("./touch-behavior"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface KeyLog {
|
|
2
|
+
key: string;
|
|
3
|
+
pressTime: number;
|
|
4
|
+
releaseTime: number;
|
|
5
|
+
duration: number;
|
|
6
|
+
}
|
|
7
|
+
export interface DwellTime {
|
|
8
|
+
key: string;
|
|
9
|
+
averageDuration: number;
|
|
10
|
+
duration: number;
|
|
11
|
+
count: number;
|
|
12
|
+
}
|
|
13
|
+
export interface FlightTime {
|
|
14
|
+
fromKey: string;
|
|
15
|
+
toKey: string;
|
|
16
|
+
averageDuration: number;
|
|
17
|
+
duration: number;
|
|
18
|
+
count: number;
|
|
19
|
+
}
|
|
20
|
+
export interface KeyboardMetric {
|
|
21
|
+
dwellTimes: DwellTime[];
|
|
22
|
+
flightTimes: FlightTime[];
|
|
23
|
+
statistics: {
|
|
24
|
+
backspaceCount: number;
|
|
25
|
+
shiftKeyUsage: number;
|
|
26
|
+
deleteKeyCount: number;
|
|
27
|
+
};
|
|
28
|
+
errors: {
|
|
29
|
+
totalErrors: number;
|
|
30
|
+
quickCorrections: number;
|
|
31
|
+
errorRate: number | null;
|
|
32
|
+
correctionRate: number | null;
|
|
33
|
+
};
|
|
34
|
+
typingSpeed: number | null;
|
|
35
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for touch pressure data
|
|
3
|
+
*/
|
|
4
|
+
export interface TouchPressureData {
|
|
5
|
+
/** Average pressure across all recorded touches (0.0 to 1.0). `null` when no pressure events were captured. */
|
|
6
|
+
averagePressure: number | null;
|
|
7
|
+
/** Maximum pressure recorded. `null` when no pressure events were captured. */
|
|
8
|
+
maxPressure: number | null;
|
|
9
|
+
/** Minimum pressure recorded. `null` when no pressure events were captured. */
|
|
10
|
+
minPressure: number | null;
|
|
11
|
+
/** Standard deviation of pressure values (indicates variability). `null` when no pressure events were captured. */
|
|
12
|
+
pressureVariability: number | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Interface for a single swipe gesture
|
|
16
|
+
*/
|
|
17
|
+
export interface SwipeGesture {
|
|
18
|
+
/** Speed of the swipe in pixels per millisecond */
|
|
19
|
+
speed: number;
|
|
20
|
+
/** Angle of the swipe in degrees (0-360) */
|
|
21
|
+
angle: number;
|
|
22
|
+
/** Length of the swipe in pixels */
|
|
23
|
+
length: number;
|
|
24
|
+
/** Duration of the swipe in milliseconds */
|
|
25
|
+
duration: number;
|
|
26
|
+
/** Timestamp when swipe started */
|
|
27
|
+
timestamp: number;
|
|
28
|
+
}
|
|
29
|
+
/** Cardinal direction of a swipe */
|
|
30
|
+
export type SwipeDirection = 'up' | 'down' | 'left' | 'right';
|
|
31
|
+
/**
|
|
32
|
+
* Interface for a single swipe movement with coordinates and direction
|
|
33
|
+
*/
|
|
34
|
+
export interface SwipeMovement {
|
|
35
|
+
/** Direction of the swipe */
|
|
36
|
+
direction: SwipeDirection;
|
|
37
|
+
/** Start coordinates [x, y] */
|
|
38
|
+
start: [number, number];
|
|
39
|
+
/** End coordinates [x, y] */
|
|
40
|
+
end: [number, number];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Interface for aggregated swipe metrics
|
|
44
|
+
*/
|
|
45
|
+
export interface SwipeMetrics {
|
|
46
|
+
/** Average speed across all swipes. `null` when no swipes were captured. */
|
|
47
|
+
averageSpeed: number | null;
|
|
48
|
+
/** Average angle across all swipes. `null` when no swipes were captured. */
|
|
49
|
+
averageAngle: number | null;
|
|
50
|
+
/** Average length across all swipes. `null` when no swipes were captured. */
|
|
51
|
+
averageLength: number | null;
|
|
52
|
+
/** Average duration across all swipes. `null` when no swipes were captured. */
|
|
53
|
+
averageDuration: number | null;
|
|
54
|
+
/** Speed consistency (lower = more consistent). `null` when no swipes were captured. */
|
|
55
|
+
speedVariability: number | null;
|
|
56
|
+
/** Angle consistency (lower = more consistent). `null` when no swipes were captured. */
|
|
57
|
+
angleVariability: number | null;
|
|
58
|
+
/** Number of swipe gestures recorded (always a real count — 0 means "no swipes"). */
|
|
59
|
+
swipeCount: number;
|
|
60
|
+
/** Individual swipe movements with direction and coordinates */
|
|
61
|
+
swipes: SwipeMovement[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Interface for finger size/contact area data
|
|
65
|
+
*/
|
|
66
|
+
export interface FingerSizeData {
|
|
67
|
+
/** Average touch radius in pixels. `null` when no touch-size events were captured. */
|
|
68
|
+
averageTouchRadius: number | null;
|
|
69
|
+
/** Maximum touch radius recorded. `null` when no touch-size events were captured. */
|
|
70
|
+
maxTouchRadius: number | null;
|
|
71
|
+
/** Minimum touch radius recorded. `null` when no touch-size events were captured. */
|
|
72
|
+
minTouchRadius: number | null;
|
|
73
|
+
/** Variability in touch size. `null` when no touch-size events were captured. */
|
|
74
|
+
sizeVariability: number | null;
|
|
75
|
+
/** Average touch area (radiusX * radiusY). `null` when no touch-size events were captured. */
|
|
76
|
+
averageTouchArea: number | null;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Complete touch behavioral biometrics
|
|
80
|
+
*/
|
|
81
|
+
export interface TouchBehaviorBiometrics {
|
|
82
|
+
/** Pressure-related metrics */
|
|
83
|
+
pressure: TouchPressureData;
|
|
84
|
+
/** Swipe gesture metrics */
|
|
85
|
+
swipe: SwipeMetrics;
|
|
86
|
+
/** Finger size/contact area metrics */
|
|
87
|
+
fingerSize: FingerSizeData;
|
|
88
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface DisplayChecks {
|
|
2
|
+
resolution: [number, number];
|
|
3
|
+
width: number;
|
|
4
|
+
width1: number;
|
|
5
|
+
width2: number;
|
|
6
|
+
height1: number;
|
|
7
|
+
height2: number;
|
|
8
|
+
isWider: boolean;
|
|
9
|
+
isTaller: boolean;
|
|
10
|
+
aspectRatio: number;
|
|
11
|
+
}
|
|
12
|
+
export interface DisplayChecksInput {
|
|
13
|
+
colorDepth: number;
|
|
14
|
+
height: number;
|
|
15
|
+
width: number;
|
|
16
|
+
availHeight: number;
|
|
17
|
+
availWidth: number;
|
|
18
|
+
innerHeight: number;
|
|
19
|
+
innerWidth: number;
|
|
20
|
+
outerHeight: number;
|
|
21
|
+
outerWidth: number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./display"), exports);
|
|
18
|
+
__exportStar(require("./navigator"), exports);
|
|
19
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface Language {
|
|
2
|
+
language: string;
|
|
3
|
+
systemLanguage: string;
|
|
4
|
+
userLanguage: string;
|
|
5
|
+
}
|
|
6
|
+
export interface NavigatorUABrandVersion {
|
|
7
|
+
brand: string;
|
|
8
|
+
version: string;
|
|
9
|
+
}
|
|
10
|
+
export interface UADataValues {
|
|
11
|
+
brands?: NavigatorUABrandVersion[];
|
|
12
|
+
mobile?: boolean;
|
|
13
|
+
platform?: string;
|
|
14
|
+
architecture?: string;
|
|
15
|
+
bitness?: string;
|
|
16
|
+
model?: string;
|
|
17
|
+
platformVersion?: string;
|
|
18
|
+
uaFullVersion?: string;
|
|
19
|
+
fullVersionList?: NavigatorUABrandVersion[];
|
|
20
|
+
}
|
|
21
|
+
export interface NavigatorUAData {
|
|
22
|
+
brands: NavigatorUABrandVersion[];
|
|
23
|
+
mobile: boolean;
|
|
24
|
+
platform: string;
|
|
25
|
+
getHighEntropyValues(hints: string[]): Promise<UADataValues>;
|
|
26
|
+
toJSON(): UADataValues;
|
|
27
|
+
}
|
|
28
|
+
export interface NetworkInformation {
|
|
29
|
+
rtt?: number;
|
|
30
|
+
}
|
|
31
|
+
declare global {
|
|
32
|
+
interface Navigator {
|
|
33
|
+
userAgentData?: NavigatorUAData;
|
|
34
|
+
connection?: NetworkInformation;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export interface UAParserDeviceType {
|
|
38
|
+
ua: string;
|
|
39
|
+
browser: {
|
|
40
|
+
name?: string;
|
|
41
|
+
version?: string;
|
|
42
|
+
major?: string;
|
|
43
|
+
};
|
|
44
|
+
engine: {
|
|
45
|
+
name?: string;
|
|
46
|
+
version?: string;
|
|
47
|
+
};
|
|
48
|
+
os: {
|
|
49
|
+
name?: string;
|
|
50
|
+
version?: string;
|
|
51
|
+
};
|
|
52
|
+
device: {
|
|
53
|
+
vendor?: string;
|
|
54
|
+
model?: string;
|
|
55
|
+
type?: string;
|
|
56
|
+
};
|
|
57
|
+
cpu: {
|
|
58
|
+
architecture?: string;
|
|
59
|
+
};
|
|
60
|
+
isMobile: boolean;
|
|
61
|
+
isTablet: boolean;
|
|
62
|
+
isDesktop: boolean;
|
|
63
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface NavigationTiming {
|
|
2
|
+
responseEnd: number;
|
|
3
|
+
fetchStart: number;
|
|
4
|
+
domainLookupEnd: number;
|
|
5
|
+
domainLookupStart: number;
|
|
6
|
+
connectEnd: number;
|
|
7
|
+
connectStart: number;
|
|
8
|
+
responseStart: number;
|
|
9
|
+
requestStart: number;
|
|
10
|
+
loadEventEnd: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Interface for network timing data.
|
|
14
|
+
*/
|
|
15
|
+
export interface NetworkTimes {
|
|
16
|
+
/**
|
|
17
|
+
* Total network time in seconds.
|
|
18
|
+
*/
|
|
19
|
+
networkTime: number;
|
|
20
|
+
/**
|
|
21
|
+
* DNS lookup time in seconds.
|
|
22
|
+
*/
|
|
23
|
+
dnsLookupTime: number;
|
|
24
|
+
/**
|
|
25
|
+
* TCP connection time in seconds.
|
|
26
|
+
*/
|
|
27
|
+
tcpConnectionTime: number;
|
|
28
|
+
/**
|
|
29
|
+
* Server response time in seconds.
|
|
30
|
+
*/
|
|
31
|
+
serverResponseTime: number;
|
|
32
|
+
/**
|
|
33
|
+
* Page download time in seconds.
|
|
34
|
+
*/
|
|
35
|
+
pageDownloadTime: number;
|
|
36
|
+
/**
|
|
37
|
+
* Browser time in seconds.
|
|
38
|
+
*/
|
|
39
|
+
browserTime: number;
|
|
40
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export interface DeviceIdentifierOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Custom hash function.
|
|
4
|
+
*
|
|
5
|
+
* If provided, this function will be used to generate the hash instead of the default murmurhash3_32_gc.
|
|
6
|
+
*/
|
|
7
|
+
hasher?: (value: string, seed: number) => number;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to include screen resolution in the hash.
|
|
10
|
+
*/
|
|
11
|
+
screen_resolution?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to include screen orientation in the hash.
|
|
14
|
+
*/
|
|
15
|
+
screen_orientation?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether to include canvas fingerprint in the hash.
|
|
18
|
+
*/
|
|
19
|
+
canvas?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Set by the `data-auto-init="true"` bootstrap. Sends
|
|
22
|
+
* `single_script_injection: true` on both Device-Intelligence calls.
|
|
23
|
+
*/
|
|
24
|
+
singleScriptInjection?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface DeviceIdentifierConfig {
|
|
27
|
+
token?: string;
|
|
28
|
+
env?: 'staging' | 'production';
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Flushes the collected signals for a transaction to the Device-Intelligence
|
|
32
|
+
* service and resolves with its response.
|
|
33
|
+
*/
|
|
34
|
+
export interface TrackDetails {
|
|
35
|
+
trackDetails: (transactionId: string, metadata?: DeviceIdentifierMetadata, config?: DeviceIdentifierConfig, context?: TrackDetailsContext) => Promise<Record<string, any>>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* What a `trackDetails` call knows about the transaction beyond its id.
|
|
39
|
+
*/
|
|
40
|
+
export interface TrackDetailsContext {
|
|
41
|
+
surveyId?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Survey details sent once to `POST /v1/transaction` at transaction start.
|
|
45
|
+
*/
|
|
46
|
+
export interface TransactionDetails {
|
|
47
|
+
surveyId: string;
|
|
48
|
+
expectedSurveyLOI: number;
|
|
49
|
+
surveyCountry: string;
|
|
50
|
+
surveyLanguage: string;
|
|
51
|
+
supplierId?: string;
|
|
52
|
+
supplierMemberId?: string;
|
|
53
|
+
emailHash?: string;
|
|
54
|
+
demographics?: {
|
|
55
|
+
age?: number;
|
|
56
|
+
gender?: string;
|
|
57
|
+
zip?: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Registers a transaction with the Device-Intelligence service.
|
|
62
|
+
*/
|
|
63
|
+
export interface CreateTransaction {
|
|
64
|
+
createTransaction: (details: TransactionDetails, config?: DeviceIdentifierConfig) => Promise<string | undefined>;
|
|
65
|
+
}
|
|
66
|
+
export interface DeviceIdentifierMetadata {
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
}
|
|
69
|
+
export interface BehaviorBiometricsParams {
|
|
70
|
+
survey_id?: string;
|
|
71
|
+
qualification_id?: string;
|
|
72
|
+
qualification_type?: string;
|
|
73
|
+
PSID?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface BehaviouralBiometricsOptions {
|
|
76
|
+
/**
|
|
77
|
+
* Maximum number of data points to retain in memory during cursor tracking.
|
|
78
|
+
* @default 500
|
|
79
|
+
*/
|
|
80
|
+
cursorMaxDataPoints?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Maximum number of data points to retain in memory during keystroke tracking.
|
|
83
|
+
* @default 1000
|
|
84
|
+
*/
|
|
85
|
+
keystrokeMaxDataPoints?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Minimum swipe length in pixels to be considered a valid swipe gesture.
|
|
88
|
+
* @default 15
|
|
89
|
+
*/
|
|
90
|
+
minSwipeLength?: number;
|
|
91
|
+
/**
|
|
92
|
+
* Maximum swipe duration in milliseconds to be considered a valid swipe gesture.
|
|
93
|
+
* @default 2000
|
|
94
|
+
*/
|
|
95
|
+
maxSwipeDuration?: number;
|
|
96
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DeviceIdentifierConfig } from "./device-identifier";
|
|
2
|
+
import { HttpMethod } from "../http/http-client";
|
|
3
|
+
export interface DeviceIntelligenceHTTPRequest {
|
|
4
|
+
performRequest: (path: string, method: HttpMethod, config: DeviceIdentifierConfig | undefined, data?: any) => Promise<any>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface StartDetection<TArgs extends unknown[] = []> {
|
|
2
|
+
startDetection(...args: TArgs): void;
|
|
3
|
+
}
|
|
4
|
+
export interface StopDetection<TArgs extends unknown[] = []> {
|
|
5
|
+
stopDetection(...args: TArgs): void;
|
|
6
|
+
}
|
|
7
|
+
export interface ResetData<TArgs extends unknown[] = []> {
|
|
8
|
+
resetData(...args: TArgs): void;
|
|
9
|
+
}
|