import { AssignMethod, ConversationAssigned } from '../../Conversations/Conversation'; import { ChannelType } from './ChannelType'; import { EmailConfig } from './Email'; import { FacebookConfig } from './Facebook'; import { FormConfig } from './Form'; import { GoogleBusinessConfig } from './GoogleBusiness'; import { InstagramConfig } from './Instagram'; import { MercadoLibreConfig } from './MercadoLibre'; import { PbxConfig } from './Pbx'; import { Permission } from './Permission'; import { SipConfig } from './Sip'; import { SmsConfig } from './Sms'; import { WebChatConfig } from './WebChat'; import { WhatsAppConectionType, WhatsAppConfig } from './WhatsApp'; import { RCSConfig } from './RCS'; interface IChannelInfo { id?: string | null; name?: string | null; description?: string | null; type?: ChannelType | null; /** * Whatsapp specific - indicates the type of connection (Cloud API or APIQR) */ connectionType?: WhatsAppConectionType | null; /** * Indicates if the WhatsApp business is on the WhatsApp Business App */ cloudApiIsOnBizApp?: boolean | null; /** * ID of the channel in the external system. */ externalChannelId?: string | null; /** * Indicates the status of the channel. * actually each channel type has its own status values, so this property is a string to accommodate that. * TODO: which can be one of the following values: "ACTIVE", "INACTIVE", "DELETED", "ERROR", "PROVISIONING", "DEPROVISIONING", "SUSPENDED", or "CONFIGURATION_PENDING". */ status?: string; } /** * Fallback routing used only when no published Flow entry point matches the * channel, or when the selected Flow cannot produce a valid disposition. * * Flow-to-channel bindings remain authoritative in FlowEntryPoint. */ interface ChannelConversationRoutingConfig { /** Stable id of a ConversationQueue in the same space as the channel. */ defaultQueueId: string; } interface IChannel { id?: string | null; spaceId?: string | null; name?: string | null; description?: string | null; type?: ChannelType | null; permissions?: Permission[] | null; /** * @deprecated Legacy channel assignment configuration. Use * ChannelConversationRoutingConfig; Flow bindings live in FlowEntryPoint. */ assignTo?: ConversationAssigned; /** * @deprecated Legacy channel assignment configuration. Use * ChannelConversationRoutingConfig; QueueRoutingPolicy controls agent * distribution only after a Queue has been selected. */ assignMethod: AssignMethod; /** * @deprecated Ownership is produced by the routing decision. */ assignToOwner?: boolean; /** * habilita la creacion de conversaciones para este canal, si esta en false, los mensajes entrantes no generaran conversaciones */ conversationsEnabled: boolean | false; /** * Default Queue for newly-created conversations that are not handled by a * Flow. Store only the Queue id; */ conversationRouting?: ChannelConversationRoutingConfig | null; /** * Gets or sets a value indicating whether webhook notifications are enabled. * Redirects incoming messages to the specified webhook URL when set to true. */ webhookEnabled: boolean | false; /**Gets or sets the URL of the webhook endpoint to which notifications are sent. */ webhookUrl?: string | null; /**Used to sign the webhook payloads, to verify that they come from Trii. The receiver webhook endpoint should have the logic to verify the signature using this secret. */ webhookSecret?: string | null; email?: EmailConfig | null; sms?: SmsConfig | null; webChat?: WebChatConfig | null; form?: FormConfig | null; pbx?: PbxConfig | null; sip?: SipConfig | null; whatsApp?: WhatsAppConfig | null; instagram?: InstagramConfig | null; facebook?: FacebookConfig | null; mercadoLibre?: MercadoLibreConfig | null; googleBusiness?: GoogleBusinessConfig | null; rcsBusiness?: RCSConfig | null; createdAt?: string | null; createdBy?: string | null; updatedAt?: string | null; deletedAt?: string | null; statusCode: channelStatus | channelStatus.UNKNOWN; statusDetails: string | ''; statusUpdateAt?: Date | null; messagingAvailability: MessagingAvailability; } declare enum MessagingAvailability { AVAILABLE = 0, BLOCKED = 1 } declare enum channelStatus { UNKNOWN = 0, ACTIVE = 1, INACTIVE = 2, DELETED = 3, ERROR = 4, PROVISIONING = 5, DEPROVISIONING = 6, SUSPENDED = 7, CONFIGURATION_PENDING = 9 } export { IChannel, IChannelInfo, ChannelConversationRoutingConfig, channelStatus, MessagingAvailability };