import { ISession, ISessionDetails, ISessionItem, ISessionResource, SessionResourceSource as ISessionResourceSource, SessionResourceVisibility as ISessionResourceVisibility, SessionResourceWorkflowComponent as ISessionResourceWorkflowComponent } from '@cee-eng/hydrajs/@types/api/pcm/troubleshootSession'; import { ICasePayload } from '@cee-eng/hydrajs/@types/api/public/case'; import { ISolrRecommendation } from '@cee-eng/hydrajs/@types/models/solr/solr'; import { ITopContent, ITopContentList } from '@cee-eng/hydrajs/@types/models/topContent/topContentModel'; import { IAction, IApiCreateState, IApiResponseDetails, IApiUpdateState } from '@rh-support/types/shared'; import { ICVEWorkflowRecommendation, IErrataDetails } from '../models/caseCreationWorkflows'; import { CaseReducerDispatchType } from './CaseConstNTypes'; export interface IPrevSessions { [sessionId: string]: ISessionItem; } export interface IResourceTracking { resourceOriginId: string; resourceEntityId: string; payload: string; isCreating: boolean; isUpdating: boolean; visitedResources: ISessionResource[]; presentedResources: ISessionResource[]; presentedTabResources: ISessionResource[]; } export interface ISessionResourcesTracking { [source: string]: IResourceTracking; } export interface ISessionRestoreState { previousSessions: IApiResponseDetails; activeSessionId: string; hasFetchedPreviousSessions: boolean; sessionCreationStatus: IApiCreateState; sessionUpdationStatus: IApiUpdateState; sessionResourceTracking: ISessionResourcesTracking; referrerUrl: string; sessionOfCaseCreationError: ISessionItem | null; } export interface ISessionRestorePayloadType extends ISessionRestoreState { sessionItem: ISessionItem; sessionItems: ISessionItem[]; resourceSource: string; resourceOriginId: string; payload: string; visitedResources: ISessionResource[]; presentedResources: ISessionResource[]; presentedTabResources: ISessionResource[]; } type IActionType = IAction; export type SessionReducerDispatchType = (value: IActionType) => void; export declare enum SessionRestoreConstants { getSessions = "getSessions", patchSession = "patchSession", createSession = "createSession", setIndividualSession = "setIndividualSession", setActiveSessionId = "setActiveSessionId", setSessionCreationState = "setSessionCreationState", setSessionUpdationState = "setSessionUpdationState", updateSessionResourceTracking = "updateSessionResourceTracking", updatePreviousSessions = "updatePreviousSessions", updateSessionOfCaseCreationError = "updateSessionOfCaseCreationError" } export declare const initialSessionRestoreState: ISessionRestoreState; export type SessionRestoreDispatchType = (value: IActionType) => void; export declare const sessionRestoreReducer: (state: ISessionRestoreState, action: IActionType) => ISessionRestoreState; export declare const getIndividualSessionById: (dispatch: SessionReducerDispatchType, sessionId: string | undefined, isCaseCreate: boolean, ABTestVariation?: string) => Promise; export declare const loadPreviousSessions: (dispatch: SessionReducerDispatchType, caseDispatch: CaseReducerDispatchType) => Promise; export declare const createSession: (dispatch: SessionReducerDispatchType, sessionDetails: ISessionDetails, session: ISession) => Promise; export declare const updateSession: (dispatch: SessionReducerDispatchType, sessionId: string, sessionDetails: ISessionDetails, session?: ISession) => Promise; export declare const updateActiveSessionId: (dispatch: SessionReducerDispatchType, activeSessionId: string) => void; export declare const isAISureSession: (sessionItem: ISessionItem) => boolean; export declare function getRelevantSessionFromSessions(dispatch: SessionReducerDispatchType, currentRelevantSessionId: string, previousSessions: IPrevSessions, caseDetails: Partial): string; export declare function markAllSessionsUnresolved(dispatch: SessionReducerDispatchType, sessionData: IPrevSessions, userAgent: string): Promise; export declare function createOrUpdateSessionResources(dispatch: SessionReducerDispatchType, activeSessionId: string, currentSessionResourceTracking: ISessionResourcesTracking, source: ISessionResourceSource, resources: ISessionResource[] | undefined, payload?: string, workflowSource?: string | undefined): Promise; export declare function createSessionResourcesLocal(dispatch: SessionReducerDispatchType, activeSessionId: string, currentSessionResourceTracking: ISessionResourcesTracking, source: ISessionResourceSource, payload: string, resources: ISessionResource[] | undefined, workflowSource?: string | undefined): Promise; export declare function updateSessionResourcesLocal(dispatch: SessionReducerDispatchType, activeSessionId: string, currentSessionResourceTracking: ISessionResourcesTracking, source: ISessionResourceSource, resources: ISessionResource[] | undefined, workflowSource?: string | undefined): Promise; export declare const getSessResTCCategory: (tcCategory: ITopContentList, visibilityStatus: ISessionResourceVisibility, rank?: number) => ISessionResource[]; export declare const getSessResTC: (tc: ITopContent, visibilityStatus: ISessionResourceVisibility, rank?: number) => ISessionResource; export declare function getSessResFromRecs(recs: ISolrRecommendation[], visibilityStatus: ISessionResourceVisibility, pageSize?: number, currentPage?: number): ISessionResource[]; export declare const getSessResFromRec: (rec: ISolrRecommendation, visibilityStatus: ISessionResourceVisibility, rank?: number) => ISessionResource; export declare const getSessResFromRules: (url: string, visibilityStatus: ISessionResourceVisibility, rank?: number, resourceEntityId?: any) => ISessionResource; export declare const getSessResFromErrata: (errata: IErrataDetails, visibilityStatus: ISessionResourceVisibility, rank?: number, resourceComponent?: ISessionResourceWorkflowComponent | undefined) => ISessionResource; export declare const getSessResFromCve: (cve: ICVEWorkflowRecommendation, visibilityStatus: ISessionResourceVisibility, rank?: number, resourceComponent?: ISessionResourceWorkflowComponent | undefined, isCveOnly?: boolean, maxErrata?: number) => ISessionResource[]; export declare const getRulesToSave: (visiterUrl: any, visitedRec: any, allPresentedRec: any) => ISessionResource[]; export declare const getInsightRulesToSave: (visiterUrl: any, visitedRec: any, allPresentedRec: any) => ISessionResource[]; export declare const getSessResFromEA: (cta: string, visibilityStatus: ISessionResourceVisibility, rank?: number, resourceEntityId?: any) => ISessionResource; export declare const getRecToSave: (visitedRec: ISolrRecommendation, allPresentedRec: ISolrRecommendation[], allDocs?: ISolrRecommendation[]) => ISessionResource[]; export {}; //# sourceMappingURL=SessionRestoreReducer.d.ts.map