import { type CanonicalHumanIdentityMutationResponse as CanonicalHumanIdentityMutationResponseType, type CanonicalHumanIdentityProjection as CanonicalHumanIdentityProjectionType } from "@opengeni/contracts/canonical-human-identities"; import type { Database } from "./database.js"; export type CanonicalHumanSessionAuthority = { identityId: string; identityRevision: number; authRevision: number; identityStatus: "active" | "recovery_required" | "disputed" | "disabled"; }; export type CanonicalHumanExactLoginBinding = { id: string; identityId: string; revision: number; status: "active" | "recovery_pending" | "stale" | "disputed" | "revoked"; }; export declare function getCanonicalHumanExactLoginBindingForAuthUser(db: Database, input: { authUserId: string; providerId: string; }): Promise; export declare class CanonicalHumanIdentityConflictError extends Error { readonly name = "CanonicalHumanIdentityConflictError"; readonly code = "CANONICAL_HUMAN_IDENTITY_CONFLICT"; constructor(); } export declare class CanonicalHumanIdentityOperationReuseError extends Error { readonly name = "CanonicalHumanIdentityOperationReuseError"; readonly code = "CANONICAL_HUMAN_IDENTITY_OPERATION_REUSED"; constructor(); } export declare class CanonicalHumanIdentityMutationInFlightError extends Error { readonly name = "CanonicalHumanIdentityMutationInFlightError"; readonly code = "CANONICAL_HUMAN_IDENTITY_MUTATION_IN_FLIGHT"; constructor(); } export declare class CanonicalHumanIdentityNotFoundError extends Error { readonly name = "CanonicalHumanIdentityNotFoundError"; constructor(message?: string); } export declare class CanonicalHumanIdentityAuthorityError extends Error { readonly name = "CanonicalHumanIdentityAuthorityError"; } export declare function ensureCanonicalHumanIdentity(db: Database, input: { authUserId: string; displayName: string; }): Promise; export declare function ensureCanonicalHumanIdentityForAuthUser(db: Database, authUserId: string): Promise; export declare function synchronizeCanonicalHumanLoginBindings(db: Database, authUserId: string): Promise; export declare function validateCanonicalHumanSession(db: Database, input: { authSessionId: string; authUserId: string; allowRecovery?: boolean; }): Promise; export declare function getCanonicalHumanIdentityProjection(db: Database, authUserId: string): Promise; export type ApplyCanonicalHumanIdentityOperationInput = { operationId: string; authUserId: string; expectedIdentityRevision: number; operationType: "link" | "unlink" | "begin_recovery" | "recover"; bindingId?: string | null; providerId?: string | null; providerAccountId?: string | null; reason: string; verifiedRecovery?: { authSessionId: string; requestDigest: string; }; actorFence?: { authorityHash: string; actorEpoch: string; requestId: string; }; }; export declare function applyCanonicalHumanIdentityOperation(db: Database, input: ApplyCanonicalHumanIdentityOperationInput): Promise;