@bcc-code/vue-bcc-chat-ui 6.4.0 → 6.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.
@@ -1,2 +1,3 @@
1
1
  export declare function getAccessToken(): string | null;
2
2
  export declare function storeAccessToken(token: string | null | undefined): void;
3
+ export declare function getAccessTokenSubject(accessToken?: string | null): any;
@@ -0,0 +1,13 @@
1
+ export declare function getChatCacheScope(): string | null;
2
+ export declare function getChatCacheOwner(): string | null;
3
+ /**
4
+ * Ensures a cache scope exists for the given owner. Reuses the current scope
5
+ * when the owner has not changed; rotates it otherwise.
6
+ */
7
+ export declare function ensureChatCacheScope(ownerId: string): string;
8
+ /**
9
+ * Clears the in-memory mirrors so the next read re-fetches from localStorage.
10
+ * Only needed in tests where localStorage is cleared between runs without
11
+ * reloading the module.
12
+ */
13
+ export declare function resetCacheScopeForTesting(): void;
@@ -1,12 +1,15 @@
1
1
  import { BaseMessage, Group, User } from '@cometchat/chat-sdk-javascript';
2
- import { Ref } from 'vue';
2
+ import { Ref, WatchHandle } from 'vue';
3
3
  import { ParticipantInfo, PersonSettings, SearchedItems, UserChatInfo } from './types';
4
+ export declare const userChats: Ref<UserChatInfo[]>;
4
5
  export declare function getGroup(groupUid: string): Promise<Group | null | undefined>;
5
6
  export declare function clearGroupChatCount(groupUid: string): Promise<void>;
6
7
  export declare function getGroupOnlineCount(groupUid: string): Promise<number>;
7
8
  export declare function getGroupMembersInfo(groupUid: string): Promise<ParticipantInfo[]>;
8
- export declare const userChats: Ref<UserChatInfo[]>;
9
9
  export declare function getUserChats(): Promise<UserChatInfo[]>;
10
+ export declare function clearUserChats(): void;
11
+ export declare function restoreUserChatsFromOfflineStore(): UserChatInfo[];
12
+ export declare function installUserChatsSync(initialized: Ref<boolean>): WatchHandle;
10
13
  export declare function searchChat(searchQuery: string, limit?: number): SearchedItems | undefined;
11
14
  export declare function scrollToMessage(messageId: string): void;
12
15
  export declare function getSenderDisplayName(message: BaseMessage | undefined, group?: Ref<Group | undefined>): any;
