@ianmenethil/zp-devicefp 0.1.0-alpha.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 +134 -0
- package/dist/cdn/zp.dfp.esm.js +1449 -0
- package/dist/cdn/zp.dfp.js +1453 -0
- package/dist/cdn/zp.dfp.manifest.json +34 -0
- package/dist/cdn/zp.dfp.min.js +1 -0
- package/dist/cdn/zp.dfp.obf.js +1 -0
- package/dist/npm/index.cjs +1478 -0
- package/dist/npm/index.d.ts +101 -0
- package/dist/npm/index.mjs +1449 -0
- package/docs/architecture.md +40 -0
- package/docs/privacy.md +20 -0
- package/docs/testing.md +32 -0
- package/package.json +75 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export type SignalName =
|
|
2
|
+
| 'ua'
|
|
3
|
+
| 'uaHints'
|
|
4
|
+
| 'locale'
|
|
5
|
+
| 'screen'
|
|
6
|
+
| 'hardware'
|
|
7
|
+
| 'storage'
|
|
8
|
+
| 'fonts'
|
|
9
|
+
| 'canvas'
|
|
10
|
+
| 'webgl'
|
|
11
|
+
| 'audio'
|
|
12
|
+
| 'mediaDevices'
|
|
13
|
+
| 'permissions'
|
|
14
|
+
| 'webrtc'
|
|
15
|
+
| 'frameInfo'
|
|
16
|
+
| 'networkInfo'
|
|
17
|
+
| 'paymentSupport'
|
|
18
|
+
| 'referrerInfo'
|
|
19
|
+
| 'navigationInfo'
|
|
20
|
+
| 'riskSignals';
|
|
21
|
+
|
|
22
|
+
export type SignalStatus = 'ok' | 'unsupported' | 'blocked' | 'timeout' | 'error';
|
|
23
|
+
|
|
24
|
+
export interface SignalResult<T = unknown> {
|
|
25
|
+
status: SignalStatus;
|
|
26
|
+
value?: T;
|
|
27
|
+
durationMs: number;
|
|
28
|
+
error?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface AntiSpoofReport {
|
|
32
|
+
score: number;
|
|
33
|
+
anomalies: string[];
|
|
34
|
+
automationHints: string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface FingerprintResult {
|
|
38
|
+
schemaVersion: number;
|
|
39
|
+
libraryVersion: string;
|
|
40
|
+
thumbprint: string;
|
|
41
|
+
confidence: number;
|
|
42
|
+
componentHashes: Partial<Record<SignalName, string>>;
|
|
43
|
+
signals: Partial<Record<SignalName, SignalResult>>;
|
|
44
|
+
antiSpoof: AntiSpoofReport;
|
|
45
|
+
warnings: string[];
|
|
46
|
+
diagnostics: CollectorDiagnostics;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface CollectOptions {
|
|
50
|
+
include?: SignalName[];
|
|
51
|
+
exclude?: SignalName[];
|
|
52
|
+
timeoutMs?: number;
|
|
53
|
+
abortSignal?: AbortSignal;
|
|
54
|
+
extended?: boolean;
|
|
55
|
+
debug?: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface CollectorDiagnostics {
|
|
59
|
+
requestedSignals: SignalName[];
|
|
60
|
+
completedSignals: SignalName[];
|
|
61
|
+
elapsedMs: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface UploadOptions {
|
|
65
|
+
endpoint: string;
|
|
66
|
+
headers?: Record<string, string>;
|
|
67
|
+
bodyExtras?: Record<string, unknown>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface ProgressEvent {
|
|
71
|
+
completed: number;
|
|
72
|
+
total: number;
|
|
73
|
+
signal: SignalName;
|
|
74
|
+
result: SignalResult;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface WarningEvent {
|
|
78
|
+
signal?: SignalName;
|
|
79
|
+
message: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface CompleteEvent {
|
|
83
|
+
result: FingerprintResult;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface EventPayloadMap {
|
|
87
|
+
progress: ProgressEvent;
|
|
88
|
+
warning: WarningEvent;
|
|
89
|
+
complete: CompleteEvent;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface FingerprintClient {
|
|
93
|
+
collect(options?: CollectOptions): Promise<FingerprintResult>;
|
|
94
|
+
collectSync(options?: Omit<CollectOptions, 'timeoutMs' | 'abortSignal'>): FingerprintResult;
|
|
95
|
+
upload(result: FingerprintResult, options: UploadOptions): Promise<Response>;
|
|
96
|
+
on<K extends keyof EventPayloadMap>(event: K, cb: (payload: EventPayloadMap[K]) => void): () => void;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export declare const LIBRARY_VERSION: string;
|
|
100
|
+
export declare const SCHEMA_VERSION: number;
|
|
101
|
+
export declare function createFingerprintClient(options?: CollectOptions): Promise<FingerprintClient>;
|