import type { PrincipalStore } from './store.js'; import { type PrincipalIdentity, type PrincipalKind, type PrincipalRecord } from './types.js'; export interface CreatePrincipalInput { readonly name: string; readonly kind: PrincipalKind; readonly identities?: readonly PrincipalIdentity[] | undefined; readonly metadata?: Readonly> | undefined; } export interface UpdatePrincipalInput { readonly name?: string | undefined; readonly kind?: PrincipalKind | undefined; readonly identities?: readonly PrincipalIdentity[] | undefined; readonly metadata?: Readonly> | undefined; } /** The outcome of resolving a sender identity: the principal plus whether it was a real mapping. */ export interface PrincipalResolution { readonly principal: PrincipalRecord; readonly known: boolean; } export declare class PrincipalRegistry { private readonly store; private records; /** Whole-store writes run one at a time, in call order. See StoreWriteQueue. */ private readonly writes; constructor(store: PrincipalStore); /** * Write the principals as they stand at THIS call, after every write already * queued has finished. * * `PrincipalStore.save` replaces the file atomically but says nothing about * ORDER, and `records` is one live array every method mutates in place, so two * gateway calls in flight at once finished in whatever order their renames * landed. Unordered, a `create` could land after the `delete` that followed * it, and a principal is the thing channel intake resolves a sender identity * against, so a deleted principal back on disk is a person whose messages are * still attributed to a named identity after they were unmapped. * * The snapshot is taken here rather than at write time: every caller mutates * `records` and then saves, so each snapshot is at least as new as the one * queued before it. */ private persist; private all; /** Throw CONFLICT if any of `identities` already belongs to a principal other than `exceptId`. */ private assertIdentitiesFree; list(): Promise; get(id: string): Promise; create(input: CreatePrincipalInput): Promise; update(id: string, input: UpdatePrincipalInput): Promise; delete(id: string): Promise; /** * Resolve a channel-specific sender identity to its named principal. An * unmapped identity resolves to the unknown principal with known:false, the * registry never guesses. */ resolveByIdentity(identity: PrincipalIdentity): Promise; } //# sourceMappingURL=registry.d.ts.map