import type { ConnectorAuthorization, ConnectorAuthorizationStore } from "./authorization-store.js"; export interface CredentialRotationClient { rotateConnectorCredential(credential: string, signal?: AbortSignal): Promise<{ credential: string; activateBy: string; }>; activateConnectorCredential(credential: string, signal?: AbortSignal): Promise<{ credentialExpiresAt: string; }>; } /** What the maintenance pass actually did, so the caller can report it without re-deriving the renewal window. */ export type CredentialMaintenanceOutcome = "unchanged" | "renewed" | "failed"; export interface CredentialMaintenanceResult { authorization: ConnectorAuthorization; outcome: CredentialMaintenanceOutcome; } interface MaintainOptions { store: ConnectorAuthorizationStore; api: CredentialRotationClient; authorization: ConnectorAuthorization; now?: () => number; signal?: AbortSignal; } /** * Settles any rotation left pending by an earlier run, then renews the credential if it is * close enough to expiry. Returns the authorization that is now on disk. It never throws and * never leaves the caller without a usable credential: every failure path returns the most * recent authorization that was persisted successfully. */ export declare function maintainConnectorCredential(options: MaintainOptions): Promise; export {}; //# sourceMappingURL=credential-renewal.d.ts.map