mirror of
https://github.com/jakejarvis/rdapper.git
synced 2026-09-23 00:15:31 -04:00
feat: add RFC 9537 redaction support, vCard address/fax parsing, and registrar address fields
- Parse the top-level RDAP `redacted` array (RFC 9537) into a new `redactions` field on `DomainRecord`; set `privacyEnabled` when any redaction references "registrant" - Expose `street`, `city`, `state`, `postalCode`, `country`, and `countryCode` on both `RegistrarInfo` and `Contact`; extract ISO 3166-1 alpha-2 from the vCard `cc` parameter (RFC 8605) - Split `tel` entries by fax type parameter (`"fax"` / `["work","fax"]`) into separate `tel` and `fax` lists; collect multiple email addresses as an array, collapsing singletons to a plain string - Prefer an exact `registration` event match over `reregistration` when extracting `creationDate` (RFC 9083) - Merge `redacted` arrays in `mergeRdapDocs`, deduplicating by JSON identity - Split `adr` street on `\r?\n` only (not commas) to avoid splitting inline comma-separated addresses
This commit is contained in:
@@ -508,6 +508,12 @@ interface DomainRecord {
|
||||
url?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
street?: string[]; // address (RDAP only)
|
||||
city?: string;
|
||||
state?: string;
|
||||
postalCode?: string;
|
||||
country?: string;
|
||||
countryCode?: string; // ISO 3166-1 alpha-2, from the vCard "cc" parameter
|
||||
};
|
||||
reseller?: string;
|
||||
statuses?: Array<{
|
||||
@@ -549,7 +555,15 @@ interface DomainRecord {
|
||||
country?: string;
|
||||
countryCode?: string;
|
||||
}>;
|
||||
privacyEnabled?: boolean; // registrant appears privacy-redacted based on keyword heuristics
|
||||
privacyEnabled?: boolean; // registrant appears privacy-redacted based on keyword heuristics or RFC 9537 redactions
|
||||
redactions?: Array<{
|
||||
name: string; // e.g. "Registrant Email"
|
||||
prePath?: string;
|
||||
postPath?: string;
|
||||
replacementPath?: string;
|
||||
method?: string; // e.g. "emptyValue", "partialValue"
|
||||
reason?: string;
|
||||
}>; // RFC 9537 redaction metadata (RDAP only)
|
||||
whoisServer?: string; // authoritative WHOIS queried (if any)
|
||||
rdapServers?: string[]; // RDAP URLs tried (bootstrap bases and related/entity links)
|
||||
rawRdap?: unknown; // raw RDAP JSON (only when options.includeRaw)
|
||||
|
||||
Reference in New Issue
Block a user