/*! * Copyright (c) 2025 Akshat Kotpalliwar (alias IntegerAlex on GitHub) * This software is licensed under the GNU Lesser General Public License (LGPL) v3 or later. * * You are free to use, modify, and redistribute this software, but modifications must also be licensed under the LGPL. * This project is distributed without any warranty; see the LGPL for more details. * * For a full copy of the LGPL and ethical contribution guidelines, please refer to the `COPYRIGHT.md` and `NOTICE.md` files. */ import { generateJSON } from './json'; import { fetchGeolocationInfo } from './geo-ip'; import { getSystemInfo, detectBot } from './systemInfo'; import { detectDeviceType } from './deviceType'; import { getMockSystemInfo } from './mock'; import { isRiskyASN, getUAPlatformMismatch, getLanguageConsistency, checkBrowserConsistency } from './confidence'; import { Toast } from './compliance'; import { generateId } from './hash'; import { detectIncognito } from './incognito'; import { detectAdBlockers } from './adblocker'; import { getVpnStatus } from './vpn'; import { Telemetry, TelemetryConfig, withTelemetry } from './telemetry'; import { getColorGamut, getVendorFlavors, isLocalStorageEnabled, isSessionStorageEnabled, isIndexedDBEnabled, getTouchSupportInfo, getOSInfo, getPluginsInfo, getMathFingerprint, getCanvasFingerprint, getAudioFingerprint, getWebGLInfo, getFontPreferences, estimateCores } from './helper'; import { initializeConfig, getConfig, updateConfig, detectEnvironment, isVerboseEnabled, StructuredLogger, PerformanceTimer } from './config'; import type { UserInfoConfig } from './types'; /** * Retrieves user system and geolocation data concurrently, computes a confidence score, and returns a JSON object summarizing these details. * * The function fetches system and geolocation information in parallel and calculates a confidence score based on the integrity of the data. When the optional `transparency` flag is enabled, it logs a copyright notice and displays a notification via Toast using a custom message (or a default message if none is provided). If an error occurs during data retrieval, the function logs the error and uses fallback system data to compute the confidence score. * * @param config - Optional configuration with: * - `transparency`: When true, enables logging and Toast notifications for data collection transparency. * - `message`: A custom message to log and display; defaults to "the software is gathering system data" if not specified. * - `telemetry`: Configuration for OpenTelemetry data collection. * - `environment`: Override environment detection (TEST, DEV, STAGING, PROD). * - `verbose`: Enable verbose logging. * - `logLevel`: Set log level (error, warn, info, verbose, debug). * - `enableConsoleLogging`: Enable/disable console logging. * - `enablePerformanceLogging`: Enable performance metrics logging. * @returns A JSON object containing the fetched system and geolocation data (when available) along with the computed confidence score. */ declare function userInfo(config?: UserInfoConfig & { telemetry?: TelemetryConfig; }): Promise<{ confidenceAssessment: { combined?: { factors: string; rating: string; description: string; reliability: string; level: "low" | "medium-low" | "medium" | "medium-high" | "high"; score: number; } | undefined; system: { factors: string; rating: string; description: string; reliability: string; level: "low" | "medium-low" | "medium" | "medium-high" | "high"; score: number; }; }; geolocation: { vpnStatus: Object | undefined; ip: string | null; ipv4: string | null; ipv6: string | null; city: string; region: { isoCode: string; name: string; }; country: { isoCode: string; name: string; }; continent: { code: string; name: string; }; location: { accuracyRadius: number; latitude: number; longitude: number; timeZone: string; }; traits: { isAnonymous: boolean; isAnonymousProxy: boolean; isAnonymousVpn: boolean; network: string; }; } | null; systemInfo: import("./types").SystemInfo; hash: string; }>; declare const fingerprintOSS: typeof userInfo & { getSystemInfo: typeof getSystemInfo; detectBot: typeof detectBot; fetchGeolocationInfo: typeof fetchGeolocationInfo; generateJSON: typeof generateJSON; generateId: typeof generateId; detectDeviceType: typeof detectDeviceType; detectIncognito: typeof detectIncognito; detectAdBlockers: typeof detectAdBlockers; getVpnStatus: typeof getVpnStatus; getColorGamut: typeof getColorGamut; getVendorFlavors: typeof getVendorFlavors; isLocalStorageEnabled: typeof isLocalStorageEnabled; isSessionStorageEnabled: typeof isSessionStorageEnabled; isIndexedDBEnabled: typeof isIndexedDBEnabled; getTouchSupportInfo: typeof getTouchSupportInfo; getOSInfo: typeof getOSInfo; getPluginsInfo: typeof getPluginsInfo; getMathFingerprint: typeof getMathFingerprint; getCanvasFingerprint: typeof getCanvasFingerprint; getAudioFingerprint: typeof getAudioFingerprint; getWebGLInfo: typeof getWebGLInfo; getFontPreferences: typeof getFontPreferences; estimateCores: typeof estimateCores; getLanguageConsistency: typeof getLanguageConsistency; isRiskyASN: typeof isRiskyASN; getUAPlatformMismatch: typeof getUAPlatformMismatch; checkBrowserConsistency: typeof checkBrowserConsistency; getMockSystemInfo: typeof getMockSystemInfo; Toast: typeof Toast; Telemetry: { initialize: (config?: TelemetryConfig) => void; startSpan: (name: string, attributes?: Record) => import("@opentelemetry/api").Span | null; endSpan: (span: import("@opentelemetry/api").Span | null, attributes?: Record) => void; endSpanWithError: (span: import("@opentelemetry/api").Span | null, error: Error, attributes?: Record) => void; recordError: (error: Error, context?: Record) => void; recordFunctionCall: (functionName: string, executionTime: number, success: boolean, context?: Record) => void; incrementCounter: (name: string, value?: number, attributes?: Record) => void; recordHistogram: (name: string, value: number, attributes?: Record) => void; isEnabled: () => boolean; getConfig: () => TelemetryConfig; }; withTelemetry: typeof withTelemetry; getConfig: typeof getConfig; initializeConfig: typeof initializeConfig; updateConfig: typeof updateConfig; detectEnvironment: typeof detectEnvironment; isVerboseEnabled: typeof isVerboseEnabled; StructuredLogger: typeof StructuredLogger; PerformanceTimer: typeof PerformanceTimer; }; export default fingerprintOSS; export { Telemetry, withTelemetry }; export type { TelemetryConfig }; export { getConfig, initializeConfig, updateConfig, detectEnvironment, isVerboseEnabled, StructuredLogger, PerformanceTimer } from './config'; export type { FingerprintConfig, UserInfoConfig, Environment, LogLevel, ResolvedUserInfoConfig } from './types'; export { FingerprintError } from './errors'; export type { FingerprintWarning } from './errors'; export { getSystemInfo, detectBot } from './systemInfo'; export { fetchGeolocationInfo } from './geo-ip'; export { generateJSON } from './json'; export { generateId, generateIdWithDebug, compareInputs } from './hash'; export { detectIncognito } from './incognito'; export { detectAdBlockers } from './adblocker'; export { getVpnStatus } from './vpn'; export { detectDeviceType } from './deviceType'; export type { DeviceTypeInfo, DeviceTypeSignal } from './deviceType'; export { getColorGamut, getVendorFlavors, isLocalStorageEnabled, isSessionStorageEnabled, isIndexedDBEnabled, getTouchSupportInfo, getOSInfo, getPluginsInfo, getMathFingerprint, getCanvasFingerprint, getAudioFingerprint, getWebGLInfo, getFontPreferences, estimateCores } from './helper'; export { getLanguageConsistency, isRiskyASN, getUAPlatformMismatch, checkBrowserConsistency } from './confidence'; export { getMockSystemInfo } from './mock'; export { Toast } from './compliance';