@hasna/domains
Version:
Domain portfolio, registrar, marketplace, and DNS management for AI agents — CLI + MCP + HTTP API + SDK, shared account API and PostgreSQL
158 lines • 6 kB
TypeScript
/**
* Brandsight — GoDaddy's enterprise brand protection and domain registrar platform
*
* Two distinct capabilities:
* 1. Domain registrar (GoDaddy Corporate Domains via Brandsight)
* 2. Brand monitoring / threat detection
*
* Env vars:
* BRANDSIGHT_API_KEY — API key for Brandsight
* BRANDSIGHT_ACCOUNT_ID — Account ID for corporate domain operations (optional)
*/
export interface BrandsightConfig {
apiKey: string;
apiSecret?: string;
customerId?: string;
shopperId?: string;
accountId?: string;
baseUrl?: string;
}
/**
* Resolve Brandsight (GoDaddy Corporate Domains) credentials from standard
* BRANDSIGHT_* env vars. Pure / testable.
*/
export declare function resolveBrandsightConfig(env?: Record<string, string | undefined>): BrandsightConfig;
export interface BrandsightCapability {
configured: boolean;
gated: boolean;
notes: string;
}
/**
* Brandsight is GoDaddy Corporate Domains — an enterprise/contract-only
* registrar. Even with credentials present, automated self-serve purchase is
* gated, so callers must not attempt it blindly.
*/
export declare function brandsightCapability(env?: Record<string, string | undefined>): BrandsightCapability;
export interface BrandsightDomain {
domain: string;
status: string;
expires: string;
created?: string;
auto_renew: boolean;
locked: boolean;
nameservers: string[];
domainId?: string;
createdAt?: string;
expiresAt?: string;
nameServers?: string[];
renewAuto?: boolean;
renewal?: {
currency?: string;
price?: number;
renewable?: boolean;
};
}
export interface BrandsightAvailability {
domain: string;
available: boolean;
price?: number;
currency?: string;
registryPremiumPricing?: boolean;
}
export interface BrandsightAgreement {
agreementKey: string;
content?: string;
title?: string;
url?: string;
}
export interface BrandsightAlert {
domain: string;
type: "typosquat" | "homoglyph" | "keyword" | "tld_variation";
registered_at: string;
}
export interface BrandMonitorResult {
brand: string;
alerts: BrandsightAlert[];
stub: boolean;
}
export interface WhoisHistoryEntry {
registrant: string;
date: string;
changes: string[];
}
export interface WhoisHistoryResult {
domain: string;
history: WhoisHistoryEntry[];
stub: boolean;
}
export interface ThreatAssessment {
domain: string;
risk_level: "low" | "medium" | "high" | "critical";
threats: string[];
recommendation: string;
stub: boolean;
}
export declare class BrandsightApiError extends Error {
statusCode?: number | undefined;
responseBody?: string | undefined;
constructor(message: string, statusCode?: number | undefined, responseBody?: string | undefined);
}
type FetchFn = typeof globalThis.fetch;
export declare function _setFetch(fn: FetchFn | null): void;
export declare function getApiKey(): string;
export declare function getConfig(): BrandsightConfig;
export declare function monitorBrand(brandName: string): Promise<BrandMonitorResult>;
export declare function getSimilarDomains(domain: string): Promise<{
domain: string;
similar: string[];
stub: boolean;
}>;
export declare function getWhoisHistory(domain: string): Promise<WhoisHistoryResult>;
export declare function getThreatAssessment(domain: string): Promise<ThreatAssessment>;
export declare function listDomains(config?: BrandsightConfig): Promise<BrandsightDomain[]>;
export declare function getDomainInfo(domain: string, config?: BrandsightConfig): Promise<BrandsightDomain | null>;
export declare function checkAvailability(domain: string, config?: BrandsightConfig): Promise<BrandsightAvailability>;
export declare function renewDomain(domain: string, years?: number, config?: BrandsightConfig): Promise<{
success: boolean;
orderId?: string;
}>;
export declare function getLegalAgreements(tld: string, privacy?: boolean, config?: BrandsightConfig): Promise<BrandsightAgreement[]>;
export declare function getRegistrationSchema(tld: string, config?: BrandsightConfig): Promise<Record<string, unknown>>;
export declare function validateRegistrationRequest(payload: Record<string, unknown>, config?: BrandsightConfig): Promise<boolean>;
export declare function registerBrandsightDomain(domain: string, contact: import("./registrar.js").ProviderRegistrationContact, options?: import("./registrar.js").ProviderRegistrationOptions, config?: BrandsightConfig): Promise<{
success: boolean;
orderId?: string;
operationId?: string;
chargedAmount?: string;
}>;
export declare function updateNameservers(domain: string, nameservers: string[], config?: BrandsightConfig): Promise<{
success: boolean;
operationId?: string;
}>;
export interface BrandsightDnsRecord {
type: string;
name: string;
data: string;
ttl: number;
priority?: number;
port?: number;
protocol?: string;
service?: string;
weight?: number;
}
export declare function getDnsRecords(domain: string, config?: BrandsightConfig): Promise<BrandsightDnsRecord[]>;
export declare function setDnsRecords(domain: string, records: BrandsightDnsRecord[], config?: BrandsightConfig): Promise<boolean>;
export declare function syncToLocalDb(dbFns: {
getDomainByName: (name: string) => Promise<import("../db/domains.js").Domain | null>;
createDomain: (input: import("../db/domains.js").CreateDomainInput) => Promise<import("../db/domains.js").Domain>;
updateDomain: (id: string, input: import("../db/domains.js").UpdateDomainInput) => Promise<import("../db/domains.js").Domain | null>;
}, config?: BrandsightConfig): Promise<{
synced: number;
created: number;
updated: number;
errors: string[];
}>;
import type { FullProvider } from "./registrar.js";
export declare function createBrandsightProvider(config?: BrandsightConfig): FullProvider;
export {};
//# sourceMappingURL=brandsight.d.ts.map