@channel.io/be-user-chat-mcp
Version:
Backend UserChat Model Context Protocol server for Channel.io
191 lines • 5.8 kB
TypeScript
import type { RequestContext } from "../config/index.js";
export type UserChatState = "opened" | "queued" | "snoozed" | "closed";
export type MissedReason = string;
export type AutoAssignPriority = "high" | "medium" | "low";
export type UserChatSubtextType = "description" | "incoming";
export type UserChatGoalState = "achieved" | "waiting" | "notAchieved" | "none";
export type UserChatAlfState = "inProgress" | "completed";
export type AlfState = "NONE";
export type UserChatMedium = "inAppChat" | "appKakao" | "appLine" | "appNaverTalk" | "appInstagramMessenger" | "call" | "email";
export interface UserChatSourceMarketing {
id?: string;
type?: string;
}
export interface UserChatSourceSupportBot {
id?: string;
revisionId?: string;
sectionPath?: string[];
}
export interface UserChatSourceWorkflow {
id?: string;
revisionId?: string;
traceId?: string;
sectionPath?: string[];
causeOfEnd?: string;
}
export interface UserChatSourceAppMessenger {
id?: string;
mediumType?: string;
displayName?: string;
}
export interface UserChatSource {
page?: string;
marketing?: UserChatSourceMarketing;
supportBot?: UserChatSourceSupportBot;
workflow?: UserChatSourceWorkflow;
appMessenger?: UserChatSourceAppMessenger;
}
export type UserChatProfile = Record<string, unknown>;
export interface WorkflowTrace {
id: string;
workflowId: string;
revisionId: string;
sectionPath: string[];
actionIndex: number;
ended: boolean;
previousTrace?: WorkflowTrace;
}
export interface ButtonSectionInfo {
sectionId: string;
revisionId: string;
}
export interface Button {
id: string;
type?: string;
}
export interface HandlingBase {
type: string;
}
export interface HandlingWorkflowFields extends HandlingBase {
id?: string;
trace?: WorkflowTrace;
buttons?: Button[];
triggerMessageId?: string;
nextSectionId?: string;
paused?: boolean;
charged?: boolean;
opened?: boolean;
language?: string;
postbackButtonMessageSuccess?: boolean;
validButtonResponse?: boolean;
buttonSectionStack?: ButtonSectionInfo[];
}
export interface HandlingWorkflow extends HandlingWorkflowFields {
type: "workflow";
}
export interface HandlingIvr extends HandlingWorkflowFields {
type: "ivr";
inputs?: unknown[];
}
export interface HandlingCollectUserReply extends HandlingWorkflowFields {
type: "collectUserReply";
}
export interface HandlingSupportBot extends HandlingBase {
type: "supportBot";
id?: string;
revisionId?: string;
sectionPath?: string[];
pausedStepIndex?: number;
pausedMessageId?: string;
}
export interface HandlingFollowUpMandatory extends HandlingBase {
type: "followUpMandatory";
previous?: HandlingWorkflow;
}
export interface HandlingWaitingToStartChat extends HandlingBase {
type: "waitingToStartChat";
}
export interface HandlingAlf extends HandlingWorkflowFields {
type: "alf";
actionProcessId?: string;
state?: AlfState;
additionalRoleDescription?: string;
enableOpenChat?: boolean;
alfBotId?: string;
alfLanguage?: string;
revisionId?: string;
sectionPath?: string[];
pausedStepIndex?: number;
pausedMessageId?: string;
alfBot?: unknown;
}
export type UserChatHandling = HandlingWorkflow | HandlingIvr | HandlingCollectUserReply | HandlingSupportBot | HandlingFollowUpMandatory | HandlingWaitingToStartChat | HandlingAlf | undefined;
export interface UserChat {
id: string;
channelId: string;
managedStateKey?: string;
managedAssigneeStateKey?: string;
managedTeamNoAssigneeStateKey?: string;
alfStateKey?: string;
managedSyncAssigneeStateKey?: string;
contactKey?: string;
contactOrder?: number;
contactMediumType?: UserChatMedium;
liveMeetId?: string;
sync?: boolean;
state?: UserChatState;
missedReason?: MissedReason;
managed?: boolean;
priority?: AutoAssignPriority;
userId?: string;
xerId?: string;
name?: string;
title?: string;
description?: string;
subtextType?: UserChatSubtextType;
handling?: UserChatHandling;
source?: UserChatSource;
managerIds?: Set<string>;
assigneeId?: string;
teamId?: string;
tags?: Set<string>;
profile?: UserChatProfile;
goalEventName?: string;
goalEventQuery?: unknown;
goalCheckedAt?: string;
goalState?: UserChatGoalState;
firstOpenedAt?: string;
openedAt?: string;
firstQueuedAt?: string;
queuedAt?: string;
createdAt: string;
updatedAt: string;
frontMessageId?: string;
frontUpdatedAt?: string;
deskMessageId?: string;
summarizedMessageId?: string;
deskUpdatedAt?: string;
userLastMessageId?: string;
followUpTriggeredAt?: string;
firstAssigneeIdAfterOpen?: string;
firstRepliedAt?: string;
firstRepliedAtAfterOpen?: string;
oneStop?: boolean;
waitingTime?: number;
avgReplyTime?: number;
totalReplyTime?: number;
replyCount?: number;
resolutionTime?: number;
operationWaitingTime?: number;
operationAvgReplyTime?: number;
operationTotalReplyTime?: number;
operationReplyCount?: number;
operationResolutionTime?: number;
askedAt?: string;
accessLog?: unknown;
firstAskedAt?: string;
closedAt?: string;
snoozedAt?: string;
expiresAt?: string;
removedAt?: string;
version?: number;
managerWaitingMessageId?: string;
userWaitingMessageId?: string;
lastInboundEmailId?: string;
alfRequestedAt?: string;
}
/**
* Fetches a user chat item from DynamoDB by its ID.
*/
export declare function getUserChat(userChatId: string, context: RequestContext): Promise<UserChat | null>;
//# sourceMappingURL=user-chat.repository.d.ts.map