import { vonage } from './clientsdk-clientcore_js'; /** * The EmbeddedInfo type * * @property kind The kind property of EmbeddedInfo * @property memberId The memberId property of EmbeddedInfo * @property user The user property of EmbeddedInfo * @interface */ export type EmbeddedInfo = Omit & { kind: 'embeddedInfo'; }; /** * The System type * * @property kind The kind property of System * @interface */ export type System = Omit & { kind: 'system'; }; /** * A From is a discriminated union of {@link EmbeddedInfo}, {@link System} */ export type From = EmbeddedInfo | System; /** * The EphemeralConversationEvent type * * @property kind The kind property of EphemeralConversationEvent * @property timestamp The timestamp property of EphemeralConversationEvent * @property conversationId The conversationId property of EphemeralConversationEvent * @property from The {@link From} property of EphemeralConversationEvent * @property body The body property of EphemeralConversationEvent * @interface * @group Chat */ export type EphemeralConversationEvent = Omit & { kind: 'ephemeral'; from: From; }; /** * A NonPersistentConversationEvent is a {@link EphemeralConversationEvent} * @group Chat */ export type NonPersistentConversationEvent = EphemeralConversationEvent; import { MessageAudioEventBody } from '../utils/ConversationEventBodies'; import { MemberStatus } from '../utils/ConversationEventBodies'; import { MessageFileEventBody } from '../utils/ConversationEventBodies'; import { MessageImageEventBody } from '../utils/ConversationEventBodies'; import { MessageLocationEventBody } from '../utils/ConversationEventBodies'; import { MessageTemplateEventBody } from '../utils/ConversationEventBodies'; import { MessageTextEventBody } from '../utils/ConversationEventBodies'; import { MessageVCardEventBody } from '../utils/ConversationEventBodies'; import { MessageVideoEventBody } from '../utils/ConversationEventBodies'; /** * The CustomConversationEvent type * * @property kind The kind property of CustomConversationEvent * @property id The id property of CustomConversationEvent * @property timestamp The timestamp property of CustomConversationEvent * @property conversationId The conversationId property of CustomConversationEvent * @property from The {@link From} property of CustomConversationEvent * @property eventType The eventType property of CustomConversationEvent * @property body The body property of CustomConversationEvent * @interface * @group Chat */ export type CustomConversationEvent = Omit & { kind: 'custom'; from: From; }; /** * The EventDeleteConversationEvent type * * @property kind The kind property of EventDeleteConversationEvent * @property id The id property of EventDeleteConversationEvent * @property timestamp The timestamp property of EventDeleteConversationEvent * @property conversationId The conversationId property of EventDeleteConversationEvent * @property from The {@link From} property of EventDeleteConversationEvent * @property body The body property of EventDeleteConversationEvent * @interface * @group Chat */ export type EventDeleteConversationEvent = Omit & { kind: 'event:delete'; from: From; }; /** * The MemberInvitedEvent type * * @property kind The kind property of MemberInvitedEvent * @property id The event id * @property timestamp The event timestamp * @property conversationId The conversation id * @property from The event sender * @property body The invited member * @interface * @group Chat */ export type MemberInvitedEvent = Omit & { kind: 'member:invited'; from: From; }; /** * The MemberJoinedEvent type * * @property kind The kind property of MemberJoinedEvent * @property id The id property of MemberJoinedEvent * @property timestamp The timestamp property of MemberJoinedEvent * @property conversationId The conversationId property of MemberJoinedEvent * @property from The {@link From} property of MemberJoinedEvent * @property body The body property of MemberJoinedEvent * @interface * @group Chat */ export type MemberJoinedEvent = Omit & { kind: 'member:joined'; from: From; }; /** * The MemberLeftEvent type * * @property kind The kind property of MemberLeftEvent * @property id The id property of MemberLeftEvent * @property timestamp The timestamp property of MemberLeftEvent * @property conversationId The conversationId property of MemberLeftEvent * @property from The {@link From} property of MemberLeftEvent * @property body The body property of MemberLeftEvent * @interface * @group Chat */ export type MemberLeftEvent = Omit & { kind: 'member:left'; from: From; }; /** * The MessageAudioEvent type * * @property kind The kind property of MessageAudioEvent * @property id The id property of MessageAudioEvent * @property timestamp The timestamp property of MessageAudioEvent * @property conversationId The conversationId property of MessageAudioEvent * @property from The {@link From} property of MessageAudioEvent * @property body The body property of MessageAudioEvent * @property memberStatuses The memberStatuses property of MessageAudioEvent * @interface * @group Chat */ export type MessageAudioEvent = Omit & { kind: 'message:audio'; from: From; body: MessageAudioEventBody; memberStatuses: MemberStatus; }; /** * The MessageCustomEvent type * * @property kind The kind property of MessageCustomEvent * @property id The id property of MessageCustomEvent * @property timestamp The timestamp property of MessageCustomEvent * @property conversationId The conversationId property of MessageCustomEvent * @property from The {@link From} property of MessageCustomEvent * @property body The body property of MessageCustomEvent * @property memberStatuses The memberStatuses property of MessageCustomEvent * @interface * @group Chat */ export type MessageCustomEvent = Omit & { kind: 'message:custom'; from: From; memberStatuses: MemberStatus; }; /** * The MessageDeliveredEvent type * * @property kind The kind property of MessageDeliveredEvent * @property id The id property of MessageDeliveredEvent * @property timestamp The timestamp property of MessageDeliveredEvent * @property conversationId The conversationId property of MessageDeliveredEvent * @property from The {@link From} property of MessageDeliveredEvent * @property body The body property of MessageDeliveredEvent * @interface * @group Chat */ export type MessageDeliveredEvent = Omit & { kind: 'message:delivered'; from: From; }; /** * The MessageFileEvent type * * @property kind The kind property of MessageFileEvent * @property id The id property of MessageFileEvent * @property timestamp The timestamp property of MessageFileEvent * @property conversationId The conversationId property of MessageFileEvent * @property from The {@link From} property of MessageFileEvent * @property body The body property of MessageFileEvent * @property memberStatuses The memberStatuses property of MessageFileEvent * @interface * @group Chat */ export type MessageFileEvent = Omit & { kind: 'message:file'; from: From; body: MessageFileEventBody; memberStatuses: MemberStatus; }; /** * The MessageImageEvent type * * @property kind The kind property of MessageImageEvent * @property id The id property of MessageImageEvent * @property timestamp The timestamp property of MessageImageEvent * @property conversationId The conversationId property of MessageImageEvent * @property from The {@link From} property of MessageImageEvent * @property body The body property of MessageImageEvent * @property memberStatuses The memberStatuses property of MessageImageEvent * @interface * @group Chat */ export type MessageImageEvent = Omit & { kind: 'message:image'; from: From; body: MessageImageEventBody; memberStatuses: MemberStatus; }; /** * The MessageLocationEvent type * * @property kind The kind property of MessageLocationEvent * @property id The id property of MessageLocationEvent * @property timestamp The timestamp property of MessageLocationEvent * @property conversationId The conversationId property of MessageLocationEvent * @property from The {@link From} property of MessageLocationEvent * @property body The body property of MessageLocationEvent * @property memberStatuses The memberStatuses property of MessageLocationEvent * @interface * @group Chat */ export type MessageLocationEvent = Omit & { kind: 'message:location'; from: From; body: MessageLocationEventBody; memberStatuses: MemberStatus; }; /** * The MessageRejectedEvent type * * @property kind The kind property of MessageRejectedEvent * @property id The id property of MessageRejectedEvent * @property timestamp The timestamp property of MessageRejectedEvent * @property conversationId The conversationId property of MessageRejectedEvent * @property from The {@link From} property of MessageRejectedEvent * @property body The body property of MessageRejectedEvent * @interface * @group Chat */ export type MessageRejectedEvent = Omit & { kind: 'message:rejected'; from: From; }; /** * The MessageSeenEvent type * * @property kind The kind property of MessageSeenEvent * @property id The id property of MessageSeenEvent * @property timestamp The timestamp property of MessageSeenEvent * @property conversationId The conversationId property of MessageSeenEvent * @property from The {@link From} property of MessageSeenEvent * @property body The body property of MessageSeenEvent * @interface * @group Chat */ export type MessageSeenEvent = Omit & { kind: 'message:seen'; from: From; }; /** * The MessageSubmittedEvent type * * @property kind The kind property of MessageSubmittedEvent * @property id The id property of MessageSubmittedEvent * @property timestamp The timestamp property of MessageSubmittedEvent * @property conversationId The conversationId property of MessageSubmittedEvent * @property from The {@link From} property of MessageSubmittedEvent * @property body The body property of MessageSubmittedEvent * @interface * @group Chat */ export type MessageSubmittedEvent = Omit & { kind: 'message:submitted'; from: From; }; /** * The MessageTemplateEvent type * * @property kind The kind property of MessageTemplateEvent * @property id The id property of MessageTemplateEvent * @property timestamp The timestamp property of MessageTemplateEvent * @property conversationId The conversationId property of MessageTemplateEvent * @property from The {@link From} property of MessageTemplateEvent * @property memberStatuses The memberStatuses property of MessageTemplateEvent * @property body The body property of MessageTemplateEvent * @interface * @group Chat */ export type MessageTemplateEvent = Omit & { kind: 'message:template'; from: From; memberStatuses: MemberStatus; body: MessageTemplateEventBody; }; /** * The MessageTextEvent type * * @property kind The kind property of MessageTextEvent * @property id The id property of MessageTextEvent * @property timestamp The timestamp property of MessageTextEvent * @property conversationId The conversationId property of MessageTextEvent * @property from The {@link From} property of MessageTextEvent * @property body The body property of MessageTextEvent * @property memberStatuses The memberStatuses property of MessageTextEvent * @interface * @group Chat */ export type MessageTextEvent = Omit & { kind: 'message:text'; from: From; body: MessageTextEventBody; memberStatuses: MemberStatus; }; /** * The MessageUndeliverableEvent type * * @property kind The kind property of MessageUndeliverableEvent * @property id The id property of MessageUndeliverableEvent * @property timestamp The timestamp property of MessageUndeliverableEvent * @property conversationId The conversationId property of MessageUndeliverableEvent * @property from The {@link From} property of MessageUndeliverableEvent * @property body The body property of MessageUndeliverableEvent * @interface * @group Chat */ export type MessageUndeliverableEvent = Omit & { kind: 'message:undeliverable'; from: From; }; /** * The MessageVCardEvent type * * @property kind The kind property of MessageVCardEvent * @property id The id property of MessageVCardEvent * @property timestamp The timestamp property of MessageVCardEvent * @property conversationId The conversationId property of MessageVCardEvent * @property from The {@link From} property of MessageVCardEvent * @property body The body property of MessageVCardEvent * @property memberStatuses The memberStatuses property of MessageVCardEvent * @interface * @group Chat */ export type MessageVCardEvent = Omit & { kind: 'message:vcard'; from: From; body: MessageVCardEventBody; memberStatuses: MemberStatus; }; /** * The MessageVideoEvent type * * @property kind The kind property of MessageVideoEvent * @property id The id property of MessageVideoEvent * @property timestamp The timestamp property of MessageVideoEvent * @property conversationId The conversationId property of MessageVideoEvent * @property from The {@link From} property of MessageVideoEvent * @property body The body property of MessageVideoEvent * @property memberStatuses The memberStatuses property of MessageVideoEvent * @interface * @group Chat */ export type MessageVideoEvent = Omit & { kind: 'message:video'; from: From; body: MessageVideoEventBody; memberStatuses: MemberStatus; }; /** * A PersistentConversationEvent is a discriminated union of {@link CustomConversationEvent}, {@link EventDeleteConversationEvent}, {@link MemberInvitedEvent}, {@link MemberJoinedEvent}, {@link MemberLeftEvent}, {@link MessageAudioEvent}, {@link MessageCustomEvent}, {@link MessageDeliveredEvent}, {@link MessageFileEvent}, {@link MessageImageEvent}, {@link MessageLocationEvent}, {@link MessageRejectedEvent}, {@link MessageSeenEvent}, {@link MessageSubmittedEvent}, {@link MessageTemplateEvent}, {@link MessageTextEvent}, {@link MessageUndeliverableEvent}, {@link MessageVCardEvent}, {@link MessageVideoEvent} * @group Chat */ export type PersistentConversationEvent = CustomConversationEvent | EventDeleteConversationEvent | MemberInvitedEvent | MemberJoinedEvent | MemberLeftEvent | MessageAudioEvent | MessageCustomEvent | MessageDeliveredEvent | MessageFileEvent | MessageImageEvent | MessageLocationEvent | MessageRejectedEvent | MessageSeenEvent | MessageSubmittedEvent | MessageTemplateEvent | MessageTextEvent | MessageUndeliverableEvent | MessageVCardEvent | MessageVideoEvent; /** * A VoiceChannelTypeJS is a union of 'app', 'phone', 'sip', 'websocket' */ export type VoiceChannelTypeJS = 'app' | 'phone' | 'sip' | 'websocket'; /** * A ConversationEvent is a union of {@link NonPersistentConversationEvent}, {@link PersistentConversationEvent} * @group Chat */ export type ConversationEvent = NonPersistentConversationEvent | PersistentConversationEvent; /** * A ConversationState is a union of 'ACTIVE', 'INACTIVE', 'DELETED' */ export type ConversationState = 'ACTIVE' | 'INACTIVE' | 'DELETED'; /** * A MemberState is a union of 'INVITED', 'JOINED', 'LEFT', 'UNKNOWN' */ export type MemberState = 'INVITED' | 'JOINED' | 'LEFT' | 'UNKNOWN'; /** * A ConversationChannelType is a union of 'APP', 'PHONE', 'PSTN', 'sip', 'VBC', 'WEBSOCKET', 'SMS', 'MMS', 'WHATSAPP', 'VIBER', 'MESSENGER' */ export type ConversationChannelType = 'APP' | 'PHONE' | 'PSTN' | 'sip' | 'VBC' | 'WEBSOCKET' | 'SMS' | 'MMS' | 'WHATSAPP' | 'VIBER' | 'MESSENGER'; /** * A CSErrorCodesJS is a union of 'CONVERSATION_DUPLICATE_NAME', 'MEMBER_ALREADY_JOINED', 'MEMBER_ALREADY_INVITED', 'CONVERSATION_NOT_FOUND', 'MEMBER_NOT_FOUND', 'USER_NOT_FOUND', 'INVALID_CURSOR', 'VALIDATION_FAIL', 'CONVERSATION_MAX_NUMBER_OF_MEMBERS', 'CUSTOM_DATA_OVERALL_LIMIT_EXCEEDED' */ export type CSErrorCodesJS = 'CONVERSATION_DUPLICATE_NAME' | 'MEMBER_ALREADY_JOINED' | 'MEMBER_ALREADY_INVITED' | 'CONVERSATION_NOT_FOUND' | 'MEMBER_NOT_FOUND' | 'USER_NOT_FOUND' | 'INVALID_CURSOR' | 'VALIDATION_FAIL' | 'CONVERSATION_MAX_NUMBER_OF_MEMBERS' | 'CUSTOM_DATA_OVERALL_LIMIT_EXCEEDED'; /** * A SessionErrorCodesJS is a union of 'EMPTY_TOKEN', 'FORCED_DISCONNECT', 'TIMEOUT', 'INTERNAL_FAILURE', 'NO_ACTIVE_SESSION', 'ALREADY_ACTIVE_SESSION', 'INVALID_TOKEN', 'EXPIRED_TOKEN', 'INVALID_USER', 'AUTHORIZATION_ERROR', 'INVALID_SESSION', 'MAX_OPEN_SESSIONS', 'INVALID_SOCKET_TRANSPORT', 'CLIENT_DISCONNECT', 'PING_TIMEOUT_DISCONNECT', 'TRANSPORT_CLOSED_DISCONNECT' */ export type SessionErrorCodesJS = 'EMPTY_TOKEN' | 'FORCED_DISCONNECT' | 'TIMEOUT' | 'INTERNAL_FAILURE' | 'NO_ACTIVE_SESSION' | 'ALREADY_ACTIVE_SESSION' | 'INVALID_TOKEN' | 'EXPIRED_TOKEN' | 'INVALID_USER' | 'AUTHORIZATION_ERROR' | 'INVALID_SESSION' | 'MAX_OPEN_SESSIONS' | 'INVALID_SOCKET_TRANSPORT' | 'CLIENT_DISCONNECT' | 'PING_TIMEOUT_DISCONNECT' | 'TRANSPORT_CLOSED_DISCONNECT'; /** * A VonageErrorTypeJS is a union of 'CS_ERROR', 'NETWORK_ERROR', 'SESSION_ERROR', 'INTERNAL_ERROR', 'UNKNOWN_ERROR' */ export type VonageErrorTypeJS = 'CS_ERROR' | 'NETWORK_ERROR' | 'SESSION_ERROR' | 'INTERNAL_ERROR' | 'UNKNOWN_ERROR'; /** * A SessionErrorReasonJS is a union of 'EXPIRED_TOKEN', 'TRANSPORT_CLOSED', 'PING_TIMEOUT' */ export type SessionErrorReasonJS = 'EXPIRED_TOKEN' | 'TRANSPORT_CLOSED' | 'PING_TIMEOUT'; /** * A LegStatusJS is a union of 'RINGING', 'ANSWERED', 'COMPLETED' */ export type LegStatusJS = 'RINGING' | 'ANSWERED' | 'COMPLETED'; /** * A CallDisconnectReasonJS is a 'networkChange' */ export type CallDisconnectReasonJS = 'networkChange'; /** * A HangupReasonJS is a union of 'REMOTE_HANGUP', 'REMOTE_REJECT', 'REMOTE_NO_ANSWER_TIMEOUT', 'LOCAL_HANGUP', 'MEDIA_TIMEOUT' */ export type HangupReasonJS = 'REMOTE_HANGUP' | 'REMOTE_REJECT' | 'REMOTE_NO_ANSWER_TIMEOUT' | 'LOCAL_HANGUP' | 'MEDIA_TIMEOUT'; /** * A CancelReasonJS is a union of 'RemoteCancel', 'AnsweredElsewhere', 'RejectedElsewhere', 'RemoteTimeout' */ export type CancelReasonJS = 'RemoteCancel' | 'AnsweredElsewhere' | 'RejectedElsewhere' | 'RemoteTimeout';