@@ -14,8 +14,7 @@ import {
1414} from '@forgerock/sdk-utilities' ;
1515
1616import type { GenericError } from '@forgerock/sdk-types' ;
17-
18- import type { RequestMiddleware } from '@forgerock/sdk-request-middleware' ;
17+ import type { ActionTypes , RequestMiddleware } from '@forgerock/sdk-request-middleware' ;
1918import type { Step } from '@forgerock/sdk-types' ;
2019
2120import { createJourneyStore } from './client.store.utils.js' ;
@@ -28,7 +27,7 @@ import { wellknownApi } from './wellknown.api.js';
2827import type { JourneyStep } from './step.utils.js' ;
2928import type { JourneyClientConfig } from './config.types.js' ;
3029import type { RedirectCallback } from './callbacks/redirect-callback.js' ;
31- import { NextOptions , StartParam , ResumeOptions } from './interfaces.js' ;
30+ import type { NextOptions , StartParam , ResumeOptions } from './interfaces.js' ;
3231import type { JourneyLoginFailure } from './login-failure.utils.js' ;
3332import type { JourneyLoginSuccess } from './login-success.utils.js' ;
3433
@@ -78,13 +77,13 @@ export interface JourneyClient {
7877 * }
7978 * ```
8079 */
81- export async function journey ( {
80+ export async function journey < ActionType extends ActionTypes = ActionTypes > ( {
8281 config,
8382 requestMiddleware,
8483 logger,
8584} : {
8685 config : JourneyClientConfig ;
87- requestMiddleware ?: RequestMiddleware [ ] ;
86+ requestMiddleware ?: RequestMiddleware < ActionType > [ ] ;
8887 logger ?: {
8988 level : LogLevel ;
9089 custom ?: CustomLogger ;
@@ -116,7 +115,6 @@ export async function journey({
116115 store . dispatch (
117116 configSlice . actions . set ( {
118117 wellknownResponse : wellknownResponse ,
119- middleware : config . middleware ?? requestMiddleware ,
120118 } ) ,
121119 ) ;
122120
0 commit comments