import type { AuthOAuthProviderId } from '@ankhorage/contracts'; import type { StudioAuthSettings } from '../../../authSettings'; import type { StoredOAuthCredentialLink } from './adminAuthCredentialFlow'; export type AuthAdminWriteResult = { readonly ok: true; readonly value: T; } | { readonly ok: false; readonly reason: 'full_auth_save_busy' | 'credential_transaction_busy' | 'provider_busy' | 'credential_ref_busy' | 'credential_secret_cleanup_busy'; }; export declare class AuthAdminWriteCoordinator { private fullAuthSaveActive; private readonly activeProviderIds; private readonly activeCredentialRefs; private readonly activeCredentialSecretCleanupRefs; isFullAuthSaveActive(): boolean; isAnyCredentialTransactionActive(): boolean; isProviderBusy(providerId: AuthOAuthProviderId): boolean; isCredentialRefBusy(credentialsRef: string): boolean; getBusyProviderIds(): ReadonlySet; getBusyCredentialRefs(): ReadonlySet; getBusyCredentialSecretCleanupRefs(): ReadonlySet; runFullAuthSave(operation: () => Promise): Promise>; runCredentialTransaction(providerId: AuthOAuthProviderId, credentialsRef: string, operation: () => Promise): Promise>; runCredentialSecretCleanup(credentialsRef: string, operation: () => Promise): Promise>; } export declare class AuthAdminPendingCredentialRecoveryStore { private readonly linksByProviderId; list(): readonly StoredOAuthCredentialLink[]; get(providerId: AuthOAuthProviderId): StoredOAuthCredentialLink | null; set(link: StoredOAuthCredentialLink): void; clear(providerId: AuthOAuthProviderId): void; clearByCredentialsRef(credentialsRef: string): readonly StoredOAuthCredentialLink[]; } export interface AuthAdminProjectSessionSnapshot { readonly pendingCredentialLinks: readonly StoredOAuthCredentialLink[]; readonly busyCredentialProviderIds: ReadonlySet; readonly busyCredentialRefs: ReadonlySet; readonly busyCredentialSecretCleanupRefs: ReadonlySet; readonly fullAuthSaveBusy: boolean; } export declare class AuthAdminProjectSession { readonly projectId: string; private readonly writeCoordinator; private readonly pendingRecovery; constructor(projectId: string); getSnapshot(): AuthAdminProjectSessionSnapshot; setPendingCredentialLink(link: StoredOAuthCredentialLink): void; clearPendingCredentialLink(providerId: AuthOAuthProviderId): void; clearPendingCredentialLinksByCredentialsRef(credentialsRef: string): readonly StoredOAuthCredentialLink[]; runFullAuthSave(operation: () => Promise): Promise>; runCredentialTransaction(providerId: AuthOAuthProviderId, credentialsRef: string, operation: () => Promise): Promise>; runCredentialSecretCleanup(credentialsRef: string, operation: () => Promise): Promise>; } export declare function clearPendingCredentialLinksForRemovedProjectSecret(args: { readonly session: { readonly clearPendingCredentialLinksByCredentialsRef: (credentialsRef: string) => readonly StoredOAuthCredentialLink[]; }; readonly environment: string; readonly ref: string; readonly removed: boolean; }): readonly StoredOAuthCredentialLink[]; export declare function rebaseAuthDraftOntoCanonicalCredentialRefs(args: { readonly draft: StudioAuthSettings; readonly canonical: StudioAuthSettings | null; }): StudioAuthSettings; //# sourceMappingURL=adminAuthSessionModel.d.ts.map