@ethora/chat-component 25.5.31 → 25.6.2

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.
@@ -15,4 +15,5 @@ declare const onGetLastMessageArchive: (stanza: Element) => void;
15
15
  declare const onNewRoomCreated: (stanza: Element, xmpp: any) => void;
16
16
  declare const onGetChatRooms: (stanza: Element, xmpp: any) => void;
17
17
  declare const onRoomKicked: (stanza: Element) => Promise<void>;
18
- export { onRealtimeMessage, onMessageHistory, onPresenceInRoom, onReactionHistory, onGetLastMessageArchive, handleComposing, onGetChatRooms, onNewRoomCreated, onGetMembers, onGetRoomInfo, onDeleteMessage, onEditMessage, onReactionMessage, onChatInvite, onRoomKicked, };
18
+ declare const onMessageError: (stanza: Element, client: XmppClient) => Promise<void>;
19
+ export { onRealtimeMessage, onMessageHistory, onPresenceInRoom, onReactionHistory, onGetLastMessageArchive, handleComposing, onGetChatRooms, onNewRoomCreated, onGetMembers, onGetRoomInfo, onDeleteMessage, onEditMessage, onReactionMessage, onChatInvite, onRoomKicked, onMessageError, };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Checks if the stanza is a pong (IQ result) for the given pingId.
3
+ * @param stanza - The stanza to check
4
+ * @param pingId - The ping ID to match
5
+ * @returns true if the stanza is a pong for the pingId, false otherwise
6
+ */
7
+ export declare function isPong(stanza: any, pingId: string): boolean;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Sends an XMPP ping stanza (XEP-0199) to the specified JID (usually the server or peer).
3
+ * @param client - The XMPP client instance
4
+ * @param to - The JID to ping (usually the server domain)
5
+ * @param id - Optional unique ID for the ping stanza
6
+ */
7
+ export declare function sendPing(client: any, to: string, id?: string): string;
@@ -13,6 +13,13 @@ export declare class XmppClient implements XmppClientInterface {
13
13
  maxReconnectAttempts: number;
14
14
  reconnectDelay: number;
15
15
  checkOnline(): boolean;
16
+ pingInterval: any;
17
+ pingTimeout: any;
18
+ lastPingId: string | null;
19
+ pingIntervalMs: number;
20
+ pongTimeoutMs: number;
21
+ pingOnTimeoutEnabled: boolean;
22
+ pingOnSendEnabled: boolean;
16
23
  constructor(username: string, password: string, xmppSettings?: xmppSettingsInterface);
17
24
  initializeClient(): Promise<void>;
18
25
  disconnect(): Promise<void>;
@@ -34,7 +41,8 @@ export declare class XmppClient implements XmppClientInterface {
34
41
  getRoomInfoStanza: (roomJID: string) => void;
35
42
  getRoomMembersStanza: (roomJID: string) => void;
36
43
  setVCardStanza(xmppUsername: string): void;
37
- sendMessage: (roomJID: string, firstName: string, lastName: string, photo: string, walletAddress: string, userMessage: string, notDisplayedValue?: string, isReply?: boolean, showInChannel?: boolean, mainMessage?: string, customId?: string) => void;
44
+ sendMessageWithPingCheck(sendFn: () => Promise<void>, retry?: boolean): Promise<boolean>;
45
+ sendMessage: (roomJID: string, firstName: string, lastName: string, photo: string, walletAddress: string, userMessage: string, notDisplayedValue?: string, isReply?: boolean, showInChannel?: boolean, mainMessage?: string, customId?: string) => Promise<boolean>;
38
46
  sendTextMessageWithTranslateTagStanza: (roomJID: string, firstName: string, lastName: string, photo: string, walletAddress: string, userMessage: string, notDisplayedValue?: string, isReply?: boolean, showInChannel?: boolean, mainMessage?: string, langSource?: Iso639_1Codes) => void;
39
47
  deleteMessageStanza(room: string, msgId: string): void;
40
48
  editMessageStanza(room: string, msgId: string, text: string): void;
@@ -44,5 +52,10 @@ export declare class XmppClient implements XmppClientInterface {
44
52
  actionSetTimestampToPrivateStoreStanza(chatId: string, timestamp: number, chats?: string[]): Promise<void>;
45
53
  createPrivateRoomStanza(title: string, description: string, to: string): Promise<string>;
46
54
  sendMediaMessageStanza(roomJID: string, data: any): void;
55
+ startPingLoop(): void;
56
+ stopPingLoop(): void;
57
+ sendPing(): void;
58
+ handlePong(): void;
59
+ handlePingTimeout(): void;
47
60
  }
48
61
  export default XmppClient;
@@ -1,6 +1,5 @@
1
- import { IMessage } from '../types/types';
2
1
  interface roomHeapSliceState {
3
- messageHeap: IMessage[];
2
+ messageHeap: string[];
4
3
  }
5
4
  export declare const roomHeapSlice: import('@reduxjs/toolkit').Slice<roomHeapSliceState, {
6
5
  addMessageToHeap: (state: import('immer').WritableDraft<roomHeapSliceState>, action: {
@@ -9,7 +8,7 @@ export declare const roomHeapSlice: import('@reduxjs/toolkit').Slice<roomHeapSli
9
8
  }) => void;
10
9
  popMessageFromHeap: (state: import('immer').WritableDraft<roomHeapSliceState>) => void;
11
10
  clearHeap: (state: import('immer').WritableDraft<roomHeapSliceState>) => void;
12
- }, "roomHeapSlice", "roomHeapSlice", import('@reduxjs/toolkit').SliceSelectors<roomHeapSliceState>>;
13
- export declare const addMessageToHeap: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "roomHeapSlice/addMessageToHeap">, popMessageFromHeap: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"roomHeapSlice/popMessageFromHeap">, clearHeap: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"roomHeapSlice/clearHeap">;
11
+ }, "roomHeapStore", "roomHeapStore", import('@reduxjs/toolkit').SliceSelectors<roomHeapSliceState>>;
12
+ export declare const addMessageToHeap: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "roomHeapStore/addMessageToHeap">, popMessageFromHeap: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"roomHeapStore/popMessageFromHeap">, clearHeap: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"roomHeapStore/clearHeap">;
14
13
  declare const _default: import('redux').Reducer<roomHeapSliceState>;
15
14
  export default _default;
@@ -100,6 +100,10 @@ export declare const roomsStore: import('@reduxjs/toolkit').Slice<RoomMessagesSt
100
100
  setOpenReportModal: (state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
101
101
  isOpen: boolean;
102
102
  }>) => void;
