Releases: rdapapi/node-sdk
v0.5.0
TLD catalog endpoints
Two new methods list the TLDs the API can resolve and how often each registry's RDAP server populates common fields. Neither endpoint counts against your monthly quota.
const tlds = await client.tlds();
if (tlds !== null) {
console.log(`${tlds.meta.count} TLDs, coverage ${(tlds.meta.coverage * 100).toFixed(0)}%`);
for (const tld of tlds.data) {
if (tld.fieldAvailability !== null) {
console.log(`${tld.tld}: expires_at=${tld.fieldAvailability.expiresAt}`);
}
}
}Filters: since (ISO 8601), server (hostname). Pass the previous etag via ifNoneMatch to skip unchanged transfers. The method resolves to null on HTTP 304.
const later = await client.tlds({ ifNoneMatch: tlds?.etag ?? undefined });
const com = await client.tld("com");New exported types: TldListResponse, TldResponse, TldEntry, TldListMeta, TldMeta, TldThresholds, FieldAvailability, AvailabilityLevel, TldsOptions, TldOptions.
NotSupportedError
A new NotSupportedError subclass of NotFoundError is thrown on HTTP 404 when the API returns error: "not_supported" (no RDAP coverage for the TLD, IP range, or ASN range). Existing catch (err instanceof NotFoundError) blocks keep working.
import { NotFoundError, NotSupportedError } from "rdapapi";
try {
await client.domain("example.nope");
} catch (err) {
if (err instanceof NotSupportedError) {
console.log("TLD not covered by RDAP");
} else if (err instanceof NotFoundError) {
console.log("Domain not registered");
}
}Install
npm install rdapapi@0.5.0
v0.3.0
Full Changelog: v0.2.0...v0.3.0
v0.2.0
What's New
- Date helper functions:
registeredAt(),expiresAt(),updatedAt()(Date) andexpiresInDays()(number)
v0.1.0
Full Changelog: https://github.com/rdapapi/node-sdk/commits/v0.1.0