/** Parsed metadata for an ATProto Lexicon NSID and its DNS discovery name. */ export type ParsedNsid = { nsid: string; authority: string; domain: string; name: string; dnsName: string }; export type TxtRecord = { name: string; data: string; ttl?: number }; export type DnsJsonAnswer = { name: string; type: number; TTL?: number; data: string }; export type DnsJsonResponse = { Status: number; Answer?: DnsJsonAnswer[] }; export type ApiErrorCode = 'bad_request' | 'not_found' | 'upstream_error' | 'internal_error'; export type RuntimeEnv = Env; export type LexiconDocument = { lexicon: 1; id: string; defs: Record; [key: string]: unknown }; export type ResolvedLexiconSource = { name: string; url: string }; /** HTTP request trace data for an upstream resolution step. */ export type ResolutionTraceFetch = { url: string | null; status: number | null }; /** Final resolution outcome, present on both successful and failed API responses. */ export type ResolutionTraceFinal = { success: boolean; code?: ApiErrorCode; message: string }; /** Step-by-step resolution trace returned by the API for debugging and UI display. */ export type ResolutionTrace = { dnsName: string | null; txtRecords: TxtRecord[]; selectedDid: string | null; didDocument: ResolutionTraceFetch; pdsEndpoint: string | null; repoGetRecord: ResolutionTraceFetch; final: ResolutionTraceFinal; }; /** Versioned successful API payload for a resolved Lexicon schema. */ export type ResolvedLexicon = { version: string; nsid: string; parsed: ParsedNsid; hash: string; fetchedAt: string; source: ResolvedLexiconSource; lexicon: LexiconDocument; cache: 'hit' | 'miss'; trace: ResolutionTrace; }; export type ResolvedLexiconLinks = { self: { href: string }; source: { href: string } }; export type ResolvedLexiconResponse = ResolvedLexicon & { _links: ResolvedLexiconLinks }; export type DidDocument = { service?: Array<{ id?: string; type?: string; serviceEndpoint?: string }> }; export type RepoGetRecordResponse = { value?: unknown }; export type FooterColumn = { readonly heading: string; readonly items: readonly FooterItem[] }; export type FooterItem = { readonly label: string; readonly value: string; readonly href?: string }; export type FooterConfig = { readonly left: FooterColumn; readonly right: FooterColumn };