import type { Dialect } from '@enbox/dwn-sql-store'; /** * The result of the setConnectRequest() method. */ export type SetConnectRequestResult = { /** * The Request URI that the wallet should use to retrieve the request object. */ request_uri: string; /** * The time in seconds that the Request URI is valid for. */ expires_in: number; }; /** * The Connect Server is responsible for handling the DWeb Connect flow. */ export declare class ConnectServer { static readonly ttlInSeconds = 600; private readonly baseUrl; private cache; /** * Creates a new instance of the Connect Server. * @param params.baseUrl The the base URL of the connect server including the port. * This is given to the Identity Provider (wallet) to fetch the Connect Request object. * @param params.sqlDialect The SQL dialect to use for the TTL cache. Must point to a database * where server migrations have already been run. */ static create({ baseUrl, sqlDialect }: { baseUrl: string; sqlDialect: Dialect; }): Promise; private constructor(); /** * Stores the given Connect Request object, which is also an OAuth 2 Pushed Authorization Request (PAR) object. * This is the initial call to the connect server to start the DWeb Connect flow. */ setConnectRequest(request: any): Promise; /** * Returns the Connect Request object. The request ID can only be used once. */ getConnectRequest(requestId: string): Promise; /** * Whether the Connect Request with the given ID has been claimed * (retrieved by a wallet). Non-consuming: apps poll this while waiting * for the wallet response. */ isConnectRequestClaimed(requestId: string): Promise; /** * Sets the Connect Response object. */ setConnectResponse(state: string, response: any): Promise; /** * Records the requesting app's completion signal for `state`: it fetched * and successfully opened the wallet's response. Observational only — the * marker is keyed by the same opaque `state` correlator as the token * route, reveals nothing about the session (whose objects are already * consumed by this point), and is read non-destructively so the wallet can * flip its pairing screen to a confirmed "connected" state. */ setConnectComplete(state: string): Promise; /** * Whether the requesting app has signalled completion for `state`. * Non-consuming: wallets poll this after posting their response. */ isConnectComplete(state: string): Promise; /** * Gets the Connect Response object. The `state` string can only be used once. */ getConnectResponse(state: string): Promise; /** * Stops the TTL cache cleanup timer. Must be called during shutdown to * prevent leaked timers. */ close(): void; } //# sourceMappingURL=connect-server.d.ts.map