@hasna/domains
Version:
Domain portfolio, registrar, marketplace, and DNS management for AI agents — CLI + MCP + HTTP API + SDK, shared account API and PostgreSQL
80 lines • 2.73 kB
TypeScript
/**
* Domain History — tracks WHOIS/RDAP/DNS/SSL snapshots over time per domain.
* Each lookup creates a historical record so we can track ownership changes,
* registrar changes, nameserver changes, etc.
*/
export interface DomainHistory {
id: string;
domain_id: string;
snapshot_type: DomainHistoryType;
raw_data: Record<string, unknown>;
registrant_name: string | null;
registrant_email: string | null;
registrant_org: string | null;
nameservers: string[];
registrar: string | null;
status: string | null;
notes: string | null;
created_at: string;
}
export type DomainHistoryType = (typeof HISTORY_TYPES)[number];
export declare const HISTORY_TYPES: readonly ["whois", "rdap", "dns", "ssl", "reputation", "exa_research", "purchase", "renewal"];
export interface CreateHistoryEntryInput {
domain_id: string;
snapshot_type: DomainHistoryType;
raw_data?: Record<string, unknown>;
registrant_name?: string;
registrant_email?: string;
registrant_org?: string;
nameservers?: string[];
registrar?: string;
status?: string;
notes?: string;
}
/**
* Create a new history entry for a domain.
*/
export declare function createHistoryEntry(input: CreateHistoryEntryInput): DomainHistory;
/**
* Get a single history entry by ID.
*/
export declare function getHistoryEntry(id: string): DomainHistory | null;
/**
* Get all history entries for a domain, newest first.
*/
export declare function getHistoryByDomain(domainId: string, options?: {
type?: DomainHistoryType;
limit?: number;
}): DomainHistory[];
/**
* Get history entries within a date range.
*/
export declare function getHistoryByDateRange(startDate: string, endDate: string, domainId?: string): DomainHistory[];
/**
* Get the latest snapshot of a given type for a domain.
*/
export declare function getLatestSnapshot(domainId: string, type: DomainHistoryType): DomainHistory | null;
/**
* Get the latest history entry for a domain by domain name.
*/
export declare function getLatestByDomainName(domainName: string, type?: DomainHistoryType): DomainHistory | null;
/**
* List all domains that have any history entries.
* Returns structured data with the domain name and latest snapshot info.
*/
export declare function listDomainsWithHistoryChanges(): {
domain_id: string;
domain_name: string;
latest_snapshot_type: string;
latest_snapshot_at: string;
snapshot_count: number;
}[];
/**
* Delete a history entry.
*/
export declare function deleteHistoryEntry(id: string): boolean;
/**
* Delete all history for a domain.
*/
export declare function deleteHistoryByDomain(domainId: string): boolean;
//# sourceMappingURL=domain-history.d.ts.map