import { LogLevel, CustomLogger } from '@forgerock/sdk-logger'; import type { GenericError } from '@forgerock/sdk-types'; import type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; import type { JourneyResult } from './journey.utils.js'; import type { JourneyStep } from './step.utils.js'; import type { JourneyClientConfig } from './config.types.js'; import type { NextOptions, StartParam, ResumeOptions } from './interfaces.js'; /** The journey client instance returned by the `journey()` function. */ export interface JourneyClient { subscribe: (listener: () => void) => () => void; start: (options?: StartParam) => Promise; next: (step: JourneyStep, options?: NextOptions) => Promise; redirect: (step: JourneyStep) => Promise; resume: (url: string, options?: ResumeOptions) => Promise; terminate: (options?: { query?: Record; }) => Promise; } /** * Creates a journey client for AM authentication tree/journey interactions. * * Journey-client is designed specifically for ForgeRock Access Management (AM) servers. * It uses AM-proprietary endpoints for callback-based authentication trees. * * @param options - Configuration options for the journey client * @param options.config - Configuration options (see {@link JourneyClientConfig}); only `serverConfig.wellknown` is required * @param options.requestMiddleware - Optional middleware for request customization * @param options.logger - Optional logger configuration * @returns A journey client instance * @throws When the wellknown URL is invalid, the fetch fails, or the response indicates a non-AM server * * @example * ```typescript * try { * const client = await journey({ * config: { * serverConfig: { * wellknown: 'https://am.example.com/am/oauth2/alpha/.well-known/openid-configuration', * }, * }, * }); * const step = await client.start({ journey: 'Login' }); * } catch (error) { * console.error('Failed to initialize:', error.message); * } * ``` */ export declare function journey({ config, requestMiddleware, logger, }: { config: JourneyClientConfig; requestMiddleware?: RequestMiddleware[]; logger?: { level: LogLevel; custom?: CustomLogger; }; }): Promise; //# sourceMappingURL=client.store.d.ts.map