UNPKG

node_js_ipqs_db_reader

Version:

A Node JS implementation of the IPQualityScore flat file IP reputation database reader.

50 lines (49 loc) 1.39 kB
import FileReader from "./FileReader"; import AbuseVelocity from "./AbuseVelocity"; import ConnectionType from "./ConnectionType"; import FraudScore from "./FraudScore"; import Column from "./Column"; export default class IPQSRecord { isProxy: boolean; isVPN: boolean; isTOR: boolean; isCrawler: boolean; isBot: boolean; recentAbuse: boolean; isBlacklisted: boolean; isPrivate: boolean; isMobile: boolean; hasOpenPorts: boolean; isHostingProvider: boolean; activeVPN: boolean; activeTOR: boolean; publicAccessPoint: boolean; connectionType: ConnectionType | null; abuseVelocity: AbuseVelocity | null; country: string | null; city: string | null; region: string | null; ISP: string | null; organization: string | null; ASN: number | null; timezone: string | null; latitude: number | null; longitude: number | null; fraudScore: FraudScore | null; columns: Column[]; static readonly TREE_BYTES = 8; valid: boolean; file: FileReader; constructor(file: FileReader); private position; private literal; private file_position; private previous; fetch(ip: string): Promise<any>; private populateRecord; private parseRecord; private processFirstByte; private processSecondByte; private convertIPToLitteral; private expandIPv6; }