@ethora/chat-component 26.10.8 → 26.10.9

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/dist/main.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * Main entry point for the Ethora Chat Component.
3
3
  */
4
- export { XmppProvider } from './context/xmppProvider';
4
+ export { XmppProvider, useXmppClient } from './context/xmppProvider';
5
+ export { getRoomAccess } from './networking/xmpp/getRoomAccess.xmpp';
6
+ export type { RoomAccess } from './networking/xmpp/getRoomAccess.xmpp';
5
7
  export { ReduxWrapper as Chat } from './components/MainComponents/ReduxWrapper';
6
8
  export { useUnread } from './hooks/useUnreadMessagesCounter';
7
9
  export { useRoomPresence, useIsUserOnline } from './hooks/useRoomPresence';
package/dist/main.js CHANGED
@@ -1,32 +1,34 @@
1
- import { bS as a, bT as r, bU as o, bV as t, bW as c, bX as u, bY as p, bZ as h, b_ as i, b$ as l, c0 as n, v as d, c1 as b, af as T, c2 as f, c3 as m, c4 as y, c5 as I, c6 as R, c7 as g, c8 as C, c9 as Q, ca as k, cb as A, cc as E, aP as P, aQ as S, cd as v, ce as F } from "./main-B25iFKAC.js";
1
+ import { bS as a, bT as r, bU as o, bV as c, bW as t, bX as p, bY as u, bZ as i, b_ as h, b$ as l, c0 as n, c1 as d, v as b, c2 as f, af as m, c3 as T, c4 as R, c5 as g, c6 as y, c7 as C, c8 as I, c9 as A, ca as Q, cb as k, cc as E, cd as P, aP as S, aQ as v, ce as F, cf as M, aa as U } from "./main-BNjPaiYs.js";
2
2
  export {
3
3
  a as AuthTestIds,
4
4
  r as Chat,
5
5
  o as ChatInputTestIds,
6
- t as MessageBubbleTestIds,
7
- c as RefreshFatalError,
8
- u as RoomListTestIds,
9
- p as XmppProvider,
10
- h as applyTypography,
11
- i as clearTypography,
6
+ c as MessageBubbleTestIds,
7
+ t as RefreshFatalError,
8
+ p as RoomListTestIds,
9
+ u as XmppProvider,
10
+ i as applyTypography,
11
+ h as clearTypography,
12
12
  l as formatFingerprint,
13
- n as handleQRChatId,
14
- d as isE2eeEnabled,
15
- b as isRefreshFatalError,
16
- T as logoutService,
17
- f as omemo,
18
- m as openScheduledCall,
19
- y as parseQuickReplies,
20
- I as parseScheduledCallLink,
21
- R as refreshAuthTokens,
22
- g as refreshAuthTokensQuietly,
23
- C as resendMessage,
13
+ n as getRoomAccess,
14
+ d as handleQRChatId,
15
+ b as isE2eeEnabled,
16
+ f as isRefreshFatalError,
17
+ m as logoutService,
18
+ T as omemo,
19
+ R as openScheduledCall,
20
+ g as parseQuickReplies,
21
+ y as parseScheduledCallLink,
22
+ C as refreshAuthTokens,
23
+ I as refreshAuthTokensQuietly,
24
+ A as resendMessage,
24
25
  Q as useInAppNotifications,
25
26
  k as useIsUserOnline,
26
- A as usePushNotifications,
27
- E as useQRCodeChat,
28
- P as useRoomMute,
29
- S as useRoomPresence,
30
- v as useTypography,
31
- F as useUnread
27
+ E as usePushNotifications,
28
+ P as useQRCodeChat,
29
+ S as useRoomMute,
30
+ v as useRoomPresence,
31
+ F as useTypography,
32
+ M as useUnread,
33
+ U as useXmppClient
32
34
  };
