device-passport 1.0.0 → 1.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/CHANGELOG.md +30 -0
- package/README.md +69 -2
- package/dist/adapters/index.cjs +19 -0
- package/dist/adapters/index.d.cts +156 -0
- package/dist/adapters/index.d.mts +156 -0
- package/dist/adapters/index.d.ts +156 -0
- package/dist/adapters/index.mjs +3 -0
- package/dist/evaluator/index.cjs +702 -0
- package/dist/evaluator/index.d.cts +204 -0
- package/dist/evaluator/index.d.mts +204 -0
- package/dist/evaluator/index.d.ts +204 -0
- package/dist/evaluator/index.mjs +680 -0
- package/dist/geo/index.cjs +50 -0
- package/dist/geo/index.d.cts +209 -0
- package/dist/geo/index.d.mts +209 -0
- package/dist/geo/index.d.ts +209 -0
- package/dist/geo/index.mjs +18 -0
- package/dist/index.cjs +113 -3543
- package/dist/index.d.cts +45 -903
- package/dist/index.d.mts +45 -903
- package/dist/index.d.ts +45 -903
- package/dist/index.mjs +11 -3438
- package/dist/shared/device-passport.BBf9OKap.mjs +1237 -0
- package/dist/shared/device-passport.BPd2-w8e.cjs +1265 -0
- package/dist/shared/device-passport.CLaBZWUV.cjs +1569 -0
- package/dist/shared/device-passport.C_F1vBE8.d.cts +79 -0
- package/dist/shared/device-passport.C_F1vBE8.d.mts +79 -0
- package/dist/shared/device-passport.C_F1vBE8.d.ts +79 -0
- package/dist/shared/device-passport.Cjxlv8xI.cjs +245 -0
- package/dist/shared/device-passport.CyQtcZeD.mjs +237 -0
- package/dist/shared/device-passport.NHw_f6HT.mjs +1535 -0
- package/dist/storage/index.cjs +10 -0
- package/dist/storage/index.d.cts +128 -0
- package/dist/storage/index.d.mts +128 -0
- package/dist/storage/index.d.ts +128 -0
- package/dist/storage/index.mjs +3 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +215 -0
- package/dist/types/index.d.mts +215 -0
- package/dist/types/index.d.ts +215 -0
- package/dist/types/index.mjs +1 -0
- package/package.json +27 -2
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { L as LocaleProfile } from '../shared/device-passport.C_F1vBE8.mjs';
|
|
2
|
+
export { C as CountryGeoDefinition, G as GeoContext, a as GeoCoordinates, b as GeoLocation, c as GeoOptions, d as LanguageWeight } from '../shared/device-passport.C_F1vBE8.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Metrics, Consistency Evaluation, and Benchmark types for Device Passport.
|
|
6
|
+
*/
|
|
7
|
+
type ConsistencyCategory = 'os_ua_alignment' | 'client_hints_entropy' | 'hardware_plausibility' | 'geo_locale_coherence' | 'webgl_hardware_coupling' | 'screen_viewport_consistency';
|
|
8
|
+
interface ConsistencyCheck {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
category: ConsistencyCategory;
|
|
12
|
+
passed: boolean;
|
|
13
|
+
score: number;
|
|
14
|
+
weight: number;
|
|
15
|
+
message: string;
|
|
16
|
+
details?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
interface EntropyAnalysis {
|
|
19
|
+
estimatedBits: number;
|
|
20
|
+
collisionRisk: 'very_low' | 'low' | 'moderate' | 'high';
|
|
21
|
+
fingerprintUniqueness?: number;
|
|
22
|
+
}
|
|
23
|
+
type EvaluationStatus = 'PASS' | 'WARN' | 'FAIL';
|
|
24
|
+
type EvaluationGrade = 'A+' | 'A' | 'B' | 'C' | 'F';
|
|
25
|
+
interface PassportEvaluation {
|
|
26
|
+
/** Overall consistency score (0 - 100) */
|
|
27
|
+
overallScore: number;
|
|
28
|
+
/** Pass / Warn / Fail status based on strict thresholds */
|
|
29
|
+
status: EvaluationStatus;
|
|
30
|
+
/** Academic grade assessment */
|
|
31
|
+
grade: EvaluationGrade;
|
|
32
|
+
/** Individual check breakdowns */
|
|
33
|
+
checks: ConsistencyCheck[];
|
|
34
|
+
/** Entropy and collision analysis */
|
|
35
|
+
entropyAnalysis?: EntropyAnalysis;
|
|
36
|
+
/** ISO timestamp when evaluated */
|
|
37
|
+
evaluatedAt: string;
|
|
38
|
+
}
|
|
39
|
+
interface BenchmarkMetrics {
|
|
40
|
+
passportId: string;
|
|
41
|
+
determinismScore: number;
|
|
42
|
+
contradictionRate: number;
|
|
43
|
+
overallConsistencyScore: number;
|
|
44
|
+
generationLatencyMs: number;
|
|
45
|
+
entropyBits: number;
|
|
46
|
+
timestamp: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Core type definitions for Device Passport.
|
|
51
|
+
* Compliant with RFC 8942, W3C User-Agent Client Hints, and WebGL specs.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
type SupportedBrowserName = 'Chrome' | 'Edge' | 'Safari' | 'Firefox';
|
|
55
|
+
type SupportedPlatform = 'macOS' | 'Windows';
|
|
56
|
+
type SupportedArchitecture = 'arm' | 'x86';
|
|
57
|
+
interface BrowserProfile {
|
|
58
|
+
name: SupportedBrowserName;
|
|
59
|
+
version: string;
|
|
60
|
+
majorVersion: number;
|
|
61
|
+
userAgent: string;
|
|
62
|
+
}
|
|
63
|
+
interface OperatingSystemProfile {
|
|
64
|
+
name: SupportedPlatform;
|
|
65
|
+
platform: SupportedPlatform;
|
|
66
|
+
version: string;
|
|
67
|
+
release: string;
|
|
68
|
+
architecture: SupportedArchitecture;
|
|
69
|
+
}
|
|
70
|
+
interface ScreenProfile {
|
|
71
|
+
width: number;
|
|
72
|
+
height: number;
|
|
73
|
+
availWidth: number;
|
|
74
|
+
availHeight: number;
|
|
75
|
+
dpr: number;
|
|
76
|
+
colorDepth: number;
|
|
77
|
+
pixelDepth: number;
|
|
78
|
+
}
|
|
79
|
+
interface CpuProfile {
|
|
80
|
+
architecture: SupportedArchitecture;
|
|
81
|
+
concurrency: number;
|
|
82
|
+
}
|
|
83
|
+
interface MemoryProfile {
|
|
84
|
+
deviceMemory: number;
|
|
85
|
+
physicalMemoryGB?: number;
|
|
86
|
+
}
|
|
87
|
+
interface GpuProfile {
|
|
88
|
+
vendor: string;
|
|
89
|
+
renderer: string;
|
|
90
|
+
webglVendor?: string;
|
|
91
|
+
webglRenderer?: string;
|
|
92
|
+
}
|
|
93
|
+
interface HardwareProfile {
|
|
94
|
+
screen: ScreenProfile;
|
|
95
|
+
cpu: CpuProfile;
|
|
96
|
+
memory: MemoryProfile;
|
|
97
|
+
gpu: GpuProfile;
|
|
98
|
+
}
|
|
99
|
+
interface BrandVersion {
|
|
100
|
+
brand: string;
|
|
101
|
+
version: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Raw RFC 8942 / RFC 8941 structured client hints headers.
|
|
105
|
+
*/
|
|
106
|
+
interface ClientHintsHeaders {
|
|
107
|
+
/** Low-entropy brand and major version, e.g. `"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"` */
|
|
108
|
+
'sec-ch-ua': string;
|
|
109
|
+
/** Low-entropy mobile indicator, `"?0"` or `"?1"` */
|
|
110
|
+
'sec-ch-ua-mobile': string;
|
|
111
|
+
/** Low-entropy platform, e.g. `"macOS"` or `"Windows"` */
|
|
112
|
+
'sec-ch-ua-platform': string;
|
|
113
|
+
/** High-entropy OS version, e.g. `"14.6.1"` or `"15.0.0"` */
|
|
114
|
+
'sec-ch-ua-platform-version': string;
|
|
115
|
+
/** High-entropy architecture, e.g. `"arm"` or `"x86"` */
|
|
116
|
+
'sec-ch-ua-arch': string;
|
|
117
|
+
/** High-entropy bitness, e.g. `"64"` */
|
|
118
|
+
'sec-ch-ua-bitness': string;
|
|
119
|
+
/** High-entropy device model, `""` for desktop */
|
|
120
|
+
'sec-ch-ua-model': string;
|
|
121
|
+
/** High-entropy full version list, e.g. `"Chromium";v="124.0.6367.208", "Google Chrome";v="124.0.6367.208"` */
|
|
122
|
+
'sec-ch-ua-full-version-list': string;
|
|
123
|
+
/** High-entropy 32-bit on 64-bit Windows flag, `"?0"` */
|
|
124
|
+
'sec-ch-ua-wow64'?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Structured User-Agent Client Hints object representing navigator.userAgentData.
|
|
128
|
+
*/
|
|
129
|
+
interface UserAgentClientHints {
|
|
130
|
+
brands: BrandVersion[];
|
|
131
|
+
mobile: boolean;
|
|
132
|
+
platform: string;
|
|
133
|
+
platformVersion: string;
|
|
134
|
+
architecture: string;
|
|
135
|
+
bitness: string;
|
|
136
|
+
model: string;
|
|
137
|
+
fullVersionList: BrandVersion[];
|
|
138
|
+
wow64?: boolean;
|
|
139
|
+
/** Serialized RFC 8942 compliant headers */
|
|
140
|
+
headers: ClientHintsHeaders;
|
|
141
|
+
}
|
|
142
|
+
interface DevicePassportContext {
|
|
143
|
+
viewport: {
|
|
144
|
+
width: number;
|
|
145
|
+
height: number;
|
|
146
|
+
};
|
|
147
|
+
userAgent: string;
|
|
148
|
+
locale: string;
|
|
149
|
+
timezoneId: string;
|
|
150
|
+
geolocation?: {
|
|
151
|
+
latitude: number;
|
|
152
|
+
longitude: number;
|
|
153
|
+
accuracy?: number;
|
|
154
|
+
};
|
|
155
|
+
permissions?: string[];
|
|
156
|
+
extraHTTPHeaders: Record<string, string>;
|
|
157
|
+
deviceScaleFactor: number;
|
|
158
|
+
hasTouch: boolean;
|
|
159
|
+
isMobile: boolean;
|
|
160
|
+
colorScheme?: 'light' | 'dark' | 'no-preference';
|
|
161
|
+
}
|
|
162
|
+
interface DevicePassport {
|
|
163
|
+
/** Unique deterministic or UUID identifier */
|
|
164
|
+
id: string;
|
|
165
|
+
/** Seed used to generate this passport */
|
|
166
|
+
seed: string;
|
|
167
|
+
/** ISO 8601 creation timestamp */
|
|
168
|
+
createdAt: string;
|
|
169
|
+
/** Browser profile */
|
|
170
|
+
browser: BrowserProfile;
|
|
171
|
+
/** Operating system profile */
|
|
172
|
+
os: OperatingSystemProfile;
|
|
173
|
+
/** Hardware profile (screen, cpu, memory, gpu) */
|
|
174
|
+
hardware: HardwareProfile;
|
|
175
|
+
/** Locale, language, timezone */
|
|
176
|
+
locale: LocaleProfile;
|
|
177
|
+
/** All HTTP headers (User-Agent, Sec-CH-UA*, Accept*, etc.) */
|
|
178
|
+
headers: Record<string, string>;
|
|
179
|
+
/** High-entropy and low-entropy Client Hints */
|
|
180
|
+
clientHints: UserAgentClientHints;
|
|
181
|
+
/** Ready-to-use context options for Playwright / Puppeteer / Browser */
|
|
182
|
+
context: DevicePassportContext;
|
|
183
|
+
/** Consistency and anti-detection score evaluation */
|
|
184
|
+
evaluation?: PassportEvaluation;
|
|
185
|
+
/** Optional helper method to get merged headers */
|
|
186
|
+
getHeaders?: (overrides?: Record<string, string>) => Record<string, string>;
|
|
187
|
+
}
|
|
188
|
+
/** Alias for backward compatibility */
|
|
189
|
+
type DeviceProfile = DevicePassport;
|
|
190
|
+
interface PassportGeneratorOptions {
|
|
191
|
+
/** Deterministic seed (username, account ID, proxy IP, etc.) */
|
|
192
|
+
seed?: string | number;
|
|
193
|
+
/** Geographic country code ('US', 'JP', etc.) or residential proxy URL */
|
|
194
|
+
geo?: string;
|
|
195
|
+
/** Residential proxy URL to detect geographical location from */
|
|
196
|
+
proxy?: string;
|
|
197
|
+
proxyUrl?: string;
|
|
198
|
+
/** Preferred Operating System */
|
|
199
|
+
os?: SupportedPlatform;
|
|
200
|
+
/** Preferred Browser */
|
|
201
|
+
browser?: SupportedBrowserName;
|
|
202
|
+
/** Preferred primary locale (e.g. 'en-US', 'zh-CN') */
|
|
203
|
+
locale?: string;
|
|
204
|
+
/** Preferred country code (e.g. 'US', 'GB', 'DE', 'JP') */
|
|
205
|
+
country?: string;
|
|
206
|
+
/** Preferred timezone (e.g. 'America/New_York') */
|
|
207
|
+
timezone?: string;
|
|
208
|
+
/** Whether to integrate with header-generator when available */
|
|
209
|
+
useHeaderGenerator?: boolean;
|
|
210
|
+
/** Hardware tier preference */
|
|
211
|
+
hardwareTier?: 'standard' | 'high-performance';
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export { LocaleProfile };
|
|
215
|
+
export type { BenchmarkMetrics, BrandVersion, BrowserProfile, ClientHintsHeaders, ConsistencyCategory, ConsistencyCheck, CpuProfile, DevicePassport, DevicePassportContext, DeviceProfile, EntropyAnalysis, EvaluationGrade, EvaluationStatus, GpuProfile, HardwareProfile, MemoryProfile, OperatingSystemProfile, PassportEvaluation, PassportGeneratorOptions, ScreenProfile, SupportedArchitecture, SupportedBrowserName, SupportedPlatform, UserAgentClientHints };
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { L as LocaleProfile } from '../shared/device-passport.C_F1vBE8.js';
|
|
2
|
+
export { C as CountryGeoDefinition, G as GeoContext, a as GeoCoordinates, b as GeoLocation, c as GeoOptions, d as LanguageWeight } from '../shared/device-passport.C_F1vBE8.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Metrics, Consistency Evaluation, and Benchmark types for Device Passport.
|
|
6
|
+
*/
|
|
7
|
+
type ConsistencyCategory = 'os_ua_alignment' | 'client_hints_entropy' | 'hardware_plausibility' | 'geo_locale_coherence' | 'webgl_hardware_coupling' | 'screen_viewport_consistency';
|
|
8
|
+
interface ConsistencyCheck {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
category: ConsistencyCategory;
|
|
12
|
+
passed: boolean;
|
|
13
|
+
score: number;
|
|
14
|
+
weight: number;
|
|
15
|
+
message: string;
|
|
16
|
+
details?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
interface EntropyAnalysis {
|
|
19
|
+
estimatedBits: number;
|
|
20
|
+
collisionRisk: 'very_low' | 'low' | 'moderate' | 'high';
|
|
21
|
+
fingerprintUniqueness?: number;
|
|
22
|
+
}
|
|
23
|
+
type EvaluationStatus = 'PASS' | 'WARN' | 'FAIL';
|
|
24
|
+
type EvaluationGrade = 'A+' | 'A' | 'B' | 'C' | 'F';
|
|
25
|
+
interface PassportEvaluation {
|
|
26
|
+
/** Overall consistency score (0 - 100) */
|
|
27
|
+
overallScore: number;
|
|
28
|
+
/** Pass / Warn / Fail status based on strict thresholds */
|
|
29
|
+
status: EvaluationStatus;
|
|
30
|
+
/** Academic grade assessment */
|
|
31
|
+
grade: EvaluationGrade;
|
|
32
|
+
/** Individual check breakdowns */
|
|
33
|
+
checks: ConsistencyCheck[];
|
|
34
|
+
/** Entropy and collision analysis */
|
|
35
|
+
entropyAnalysis?: EntropyAnalysis;
|
|
36
|
+
/** ISO timestamp when evaluated */
|
|
37
|
+
evaluatedAt: string;
|
|
38
|
+
}
|
|
39
|
+
interface BenchmarkMetrics {
|
|
40
|
+
passportId: string;
|
|
41
|
+
determinismScore: number;
|
|
42
|
+
contradictionRate: number;
|
|
43
|
+
overallConsistencyScore: number;
|
|
44
|
+
generationLatencyMs: number;
|
|
45
|
+
entropyBits: number;
|
|
46
|
+
timestamp: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Core type definitions for Device Passport.
|
|
51
|
+
* Compliant with RFC 8942, W3C User-Agent Client Hints, and WebGL specs.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
type SupportedBrowserName = 'Chrome' | 'Edge' | 'Safari' | 'Firefox';
|
|
55
|
+
type SupportedPlatform = 'macOS' | 'Windows';
|
|
56
|
+
type SupportedArchitecture = 'arm' | 'x86';
|
|
57
|
+
interface BrowserProfile {
|
|
58
|
+
name: SupportedBrowserName;
|
|
59
|
+
version: string;
|
|
60
|
+
majorVersion: number;
|
|
61
|
+
userAgent: string;
|
|
62
|
+
}
|
|
63
|
+
interface OperatingSystemProfile {
|
|
64
|
+
name: SupportedPlatform;
|
|
65
|
+
platform: SupportedPlatform;
|
|
66
|
+
version: string;
|
|
67
|
+
release: string;
|
|
68
|
+
architecture: SupportedArchitecture;
|
|
69
|
+
}
|
|
70
|
+
interface ScreenProfile {
|
|
71
|
+
width: number;
|
|
72
|
+
height: number;
|
|
73
|
+
availWidth: number;
|
|
74
|
+
availHeight: number;
|
|
75
|
+
dpr: number;
|
|
76
|
+
colorDepth: number;
|
|
77
|
+
pixelDepth: number;
|
|
78
|
+
}
|
|
79
|
+
interface CpuProfile {
|
|
80
|
+
architecture: SupportedArchitecture;
|
|
81
|
+
concurrency: number;
|
|
82
|
+
}
|
|
83
|
+
interface MemoryProfile {
|
|
84
|
+
deviceMemory: number;
|
|
85
|
+
physicalMemoryGB?: number;
|
|
86
|
+
}
|
|
87
|
+
interface GpuProfile {
|
|
88
|
+
vendor: string;
|
|
89
|
+
renderer: string;
|
|
90
|
+
webglVendor?: string;
|
|
91
|
+
webglRenderer?: string;
|
|
92
|
+
}
|
|
93
|
+
interface HardwareProfile {
|
|
94
|
+
screen: ScreenProfile;
|
|
95
|
+
cpu: CpuProfile;
|
|
96
|
+
memory: MemoryProfile;
|
|
97
|
+
gpu: GpuProfile;
|
|
98
|
+
}
|
|
99
|
+
interface BrandVersion {
|
|
100
|
+
brand: string;
|
|
101
|
+
version: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Raw RFC 8942 / RFC 8941 structured client hints headers.
|
|
105
|
+
*/
|
|
106
|
+
interface ClientHintsHeaders {
|
|
107
|
+
/** Low-entropy brand and major version, e.g. `"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"` */
|
|
108
|
+
'sec-ch-ua': string;
|
|
109
|
+
/** Low-entropy mobile indicator, `"?0"` or `"?1"` */
|
|
110
|
+
'sec-ch-ua-mobile': string;
|
|
111
|
+
/** Low-entropy platform, e.g. `"macOS"` or `"Windows"` */
|
|
112
|
+
'sec-ch-ua-platform': string;
|
|
113
|
+
/** High-entropy OS version, e.g. `"14.6.1"` or `"15.0.0"` */
|
|
114
|
+
'sec-ch-ua-platform-version': string;
|
|
115
|
+
/** High-entropy architecture, e.g. `"arm"` or `"x86"` */
|
|
116
|
+
'sec-ch-ua-arch': string;
|
|
117
|
+
/** High-entropy bitness, e.g. `"64"` */
|
|
118
|
+
'sec-ch-ua-bitness': string;
|
|
119
|
+
/** High-entropy device model, `""` for desktop */
|
|
120
|
+
'sec-ch-ua-model': string;
|
|
121
|
+
/** High-entropy full version list, e.g. `"Chromium";v="124.0.6367.208", "Google Chrome";v="124.0.6367.208"` */
|
|
122
|
+
'sec-ch-ua-full-version-list': string;
|
|
123
|
+
/** High-entropy 32-bit on 64-bit Windows flag, `"?0"` */
|
|
124
|
+
'sec-ch-ua-wow64'?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Structured User-Agent Client Hints object representing navigator.userAgentData.
|
|
128
|
+
*/
|
|
129
|
+
interface UserAgentClientHints {
|
|
130
|
+
brands: BrandVersion[];
|
|
131
|
+
mobile: boolean;
|
|
132
|
+
platform: string;
|
|
133
|
+
platformVersion: string;
|
|
134
|
+
architecture: string;
|
|
135
|
+
bitness: string;
|
|
136
|
+
model: string;
|
|
137
|
+
fullVersionList: BrandVersion[];
|
|
138
|
+
wow64?: boolean;
|
|
139
|
+
/** Serialized RFC 8942 compliant headers */
|
|
140
|
+
headers: ClientHintsHeaders;
|
|
141
|
+
}
|
|
142
|
+
interface DevicePassportContext {
|
|
143
|
+
viewport: {
|
|
144
|
+
width: number;
|
|
145
|
+
height: number;
|
|
146
|
+
};
|
|
147
|
+
userAgent: string;
|
|
148
|
+
locale: string;
|
|
149
|
+
timezoneId: string;
|
|
150
|
+
geolocation?: {
|
|
151
|
+
latitude: number;
|
|
152
|
+
longitude: number;
|
|
153
|
+
accuracy?: number;
|
|
154
|
+
};
|
|
155
|
+
permissions?: string[];
|
|
156
|
+
extraHTTPHeaders: Record<string, string>;
|
|
157
|
+
deviceScaleFactor: number;
|
|
158
|
+
hasTouch: boolean;
|
|
159
|
+
isMobile: boolean;
|
|
160
|
+
colorScheme?: 'light' | 'dark' | 'no-preference';
|
|
161
|
+
}
|
|
162
|
+
interface DevicePassport {
|
|
163
|
+
/** Unique deterministic or UUID identifier */
|
|
164
|
+
id: string;
|
|
165
|
+
/** Seed used to generate this passport */
|
|
166
|
+
seed: string;
|
|
167
|
+
/** ISO 8601 creation timestamp */
|
|
168
|
+
createdAt: string;
|
|
169
|
+
/** Browser profile */
|
|
170
|
+
browser: BrowserProfile;
|
|
171
|
+
/** Operating system profile */
|
|
172
|
+
os: OperatingSystemProfile;
|
|
173
|
+
/** Hardware profile (screen, cpu, memory, gpu) */
|
|
174
|
+
hardware: HardwareProfile;
|
|
175
|
+
/** Locale, language, timezone */
|
|
176
|
+
locale: LocaleProfile;
|
|
177
|
+
/** All HTTP headers (User-Agent, Sec-CH-UA*, Accept*, etc.) */
|
|
178
|
+
headers: Record<string, string>;
|
|
179
|
+
/** High-entropy and low-entropy Client Hints */
|
|
180
|
+
clientHints: UserAgentClientHints;
|
|
181
|
+
/** Ready-to-use context options for Playwright / Puppeteer / Browser */
|
|
182
|
+
context: DevicePassportContext;
|
|
183
|
+
/** Consistency and anti-detection score evaluation */
|
|
184
|
+
evaluation?: PassportEvaluation;
|
|
185
|
+
/** Optional helper method to get merged headers */
|
|
186
|
+
getHeaders?: (overrides?: Record<string, string>) => Record<string, string>;
|
|
187
|
+
}
|
|
188
|
+
/** Alias for backward compatibility */
|
|
189
|
+
type DeviceProfile = DevicePassport;
|
|
190
|
+
interface PassportGeneratorOptions {
|
|
191
|
+
/** Deterministic seed (username, account ID, proxy IP, etc.) */
|
|
192
|
+
seed?: string | number;
|
|
193
|
+
/** Geographic country code ('US', 'JP', etc.) or residential proxy URL */
|
|
194
|
+
geo?: string;
|
|
195
|
+
/** Residential proxy URL to detect geographical location from */
|
|
196
|
+
proxy?: string;
|
|
197
|
+
proxyUrl?: string;
|
|
198
|
+
/** Preferred Operating System */
|
|
199
|
+
os?: SupportedPlatform;
|
|
200
|
+
/** Preferred Browser */
|
|
201
|
+
browser?: SupportedBrowserName;
|
|
202
|
+
/** Preferred primary locale (e.g. 'en-US', 'zh-CN') */
|
|
203
|
+
locale?: string;
|
|
204
|
+
/** Preferred country code (e.g. 'US', 'GB', 'DE', 'JP') */
|
|
205
|
+
country?: string;
|
|
206
|
+
/** Preferred timezone (e.g. 'America/New_York') */
|
|
207
|
+
timezone?: string;
|
|
208
|
+
/** Whether to integrate with header-generator when available */
|
|
209
|
+
useHeaderGenerator?: boolean;
|
|
210
|
+
/** Hardware tier preference */
|
|
211
|
+
hardwareTier?: 'standard' | 'high-performance';
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export { LocaleProfile };
|
|
215
|
+
export type { BenchmarkMetrics, BrandVersion, BrowserProfile, ClientHintsHeaders, ConsistencyCategory, ConsistencyCheck, CpuProfile, DevicePassport, DevicePassportContext, DeviceProfile, EntropyAnalysis, EvaluationGrade, EvaluationStatus, GpuProfile, HardwareProfile, MemoryProfile, OperatingSystemProfile, PassportEvaluation, PassportGeneratorOptions, ScreenProfile, SupportedArchitecture, SupportedBrowserName, SupportedPlatform, UserAgentClientHints };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "device-passport",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Digital device passports for scrapers, bots and automation. 100% consistent, stateful browser personas with sticky hardware, correlated Client-Hints, and geo-aligned locales.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -11,6 +11,31 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"import": "./dist/index.mjs",
|
|
13
13
|
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./geo": {
|
|
16
|
+
"types": "./dist/geo/index.d.ts",
|
|
17
|
+
"import": "./dist/geo/index.mjs",
|
|
18
|
+
"require": "./dist/geo/index.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./storage": {
|
|
21
|
+
"types": "./dist/storage/index.d.ts",
|
|
22
|
+
"import": "./dist/storage/index.mjs",
|
|
23
|
+
"require": "./dist/storage/index.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./adapters": {
|
|
26
|
+
"types": "./dist/adapters/index.d.ts",
|
|
27
|
+
"import": "./dist/adapters/index.mjs",
|
|
28
|
+
"require": "./dist/adapters/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./evaluator": {
|
|
31
|
+
"types": "./dist/evaluator/index.d.ts",
|
|
32
|
+
"import": "./dist/evaluator/index.mjs",
|
|
33
|
+
"require": "./dist/evaluator/index.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./types": {
|
|
36
|
+
"types": "./dist/types/index.d.ts",
|
|
37
|
+
"import": "./dist/types/index.mjs",
|
|
38
|
+
"require": "./dist/types/index.cjs"
|
|
14
39
|
}
|
|
15
40
|
},
|
|
16
41
|
"files": [
|
|
@@ -24,7 +49,7 @@
|
|
|
24
49
|
"build": "unbuild",
|
|
25
50
|
"test": "bun test tests/",
|
|
26
51
|
"lint": "tsc --noEmit",
|
|
27
|
-
"prepublishOnly": "
|
|
52
|
+
"prepublishOnly": "npm run build && node scripts/prepublish-gate.mjs && node scripts/readme-gate.mjs && node scripts/version-sync-gate.mjs"
|
|
28
53
|
},
|
|
29
54
|
"keywords": [
|
|
30
55
|
"user-agent",
|