103
+ updateMessageStatus(state: import('immer').WritableDraft<RoomMessagesState>, action: {
104
+ payload: any;
105
+ type: string;
106
+ }): void;
103
107
  }, "roomMessages", "roomMessages", import('@reduxjs/toolkit').SliceSelectors<RoomMessagesState>>;
104
108
  export declare const getLastMessageTimestamp: (state: RoomMessagesState, jid: string) => string | null;
105
109
  export declare const addRoom: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
@@ -149,6 +153,6 @@ export declare const addRoom: import('@reduxjs/toolkit').ActionCreatorWithOption
149
153
  isOpen: boolean;
150
154
  }, "roomMessages/setOpenReportModal">, insertUsers: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
151
155
  newUsers: RoomMember[];
152
- }, "roomMessages/insertUsers">;
156
+ }, "roomMessages/insertUsers">, updateMessageStatus: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "roomMessages/updateMessageStatus">;
153
157
  declare const _default: import('redux').Reducer<RoomMessagesState>;
154
158
  export default _default;
@@ -103,8 +103,5 @@ export interface IConfig {
103
103
  enabled: boolean;
104
104
  filterFunction: (text: string) => string;
105
105
  };
106
- refreshRoomsTillFoundNeeded?: {
107
- enabled: boolean;
108
- timeout: number;
109
- };
106
+ disableTypingIndicator?: boolean;
110
107
  }
@@ -15,6 +15,7 @@ export interface IMessage {
15
15
  mimetype?: string;
16
16
  location?: string;
17
17
  pending?: boolean;
18
+ failed?: boolean;
18
19
  timestamp?: number;
19
20
  showInChannel?: string;
20
21
  activeMessage?: boolean;
@@ -10,6 +10,9 @@ export interface xmppSettingsInterface {
10
10
  devServer: string;
11
11
  host: string;
12
12
  conference?: string;
13
+ xmppPingPongEnabled?: boolean;
14
+ xmppPingOnTimeoutEnabled?: boolean;
15
+ xmppPingOnSendEnabled?: boolean;
13
16
  }
14
17
  export interface MediaUploadData {
15
18
  file: File;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethora/chat-component",
3
- "version": "25.5.31",
3
+ "version": "25.6.2",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
@@ -1,4 +0,0 @@
1
- export declare const useStoreConsole: () => {
2
- chatSettingStore: any;
3
- rooms: any;
4
- };
@@ -1,24 +0,0 @@
1
- import { Reducer } from '@reduxjs/toolkit';
2
- import { IRoom } from '../types/types';
3
- import { AnyAction } from 'redux-saga';
4
- declare const rootReducer: Reducer<{
5
- chatSettingStore: any;
6
- rooms: any;
7
- }, import('redux').UnknownAction, Partial<{
8
- chatSettingStore: any;
9
- rooms: any;
10
- }>>;
11
- export type RootState = ReturnType<typeof rootReducer>;
12
- export declare const getActiveRoom: (state: RootState) => IRoom | null;
13
- export declare const store: import('@reduxjs/toolkit').EnhancedStore<{
14
- chatSettingStore: any;
15
- rooms: any;
16
- }, AnyAction, import('@reduxjs/toolkit').Tuple<[import('redux').StoreEnhancer<{
17
- dispatch: import('redux-thunk').ThunkDispatch<{
18
- chatSettingStore: any;
19
- rooms: any;
20
- }, undefined, import('redux').UnknownAction>;
21
- }>, import('redux').StoreEnhancer]>>;
22
- export type AppDispatch = typeof store.dispatch;
23
- export declare const persistor: import('redux-persist').Persistor;
24
- export {};