@antzsoft/chat-core 1.2.3 → 1.2.4
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/README.md +70 -36
- package/dist/chat.store-DLNRJ5ZT.js +7 -0
- package/dist/{chunk-P7VAN6NA.js → chunk-6NMA64BX.js} +71 -11
- package/dist/chunk-6NMA64BX.js.map +1 -0
- package/dist/{chunk-GUO5QQGK.js → chunk-EOL5B7GS.js} +4 -2
- package/dist/chunk-EOL5B7GS.js.map +1 -0
- package/dist/index.cjs +73 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +68 -8
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/{storage-DO8QIqKq.d.cts → storage-Bp6fk9aM.d.cts} +54 -4
- package/dist/{storage-DO8QIqKq.d.ts → storage-Bp6fk9aM.d.ts} +54 -4
- package/docs/integration-guide.html +209 -28
- package/package.json +1 -1
- package/dist/chat.store-JC6QYDDL.js +0 -7
- package/dist/chunk-GUO5QQGK.js.map +0 -1
- package/dist/chunk-P7VAN6NA.js.map +0 -1
- /package/dist/{chat.store-JC6QYDDL.js.map → chat.store-DLNRJ5ZT.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { b as Attachment,
|
|
1
|
+
import { Y as ResolvedCompressionConfig, o as LoginCredentials, c as AuthResponse, W as RegisterData, d as AuthTokens, a7 as User, a as AppConfig, a0 as SendMessagePayload, l as CursorPaginatedResponse, M as Message, P as PaginatedResponse, x as MessageReceiptsResponse, i as ConversationListParams, h as Conversation, H as Participant, k as ConversationUnreadCount, a3 as UnreadSummary, a8 as UserPreferences, Z as ResolvedConfig, I as PersistStorage, R as PresignedUrlRequest, S as PresignedUrlResponse, F as FileResponse, C as CompletedPart, n as FileType, A as AntzChatConfig, a6 as UploadableFile, B as BatchUploadResult } from './storage-Bp6fk9aM.cjs';
|
|
2
|
+
export { b as Attachment, e as CompressedFile, f as CompressionAlgorithm, g as CompressionConfig, j as ConversationType, m as FileSizeLimits, L as LastReaction, p as MessageAckEvent, q as MessageContent, r as MessageDeletedEvent, s as MessageDeletedForMeEvent, t as MessageDeliveredEvent, u as MessageMetadata, v as MessageReaction, w as MessageReceiptEntry, y as MessageReplyReference, z as MessageUpdatedEvent, D as MessagesDeliveredEvent, E as MultipartPartUrl, G as MultipartUploadInfo, N as NewMessageEvent, O as OptimisticAttachment, J as PlatformCompressFn, K as PlatformUploadFn, Q as PlatformUploadPartFn, T as QuietHours, U as ReactionUpdatedEvent, V as ReadReceiptEvent, X as ReplyAttachmentSnapshot, _ as ResolvedFileSizeLimits, $ as SendMessageAttachment, a1 as SystemMessageMetadata, a2 as TypingIndicatorEvent, a4 as UploadConfig, a5 as UploadProgress, a9 as UserStatusEvent, aa as resolveConfig, ab as storageApi, ac as uploadBatch } from './storage-Bp6fk9aM.cjs';
|
|
3
3
|
import { AxiosInstance } from 'axios';
|
|
4
4
|
import { Socket } from 'socket.io-client';
|
|
5
5
|
import * as zustand_middleware from 'zustand/middleware';
|
|
@@ -398,6 +398,8 @@ interface ChatState {
|
|
|
398
398
|
isSidebarOpen: boolean;
|
|
399
399
|
isGroupInfoOpen: boolean;
|
|
400
400
|
isStarredPanelOpen: boolean;
|
|
401
|
+
/** messageId currently shown in the Message Info panel, null = closed */
|
|
402
|
+
messageInfoId: string | null;
|
|
401
403
|
setActiveConversation: (id: string | null) => void;
|
|
402
404
|
setPendingTarget: (target: {
|
|
403
405
|
conversationId: string;
|
|
@@ -418,6 +420,7 @@ interface ChatState {
|
|
|
418
420
|
setGroupInfoOpen: (open: boolean) => void;
|
|
419
421
|
toggleStarredPanel: () => void;
|
|
420
422
|
setStarredPanelOpen: (open: boolean) => void;
|
|
423
|
+
setMessageInfoId: (id: string | null) => void;
|
|
421
424
|
}
|
|
422
425
|
declare const useChatStore: zustand.UseBoundStore<zustand.StoreApi<ChatState>>;
|
|
423
426
|
|
|
@@ -530,6 +533,7 @@ declare class AntzChatClient {
|
|
|
530
533
|
expiresAt: string;
|
|
531
534
|
}>;
|
|
532
535
|
deleteFile(fileId: string): Promise<void>;
|
|
536
|
+
completeMultipartUpload(fileId: string, uploadId: string, parts: CompletedPart[]): Promise<FileResponse>;
|
|
533
537
|
getConversationFiles(conversationId: string, params?: {
|
|
534
538
|
page?: number;
|
|
535
539
|
limit?: number;
|
|
@@ -562,4 +566,4 @@ declare class AntzChatClient {
|
|
|
562
566
|
uploadIcon(conversationId: string, file: UploadableFile): Promise<Conversation>;
|
|
563
567
|
}
|
|
564
568
|
|
|
565
|
-
export { AntzChatClient, AntzChatConfig, AppConfig, AuthResponse, AuthTokens, BatchUploadResult, Conversation, ConversationListParams, ConversationUnreadCount, type CreateDirectData, type CreateGroupData, CursorPaginatedResponse, FileResponse, FileType, type LastReadEntry, type ListMessagesParams, LoginCredentials, Message, MessageReceiptsResponse, type MobileDeviceToken, PaginatedResponse, Participant, PersistStorage, PresignedUrlRequest, PresignedUrlResponse, RegisterData, type RegisterDeviceTokenPayload, ResolvedCompressionConfig, ResolvedConfig, type SearchParams, type SendData, SendMessagePayload, type SocketStatus, type StatusListener, type TokenStore, UnreadSummary, type UpdateConversationData, type UpdateProfilePayload, UploadableFile, User, UserPreferences, type WebPushDeviceToken, appConfigApi, authApi, connectSocket, conversationsApi, createAuthStore, devicesApi, disconnectSocket, getApiClient, getAuthStore, getCompressionStrategy, getSocket, getSocketStatus, initApiClient, initAuthStore, messagesApi, normalizeConversation, onSocketStatus, reconnectSocket, refreshSocketAuth, resetAuthStore, resolveSystemMessageText, setApiClientInstance, setTransitSession, socketEmit, tryGetSocket, useChatStore, usersApi };
|
|
569
|
+
export { AntzChatClient, AntzChatConfig, AppConfig, AuthResponse, AuthTokens, BatchUploadResult, CompletedPart, Conversation, ConversationListParams, ConversationUnreadCount, type CreateDirectData, type CreateGroupData, CursorPaginatedResponse, FileResponse, FileType, type LastReadEntry, type ListMessagesParams, LoginCredentials, Message, MessageReceiptsResponse, type MobileDeviceToken, PaginatedResponse, Participant, PersistStorage, PresignedUrlRequest, PresignedUrlResponse, RegisterData, type RegisterDeviceTokenPayload, ResolvedCompressionConfig, ResolvedConfig, type SearchParams, type SendData, SendMessagePayload, type SocketStatus, type StatusListener, type TokenStore, UnreadSummary, type UpdateConversationData, type UpdateProfilePayload, UploadableFile, User, UserPreferences, type WebPushDeviceToken, appConfigApi, authApi, connectSocket, conversationsApi, createAuthStore, devicesApi, disconnectSocket, getApiClient, getAuthStore, getCompressionStrategy, getSocket, getSocketStatus, initApiClient, initAuthStore, messagesApi, normalizeConversation, onSocketStatus, reconnectSocket, refreshSocketAuth, resetAuthStore, resolveSystemMessageText, setApiClientInstance, setTransitSession, socketEmit, tryGetSocket, useChatStore, usersApi };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { b as Attachment,
|
|
1
|
+
import { Y as ResolvedCompressionConfig, o as LoginCredentials, c as AuthResponse, W as RegisterData, d as AuthTokens, a7 as User, a as AppConfig, a0 as SendMessagePayload, l as CursorPaginatedResponse, M as Message, P as PaginatedResponse, x as MessageReceiptsResponse, i as ConversationListParams, h as Conversation, H as Participant, k as ConversationUnreadCount, a3 as UnreadSummary, a8 as UserPreferences, Z as ResolvedConfig, I as PersistStorage, R as PresignedUrlRequest, S as PresignedUrlResponse, F as FileResponse, C as CompletedPart, n as FileType, A as AntzChatConfig, a6 as UploadableFile, B as BatchUploadResult } from './storage-Bp6fk9aM.js';
|
|
2
|
+
export { b as Attachment, e as CompressedFile, f as CompressionAlgorithm, g as CompressionConfig, j as ConversationType, m as FileSizeLimits, L as LastReaction, p as MessageAckEvent, q as MessageContent, r as MessageDeletedEvent, s as MessageDeletedForMeEvent, t as MessageDeliveredEvent, u as MessageMetadata, v as MessageReaction, w as MessageReceiptEntry, y as MessageReplyReference, z as MessageUpdatedEvent, D as MessagesDeliveredEvent, E as MultipartPartUrl, G as MultipartUploadInfo, N as NewMessageEvent, O as OptimisticAttachment, J as PlatformCompressFn, K as PlatformUploadFn, Q as PlatformUploadPartFn, T as QuietHours, U as ReactionUpdatedEvent, V as ReadReceiptEvent, X as ReplyAttachmentSnapshot, _ as ResolvedFileSizeLimits, $ as SendMessageAttachment, a1 as SystemMessageMetadata, a2 as TypingIndicatorEvent, a4 as UploadConfig, a5 as UploadProgress, a9 as UserStatusEvent, aa as resolveConfig, ab as storageApi, ac as uploadBatch } from './storage-Bp6fk9aM.js';
|
|
3
3
|
import { AxiosInstance } from 'axios';
|
|
4
4
|
import { Socket } from 'socket.io-client';
|
|
5
5
|
import * as zustand_middleware from 'zustand/middleware';
|
|
@@ -398,6 +398,8 @@ interface ChatState {
|
|
|
398
398
|
isSidebarOpen: boolean;
|
|
399
399
|
isGroupInfoOpen: boolean;
|
|
400
400
|
isStarredPanelOpen: boolean;
|
|
401
|
+
/** messageId currently shown in the Message Info panel, null = closed */
|
|
402
|
+
messageInfoId: string | null;
|
|
401
403
|
setActiveConversation: (id: string | null) => void;
|
|
402
404
|
setPendingTarget: (target: {
|
|
403
405
|
conversationId: string;
|
|
@@ -418,6 +420,7 @@ interface ChatState {
|
|
|
418
420
|
setGroupInfoOpen: (open: boolean) => void;
|
|
419
421
|
toggleStarredPanel: () => void;
|
|
420
422
|
setStarredPanelOpen: (open: boolean) => void;
|
|
423
|
+
setMessageInfoId: (id: string | null) => void;
|
|
421
424
|
}
|
|
422
425
|
declare const useChatStore: zustand.UseBoundStore<zustand.StoreApi<ChatState>>;
|
|
423
426
|
|
|
@@ -530,6 +533,7 @@ declare class AntzChatClient {
|
|
|
530
533
|
expiresAt: string;
|
|
531
534
|
}>;
|
|
532
535
|
deleteFile(fileId: string): Promise<void>;
|
|
536
|
+
completeMultipartUpload(fileId: string, uploadId: string, parts: CompletedPart[]): Promise<FileResponse>;
|
|
533
537
|
getConversationFiles(conversationId: string, params?: {
|
|
534
538
|
page?: number;
|
|
535
539
|
limit?: number;
|
|
@@ -562,4 +566,4 @@ declare class AntzChatClient {
|
|
|
562
566
|
uploadIcon(conversationId: string, file: UploadableFile): Promise<Conversation>;
|
|
563
567
|
}
|
|
564
568
|
|
|
565
|
-
export { AntzChatClient, AntzChatConfig, AppConfig, AuthResponse, AuthTokens, BatchUploadResult, Conversation, ConversationListParams, ConversationUnreadCount, type CreateDirectData, type CreateGroupData, CursorPaginatedResponse, FileResponse, FileType, type LastReadEntry, type ListMessagesParams, LoginCredentials, Message, MessageReceiptsResponse, type MobileDeviceToken, PaginatedResponse, Participant, PersistStorage, PresignedUrlRequest, PresignedUrlResponse, RegisterData, type RegisterDeviceTokenPayload, ResolvedCompressionConfig, ResolvedConfig, type SearchParams, type SendData, SendMessagePayload, type SocketStatus, type StatusListener, type TokenStore, UnreadSummary, type UpdateConversationData, type UpdateProfilePayload, UploadableFile, User, UserPreferences, type WebPushDeviceToken, appConfigApi, authApi, connectSocket, conversationsApi, createAuthStore, devicesApi, disconnectSocket, getApiClient, getAuthStore, getCompressionStrategy, getSocket, getSocketStatus, initApiClient, initAuthStore, messagesApi, normalizeConversation, onSocketStatus, reconnectSocket, refreshSocketAuth, resetAuthStore, resolveSystemMessageText, setApiClientInstance, setTransitSession, socketEmit, tryGetSocket, useChatStore, usersApi };
|
|
569
|
+
export { AntzChatClient, AntzChatConfig, AppConfig, AuthResponse, AuthTokens, BatchUploadResult, CompletedPart, Conversation, ConversationListParams, ConversationUnreadCount, type CreateDirectData, type CreateGroupData, CursorPaginatedResponse, FileResponse, FileType, type LastReadEntry, type ListMessagesParams, LoginCredentials, Message, MessageReceiptsResponse, type MobileDeviceToken, PaginatedResponse, Participant, PersistStorage, PresignedUrlRequest, PresignedUrlResponse, RegisterData, type RegisterDeviceTokenPayload, ResolvedCompressionConfig, ResolvedConfig, type SearchParams, type SendData, SendMessagePayload, type SocketStatus, type StatusListener, type TokenStore, UnreadSummary, type UpdateConversationData, type UpdateProfilePayload, UploadableFile, User, UserPreferences, type WebPushDeviceToken, appConfigApi, authApi, connectSocket, conversationsApi, createAuthStore, devicesApi, disconnectSocket, getApiClient, getAuthStore, getCompressionStrategy, getSocket, getSocketStatus, initApiClient, initAuthStore, messagesApi, normalizeConversation, onSocketStatus, reconnectSocket, refreshSocketAuth, resetAuthStore, resolveSystemMessageText, setApiClientInstance, setTransitSession, socketEmit, tryGetSocket, useChatStore, usersApi };
|
package/dist/index.js
CHANGED
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
setTransitSession,
|
|
14
14
|
storageApi,
|
|
15
15
|
uploadBatch
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6NMA64BX.js";
|
|
17
17
|
import {
|
|
18
18
|
useChatStore
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-EOL5B7GS.js";
|
|
20
20
|
|
|
21
21
|
// src/config/types.ts
|
|
22
22
|
function resolveConfig(config) {
|
|
@@ -63,6 +63,7 @@ function resolveConfig(config) {
|
|
|
63
63
|
onProgress: config.upload?.onProgress
|
|
64
64
|
},
|
|
65
65
|
platformUploadFn: config.platformUploadFn,
|
|
66
|
+
platformUploadPartFn: config.platformUploadPartFn,
|
|
66
67
|
platformCompressFn: config.platformCompressFn,
|
|
67
68
|
compression: {
|
|
68
69
|
enabled: config.compression?.enabled ?? config.platformCompressFn != null,
|
|
@@ -366,7 +367,7 @@ function normalizeLastMessage(lastMsg) {
|
|
|
366
367
|
id: lastMsg.messageId ?? "",
|
|
367
368
|
tenantId: "",
|
|
368
369
|
conversationId: "",
|
|
369
|
-
senderId: "",
|
|
370
|
+
senderId: lastMsg.senderId ?? "",
|
|
370
371
|
content: {
|
|
371
372
|
type: lastMsg.hasAttachments ? "attachment" : "text",
|
|
372
373
|
text: lastMsg.contentPreview
|
|
@@ -852,13 +853,13 @@ async function _doConnect(config, getToken) {
|
|
|
852
853
|
});
|
|
853
854
|
}
|
|
854
855
|
secureOn(_socket, "read_receipt", (event) => {
|
|
855
|
-
import("./chat.store-
|
|
856
|
+
import("./chat.store-DLNRJ5ZT.js").then(({ useChatStore: useChatStore2 }) => {
|
|
856
857
|
const e = event;
|
|
857
858
|
useChatStore2.getState().setLastRead(e.conversationId, e.messageId, e.readAt);
|
|
858
859
|
});
|
|
859
860
|
});
|
|
860
861
|
secureOn(_socket, "user_online", (event) => {
|
|
861
|
-
import("./chat.store-
|
|
862
|
+
import("./chat.store-DLNRJ5ZT.js").then(({ useChatStore: useChatStore2 }) => {
|
|
862
863
|
const store = useChatStore2.getState();
|
|
863
864
|
const e = event;
|
|
864
865
|
store.setUserOnline(e.userId);
|
|
@@ -866,7 +867,7 @@ async function _doConnect(config, getToken) {
|
|
|
866
867
|
});
|
|
867
868
|
});
|
|
868
869
|
secureOn(_socket, "user_offline", (event) => {
|
|
869
|
-
import("./chat.store-
|
|
870
|
+
import("./chat.store-DLNRJ5ZT.js").then(({ useChatStore: useChatStore2 }) => {
|
|
870
871
|
const e = event;
|
|
871
872
|
const store = useChatStore2.getState();
|
|
872
873
|
store.setUserOffline(e.userId);
|