@@ -7,8 +7,8 @@ declare const _default: {
7
7
  getGroupMessages: Ref<((guid: string, query: string) => Promise<any>) | undefined, ((guid: string, query: string) => Promise<any>) | undefined>;
8
8
  loadMessageId: Ref<string | undefined, string | undefined>;
9
9
  scrollToMessageId: Ref<string | undefined, string | undefined>;
10
- onlineMode: import('vue').WritableComputedRef<import('../types').OnlineStatus, import('../types').OnlineStatus>;
11
- onlineStatus: import('vue').ComputedRef<import('../types').OnlineStatus>;
10
+ onlineMode: import('vue').WritableComputedRef<import('../offline/types').OnlineStatus, import('../offline/types').OnlineStatus>;
11
+ onlineStatus: import('vue').ComputedRef<import('../offline/types').OnlineStatus>;
12
12
  theme: Ref<{
13
13
  palette: {
14
14
  mode: string;
@@ -430,6 +430,9 @@ declare const _default: {
430
430
  getGroupOnlineCount(groupUid: string): Promise<number>;
431
431
  getGroupMembersInfo(groupUid: string): Promise<import('./types').ParticipantInfo[]>;
432
432
  getUserChats(): Promise<import('./types').UserChatInfo[]>;
433
+ clearUserChats(): void;
434
+ restoreUserChatsFromOfflineStore(): import('./types').UserChatInfo[];
435
+ installUserChatsSync(initialized: Ref<boolean>): import('vue').WatchHandle;
433
436
  searchChat(searchQuery: string, limit?: number): import('./types').SearchedItems | undefined;
434
437
  scrollToMessage(messageId: string): void;
435
438
  getSenderDisplayName(message: import('@cometchat/chat-sdk-javascript').BaseMessage | undefined, group?: Ref<import('@cometchat/chat-sdk-javascript').Group | undefined>): any;
@@ -1,8 +1,9 @@
1
1
  import { BaseMessage, Group, MessageReceipt } from '@cometchat/chat-sdk-javascript';
2
2
  import { FuseResultMatch } from 'fuse.js';
3
3
  import { Ref } from 'vue';
4
- import { Conversation, Message } from '../offline/types';
4
+ import { Conversation as OfflineConversation, Message as OfflineMessage } from '../offline/types';
5
5
  export * from 'fuse.js';
6
+ export { OfflineConversation, OfflineMessage };
6
7
  export interface ChatInstallOptions {
7
8
  environment: Environment;
8
9
  language?: Language;
@@ -94,11 +95,11 @@ export declare enum LogSeverity {
94
95
  }
95
96
  export interface SearchedItems {
96
97
  conversations: {
97
- conversation: Conversation;
98
+ conversation: OfflineConversation;
98
99
  matches: FuseResultMatch[];
99
100
  }[];
100
101
  messages: {
101
- message: Message;
102
+ message: OfflineMessage;
102
103
  matches: FuseResultMatch[];
103
104
  }[];
104
105
  }
@@ -1,6 +1,7 @@
1
1
  import { OfflineStore } from './types.js';
2
2
  export declare let offlineStore: OfflineStore;
3
3
  export declare function installOfflineCaching(): void;
4
+ export declare function setOfflineStoreScope(): void;
4
5
  export declare function purgeLeftChatsFromCache(conversations: CometChat.Conversation[]): void;
5
6
  declare const _default: {
6
7
  installOfflineCaching: typeof installOfflineCaching;
@@ -1,10 +1,11 @@
1
1
  import { default as Fuse } from 'fuse.js';
2
- import { CachedLastMessage, CachedParticipantSettings } from '../chat/types';
2
+ import { CachedLastMessage, CachedParticipantSettings, UserChatInfo } from '../chat/types';
3
3
  import { Conversation, ConversationPaginationMeta, Group, Message, MessagePaginationMeta, OfflineStore, PaginatedResponse } from './types';
4
4
  export declare class OfflineStoreLocalStorage implements OfflineStore {
5
5
  #private;
6
6
  storePrefix: string;
7
7
  constructor(storePrefix?: string);
8
+ setStorePrefix(storePrefix: string, scopedPrefix?: string, clearOtherScopedKeys?: boolean): void;
8
9
  getGroupMessages(groupId: string, pagination: MessagePaginationMeta): PaginatedResponse<Message>;
9
10
  getThreadMessages(parentId: string, pagination: MessagePaginationMeta): PaginatedResponse<Message>;
10
11
  getMessage(messageId: string): {
@@ -26,4 +27,6 @@ export declare class OfflineStoreLocalStorage implements OfflineStore {
26
27
  storeSettings(participantSettings: CachedParticipantSettings): void;
27
28
  getLastMessage(groupId: string): CachedLastMessage | null;
28
29
  storeLastMessage(cachedLastMessage: CachedLastMessage): void;
30
+ getUserChats(): UserChatInfo[];
31
+ saveUserChats(userChats: UserChatInfo[]): void;
29
32
  }
@@ -1,5 +1,5 @@
1
1
  import { default as Fuse } from 'fuse.js';
2
- import { CachedLastMessage, CachedParticipantSettings } from '../chat/types';
2
+ import { CachedLastMessage, CachedParticipantSettings, UserChatInfo } from '../chat/types';
3
3
  export type ReqType = {
4
4
  url: URL;
5
5
  query: Record<string, any>;
@@ -62,6 +62,8 @@ export interface OfflineStore {
62
62
  storeSettings(participantSettings: CachedParticipantSettings): void;
63
63
  getLastMessage(groupId: string): CachedLastMessage | null;
64
64
  storeLastMessage(lastMessage: CachedLastMessage): void;
65
+ getUserChats(): UserChatInfo[];
66
+ saveUserChats(userChats: UserChatInfo[]): void;
65
67
  checkIfCachedMessagesIsExpired(): boolean;
66
68
  updateExpiredCachedMessages(): Promise<void>;
67
69
  }