@realtimexsco/live-chat 1.4.18 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PERMISSIONS.md +209 -0
- package/dist/firebase-messaging-sw.js +13 -4
- package/dist/index.cjs +5506 -4372
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +169 -3
- package/dist/index.d.ts +169 -3
- package/dist/index.mjs +3231 -2099
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -1
package/dist/index.d.mts
CHANGED
|
@@ -564,10 +564,17 @@ interface ChatFeatures {
|
|
|
564
564
|
* in DM and group chats. Buttons stay visible; use showPhoneCall/showVideoCall to hide.
|
|
565
565
|
*/
|
|
566
566
|
hideCallActionsInGroupChats?: boolean;
|
|
567
|
-
/**
|
|
567
|
+
/**
|
|
568
|
+
* Called when user taps voice call. Omit to use the package's built-in
|
|
569
|
+
* VideoSDK calling (room creation, ringing, overlay) — see PERMISSIONS.md
|
|
570
|
+
* / docx/videosdk_end.md. Provide this to fully replace it with your own
|
|
571
|
+
* call implementation.
|
|
572
|
+
*/
|
|
568
573
|
onPhoneCall?: (ctx: ChatCallContext) => void;
|
|
569
|
-
/**
|
|
574
|
+
/** Same as `onPhoneCall`, for video calls. */
|
|
570
575
|
onVideoCall?: (ctx: ChatCallContext) => void;
|
|
576
|
+
/** Looped while the built-in incoming-call dialog is open. Omit for silent ringing. */
|
|
577
|
+
callRingtoneUrl?: string;
|
|
571
578
|
}
|
|
572
579
|
declare const defaultChatFeatures: Required<Pick<ChatFeatures, 'showPhoneCall' | 'showVideoCall' | 'hideCallActionsInGroupChats'>>;
|
|
573
580
|
interface AvatarSlotProps {
|
|
@@ -964,6 +971,12 @@ interface ChatComponents {
|
|
|
964
971
|
ChatSocketStatus?: React__default.ComponentType<{
|
|
965
972
|
className?: string;
|
|
966
973
|
}>;
|
|
974
|
+
/** Full-screen in-call UI (built-in VideoSDK flow). Pass `() => null` to suppress it entirely. */
|
|
975
|
+
CallOverlay?: React__default.ComponentType<Record<string, never>>;
|
|
976
|
+
/** Ringing dialog shown to callees (built-in VideoSDK flow). Pass `() => null` to suppress it entirely. */
|
|
977
|
+
IncomingCallDialog?: React__default.ComponentType<{
|
|
978
|
+
ringtoneUrl?: string;
|
|
979
|
+
}>;
|
|
967
980
|
}
|
|
968
981
|
interface ChatCustomizationConfig {
|
|
969
982
|
components?: ChatComponents;
|
|
@@ -1334,6 +1347,22 @@ declare class SocketService {
|
|
|
1334
1347
|
sender: string;
|
|
1335
1348
|
}): void;
|
|
1336
1349
|
emitGetOnlineUsers(): void;
|
|
1350
|
+
emitCallInvite(payload: {
|
|
1351
|
+
callId: string;
|
|
1352
|
+
}): void;
|
|
1353
|
+
emitCallAccept(payload: {
|
|
1354
|
+
callId: string;
|
|
1355
|
+
}): void;
|
|
1356
|
+
emitCallReject(payload: {
|
|
1357
|
+
callId: string;
|
|
1358
|
+
reason?: string;
|
|
1359
|
+
}): void;
|
|
1360
|
+
emitCallCancel(payload: {
|
|
1361
|
+
callId: string;
|
|
1362
|
+
}): void;
|
|
1363
|
+
emitCallEnd(payload: {
|
|
1364
|
+
callId: string;
|
|
1365
|
+
}): void;
|
|
1337
1366
|
}
|
|
1338
1367
|
declare const socketService: SocketService;
|
|
1339
1368
|
|
|
@@ -1892,4 +1921,141 @@ type AdminFeatureKey = "audioCall" | "videoCall" | "pushNotification" | "blockUs
|
|
|
1892
1921
|
*/
|
|
1893
1922
|
declare function useAdminFeatureGate(feature: AdminFeatureKey): CallFeatureGate;
|
|
1894
1923
|
|
|
1895
|
-
|
|
1924
|
+
declare const CallOverlay: () => React__default.JSX.Element | null;
|
|
1925
|
+
|
|
1926
|
+
interface IncomingCallDialogProps {
|
|
1927
|
+
/** Looped while the dialog is open. Omit for silent ringing. */
|
|
1928
|
+
ringtoneUrl?: string;
|
|
1929
|
+
}
|
|
1930
|
+
declare const IncomingCallDialog: ({ ringtoneUrl }: IncomingCallDialogProps) => React__default.JSX.Element | null;
|
|
1931
|
+
|
|
1932
|
+
declare const CALL_MODES: {
|
|
1933
|
+
readonly AUDIO: "audio";
|
|
1934
|
+
readonly VIDEO: "video";
|
|
1935
|
+
};
|
|
1936
|
+
type CallMode = (typeof CALL_MODES)[keyof typeof CALL_MODES];
|
|
1937
|
+
declare const CALL_STATUS: {
|
|
1938
|
+
readonly RINGING: "ringing";
|
|
1939
|
+
readonly ONGOING: "ongoing";
|
|
1940
|
+
readonly ENDED: "ended";
|
|
1941
|
+
readonly MISSED: "missed";
|
|
1942
|
+
readonly REJECTED: "rejected";
|
|
1943
|
+
readonly CANCELLED: "cancelled";
|
|
1944
|
+
};
|
|
1945
|
+
type CallStatus = (typeof CALL_STATUS)[keyof typeof CALL_STATUS];
|
|
1946
|
+
/** Client-only UI phase — one step finer than backend `CallStatus`. */
|
|
1947
|
+
type CallUiStatus = "idle" | "creating" | "ringing-out" | "incoming" | "joining" | "in-call" | "ending";
|
|
1948
|
+
interface CallParticipantSummary {
|
|
1949
|
+
_id: string;
|
|
1950
|
+
name?: string;
|
|
1951
|
+
profileImage?: string;
|
|
1952
|
+
}
|
|
1953
|
+
/** Common fields on every server → client call event payload. */
|
|
1954
|
+
interface CallSummary {
|
|
1955
|
+
callId: string;
|
|
1956
|
+
conversationId: string;
|
|
1957
|
+
meetingId: string;
|
|
1958
|
+
mode: CallMode;
|
|
1959
|
+
status: CallStatus;
|
|
1960
|
+
participants: string[];
|
|
1961
|
+
}
|
|
1962
|
+
interface CallRoomResponse extends CallSummary {
|
|
1963
|
+
token: string;
|
|
1964
|
+
}
|
|
1965
|
+
interface CallJoinTokenResponse {
|
|
1966
|
+
callId: string;
|
|
1967
|
+
meetingId: string;
|
|
1968
|
+
mode: CallMode;
|
|
1969
|
+
status: CallStatus;
|
|
1970
|
+
token: string;
|
|
1971
|
+
}
|
|
1972
|
+
interface CallIncomingPayload extends CallSummary {
|
|
1973
|
+
caller: CallParticipantSummary;
|
|
1974
|
+
}
|
|
1975
|
+
interface CallAcceptedPayload extends CallSummary {
|
|
1976
|
+
userId: string;
|
|
1977
|
+
}
|
|
1978
|
+
interface CallRejectedPayload extends CallSummary {
|
|
1979
|
+
userId: string;
|
|
1980
|
+
reason?: string;
|
|
1981
|
+
}
|
|
1982
|
+
interface CallCancelledPayload extends CallSummary {
|
|
1983
|
+
endedBy: string;
|
|
1984
|
+
}
|
|
1985
|
+
interface CallEndedPayload extends CallSummary {
|
|
1986
|
+
endedBy: string;
|
|
1987
|
+
durationSeconds: number;
|
|
1988
|
+
}
|
|
1989
|
+
interface CallBusyPayload extends CallSummary {
|
|
1990
|
+
userId: string;
|
|
1991
|
+
}
|
|
1992
|
+
interface CallHistoryEntry {
|
|
1993
|
+
_id: string;
|
|
1994
|
+
conversationId: string;
|
|
1995
|
+
meetingId: string;
|
|
1996
|
+
mode: CallMode;
|
|
1997
|
+
status: CallStatus;
|
|
1998
|
+
initiator: CallParticipantSummary;
|
|
1999
|
+
endedBy?: CallParticipantSummary;
|
|
2000
|
+
participants: string[];
|
|
2001
|
+
joinedParticipants?: string[];
|
|
2002
|
+
startedAt?: string;
|
|
2003
|
+
endedAt?: string;
|
|
2004
|
+
durationSeconds: number;
|
|
2005
|
+
}
|
|
2006
|
+
interface CallHistoryResponse {
|
|
2007
|
+
calls: CallHistoryEntry[];
|
|
2008
|
+
pagination: {
|
|
2009
|
+
page: number;
|
|
2010
|
+
limit: number;
|
|
2011
|
+
total: number;
|
|
2012
|
+
hasMore: boolean;
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
interface CallPeer {
|
|
2017
|
+
name?: string;
|
|
2018
|
+
avatar?: string | null;
|
|
2019
|
+
}
|
|
2020
|
+
interface CallState {
|
|
2021
|
+
uiStatus: CallUiStatus;
|
|
2022
|
+
callId: string | null;
|
|
2023
|
+
conversationId: string | null;
|
|
2024
|
+
meetingId: string | null;
|
|
2025
|
+
mode: CallMode | null;
|
|
2026
|
+
token: string | null;
|
|
2027
|
+
caller: CallParticipantSummary | null;
|
|
2028
|
+
participants: string[];
|
|
2029
|
+
error: string | null;
|
|
2030
|
+
/** Caller side only — the channel being called, for the "Calling {name}" screen. */
|
|
2031
|
+
callee: CallPeer | null;
|
|
2032
|
+
/** Set on transition to in-call. Display-only (duration timer), not billing-accurate. */
|
|
2033
|
+
callStartedAt: number | null;
|
|
2034
|
+
/** Caller: create the room and start ringing everyone else. */
|
|
2035
|
+
startCall: (conversationId: string, mode: CallMode, callee?: CallPeer) => Promise<void>;
|
|
2036
|
+
/** Caller: stop ringing before anyone accepted. */
|
|
2037
|
+
cancelCall: () => void;
|
|
2038
|
+
/** Callee: accept the ringing call and fetch a join token. */
|
|
2039
|
+
acceptCall: () => Promise<void>;
|
|
2040
|
+
/** Callee: decline the ringing call. */
|
|
2041
|
+
rejectCall: (reason?: string) => void;
|
|
2042
|
+
/** Either side: leave/end a live call. */
|
|
2043
|
+
endCall: () => void;
|
|
2044
|
+
/** Drop back to idle without notifying anyone (e.g. after a fatal error). */
|
|
2045
|
+
reset: () => void;
|
|
2046
|
+
_receiveIncoming: (payload: CallIncomingPayload) => void;
|
|
2047
|
+
_receiveAccepted: (payload: CallAcceptedPayload) => void;
|
|
2048
|
+
_receiveRejected: (payload: CallRejectedPayload) => void;
|
|
2049
|
+
_receiveCancelled: (payload: CallCancelledPayload) => void;
|
|
2050
|
+
_receiveEnded: (payload: CallEndedPayload) => void;
|
|
2051
|
+
_receiveBusy: (payload: CallBusyPayload) => void;
|
|
2052
|
+
_receiveMissed: (payload: CallSummary) => void;
|
|
2053
|
+
}
|
|
2054
|
+
declare const useCallStore: zustand.UseBoundStore<zustand.StoreApi<CallState>>;
|
|
2055
|
+
|
|
2056
|
+
declare const apiCreateCallRoom: (conversationId: string, mode: CallMode) => Promise<CallRoomResponse>;
|
|
2057
|
+
declare const apiFetchJoinToken: (meetingId: string) => Promise<CallJoinTokenResponse>;
|
|
2058
|
+
declare const apiFetchCallHistory: (conversationId?: string, page?: number, limit?: number) => Promise<CallHistoryResponse>;
|
|
2059
|
+
declare const apiFetchCallDetail: (callId: string) => Promise<CallHistoryEntry>;
|
|
2060
|
+
|
|
2061
|
+
export { ADMIN_PERMISSION_DENIED_MESSAGE, type ActiveChannelMessagesSlotProps, type AdminFeatureKey, AdminPermissionTooltip, type AdminsDrawerSlotProps, type AttachmentsDrawerSlotProps, type AvatarSlotProps, CALLS_NOT_ALLOWED_BY_PLATFORM_MESSAGE, CALLS_NOT_CONFIGURED_MESSAGE, CALL_MODES, CALL_STATUS, CHAT_API_KEYS, CHAT_GET_API_KEYS, Calendar, CalendarDayButton, type CallAcceptedPayload, type CallBusyPayload, type CallCancelledPayload, type CallEndedPayload, type CallFeatureGate, type CallHistoryEntry, type CallHistoryResponse, type CallIncomingPayload, type CallJoinTokenResponse, type CallMode, CallOverlay, type CallParticipantSummary, type CallRejectedPayload, type CallRoomResponse, type CallState, type CallStatus, type CallSummary, type CallUiStatus, Channel, type ChannelDetailsDrawerSlotProps, ChannelHeaderView as ChannelHeader, type ChannelHeaderSlotProps, ChannelListView as ChannelList, ChannelListItem, type ChannelListItemSlotProps, type ChannelListSlotProps, type ChannelMessageBoxSlotProps, Chat, type ChatActionModalSlotProps, ChatAlertsProvider, type ChatApiKey, type ChatApiVersionConfig, type ChatApiVersionKey, ChatAvatar, type ChatCallContext, type ChatClassNames, type ChatColorMode, type ChatComponents, type ChatCustomizationConfig, ChatCustomizationProvider, ChatDateJumpMenu, type ChatDateTimePreferences, ChatEffectiveSettingsProvider, type ChatFeatures, type ChatGetApiKey, ChatLayout, type ChatLayoutConfig, type ChatLayoutSlotProps, ChatLocaleProvider, ChatMain, type ChatPanelAlertsSlotProps, type ChatQueryParams, type ChatQueryParamsByApi, ChatThemeProvider, ChatViewport, type ChatViewportHeight, DEFAULT_EFFECTIVE_SETTINGS, DefaultChannelListItem, DefaultChatAvatar, DefaultChatLayout, type EffectiveAttachmentsSettings, type EffectiveCallsSettings, type EffectiveGroupPolicy, type EffectiveMessageTimers, type EffectiveSettings, ForegroundPushBridge, type ForegroundPushBridgeProps, type ForegroundPushPayload, ForwardModalView as ForwardModal, type ForwardModalSlotProps, HeaderCallActions, type HeaderCallActionsSlotProps, type HeaderLeftSideSlotProps, type HeaderRightSideSlotProps, type HeaderSearchOverlaySlotProps, type IAttachment, type IChannel, type IDMDelete, type IDMEditMessage, type IDMForward, type IDMMessage, type IDMPin, type IDMReaction, type IDMRead, type IDMStar, type IDMTyping, type IDMUnstar, type IMessage, type ISocketConfig, IncomingCallDialog, type JumpToPreset, LoggedUserDetails, type LoggedUserDetailsSlotProps, LoggedUserSettingsContent, type LoggedUserSettingsContentSlotProps, LoggedUserSettingsDialog, type LoggedUserSettingsDialogSlotProps, LoggedUserSettingsTrigger, type LoggedUserSettingsTriggerSlotProps, type MembersDrawerSlotProps, type MessageAttachmentsSlotProps, ChannelMessageBoxView as MessageInput, MessageItemView as MessageItem, type MessageItemSlotProps, ActiveChannelMessagesView as MessageList, type MessageReactionsSlotProps, type MessageReplySnippetSlotProps, type MessageStatusSlotProps, type MessageToolbarSlotProps, NOTIFICATION_CLICK_SW_TYPE, type NotificationClickBridgeOptions, OPEN_CONVERSATION_EVENT, PUSH_BROADCAST_CHANNEL, PUSH_CHANGED_EVENT, PUSH_DATA_CACHE_NAME, type PendingJump, type PermissionDrawerSlotProps, type PhoneCallButtonSlotProps, type PinnedMessagesDrawerSlotProps, type PushConfig, PushNotificationToggle, type PushNotificationToggleProps, type PushNotificationToggleRenderProps, type PushNotificationsState, type PushOpenRequest, type PushPreference, type StarredMessagesDrawerSlotProps, type UIConfig, type UsePushNotifications, type VideoCallButtonSlotProps, apiCreateCallRoom, apiFetchCallDetail, apiFetchCallHistory, apiFetchJoinToken, apiGetPushConfig, apiGetPushPreference, apiRegisterPushToken, apiRemovePushToken, apiUpdatePushPreference, buildChannelFromPushRequest, buildLoggedUserProfile, buildVersionedApiUrl, capitalizeFirst, clampJumpDate, consumePendingOpenConversation, consumePendingOpenFromPushCache, consumePendingOpenRequest, ChatMain as default, defaultChatClassNames, defaultChatComponents, defaultChatFeatures, defaultChatLayoutConfig, disablePushOnThisDevice, downloadFile, enablePushOnThisDevice, fetchEffectiveSettings, getChatApiVersions, getChatBaseUrl, getChatQueryParamApis, getChatQueryParams, getChatQueryParamsByApi, getChatSocketUrl, getFirstAndLastNameOneCharacter, getResponsiveWidth, getSocketConfig, getStoredPushToken, installNotificationClickBridge, isEmpty, isPushSupported, mergeChatCustomization, mergeChatLayoutConfig, onForegroundPush, packageDefaultComponents, peekPendingOpenConversation, peekPendingOpenRequest, requestOpenConversation, resolveApiRoot, resolveApiUrl, resolveChatApiKey, resolveConversationIdFromPushData, resolveJumpDateBounds, resolveJumpPreset, resolveJumpStep, resolveSocketUrl, setChatAccessToken, setChatApiVersions, setChatBaseURL, setChatClientId, setChatPushApiVersion, setChatQueryParamApis, setChatQueryParams, setChatQueryParamsByApi, setChatSocketUrl, showNotification, smoothScrollToMessage, socketService, startOfLocalDay, toDateInputValue, uniqueList, useAdminFeatureGate, useCallStore, useChatAlerts, useChatContext, useChatController, useChatCustomization, useChatCustomizationOptional, useChatFeatures, useChatFeaturesOptional, useChatLocale, useStore as useChatStore, useChatTheme, useEffectiveSettings, useEffectiveSettingsOptional, usePushNotifications };
|
package/dist/index.d.ts
CHANGED
|
@@ -564,10 +564,17 @@ interface ChatFeatures {
|
|
|
564
564
|
* in DM and group chats. Buttons stay visible; use showPhoneCall/showVideoCall to hide.
|
|
565
565
|
*/
|
|
566
566
|
hideCallActionsInGroupChats?: boolean;
|
|
567
|
-
/**
|
|
567
|
+
/**
|
|
568
|
+
* Called when user taps voice call. Omit to use the package's built-in
|
|
569
|
+
* VideoSDK calling (room creation, ringing, overlay) — see PERMISSIONS.md
|
|
570
|
+
* / docx/videosdk_end.md. Provide this to fully replace it with your own
|
|
571
|
+
* call implementation.
|
|
572
|
+
*/
|
|
568
573
|
onPhoneCall?: (ctx: ChatCallContext) => void;
|
|
569
|
-
/**
|
|
574
|
+
/** Same as `onPhoneCall`, for video calls. */
|
|
570
575
|
onVideoCall?: (ctx: ChatCallContext) => void;
|
|
576
|
+
/** Looped while the built-in incoming-call dialog is open. Omit for silent ringing. */
|
|
577
|
+
callRingtoneUrl?: string;
|
|
571
578
|
}
|
|
572
579
|
declare const defaultChatFeatures: Required<Pick<ChatFeatures, 'showPhoneCall' | 'showVideoCall' | 'hideCallActionsInGroupChats'>>;
|
|
573
580
|
interface AvatarSlotProps {
|
|
@@ -964,6 +971,12 @@ interface ChatComponents {
|
|
|
964
971
|
ChatSocketStatus?: React__default.ComponentType<{
|
|
965
972
|
className?: string;
|
|
966
973
|
}>;
|
|
974
|
+
/** Full-screen in-call UI (built-in VideoSDK flow). Pass `() => null` to suppress it entirely. */
|
|
975
|
+
CallOverlay?: React__default.ComponentType<Record<string, never>>;
|
|
976
|
+
/** Ringing dialog shown to callees (built-in VideoSDK flow). Pass `() => null` to suppress it entirely. */
|
|
977
|
+
IncomingCallDialog?: React__default.ComponentType<{
|
|
978
|
+
ringtoneUrl?: string;
|
|
979
|
+
}>;
|
|
967
980
|
}
|
|
968
981
|
interface ChatCustomizationConfig {
|
|
969
982
|
components?: ChatComponents;
|
|
@@ -1334,6 +1347,22 @@ declare class SocketService {
|
|
|
1334
1347
|
sender: string;
|
|
1335
1348
|
}): void;
|
|
1336
1349
|
emitGetOnlineUsers(): void;
|
|
1350
|
+
emitCallInvite(payload: {
|
|
1351
|
+
callId: string;
|
|
1352
|
+
}): void;
|
|
1353
|
+
emitCallAccept(payload: {
|
|
1354
|
+
callId: string;
|
|
1355
|
+
}): void;
|
|
1356
|
+
emitCallReject(payload: {
|
|
1357
|
+
callId: string;
|
|
1358
|
+
reason?: string;
|
|
1359
|
+
}): void;
|
|
1360
|
+
emitCallCancel(payload: {
|
|
1361
|
+
callId: string;
|
|
1362
|
+
}): void;
|
|
1363
|
+
emitCallEnd(payload: {
|
|
1364
|
+
callId: string;
|
|
1365
|
+
}): void;
|
|
1337
1366
|
}
|
|
1338
1367
|
declare const socketService: SocketService;
|
|
1339
1368
|
|
|
@@ -1892,4 +1921,141 @@ type AdminFeatureKey = "audioCall" | "videoCall" | "pushNotification" | "blockUs
|
|
|
1892
1921
|
*/
|
|
1893
1922
|
declare function useAdminFeatureGate(feature: AdminFeatureKey): CallFeatureGate;
|
|
1894
1923
|
|
|
1895
|
-
|
|
1924
|
+
declare const CallOverlay: () => React__default.JSX.Element | null;
|
|
1925
|
+
|
|
1926
|
+
interface IncomingCallDialogProps {
|
|
1927
|
+
/** Looped while the dialog is open. Omit for silent ringing. */
|
|
1928
|
+
ringtoneUrl?: string;
|
|
1929
|
+
}
|
|
1930
|
+
declare const IncomingCallDialog: ({ ringtoneUrl }: IncomingCallDialogProps) => React__default.JSX.Element | null;
|
|
1931
|
+
|
|
1932
|
+
declare const CALL_MODES: {
|
|
1933
|
+
readonly AUDIO: "audio";
|
|
1934
|
+
readonly VIDEO: "video";
|
|
1935
|
+
};
|
|
1936
|
+
type CallMode = (typeof CALL_MODES)[keyof typeof CALL_MODES];
|
|
1937
|
+
declare const CALL_STATUS: {
|
|
1938
|
+
readonly RINGING: "ringing";
|
|
1939
|
+
readonly ONGOING: "ongoing";
|
|
1940
|
+
readonly ENDED: "ended";
|
|
1941
|
+
readonly MISSED: "missed";
|
|
1942
|
+
readonly REJECTED: "rejected";
|
|
1943
|
+
readonly CANCELLED: "cancelled";
|
|
1944
|
+
};
|
|
1945
|
+
type CallStatus = (typeof CALL_STATUS)[keyof typeof CALL_STATUS];
|
|
1946
|
+
/** Client-only UI phase — one step finer than backend `CallStatus`. */
|
|
1947
|
+
type CallUiStatus = "idle" | "creating" | "ringing-out" | "incoming" | "joining" | "in-call" | "ending";
|
|
1948
|
+
interface CallParticipantSummary {
|
|
1949
|
+
_id: string;
|
|
1950
|
+
name?: string;
|
|
1951
|
+
profileImage?: string;
|
|
1952
|
+
}
|
|
1953
|
+
/** Common fields on every server → client call event payload. */
|
|
1954
|
+
interface CallSummary {
|
|
1955
|
+
callId: string;
|
|
1956
|
+
conversationId: string;
|
|
1957
|
+
meetingId: string;
|
|
1958
|
+
mode: CallMode;
|
|
1959
|
+
status: CallStatus;
|
|
1960
|
+
participants: string[];
|
|
1961
|
+
}
|
|
1962
|
+
interface CallRoomResponse extends CallSummary {
|
|
1963
|
+
token: string;
|
|
1964
|
+
}
|
|
1965
|
+
interface CallJoinTokenResponse {
|
|
1966
|
+
callId: string;
|
|
1967
|
+
meetingId: string;
|
|
1968
|
+
mode: CallMode;
|
|
1969
|
+
status: CallStatus;
|
|
1970
|
+
token: string;
|
|
1971
|
+
}
|
|
1972
|
+
interface CallIncomingPayload extends CallSummary {
|
|
1973
|
+
caller: CallParticipantSummary;
|
|
1974
|
+
}
|
|
1975
|
+
interface CallAcceptedPayload extends CallSummary {
|
|
1976
|
+
userId: string;
|
|
1977
|
+
}
|
|
1978
|
+
interface CallRejectedPayload extends CallSummary {
|
|
1979
|
+
userId: string;
|
|
1980
|
+
reason?: string;
|
|
1981
|
+
}
|
|
1982
|
+
interface CallCancelledPayload extends CallSummary {
|
|
1983
|
+
endedBy: string;
|
|
1984
|
+
}
|
|
1985
|
+
interface CallEndedPayload extends CallSummary {
|
|
1986
|
+
endedBy: string;
|
|
1987
|
+
durationSeconds: number;
|
|
1988
|
+
}
|
|
1989
|
+
interface CallBusyPayload extends CallSummary {
|
|
1990
|
+
userId: string;
|
|
1991
|
+
}
|
|
1992
|
+
interface CallHistoryEntry {
|
|
1993
|
+
_id: string;
|
|
1994
|
+
conversationId: string;
|
|
1995
|
+
meetingId: string;
|
|
1996
|
+
mode: CallMode;
|
|
1997
|
+
status: CallStatus;
|
|
1998
|
+
initiator: CallParticipantSummary;
|
|
1999
|
+
endedBy?: CallParticipantSummary;
|
|
2000
|
+
participants: string[];
|
|
2001
|
+
joinedParticipants?: string[];
|
|
2002
|
+
startedAt?: string;
|
|
2003
|
+
endedAt?: string;
|
|
2004
|
+
durationSeconds: number;
|
|
2005
|
+
}
|
|
2006
|
+
interface CallHistoryResponse {
|
|
2007
|
+
calls: CallHistoryEntry[];
|
|
2008
|
+
pagination: {
|
|
2009
|
+
page: number;
|
|
2010
|
+
limit: number;
|
|
2011
|
+
total: number;
|
|
2012
|
+
hasMore: boolean;
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
interface CallPeer {
|
|
2017
|
+
name?: string;
|
|
2018
|
+
avatar?: string | null;
|
|
2019
|
+
}
|
|
2020
|
+
interface CallState {
|
|
2021
|
+
uiStatus: CallUiStatus;
|
|
2022
|
+
callId: string | null;
|
|
2023
|
+
conversationId: string | null;
|
|
2024
|
+
meetingId: string | null;
|
|
2025
|
+
mode: CallMode | null;
|
|
2026
|
+
token: string | null;
|
|
2027
|
+
caller: CallParticipantSummary | null;
|
|
2028
|
+
participants: string[];
|
|
2029
|
+
error: string | null;
|
|
2030
|
+
/** Caller side only — the channel being called, for the "Calling {name}" screen. */
|
|
2031
|
+
callee: CallPeer | null;
|
|
2032
|
+
/** Set on transition to in-call. Display-only (duration timer), not billing-accurate. */
|
|
2033
|
+
callStartedAt: number | null;
|
|
2034
|
+
/** Caller: create the room and start ringing everyone else. */
|
|
2035
|
+
startCall: (conversationId: string, mode: CallMode, callee?: CallPeer) => Promise<void>;
|
|
2036
|
+
/** Caller: stop ringing before anyone accepted. */
|
|
2037
|
+
cancelCall: () => void;
|
|
2038
|
+
/** Callee: accept the ringing call and fetch a join token. */
|
|
2039
|
+
acceptCall: () => Promise<void>;
|
|
2040
|
+
/** Callee: decline the ringing call. */
|
|
2041
|
+
rejectCall: (reason?: string) => void;
|
|
2042
|
+
/** Either side: leave/end a live call. */
|
|
2043
|
+
endCall: () => void;
|
|
2044
|
+
/** Drop back to idle without notifying anyone (e.g. after a fatal error). */
|
|
2045
|
+
reset: () => void;
|
|
2046
|
+
_receiveIncoming: (payload: CallIncomingPayload) => void;
|
|
2047
|
+
_receiveAccepted: (payload: CallAcceptedPayload) => void;
|
|
2048
|
+
_receiveRejected: (payload: CallRejectedPayload) => void;
|
|
2049
|
+
_receiveCancelled: (payload: CallCancelledPayload) => void;
|
|
2050
|
+
_receiveEnded: (payload: CallEndedPayload) => void;
|
|
2051
|
+
_receiveBusy: (payload: CallBusyPayload) => void;
|
|
2052
|
+
_receiveMissed: (payload: CallSummary) => void;
|
|
2053
|
+
}
|
|
2054
|
+
declare const useCallStore: zustand.UseBoundStore<zustand.StoreApi<CallState>>;
|
|
2055
|
+
|
|
2056
|
+
declare const apiCreateCallRoom: (conversationId: string, mode: CallMode) => Promise<CallRoomResponse>;
|
|
2057
|
+
declare const apiFetchJoinToken: (meetingId: string) => Promise<CallJoinTokenResponse>;
|
|
2058
|
+
declare const apiFetchCallHistory: (conversationId?: string, page?: number, limit?: number) => Promise<CallHistoryResponse>;
|
|
2059
|
+
declare const apiFetchCallDetail: (callId: string) => Promise<CallHistoryEntry>;
|
|
2060
|
+
|
|
2061
|
+
export { ADMIN_PERMISSION_DENIED_MESSAGE, type ActiveChannelMessagesSlotProps, type AdminFeatureKey, AdminPermissionTooltip, type AdminsDrawerSlotProps, type AttachmentsDrawerSlotProps, type AvatarSlotProps, CALLS_NOT_ALLOWED_BY_PLATFORM_MESSAGE, CALLS_NOT_CONFIGURED_MESSAGE, CALL_MODES, CALL_STATUS, CHAT_API_KEYS, CHAT_GET_API_KEYS, Calendar, CalendarDayButton, type CallAcceptedPayload, type CallBusyPayload, type CallCancelledPayload, type CallEndedPayload, type CallFeatureGate, type CallHistoryEntry, type CallHistoryResponse, type CallIncomingPayload, type CallJoinTokenResponse, type CallMode, CallOverlay, type CallParticipantSummary, type CallRejectedPayload, type CallRoomResponse, type CallState, type CallStatus, type CallSummary, type CallUiStatus, Channel, type ChannelDetailsDrawerSlotProps, ChannelHeaderView as ChannelHeader, type ChannelHeaderSlotProps, ChannelListView as ChannelList, ChannelListItem, type ChannelListItemSlotProps, type ChannelListSlotProps, type ChannelMessageBoxSlotProps, Chat, type ChatActionModalSlotProps, ChatAlertsProvider, type ChatApiKey, type ChatApiVersionConfig, type ChatApiVersionKey, ChatAvatar, type ChatCallContext, type ChatClassNames, type ChatColorMode, type ChatComponents, type ChatCustomizationConfig, ChatCustomizationProvider, ChatDateJumpMenu, type ChatDateTimePreferences, ChatEffectiveSettingsProvider, type ChatFeatures, type ChatGetApiKey, ChatLayout, type ChatLayoutConfig, type ChatLayoutSlotProps, ChatLocaleProvider, ChatMain, type ChatPanelAlertsSlotProps, type ChatQueryParams, type ChatQueryParamsByApi, ChatThemeProvider, ChatViewport, type ChatViewportHeight, DEFAULT_EFFECTIVE_SETTINGS, DefaultChannelListItem, DefaultChatAvatar, DefaultChatLayout, type EffectiveAttachmentsSettings, type EffectiveCallsSettings, type EffectiveGroupPolicy, type EffectiveMessageTimers, type EffectiveSettings, ForegroundPushBridge, type ForegroundPushBridgeProps, type ForegroundPushPayload, ForwardModalView as ForwardModal, type ForwardModalSlotProps, HeaderCallActions, type HeaderCallActionsSlotProps, type HeaderLeftSideSlotProps, type HeaderRightSideSlotProps, type HeaderSearchOverlaySlotProps, type IAttachment, type IChannel, type IDMDelete, type IDMEditMessage, type IDMForward, type IDMMessage, type IDMPin, type IDMReaction, type IDMRead, type IDMStar, type IDMTyping, type IDMUnstar, type IMessage, type ISocketConfig, IncomingCallDialog, type JumpToPreset, LoggedUserDetails, type LoggedUserDetailsSlotProps, LoggedUserSettingsContent, type LoggedUserSettingsContentSlotProps, LoggedUserSettingsDialog, type LoggedUserSettingsDialogSlotProps, LoggedUserSettingsTrigger, type LoggedUserSettingsTriggerSlotProps, type MembersDrawerSlotProps, type MessageAttachmentsSlotProps, ChannelMessageBoxView as MessageInput, MessageItemView as MessageItem, type MessageItemSlotProps, ActiveChannelMessagesView as MessageList, type MessageReactionsSlotProps, type MessageReplySnippetSlotProps, type MessageStatusSlotProps, type MessageToolbarSlotProps, NOTIFICATION_CLICK_SW_TYPE, type NotificationClickBridgeOptions, OPEN_CONVERSATION_EVENT, PUSH_BROADCAST_CHANNEL, PUSH_CHANGED_EVENT, PUSH_DATA_CACHE_NAME, type PendingJump, type PermissionDrawerSlotProps, type PhoneCallButtonSlotProps, type PinnedMessagesDrawerSlotProps, type PushConfig, PushNotificationToggle, type PushNotificationToggleProps, type PushNotificationToggleRenderProps, type PushNotificationsState, type PushOpenRequest, type PushPreference, type StarredMessagesDrawerSlotProps, type UIConfig, type UsePushNotifications, type VideoCallButtonSlotProps, apiCreateCallRoom, apiFetchCallDetail, apiFetchCallHistory, apiFetchJoinToken, apiGetPushConfig, apiGetPushPreference, apiRegisterPushToken, apiRemovePushToken, apiUpdatePushPreference, buildChannelFromPushRequest, buildLoggedUserProfile, buildVersionedApiUrl, capitalizeFirst, clampJumpDate, consumePendingOpenConversation, consumePendingOpenFromPushCache, consumePendingOpenRequest, ChatMain as default, defaultChatClassNames, defaultChatComponents, defaultChatFeatures, defaultChatLayoutConfig, disablePushOnThisDevice, downloadFile, enablePushOnThisDevice, fetchEffectiveSettings, getChatApiVersions, getChatBaseUrl, getChatQueryParamApis, getChatQueryParams, getChatQueryParamsByApi, getChatSocketUrl, getFirstAndLastNameOneCharacter, getResponsiveWidth, getSocketConfig, getStoredPushToken, installNotificationClickBridge, isEmpty, isPushSupported, mergeChatCustomization, mergeChatLayoutConfig, onForegroundPush, packageDefaultComponents, peekPendingOpenConversation, peekPendingOpenRequest, requestOpenConversation, resolveApiRoot, resolveApiUrl, resolveChatApiKey, resolveConversationIdFromPushData, resolveJumpDateBounds, resolveJumpPreset, resolveJumpStep, resolveSocketUrl, setChatAccessToken, setChatApiVersions, setChatBaseURL, setChatClientId, setChatPushApiVersion, setChatQueryParamApis, setChatQueryParams, setChatQueryParamsByApi, setChatSocketUrl, showNotification, smoothScrollToMessage, socketService, startOfLocalDay, toDateInputValue, uniqueList, useAdminFeatureGate, useCallStore, useChatAlerts, useChatContext, useChatController, useChatCustomization, useChatCustomizationOptional, useChatFeatures, useChatFeaturesOptional, useChatLocale, useStore as useChatStore, useChatTheme, useEffectiveSettings, useEffectiveSettingsOptional, usePushNotifications };
|