UNPKG

@hasna/domains

Version:

Domain portfolio, registrar, marketplace, and DNS management for AI agents — CLI + MCP + HTTP API + SDK, shared account API and PostgreSQL

104 lines • 3.62 kB
/** * Namecheap API integration for domain management * * Requires environment variables: * NAMECHEAP_API_KEY — API key from Namecheap * NAMECHEAP_USERNAME — Namecheap account username * NAMECHEAP_CLIENT_IP — Whitelisted client IP address */ import type { ProviderRegistrationContact } from "./registrar.js"; export interface NamecheapConfig { apiKey: string; username: string; clientIp: string; sandbox?: boolean; } export interface NamecheapDomain { domain: string; expiry: string; autoRenew: boolean; isExpired: boolean; isLocked: boolean; } export interface NamecheapDomainInfo { domain: string; registrar: string; created: string; expires: string; nameservers: string[]; } export interface NamecheapDnsRecord { type: string; name: string; address: string; ttl: number; mxPref?: number; } export interface NamecheapAvailability { domain: string; available: boolean; premium: boolean; price?: number; } export interface NamecheapRenewResult { domain: string; success: boolean; orderId?: string; chargedAmount?: string; } export interface NamecheapRegistrationResult { domain: string; success: boolean; orderId?: string; chargedAmount?: string; } export interface NamecheapSyncResult { synced: number; errors: string[]; domains: string[]; } export declare function getConfig(): NamecheapConfig; export declare function listNamecheapDomains(config?: NamecheapConfig): Promise<NamecheapDomain[]>; export declare function getDomainInfo(domain: string, config?: NamecheapConfig): Promise<NamecheapDomainInfo>; export declare function renewDomain(domain: string, years?: number, config?: NamecheapConfig): Promise<NamecheapRenewResult>; export declare function registerDomain(domain: string, contact: ProviderRegistrationContact, options?: { years?: number; premiumPrice?: number; whoisGuard?: boolean; }, config?: NamecheapConfig): Promise<NamecheapRegistrationResult>; export declare function updateNameservers(domain: string, nameservers: string[], config?: NamecheapConfig): Promise<boolean>; export declare function getDnsRecords(_domain: string, sld: string, tld: string, config?: NamecheapConfig): Promise<NamecheapDnsRecord[]>; export declare function setDnsRecords(_domain: string, sld: string, tld: string, records: NamecheapDnsRecord[], config?: NamecheapConfig): Promise<boolean>; export declare function checkAvailability(domain: string, config?: NamecheapConfig): Promise<NamecheapAvailability>; export declare function splitDomain(domain: string): { sld: string; tld: string; }; export declare function syncToLocalDb(dbFunctions: { getDomainByName: (name: string) => Promise<{ id: string; } | null>; createDomain: (input: { name: string; registrar?: string; status?: "active" | "expired" | "transferring" | "redemption"; registered_at?: string; expires_at?: string; auto_renew?: boolean; nameservers?: string[]; expiry_synced_at?: string | null; }) => Promise<{ id: string; name: string; }>; updateDomain: (id: string, input: { registrar?: string; status?: "active" | "expired" | "transferring" | "redemption"; registered_at?: string; expires_at?: string; auto_renew?: boolean; nameservers?: string[]; expiry_synced_at?: string | null; }) => Promise<unknown>; }, config?: NamecheapConfig): Promise<NamecheapSyncResult>; //# sourceMappingURL=namecheap.d.ts.map