@@ -1,8 +1,6 @@
1
- /**
2
- * push.api.ts
3
- * API methods for registering / unregistering a push notification subscription
4
- * with the Ethora backend so the server can target this browser for push events.
5
- */
1
+ import { store } from '../../roomStore';
2
+ type PushState = ReturnType<typeof store.getState>;
3
+ export declare const resolvePushLanguage: (state: PushState) => string;
6
4
  /**
7
5
  * Register a push notification/FCM registration token with the backend.
8
6
  * Sends a POST to /push/subscription/{userId} with the registration token.
@@ -16,3 +14,4 @@ export declare function registerPushToken(registrationToken: string): Promise<an
16
14
  * @param registrationToken – The token to unregister.
17
15
  */
18
16
  export declare function unregisterPushToken(registrationToken: string, authToken?: string): Promise<any>;
17
+ export {};
@@ -0,0 +1,7 @@
1
+ import { Client } from '@xmpp/client';
2
+ export type RoomAccess = 'open' | 'membersOnly' | 'notFound' | 'unknown';
3
+ type IqRequester = {
4
+ iqCaller: Pick<Client['iqCaller'], 'request'>;
5
+ };
6
+ export declare const getRoomAccess: (roomJID: string, client: IqRequester, timeoutMs?: number) => Promise<RoomAccess>;
7
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { Client } from '@xmpp/client';
2
+ import { RoomAccess } from './xmpp/getRoomAccess.xmpp';
2
3
  import { Iso639_1Codes, XmppClientInterface, xmppSettingsInterface, IMessage, IMentionSpan } from '../types/types';
3
4
  import { ReactionStanzaData } from './xmpp/sendMessageReaction.xmpp';
4
5
  import { AllRoomPresenceSummary } from './xmpp/allRoomPresences.xmpp';
@@ -307,6 +308,7 @@ export declare class XmppClient implements XmppClientInterface {
307
308
  getLastMessageArchiveStanza(roomJID: string): void;
308
309
  setRoomImageStanza: (roomJid: string, roomThumbnail: string, type: string, roomBackground?: string) => void;
309
310
  getRoomInfoStanza: (roomJID: string) => void;
311
+ getRoomAccessStanza: (roomJID: string, timeoutMs?: number) => Promise<RoomAccess>;
310
312
  getRoomMembersStanza: (roomJID: string) => void;
311
313
  setVCardStanza(xmppUsername: string): void;
312
314
  sendMessageWithPingCheck(sendFn: () => Promise<boolean>): Promise<boolean>;
@@ -1,5 +1,6 @@
1
1
  import { Client } from '@xmpp/client';
2
2
  import { ReactionStanzaData } from '../../networking/xmpp/sendMessageReaction.xmpp';
3
+ import { RoomAccess } from '../../networking/xmpp/getRoomAccess.xmpp';
3
4
  import { Iso639_1Codes } from './language.model';
4
5
  import { default as XmppClient, HistoryWindowPage } from '../../networking/xmppClient';
5
6
  import { IMessage } from './message.model';
@@ -100,6 +101,7 @@ export interface XmppClientInterface {
100
101
  getLastMessageArchiveStanza(roomJID: string): void;
101
102
  setRoomImageStanza(roomJid: string, roomThumbnail: string, type: string, roomBackground?: string): void;
102
103
  getRoomInfoStanza(roomJID: string): void;
104
+ getRoomAccessStanza(roomJID: string, timeoutMs?: number): Promise<RoomAccess>;
103
105
  getRoomMembersStanza(roomJID: string): void;
104
106
  setVCardStanza(xmppUsername: string): void;
105
107
  sendMessage(roomJID: string, firstName: string, lastName: string, photo: string, walletAddress: string, userMessage: string, notDisplayedValue?: string, isReply?: boolean, showInChannel?: boolean, mainMessage?: string, customId?: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethora/chat-component",
3
- "version": "26.10.8",
3
+ "version": "26.10.9",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",