/** * Thin presentation mapping of AthenaError kinds at the view boundary. * Public views switch on these kinds — not AuthErrorView codes. */ export type AthenaErrorUiKind = "validation" | "unauthorized" | "conflict" | "rate-limit" | "unavailable" | "internal"; /** * Optional thin envelope when a view does not consume AthenaError directly. */ export interface AthenaErrorUi { kind: AthenaErrorUiKind; message?: string; } /** * Normalized auth error codes for Auth UI. * Components must not parse arbitrary server message strings. * * @deprecated Public view contract is {@link AthenaErrorUiKind} (or AthenaError). * Kept as a compat mapper target for `toAuthErrorView`. */ export type AuthErrorCode = "invalid_credentials" | "email_not_verified" | "account_locked" | "rate_limited" | "passkey_unavailable" | "oauth_denied" | "network_error" | "runtime_discovery_error" | "runtime_configuration_error" | "auth_unavailable" | "runtime_unavailable" | "request_transport_error" | "unauthenticated" | "billing_forbidden" | "billing_unavailable" | "billing_error" | "storage_forbidden" | "storage_unavailable" | "storage_error" | "unknown"; /** * Which Auth UI transport produced an operation error. * Auxiliary scopes must not be promoted to global Auth unavailability. */ export type AuthTransportScope = "identity" | "session" | "capabilities" | "organization" | "billing" | "storage" | "api-key" | "plugin"; export type AuthErrorField = "email" | "password" | "code" | null; /** * Presentation error model. Map Athena / BAUI envelopes once via * `toAuthErrorView` / `parseAuthErrorView`. * * `message` is always short, Athena-controlled or Athena-approved copy that is * safe to render in toasts and forms. Raw transport bodies live on diagnostic * fields (`raw`, `errorDetails`) and must not be copied here. * * @deprecated Prefer `toAthenaUiError` / AthenaError at the view boundary. */ export interface AuthErrorView { code: AuthErrorCode; field?: AuthErrorField; message: string; retryable: boolean; }