import type { ClaimedDomain } from "../_internal/types.gen"; import type { RequestOptions } from "../base-client"; import { RequestBuilder } from "../request-builder"; /** Attributes accepted when creating a ClaimedDomain. Mirrors the `accept` * list of the `:create` action in * `lib/gpt_core/tenancy/resources/claimed_domain.ex`. */ export interface CreateClaimedDomainAttributes { /** The DNS domain being claimed (e.g. "acme.com"). */ domain: string; /** UUID of the tenant claiming this domain. */ tenant_id: string; /** How the domain will be verified. */ verification_method?: "dns_txt" | "dns_cname" | "meta_tag" | "manual"; /** Tenant role assigned to auto-joined users. */ default_role?: "admin" | "member"; /** Workspace UUIDs that auto-joined users are added to. */ auto_join_workspace_ids?: string[]; /** Workspace role assigned in each auto-join workspace. */ default_workspace_role?: "admin" | "editor" | "viewer"; } /** Attributes accepted when updating a ClaimedDomain (PATCH semantics). */ export interface UpdateClaimedDomainAttributes { default_role?: "admin" | "member"; auto_join_workspace_ids?: string[]; default_workspace_role?: "admin" | "editor" | "viewer"; } /** * Enterprise domain-claiming admin namespace — create, verify, revoke, and * manage DNS domains that auto-route new user registrations to a tenant. * * Claimed domains enable the "enterprise SSO-lite" flow: when a user signs * up with an email on a verified claimed domain, they join the tenant * automatically with the configured default role instead of landing in a * personal tenant. */ export declare function createClaimedDomainsNamespace(rb: RequestBuilder): { /** * List all claimed domains visible to the current actor. * * @param options - Optional request options. * @returns An array of `ClaimedDomain` records. * * @example * ```ts * const domains = await admin.claimedDomains.list(); * ``` */ list: (options?: RequestOptions) => Promise; /** * Get a claimed domain by UUID. * * @param id - UUID of the claimed domain. * @param options - Optional request options. * @returns The matching `ClaimedDomain`. * * @example * ```ts * const domain = await admin.claimedDomains.get("cd-01"); * ``` */ get: (id: string, options?: RequestOptions) => Promise; /** * Claim a new DNS domain for a tenant. Requires enterprise tier. The * record starts in `:pending` status with a DNS verification token. * * @param attributes - Domain + verification configuration. * @param options - Optional request options. * @returns The newly created `ClaimedDomain`. * * @example * ```ts * const domain = await admin.claimedDomains.create({ * domain: "acme.com", * tenant_id: "tenant-01", * verification_method: "dns_txt", * default_role: "member", * }); * ``` */ create: (attributes: CreateClaimedDomainAttributes, options?: RequestOptions) => Promise; /** * Update the auto-join configuration on a claimed domain. Domain name * and tenant cannot be changed — create a new record instead. * * @param id - UUID of the claimed domain. * @param attributes - Fields to update. * @param options - Optional request options. * @returns The updated `ClaimedDomain`. * * @example * ```ts * const domain = await admin.claimedDomains.update("cd-01", { * default_role: "admin", * }); * ``` */ update: (id: string, attributes: UpdateClaimedDomainAttributes, options?: RequestOptions) => Promise; /** * Mark a pending claimed domain as verified. Called after the DNS * verification token is confirmed out-of-band. * * @param id - UUID of the claimed domain. * @param options - Optional request options. * @returns The verified `ClaimedDomain`. * * @example * ```ts * const domain = await admin.claimedDomains.verify("cd-01"); * ``` */ verify: (id: string, options?: RequestOptions) => Promise; /** * Revoke a claimed domain. Auto-join behavior stops immediately; existing * users remain in the tenant. * * @param id - UUID of the claimed domain. * @param options - Optional request options. * @returns The revoked `ClaimedDomain`. * * @example * ```ts * const domain = await admin.claimedDomains.revoke("cd-01"); * ``` */ revoke: (id: string, options?: RequestOptions) => Promise; /** * Permanently delete a claimed domain record. * * @param id - UUID of the claimed domain. * @param options - Optional request options. * @returns `true` when deletion succeeds. * * @example * ```ts * await admin.claimedDomains.delete("cd-01"); * ``` */ delete: (id: string, options?: RequestOptions) => Promise; }; //# sourceMappingURL=claimed-domains.d.ts.map