import FetchChatTokenResponse from "./Model/FetchChatTokenResponse"; import IDataMaskingInfo from "./Interfaces/IDataMaskingInfo"; import IEmailTranscriptOptionalParams from "./Interfaces/IEmailTranscriptOptionalParams"; import IGetChatTokenOptionalParams from "./Interfaces/IGetChatTokenOptionalParams"; import IGetChatTranscriptsOptionalParams from "./Interfaces/IGetChatTranscriptsOptionalParams"; import IGetLWIDetailsOptionalParams from "./Interfaces/IGetLWIDetailsOptionalParams"; import IGetPersistentChatHistoryOptionalParams from "./Interfaces/IGetPersistentChatHistoryOptionalParams"; import IGetQueueAvailabilityOptionalParams from "./Interfaces/IGetQueueAvailabilityOptionalParams"; import IGetSurveyInviteLinkOptionalParams from "./Interfaces/IGetSurveyInviteLinkOptionalParams"; import IOmnichannelConfiguration from "./Interfaces/IOmnichannelConfiguration"; import IReconnectAvailabilityOptionalParams from "./Interfaces/IReconnectAvailabilityOptionalParams"; import IReconnectableChatsParams from "./Interfaces/IReconnectableChatsParams"; import ISDK from "./Interfaces/ISDK"; import ISDKConfiguration from "./Interfaces/ISDKConfiguration"; import ISecondaryChannelEventOptionalParams from "./Interfaces/ISecondaryChannelEventOptionalParams"; import ISendTypingIndicatorOptionalParams from "./Interfaces/ISendTypingIndicatorOptionalParams"; import ISessionCloseOptionalParams from "./Interfaces/ISessionCloseOptionalParams"; import ISessionInitOptionalParams from "./Interfaces/ISessionInitOptionalParams"; import ISubmitPostChatResponseOptionalParams from "./Interfaces/ISubmitPostChatResponseOptionalParams"; import IValidateAuthChatRecordOptionalParams from "./Interfaces/IValidateAuthChatRecordOptionalParams"; import OCSDKLogger from "./Common/OCSDKLogger"; import QueueAvailability from "./Model/QueueAvailability"; import ReconnectAvailability from "./Model/ReconnectAvailability"; import ReconnectMappingRecord from "./Model/ReconnectMappingRecord"; export default class SDK implements ISDK { private omnichannelConfiguration; private configuration; private logger?; private static defaultRequestTimeoutConfig; private static defaultConfiguration; liveChatVersion: number; sessionId?: string; ocUserAgent: string[]; HTTPTimeOutErrorMessage: string; constructor(omnichannelConfiguration: IOmnichannelConfiguration, configuration?: ISDKConfiguration, logger?: OCSDKLogger | undefined); /** * Fetches LCW FCS Details of the Org. */ getLcwFcsDetails(): Promise; /** * Fetches chat config. * @param requestId: RequestId to use to get chat config (Optional). */ getChatConfig(requestId: string, bypassCache?: boolean): Promise; /** * Fetches LWI details. * @param requestId: RequestId to use to get chat config (Optional). * @param getLWIDetailsOptionalParams: Optional parameters for get LWI Details. */ getLWIDetails(requestId: string, getLWIDetailsOptionalParams?: IGetLWIDetailsOptionalParams): Promise; /** * Fetches the chat token from Omnichannel to join T1 thread. * @param requestId: RequestId to use for getchattoken (Optional). * @param getChatTokenOptionalParams: Optional parameters for get chat token. */ getChatToken(requestId: string, getChatTokenOptionalParams?: IGetChatTokenOptionalParams, currentRetryCount?: number): Promise; /** * Fetches the reconnectable chats from omnichannel from the given user information in JWT token(claim name: sub). * @param reconnectableChatsParams Mandate parameters for get reconnectable chats. */ getReconnectableChats(reconnectableChatsParams: IReconnectableChatsParams): Promise; /** * Fetches the reconnectable chats from omnichannel from the given user information in JWT token(claim name: sub). * @param reconnectableChatsParams Mandate parameters for get reconnectable chats. */ getReconnectAvailability(reconnectId: string, optionalParams?: IReconnectAvailabilityOptionalParams): Promise; /** * * @param requestId: RequestId to use for session init. * @param queueAvailabilityOptionalParams: Optional parameters for session init. */ getAgentAvailability(requestId: string, queueAvailabilityOptionalParams?: IGetQueueAvailabilityOptionalParams): Promise; /**' * Starts a session to omnichannel. * @param requestId: RequestId to use for session init. * @param sessionInitOptionalParams: Optional parameters for session init. */ sessionInit(requestId: string, sessionInitOptionalParams?: ISessionInitOptionalParams): Promise; createConversation(requestId: string, sessionInitOptionalParams?: ISessionInitOptionalParams): Promise; /** * Closes the omnichannel session. * @param requestId: RequestId to use for session close (same request id for session init). * @param sessionCloseOptionalParams: Optional parameters for session close. */ sessionClose(requestId: string, sessionCloseOptionalParams?: ISessionCloseOptionalParams): Promise; /** * Validate the auth chat record exists in database. * @param requestId: RequestId for validateAuthChatRecord (same request id for session init). * @param validateAuthChatRecordOptionalParams: Optional parameters for validateAuthChatRecord. */ validateAuthChatRecord(requestId: string, validateAuthChatRecordOptionalParams: IValidateAuthChatRecordOptionalParams): Promise; /** * Submits post chat response. * @param requestId RequestId of the omnichannel session. * @param postChatResponse Post chat response to submit. * @param submitPostChatResponseOptionalParams: Optional parameters for submit post chat response. */ submitPostChatResponse(requestId: string, postChatResponse: object, submitPostChatResponseOptionalParams?: ISubmitPostChatResponseOptionalParams): Promise; /** * Submits post chat response. * @param requestId RequestId of the omnichannel session. * @param postChatResponse Post chat response to submit. * @param submitPostChatResponseOptionalParams: Optional parameters for submit post chat response. */ getSurveyInviteLink(surveyOwnerId: string, surveyInviteAPIRequestBody: object, getsurveyInviteLinkOptionalParams?: IGetSurveyInviteLinkOptionalParams): Promise; /** * Get chat transcripts for customer. * @param requestId RequestId of the omnichannel session. * @param chatId Chat thread Id. * @param token Skype token. * @param getChatTranscriptsOptionalParams Optional parameters for get chat transcripts. */ getChatTranscripts(requestId: string, chatId: string, token: string, getChatTranscriptsOptionalParams?: IGetChatTranscriptsOptionalParams): Promise; /** * Get persistent chat history for authenticated users. * @param requestId RequestId of the omnichannel session (Optional). * @param getPersistentChatHistoryOptionalParams Optional parameters for get persistent chat history. */ getPersistentChatHistory(requestId: string, getPersistentChatHistoryOptionalParams?: IGetPersistentChatHistoryOptionalParams): Promise; /** * Email transcript to customer. * @param requestId RequestId of the omnichannel session. * @param token Skype token. * @param emailRequestBody Email request body. * @param emailTranscriptOptionalParams Optional parameters for email transcript. */ emailTranscript(requestId: string, token: string, emailRequestBody: object, emailTranscriptOptionalParams?: IEmailTranscriptOptionalParams): Promise; /** * Fetch data masking info of the org. * @param requestId RequestId of the omnichannel session (Optional). */ fetchDataMaskingInfo(requestId: string): Promise; /** * Makes a secondary channel event network call to Omnichannel. * @param requestId RequestId to use for secondary channel event * @param secondaryChannelEventRequestBody secondaryChannel event request body * @param secondaryChannelEventOptionalParams Optional parameters for secondary channel events. */ makeSecondaryChannelEventRequest(requestId: string, secondaryChannelEventRequestBody: object, secondaryChannelEventOptionalParams?: ISecondaryChannelEventOptionalParams): Promise; /** Send typing indicator * @param requestId RequestId of the omnichannel session. */ sendTypingIndicator(requestId: string, currentLiveChatVersion: number, sendTypingIndicatorOptionalParams?: ISendTypingIndicatorOptionalParams): Promise; /** * Authenticates an ongoing (previously unauthenticated) chat session. * Upgrades engagement context so subsequent calls use authenticated endpoints. * @param requestId Current request/correlation id * @param authenticateChatParams { chatId, authenticatedUserToken } */ midConversationAuthenticateChat(requestId: string, authenticateChatParams: { chatId: string; authenticatedUserToken: string; }): Promise; /** * Fetches unread message count for the authenticated user. * Auth-only endpoint — does not require an active chat session. * @param authenticatedUserToken Auth token for the user. */ getUnreadMessageCount(authenticatedUserToken: string): Promise; /** * Sends a read receipt for a specific message in an authenticated conversation. * Updates the unread message counter on the server and forwards the receipt to ACS. * @param requestId RequestId (conversationThreadId) of the conversation. * @param messageId The ACS message ID to mark as read. * @param authenticatedUserToken Auth token for the user. */ sendReadReceipt(requestId: string, messageId: string, authenticatedUserToken: string): Promise; /** * Helper function for logging. * * @param logLevel Log level for logging. * @param telemetryEventType Telemetry event type in which event will be logged. * @param description Description of the event. * @param requestId Request ID * @param response Response * @param elapsedTimeInMilliseconds Elapsed time in ms * @param requestPath Request path * @param method Method * @param error Error * @param data Data */ private logWithLogger; private setAuthCodeNonce; private addDefaultHeaders; private setSessionIdHeader; private setRequestIdHeader; private setCorrelationIdInHeader; }