@thumbmarkjs/thumbmarkjs 1.3.1 → 1.3.3
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 +2 -5
- package/dist/thumbmark.cjs.js +1 -1
- package/dist/thumbmark.cjs.js.map +1 -1
- package/dist/thumbmark.esm.js +1 -1
- package/dist/thumbmark.esm.js.map +1 -1
- package/dist/thumbmark.umd.js +1 -1
- package/dist/thumbmark.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/functions/index.ts +1 -1
- package/src/options.ts +8 -1
- package/dist/types/components/audio/index.d.ts +0 -2
- package/dist/types/components/canvas/index.d.ts +0 -3
- package/dist/types/components/fonts/index.d.ts +0 -4
- package/dist/types/components/hardware/index.d.ts +0 -2
- package/dist/types/components/locales/index.d.ts +0 -2
- package/dist/types/components/math/index.d.ts +0 -2
- package/dist/types/components/mathml/index.d.ts +0 -2
- package/dist/types/components/permissions/index.d.ts +0 -3
- package/dist/types/components/plugins/index.d.ts +0 -2
- package/dist/types/components/screen/index.d.ts +0 -2
- package/dist/types/components/system/browser.d.ts +0 -7
- package/dist/types/components/system/index.d.ts +0 -2
- package/dist/types/components/webgl/index.d.ts +0 -2
- package/dist/types/components/webrtc/index.d.ts +0 -2
- package/dist/types/factory.d.ts +0 -60
- package/dist/types/functions/api.d.ts +0 -39
- package/dist/types/functions/filterComponents.d.ts +0 -10
- package/dist/types/functions/index.d.ts +0 -45
- package/dist/types/functions/legacy_functions.d.ts +0 -27
- package/dist/types/index.d.ts +0 -8
- package/dist/types/options.d.ts +0 -45
- package/dist/types/thumbmark.d.ts +0 -26
- package/dist/types/utils/commonPixels.d.ts +0 -1
- package/dist/types/utils/ephemeralIFrame.d.ts +0 -4
- package/dist/types/utils/getMostFrequent.d.ts +0 -5
- package/dist/types/utils/hash.d.ts +0 -5
- package/dist/types/utils/imageDataToDataURL.d.ts +0 -1
- package/dist/types/utils/log.d.ts +0 -8
- package/dist/types/utils/raceAll.d.ts +0 -9
- package/dist/types/utils/sort.d.ts +0 -8
- package/dist/types/utils/version.d.ts +0 -4
- package/dist/types/utils/visitorId.d.ts +0 -11
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { componentInterface } from '../../factory';
|
|
2
|
-
import { optionsInterface } from '../../options';
|
|
3
|
-
export default function getFonts(options?: optionsInterface): Promise<componentInterface | null>;
|
|
4
|
-
export declare function getFontMetrics(): Promise<componentInterface>;
|
package/dist/types/factory.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is used to create the includeComponent function as well as the interfaces each of the
|
|
3
|
-
* fingerprint components must implement.
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
import { optionsInterface } from './options';
|
|
7
|
-
import getAudio from "./components/audio";
|
|
8
|
-
import getCanvas from "./components/canvas";
|
|
9
|
-
import getFonts from "./components/fonts";
|
|
10
|
-
import getHardware from "./components/hardware";
|
|
11
|
-
import getLocales from "./components/locales";
|
|
12
|
-
import getMath from "./components/math";
|
|
13
|
-
import getPermissions from "./components/permissions";
|
|
14
|
-
import getPlugins from "./components/plugins";
|
|
15
|
-
import getScreen from "./components/screen";
|
|
16
|
-
import getSystem from "./components/system";
|
|
17
|
-
import getWebGL from "./components/webgl";
|
|
18
|
-
import getWebRTC from "./components/webrtc";
|
|
19
|
-
import getMathML from "./components/mathml";
|
|
20
|
-
/**
|
|
21
|
-
* @description key->function map of built-in components. Do not call the function here.
|
|
22
|
-
*/
|
|
23
|
-
export declare const tm_component_promises: {
|
|
24
|
-
audio: typeof getAudio;
|
|
25
|
-
canvas: typeof getCanvas;
|
|
26
|
-
fonts: typeof getFonts;
|
|
27
|
-
hardware: typeof getHardware;
|
|
28
|
-
locales: typeof getLocales;
|
|
29
|
-
math: typeof getMath;
|
|
30
|
-
permissions: typeof getPermissions;
|
|
31
|
-
plugins: typeof getPlugins;
|
|
32
|
-
screen: typeof getScreen;
|
|
33
|
-
system: typeof getSystem;
|
|
34
|
-
webgl: typeof getWebGL;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* @description key->function map of experimental components. Only resolved during logging.
|
|
38
|
-
*/
|
|
39
|
-
export declare const tm_experimental_component_promises: {
|
|
40
|
-
webrtc: typeof getWebRTC;
|
|
41
|
-
mathml: typeof getMathML;
|
|
42
|
-
};
|
|
43
|
-
export interface componentInterface {
|
|
44
|
-
[key: string]: string | string[] | number | boolean | componentInterface;
|
|
45
|
-
}
|
|
46
|
-
export interface componentFunctionInterface {
|
|
47
|
-
(options?: optionsInterface): Promise<componentInterface | null>;
|
|
48
|
-
}
|
|
49
|
-
export declare const customComponents: {
|
|
50
|
-
[name: string]: componentFunctionInterface | null;
|
|
51
|
-
};
|
|
52
|
-
export declare const timeoutInstance: componentInterface;
|
|
53
|
-
/**
|
|
54
|
-
* includeComponent is the function each custom component function needs to call in order for the component to be included
|
|
55
|
-
* in the fingerprint.
|
|
56
|
-
* @param {string} name - the name identifier of the component
|
|
57
|
-
* @param {componentFunctionInterface} creationFunction - the function that implements the component
|
|
58
|
-
* @returns nothing
|
|
59
|
-
*/
|
|
60
|
-
export declare const includeComponent: (name: string, creationFunction: componentFunctionInterface, options?: optionsInterface) => void;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { optionsInterface } from '../options';
|
|
2
|
-
import { componentInterface } from '../factory';
|
|
3
|
-
/**
|
|
4
|
-
* Info returned from the API (IP, classification, uniqueness, etc)
|
|
5
|
-
*/
|
|
6
|
-
export interface infoInterface {
|
|
7
|
-
ip_address?: {
|
|
8
|
-
ip_address: string;
|
|
9
|
-
ip_identifier: string;
|
|
10
|
-
autonomous_system_number: number;
|
|
11
|
-
ip_version: 'v6' | 'v4';
|
|
12
|
-
};
|
|
13
|
-
classification?: {
|
|
14
|
-
tor: boolean;
|
|
15
|
-
vpn: boolean;
|
|
16
|
-
bot: boolean;
|
|
17
|
-
datacenter: boolean;
|
|
18
|
-
danger_level: number;
|
|
19
|
-
};
|
|
20
|
-
uniqueness?: {
|
|
21
|
-
score: number | string;
|
|
22
|
-
};
|
|
23
|
-
timed_out?: boolean;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* API response structure
|
|
27
|
-
*/
|
|
28
|
-
interface apiResponse {
|
|
29
|
-
info?: infoInterface;
|
|
30
|
-
version?: string;
|
|
31
|
-
components?: componentInterface;
|
|
32
|
-
visitorId?: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Calls the Thumbmark API with the given components, using caching and deduplication.
|
|
36
|
-
* Returns a promise for the API response or null on error.
|
|
37
|
-
*/
|
|
38
|
-
export declare const getApiPromise: (options: optionsInterface, components: componentInterface) => Promise<apiResponse | null>;
|
|
39
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { componentInterface } from "../factory";
|
|
2
|
-
import { optionsInterface } from "../options";
|
|
3
|
-
/**
|
|
4
|
-
* Filters a componentInterface object based on include/exclude and stabilization options.
|
|
5
|
-
*
|
|
6
|
-
* @param obj - The object to filter
|
|
7
|
-
* @param options - Filtering options
|
|
8
|
-
* @returns Filtered object
|
|
9
|
-
*/
|
|
10
|
-
export declare function filterThumbmarkData(obj: componentInterface, options?: optionsInterface): componentInterface;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ThumbmarkJS: Main fingerprinting and API logic
|
|
3
|
-
*
|
|
4
|
-
* This module handles component collection, API calls, uniqueness scoring, and data filtering
|
|
5
|
-
* for the ThumbmarkJS browser fingerprinting library.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
import { optionsInterface } from "../options";
|
|
9
|
-
import { componentInterface, includeComponent as globalIncludeComponent } from "../factory";
|
|
10
|
-
/**
|
|
11
|
-
* Final thumbmark response structure
|
|
12
|
-
*/
|
|
13
|
-
interface thumbmarkResponse {
|
|
14
|
-
components: componentInterface;
|
|
15
|
-
info: {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
};
|
|
18
|
-
version: string;
|
|
19
|
-
thumbmark: string;
|
|
20
|
-
visitorId?: string;
|
|
21
|
-
elapsed?: any;
|
|
22
|
-
error?: string;
|
|
23
|
-
experimental?: componentInterface;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Main entry point: collects all components, optionally calls API, and returns thumbmark data.
|
|
27
|
-
*
|
|
28
|
-
* @param options - Options for fingerprinting and API
|
|
29
|
-
* @returns thumbmarkResponse (elapsed is present only if options.performance is true)
|
|
30
|
-
*/
|
|
31
|
-
export declare function getThumbmark(options?: optionsInterface): Promise<thumbmarkResponse>;
|
|
32
|
-
/**
|
|
33
|
-
* Resolves and times all filtered component promises from a component function map.
|
|
34
|
-
*
|
|
35
|
-
* @param comps - Map of component functions
|
|
36
|
-
* @param options - Options for filtering and timing
|
|
37
|
-
* @returns Object with elapsed times and filtered resolved components
|
|
38
|
-
*/
|
|
39
|
-
export declare function resolveClientComponents(comps: {
|
|
40
|
-
[key: string]: (options?: optionsInterface) => Promise<componentInterface | null>;
|
|
41
|
-
}, options?: optionsInterface): Promise<{
|
|
42
|
-
elapsed: Record<string, number>;
|
|
43
|
-
resolvedComponents: componentInterface;
|
|
44
|
-
}>;
|
|
45
|
-
export { globalIncludeComponent as includeComponent };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is here to support legacy implementations.
|
|
3
|
-
* Eventually, these functions will be removed to keep the library small.
|
|
4
|
-
*/
|
|
5
|
-
import { componentInterface } from '../factory';
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @deprecated
|
|
9
|
-
*/
|
|
10
|
-
export declare function getFingerprintData(): Promise<componentInterface>;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param includeData boolean
|
|
14
|
-
* @deprecated this function is going to be removed. use getThumbmark or Thumbmark class instead.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getFingerprint(includeData?: false): Promise<string>;
|
|
17
|
-
export declare function getFingerprint(includeData: true): Promise<{
|
|
18
|
-
hash: string;
|
|
19
|
-
data: componentInterface;
|
|
20
|
-
}>;
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @deprecated use Thumbmark or getThumbmark instead with options
|
|
24
|
-
*/
|
|
25
|
-
export declare function getFingerprintPerformance(): Promise<{
|
|
26
|
-
elapsed: Record<string, number>;
|
|
27
|
-
}>;
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { getFingerprint, getFingerprintData, getFingerprintPerformance } from './functions/legacy_functions';
|
|
2
|
-
import { getThumbmark } from './functions';
|
|
3
|
-
import { getVersion } from './utils/version';
|
|
4
|
-
import { setOption, optionsInterface, stabilizationExclusionRules } from './options';
|
|
5
|
-
import { includeComponent } from './factory';
|
|
6
|
-
import { Thumbmark } from './thumbmark';
|
|
7
|
-
import { filterThumbmarkData } from './functions/filterComponents';
|
|
8
|
-
export { Thumbmark, getThumbmark, getVersion, filterThumbmarkData, optionsInterface, stabilizationExclusionRules, setOption, getFingerprint, getFingerprintData, getFingerprintPerformance, includeComponent };
|
package/dist/types/options.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export interface optionsInterface {
|
|
2
|
-
exclude?: string[];
|
|
3
|
-
include?: string[];
|
|
4
|
-
permissions_to_check?: PermissionName[];
|
|
5
|
-
timeout?: number;
|
|
6
|
-
logging?: boolean;
|
|
7
|
-
api_key?: string;
|
|
8
|
-
cache_api_call?: boolean;
|
|
9
|
-
performance?: boolean;
|
|
10
|
-
stabilize?: string[];
|
|
11
|
-
experimental?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare const API_ENDPOINT = "https://api.thumbmarkjs.com";
|
|
14
|
-
export declare const defaultOptions: optionsInterface;
|
|
15
|
-
export declare let options: {
|
|
16
|
-
exclude?: string[] | undefined;
|
|
17
|
-
include?: string[] | undefined;
|
|
18
|
-
permissions_to_check?: PermissionName[] | undefined;
|
|
19
|
-
timeout?: number | undefined;
|
|
20
|
-
logging?: boolean | undefined;
|
|
21
|
-
api_key?: string | undefined;
|
|
22
|
-
cache_api_call?: boolean | undefined;
|
|
23
|
-
performance?: boolean | undefined;
|
|
24
|
-
stabilize?: string[] | undefined;
|
|
25
|
-
experimental?: boolean | undefined;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
29
|
-
* @param key @deprecated this function will be removed
|
|
30
|
-
* @param value
|
|
31
|
-
*/
|
|
32
|
-
export declare function setOption<K extends keyof optionsInterface>(key: K, value: optionsInterface[K]): void;
|
|
33
|
-
export declare const stabilizationExclusionRules: {
|
|
34
|
-
private: {
|
|
35
|
-
exclude: string[];
|
|
36
|
-
browsers: string[];
|
|
37
|
-
}[];
|
|
38
|
-
iframe: {
|
|
39
|
-
exclude: string[];
|
|
40
|
-
browsers: string[];
|
|
41
|
-
}[];
|
|
42
|
-
vpn: {
|
|
43
|
-
exclude: string[];
|
|
44
|
-
}[];
|
|
45
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { optionsInterface } from "./options";
|
|
2
|
-
import { componentInterface } from "./factory";
|
|
3
|
-
/**
|
|
4
|
-
* A client for generating thumbmarks with a persistent configuration.
|
|
5
|
-
*/
|
|
6
|
-
export declare class Thumbmark {
|
|
7
|
-
private options;
|
|
8
|
-
/**
|
|
9
|
-
* Creates a new Thumbmarker client instance.
|
|
10
|
-
* @param options - Default configuration options for this instance.
|
|
11
|
-
*/
|
|
12
|
-
constructor(options?: optionsInterface);
|
|
13
|
-
/**
|
|
14
|
-
* Generates a thumbmark using the instance's configuration.
|
|
15
|
-
* @param overrideOptions - Options to override for this specific call.
|
|
16
|
-
* @returns The thumbmark result.
|
|
17
|
-
*/
|
|
18
|
-
get(overrideOptions?: optionsInterface): Promise<any>;
|
|
19
|
-
getVersion(): string;
|
|
20
|
-
/**
|
|
21
|
-
* Register a custom component to be included in the fingerprint.
|
|
22
|
-
* @param key - The component name
|
|
23
|
-
* @param fn - The component function
|
|
24
|
-
*/
|
|
25
|
-
includeComponent(key: string, fn: (options?: optionsInterface) => Promise<componentInterface | null>): void;
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getCommonPixels(images: ImageData[], width: number, height: number): ImageData;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function imageDataToDataURL(imageData: ImageData): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { componentInterface } from '../factory';
|
|
2
|
-
import { optionsInterface } from '../options';
|
|
3
|
-
/**
|
|
4
|
-
* Logs thumbmark data to remote logging endpoint (only once per session)
|
|
5
|
-
* You can disable this by setting options.logging to false.
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export declare function logThumbmarkData(thisHash: string, thumbmarkData: componentInterface, options: optionsInterface, experimentalData?: componentInterface): Promise<void>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type DelayedPromise<T> = Promise<T>;
|
|
2
|
-
export declare function delay<T>(t: number, val: T): DelayedPromise<T>;
|
|
3
|
-
export interface RaceResult<T> {
|
|
4
|
-
value: T;
|
|
5
|
-
elapsed?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function raceAllPerformance<T>(promises: Promise<T>[], timeoutTime: number, timeoutVal: T): Promise<RaceResult<T>[]>;
|
|
8
|
-
export declare function raceAll<T>(promises: Promise<T>[], timeoutTime: number, timeoutVal: T): Promise<(T | undefined)[]>;
|
|
9
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { componentInterface } from '../factory';
|
|
2
|
-
/**
|
|
3
|
-
* Recursively sorts the keys of a component object alphabetically.
|
|
4
|
-
* This ensures a consistent order for hashing.
|
|
5
|
-
* @param obj The component object to sort.
|
|
6
|
-
* @returns A new object with sorted keys.
|
|
7
|
-
*/
|
|
8
|
-
export declare function sortComponentKeys(obj: componentInterface): componentInterface;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Visitor ID storage utilities - localStorage only, server generates IDs
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Gets visitor ID from localStorage, returns null if unavailable
|
|
6
|
-
*/
|
|
7
|
-
export declare function getVisitorId(): string | null;
|
|
8
|
-
/**
|
|
9
|
-
* Sets visitor ID in localStorage
|
|
10
|
-
*/
|
|
11
|
-
export declare function setVisitorId(visitorId: string): void;
|