/** * `domains` namespace — ProjectDomain lifecycle. * * Domain operations are project-scoped control-plane actions. They use the * SDK credential provider's server auth (SIWX, control-plane session, or * delegate) and deliberately do not require local project-key cache entries. */ import type { Client } from "../kernel.js"; export type ProjectDomainStatus = "action_required" | "waiting" | "active" | "needs_repair" | "failed"; export type ProjectDomainReceiveStrategy = "auto" | "outbound_only" | "forwarding_mode" | "subdomain_mode" | "full_receive_takeover"; export type ProjectDomainMailboxAddressMode = "primary" | "alias" | "managed" | "none"; export type ProjectDomainActivationMode = "automatic_when_ready" | "manual"; export type ProjectDomainWaitUntil = "active" | "safe" | "receive-active"; export interface ProjectDomainMailboxAddressBinding { local_part: string; mailbox_slug: string; create_mailbox?: boolean; } /** * Declarable connect-time authority. `hosted_dns_zone` opts the domain into a * Run402-hosted DNS zone: the owner makes ONE nameserver change and Run402 * applies every in-zone record (the only workable path for a root domain at * most registrars). Absent means manual DNS. */ export type ProjectDomainAuthorityIntent = "manual_dns" | "hosted_dns_zone"; export interface ProjectDomainDesired { authority?: ProjectDomainAuthorityIntent; web?: { enabled: boolean; target?: string; role?: "primary" | "alias"; }; email?: { send?: { enabled: boolean; }; receive?: { enabled: boolean; strategy?: ProjectDomainReceiveStrategy; resolved_strategy?: ProjectDomainReceiveStrategy; observed_mx_fingerprint?: string; mail_subdomain?: string; }; mailbox_addresses?: { mode: ProjectDomainMailboxAddressMode; addresses: ProjectDomainMailboxAddressBinding[]; }; activation?: ProjectDomainActivationMode; }; } export interface ProjectDomainCheck { id: string; status: "unknown" | "pending" | "passed" | "failed" | "drifted" | "blocked"; blocking: boolean; reason_code?: string; summary?: string; blocked_by?: string[]; checked_at?: string; } export interface ProjectDomainDnsRecord { id: string; purpose: string; type: string; name: string; value: string; priority?: number; required: boolean; status: "unknown" | "missing" | "present" | "conflict"; safety: { safe_to_auto_run: boolean; confirmation_required: boolean; destructive: boolean; external_required: boolean; conflict_policy?: string; [key: string]: unknown; }; bind?: string; } export interface ProjectDomainNextAction { type: string; method?: string; path?: string; auth?: string; why?: string; safe_to_auto_run?: boolean; destructive?: boolean; confirmation_required?: boolean; external_required?: boolean; affected_record_ids?: string[]; [key: string]: unknown; } export interface ProjectDomainReceiveTest { id: string; local_part: string; address: string; target_managed_address: string; token: string; status: "pending" | "passed" | "failed" | "stale"; created_at: string; passed_at?: string | null; } export interface ProjectDomainHostedZone { dns_hosting: "run402_hosted"; status: "provisioning" | "awaiting_delegation" | "delegated" | "releasing"; /** The nameserver pair to set at the registrar — the one customer-side step. */ ns_assigned: string[]; /** Pre-existing MX/TXT copied into the zone before the change was recommended. */ imported_records: Array<{ type: string; name: string; value: string; priority?: number; }>; } export interface ProjectDomain { project_id: string; domain: string; status: ProjectDomainStatus; desired: ProjectDomainDesired; observed: Record; effective: Record; authority: { recommended_mode: string; options: Array>; }; dns_records: ProjectDomainDnsRecord[]; checks: ProjectDomainCheck[]; /** Ordered follow-ups; `next_actions[0]` is the recommended action. */ next_actions: ProjectDomainNextAction[]; /** Present only for a domain on a Run402-hosted DNS zone. */ hosted_zone?: ProjectDomainHostedZone | null; provenance: { project: "server_control_plane"; desired: "server_control_plane"; observed_dns: "public_dns_resolvers"; effective: "run402_control_plane"; local_cache: "not_used"; }; created_at?: string; updated_at?: string; } export interface ProjectDomainListResult { domains: ProjectDomain[]; } export interface ProjectDomainEnsureOptions { desired: ProjectDomainDesired; } export interface ProjectDomainTestReceiveResult extends ProjectDomain { receive_test: ProjectDomainReceiveTest; } export interface ProjectDomainWaitOptions { until?: ProjectDomainWaitUntil; timeoutMs?: number; intervalMs?: number; } export type DomainRequestOptions = Record; export declare class Domains { private readonly client; constructor(client: Client); ensure(projectId: string, domain: string, opts: ProjectDomainEnsureOptions): Promise; get(projectId: string, domain: string): Promise; list(projectId: string): Promise; check(projectId: string, domain: string): Promise; apply(projectId: string, domain: string): Promise; repair(projectId: string, domain: string): Promise; testReceive(projectId: string, domain: string, to: string): Promise; activate(projectId: string, domain: string): Promise; disconnect(projectId: string, domain: string): Promise<{ status: string; domain: string; }>; wait(projectId: string, domain: string, opts?: ProjectDomainWaitOptions): Promise; } //# sourceMappingURL=domains.d.ts.map