interface CookieOptions { sessionMaxAge?: number; refreshMaxAge?: number; stateMaxAge?: number; secure?: boolean; sameSite?: 'lax' | 'strict' | 'none'; path?: string; /** Emit `Partitioned` for CHIPS (cross-site iframe) cookie storage. */ partitioned?: boolean; } interface RoutePaths { login?: string; callback?: string; me?: string; jwt?: string; refresh?: string; logout?: string; } interface AppDirectAuthConfig { issuerBaseUrl: string; clientId: string; clientSecret: string; appBaseUrl: string; /** Marketplace application id used to verify MyApps assignment after login. */ applicationId?: string | number; callbackPath?: string; scopes?: string[]; cookieOptions?: CookieOptions; expiryBufferSec?: number; secureCookies?: boolean; routes?: RoutePaths; onErrorRedirect?: string; } interface ResolvedConfig { issuerBaseUrl: string; clientId: string; clientSecret: string; appBaseUrl: string; applicationId: number | null; callbackPath: string; redirectUri: string; scopes: string[]; cookieOptions: Required; expiryBufferSec: number; routes: Required; onErrorRedirect: string; endpoints: { authorizeUrl: string; tokenUrl: string; userinfoUrl: string; authTokenUrl: string; authRefreshUrl: string; }; } interface CookieStore { get(name: string): string | undefined; } interface CookieMutationOptions { httpOnly: boolean; sameSite: 'lax' | 'strict' | 'none'; secure: boolean; path: string; maxAge: number; partitioned?: boolean; } interface CookieMutation { name: string; value: string; options: CookieMutationOptions; } interface AuthUser { id: string; email: string | null; name: string | null; picture: string | null; companyId: string | null; } interface TokenResponse { access_token: string; refresh_token?: string; id_token?: string; token_type?: string; expires_in?: number; } interface AuthTokenResult { accessToken: string; refreshToken?: string; } interface LoginRedirectResult { authorizeUrl: string; state: string; cookiesToSet: CookieMutation[]; } interface CallbackResult { fejwt: string; refreshToken: string | null; user: AuthUser; cookiesToSet: CookieMutation[]; cookiesToClear: string[]; } interface RefreshResult { fejwt: string; refreshToken: string | null; cookiesToSet: CookieMutation[]; } interface MeResult { user: AuthUser | null; hasSession: boolean; cookiesToSet?: CookieMutation[]; } interface JwtResult { token: string; cookiesToSet?: CookieMutation[]; } interface LogoutResult { cookiesToClear: string[]; } interface ImportSessionResult { cookiesToSet: CookieMutation[]; } interface AppDirectAuth { readonly config: ResolvedConfig; buildLoginRedirect(): LoginRedirectResult; handleCallback(input: { code?: string; error?: string; state?: string; cookies: CookieStore; }): Promise; refreshSession(input: { refreshToken: string; }): Promise; getMe(input: { sessionToken: string | null | undefined; refreshToken?: string | null; }): Promise; getUserFromSession(input: { sessionToken: string | null | undefined; }): MeResult; ensureValidFeJwt(input: { sessionToken: string | null | undefined; refreshToken?: string | null; }): Promise; getFeJwt(input: { sessionToken: string | null | undefined; refreshToken?: string | null; }): Promise; importSession(input: { sessionToken: string; refreshToken: string; }): Promise; buildLogout(): LogoutResult; } export type { AppDirectAuthConfig as A, CookieMutation as C, JwtResult as J, LoginRedirectResult as L, MeResult as M, ResolvedConfig as R, TokenResponse as T, CookieStore as a, AppDirectAuth as b, RefreshResult as c, AuthUser as d, CallbackResult as e, LogoutResult as f, RoutePaths as g, AuthTokenResult as h };