@ethora/chat-component 26.2.27 → 26.3.1

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.
@@ -10,12 +10,13 @@ export declare function registerSocial(idToken: string, accessToken: string, aut
10
10
  export declare function checkEmailExist(email: string): Promise<import('axios').AxiosResponse<any, any, {}>>;
11
11
  export declare function loginViaJwt(clientToken: string): Promise<User>;
12
12
  export declare const signInWithGoogle: () => Promise<{
13
- user: FirebaseUser;
14
- idToken: string;
15
- credential: import('firebase/auth').OAuthCredential;
16
- } | {
17
13
  user?: undefined;
18
14
  idToken?: undefined;
19
15
  credential?: undefined;
16
+ } | {
17
+ user: FirebaseUser;
18
+ idToken: string;
19
+ credential: import('firebase/auth').OAuthCredential;
20
20
  }>;
21
21
  export declare function uploadFile(formData: FormData): Promise<import('axios').AxiosResponse<any, any, {}>>;
22
+ export declare function ensureUserFromMy(user: User | null | undefined): Promise<User | null>;
@@ -45,7 +45,9 @@ export declare class XmppClient implements XmppClientInterface {
45
45
  private softPauseAfterSendMs;
46
46
  private activeRoomBoostTtlMs;
47
47
  private activeSendBoostMs;
48
+ private alwaysPrioritizeActiveRoom;
48
49
  private backgroundWhileCriticalSend;
50
+ private disableLastRead;
49
51
  private presenceFailureBackoffMs;
50
52
  private startupPrivateStoreTimeoutMs;
51
53
  private startupPrivateStoreTtlMs;
@@ -78,7 +80,9 @@ export declare class XmppClient implements XmppClientInterface {
78
80
  private isTerminalAuthFailure;
79
81
  constructor(username: string, password: string, xmppSettings?: xmppSettingsInterface);
80
82
  initializeClient(): Promise<void>;
81
- disconnect(): Promise<void>;
83
+ disconnect(options?: {
84
+ suppressReconnect?: boolean;
85
+ }): Promise<void>;
82
86
  markIntentionalLogout: () => void;
83
87
  attachEventListeners(): void;
84
88
  private scheduleAdaptivePing;
@@ -95,6 +99,9 @@ export declare class XmppClient implements XmppClientInterface {
95
99
  private getSendLane;
96
100
  setActiveRoomJid(roomJID: string | null): void;
97
101
  private getTotalSendQueueLength;
102
+ private hasPendingActiveRoomPresenceRequest;
103
+ private hasPendingActiveRoomHistoryRequest;
104
+ isActiveRoomGateOpen(): boolean;
98
105
  private hasPendingSendsForActiveRoom;
99
106
  private shouldSuppressBackgroundHistory;
100
107
  private updateBackgroundSuppressionMetrics;
@@ -3,23 +3,23 @@ import { IRoom } from '../types/types';
3
3
  declare const rootReducer: Reducer<{
4
4
  chatSettingStore: any;
5
5
  rooms: any;
6
- roomHeapSlice: any;
6
+ roomHeapSlice: import('./roomHeapSlice').roomHeapSliceState;
7
7
  }, import('redux').UnknownAction, Partial<{
8
8
  chatSettingStore: any;
9
9
  rooms: any;
10
- roomHeapSlice: any;
10
+ roomHeapSlice: import('./roomHeapSlice').roomHeapSliceState;
11
11
  }>>;
12
12
  export type RootState = ReturnType<typeof rootReducer>;
13
13
  export declare const getActiveRoom: (state: RootState) => IRoom | null;
14
14
  export declare const store: import('@reduxjs/toolkit').EnhancedStore<{
15
15
  chatSettingStore: any;
16
16
  rooms: any;
17
- roomHeapSlice: any;
17
+ roomHeapSlice: import('./roomHeapSlice').roomHeapSliceState;
18
18
  }, AnyAction, import('@reduxjs/toolkit').Tuple<[import('redux').StoreEnhancer<{
19
19
  dispatch: import('redux-thunk').ThunkDispatch<{
20
20
  chatSettingStore: any;
21
21
  rooms: any;
22
- roomHeapSlice: any;
22
+ roomHeapSlice: import('./roomHeapSlice').roomHeapSliceState;
23
23
  }, undefined, import('redux').UnknownAction>;
24
24
  }>, import('redux').StoreEnhancer]>>;
25
25
  export type AppDispatch = typeof store.dispatch;
@@ -86,6 +86,7 @@ export interface IConfig {
86
86
  myEndpoint?: string;
87
87
  };
88
88
  newArch?: boolean;
89
+ disableLastRead?: boolean;
89
90
  qrUrl?: string;
90
91
  secondarySendButton?: {
91
92
  enabled: boolean;
@@ -169,6 +170,7 @@ export interface IConfig {
169
170
  softPauseAfterSendMs?: number;
170
171
  activeRoomBoostTtlMs?: number;
171
172
  activeSendBoostMs?: number;
173
+ alwaysPrioritizeActiveRoom?: boolean;
172
174
  backgroundWhileCriticalSend?: boolean;
173
175
  preloadTopKRooms?: number;
174
176
  presenceFailureBackoffMs?: number;
@@ -10,12 +10,14 @@ export interface xmppSettingsInterface {
10
10
  devServer?: string;
11
11
  host?: string;
12
12
  conference?: string;
13
+ disableLastRead?: boolean;
13
14
  xmppPingOnSendEnabled?: boolean;
14
15
  historyQoS?: {
15
16
  maxInFlightHistory?: number;
16
17
  softPauseAfterSendMs?: number;
17
18
  activeRoomBoostTtlMs?: number;
18
19
  activeSendBoostMs?: number;
20
+ alwaysPrioritizeActiveRoom?: boolean;
19
21
  backgroundWhileCriticalSend?: boolean;
20
22
  preloadTopKRooms?: number;
21
23
  presenceFailureBackoffMs?: number;
@@ -65,6 +67,7 @@ export interface XmppClientInterface {
65
67
  }): Promise<IMessage[] | undefined>;
66
68
  promoteRoomHistory(roomJID: string): void;
67
69
  setActiveRoomJid(roomJID: string | null): void;
70
+ isActiveRoomGateOpen(): boolean;
68
71
  onCriticalSend(roomJID: string, messageId?: string): void;
69
72
  enqueueHistoryTask(params: {
70
73
  chatJID: string;
@@ -88,5 +91,7 @@ export interface XmppClientInterface {
88
91
  createPrivateRoomStanza(title: string, description: string, to: string): Promise<string>;
89
92
  sendMessageReactionStanza(messageId: string, roomJid: string, reactionsList: string[], reactionSymbol?: string): void;
90
93
  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;
91
- disconnect?(): Promise<void>;
94
+ disconnect?(options?: {
95
+ suppressReconnect?: boolean;
96
+ }): Promise<void>;
92
97
  }
@@ -1,10 +1,21 @@
1
1
  import { default as XmppClient } from '../networking/xmppClient';
2
- export declare function setGlobalXmppClient(client: XmppClient | null): void;
2
+ import { xmppSettingsInterface } from '../types/types';
3
+ export declare function buildXmppClientKey(username: string, xmppSettings?: xmppSettingsInterface): string;
4
+ export declare function isXmppClientReusable(client: XmppClient | null): boolean;
5
+ export declare function setGlobalXmppClient(client: XmppClient | null, key?: string): void;
3
6
  export declare function getGlobalXmppClient(): XmppClient | null;
7
+ export declare function getGlobalXmppClientKey(): string;
8
+ export declare function getReusableXmppClientByKey(key: string): XmppClient | null;
9
+ export declare function withXmppClientInitLock(key: string, init: () => Promise<XmppClient>): Promise<XmppClient>;
4
10
  export declare function requireXmppClient(): XmppClient;
5
11
  declare const _default: {
12
+ buildXmppClientKey: typeof buildXmppClientKey;
13
+ isXmppClientReusable: typeof isXmppClientReusable;
6
14
  setGlobalXmppClient: typeof setGlobalXmppClient;
7
15
  getGlobalXmppClient: typeof getGlobalXmppClient;
16
+ getGlobalXmppClientKey: typeof getGlobalXmppClientKey;
17
+ getReusableXmppClientByKey: typeof getReusableXmppClientByKey;
18
+ withXmppClientInitLock: typeof withXmppClientInitLock;
8
19
  requireXmppClient: typeof requireXmppClient;
9
20
  };
10
21
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethora/chat-component",
3
- "version": "26.2.27",
3
+ "version": "26.3.1",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
@@ -1,4 +1,4 @@
1
- /* eslint-disable no-empty, no-restricted-globals */
1
+ /* eslint-disable no-empty */
2
2
  /* eslint-env worker */
3
3
  /* global clients */
4
4