@antzsoft/chat-core 1.4.1 → 1.4.3

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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ResolvedCompressionConfig, L as LoginCredentials, A as AuthResponse, a as RegisterData, b as AuthTokens, U as User, C as CrossConversationSyncResponse, c as ConversationSyncResponse, d as AppConfig, S as SendMessagePayload, e as CursorPaginatedResponse, M as Message, f as MessageReactionsResponse, P as PaginatedResponse, g as MessageReceiptsResponse, h as ConversationListParams, i as Conversation, j as Participant, k as ConversationUnreadCount, l as UnreadSummary, m as UserPreferences, n as ResolvedConfig, o as PersistStorage, p as PresignedUrlRequest, q as PresignedUrlResponse, F as FileResponse, r as CompletedPart, s as FileType, t as AntzChatConfig, u as UploadableFile, B as BatchUploadResult } from './storage-Pz2Taipp.cjs';
2
- export { v as Attachment, w as CompressedFile, x as CompressionAlgorithm, y as CompressionConfig, z as ConversationType, D as ConversationUpdatedEvent, E as FileSizeLimits, G as LastReaction, H as MENTION_ALL_ID, I as MessageAckEvent, J as MessageContent, K as MessageDeletedEvent, N as MessageDeletedForMeEvent, O as MessageDeliveredEvent, Q as MessageMetadata, T as MessageReaction, V as MessageReceiptEntry, W as MessageReplyReference, X as MessageStarUpdatedEvent, Y as MessageUpdatedEvent, Z as MessagesDeliveredEvent, _ as MultipartPartUrl, $ as MultipartUploadInfo, a0 as NewMessageEvent, a1 as OptimisticAttachment, a2 as PlatformCompressFn, a3 as PlatformUploadFn, a4 as PlatformUploadPartFn, a5 as QuietHours, a6 as ReactionGroup, a7 as ReactionUpdatedEvent, a8 as ReactionUser, a9 as ReadReceiptEvent, aa as ReplyAttachmentSnapshot, ab as ResolvedFileSizeLimits, ac as SendMessageAttachment, ad as SyncDeletedForMe, ae as SyncDeliveredReceipt, af as SyncParticipantChange, ag as SyncReactionEntry, ah as SyncReactions, ai as SyncReadReceipt, aj as SyncStarEntry, ak as SystemMessageMetadata, al as TypingIndicatorEvent, am as UploadConfig, an as UploadProgress, ao as UserStatusEvent, ap as resolveConfig, aq as storageApi, ar as uploadBatch } from './storage-Pz2Taipp.cjs';
1
+ import { R as ResolvedCompressionConfig, L as LoginCredentials, A as AuthResponse, a as RegisterData, b as AuthTokens, U as User, C as CrossConversationSyncResponse, c as ConversationSyncResponse, d as AppConfig, S as SendMessagePayload, M as Message, e as CursorPaginatedResponse, f as MessageReactionsResponse, P as PaginatedResponse, g as MessageReceiptsResponse, h as ConversationListParams, i as Conversation, j as Participant, k as ConversationUnreadCount, l as UnreadSummary, m as UserPreferences, n as ResolvedConfig, o as PersistStorage, p as PresignedUrlRequest, q as PresignedUrlResponse, F as FileResponse, r as CompletedPart, s as FileType, t as AntzChatConfig, u as UploadableFile, B as BatchUploadResult } from './storage-D7GPq-Mm.cjs';
2
+ export { v as Attachment, w as CompressedFile, x as CompressionAlgorithm, y as CompressionConfig, z as ConversationType, D as ConversationUpdatedEvent, E as FileSizeLimits, G as LastReaction, H as MENTION_ALL_ID, I as MessageAckEvent, J as MessageContent, K as MessageDeletedEvent, N as MessageDeletedForMeEvent, O as MessageDeliveredEvent, Q as MessageForwardReference, T as MessageMetadata, V as MessageReaction, W as MessageReceiptEntry, X as MessageReplyReference, Y as MessageStarUpdatedEvent, Z as MessageUpdatedEvent, _ as MessagesDeliveredEvent, $ as MultipartPartUrl, a0 as MultipartUploadInfo, a1 as NewMessageEvent, a2 as OptimisticAttachment, a3 as PlatformCompressFn, a4 as PlatformUploadFn, a5 as PlatformUploadPartFn, a6 as QuietHours, a7 as ReactionGroup, a8 as ReactionUpdatedEvent, a9 as ReactionUser, aa as ReadReceiptEvent, ab as ReplyAttachmentSnapshot, ac as ResolvedFileSizeLimits, ad as SendMessageAttachment, ae as SyncDeletedForMe, af as SyncDeliveredReceipt, ag as SyncParticipantChange, ah as SyncReactionEntry, ai as SyncReactions, aj as SyncReadReceipt, ak as SyncStarEntry, al as SystemMessageMetadata, am as TypingIndicatorEvent, an as UploadConfig, ao as UploadProgress, ap as UserStatusEvent, aq as resolveConfig, ar as storageApi, as as uploadBatch } from './storage-D7GPq-Mm.cjs';
3
3
  import { AxiosInstance } from 'axios';
4
4
  import { Socket } from 'socket.io-client';
5
5
  import * as zustand_middleware from 'zustand/middleware';
@@ -75,6 +75,21 @@ interface SendData {
75
75
  replyTo?: string;
76
76
  tempId?: string;
77
77
  }
78
+ /** Matches the server-enforced cap in messages/dto/create-message.dto.ts (MAX_FORWARD_TARGETS). */
79
+ declare const MAX_FORWARD_TARGETS = 5;
80
+ /**
81
+ * Matches the server's HIGHLY_FORWARDED_DEPTH_THRESHOLD in messages.service.ts — the
82
+ * same forwardDepth value that triggers the server's fan-out-to-1 cap. Also used as
83
+ * the "Forwarded many times" label threshold so the label and the cap agree on what
84
+ * "highly forwarded" means; do not use a different number for the label alone.
85
+ */
86
+ declare const HIGHLY_FORWARDED_DEPTH_THRESHOLD = 5;
87
+ interface ForwardResult {
88
+ conversationId: string;
89
+ success: boolean;
90
+ message?: Message;
91
+ error?: string;
92
+ }
78
93
  declare const messagesApi: {
79
94
  list(conversationId: string, params?: ListMessagesParams): Promise<CursorPaginatedResponse<Message>>;
80
95
  get(messageId: string): Promise<Message>;
@@ -102,6 +117,18 @@ declare const messagesApi: {
102
117
  unpin(messageId: string): Promise<Message>;
103
118
  getPinned(conversationId: string): Promise<Message[]>;
104
119
  getReceipts(messageId: string): Promise<MessageReceiptsResponse>;
120
+ /**
121
+ * Forwards a message into one or more target conversations (max MAX_FORWARD_TARGETS
122
+ * per call, also enforced server-side). Each target is independent — one failing
123
+ * (e.g. no longer a participant) does not block the others; check `success`/`error`
124
+ * per entry in the returned array.
125
+ *
126
+ * Pass `attachmentIds` to forward only a subset of the source message's attachments
127
+ * (e.g. one image out of a multi-image message) — omit it to forward the whole
128
+ * message, including all its attachments, unchanged. An ID not present on the
129
+ * source message is ignored server-side.
130
+ */
131
+ forward(messageId: string, targetConversationIds: string[], attachmentIds?: string[]): Promise<ForwardResult[]>;
105
132
  };
106
133
 
107
134
  declare function normalizeConversation(conv: any): Conversation;
@@ -457,6 +484,10 @@ interface ChatState {
457
484
  lastSeen: Record<string, string>;
458
485
  replyingTo: Message | null;
459
486
  editingMessage: Message | null;
487
+ /** Message staged in the forward picker, null = picker closed. Unlike replyingTo,
488
+ * this does not fold into the next composer send — forwarding targets a different
489
+ * conversation and needs its own conversation-picker UI. */
490
+ forwardingMessage: Message | null;
460
491
  isSidebarOpen: boolean;
461
492
  isGroupInfoOpen: boolean;
462
493
  isStarredPanelOpen: boolean;
@@ -476,6 +507,7 @@ interface ChatState {
476
507
  setLastSeen: (userId: string, lastSeenAt: string | null) => void;
477
508
  setReplyingTo: (message: Message | null) => void;
478
509
  setEditingMessage: (message: Message | null) => void;
510
+ setForwardingMessage: (message: Message | null) => void;
479
511
  toggleSidebar: () => void;
480
512
  setSidebarOpen: (open: boolean) => void;
481
513
  toggleGroupInfo: () => void;
@@ -656,6 +688,7 @@ declare class AntzChatClient {
656
688
  unpin(messageId: string): Promise<Message>;
657
689
  getPinned(conversationId: string): Promise<Message[]>;
658
690
  getReceipts(messageId: string): Promise<MessageReceiptsResponse>;
691
+ forward(messageId: string, targetConversationIds: string[], attachmentIds?: string[]): Promise<ForwardResult[]>;
659
692
  };
660
693
  readonly conversations: {
661
694
  list(params?: ConversationListParams): Promise<PaginatedResponse<Conversation>>;
@@ -731,4 +764,4 @@ declare class AntzChatClient {
731
764
  uploadIcon(conversationId: string, file: UploadableFile): Promise<Conversation>;
732
765
  }
733
766
 
734
- export { AntzChatAuthError, AntzChatClient, AntzChatConfig, AntzChatError, AntzChatNetworkError, AntzChatPermissionError, AntzChatServerError, AntzChatValidationError, AppConfig, AuthResponse, AuthTokens, BatchUploadResult, CompletedPart, Conversation, ConversationListParams, ConversationSyncResponse, ConversationUnreadCount, type CreateDirectData, type CreateGroupData, CrossConversationSyncResponse, CursorPaginatedResponse, FileResponse, FileType, type LastReadEntry, type ListMessagesParams, LoginCredentials, type MentionPart, type MentionSegment, Message, MessageReactionsResponse, MessageReceiptsResponse, type MobileDeviceToken, PaginatedResponse, type ParsedMention, 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, buildMentionText, connectSocket, conversationsApi, createAuthStore, createRestTransitSession, decryptPayload, devicesApi, disconnectSocket, encryptPayload, extractMentionIds, fetchServerKeys, generateEphemeralKey, getApiClient, getAuthStore, getCompressionStrategy, getSessionId, getSessionKey, getSocket, getSocketStatus, initApiClient, initAuthStore, isMentionAll, isTransitEnvelope, messagesApi, normalizeAxiosError, normalizeConversation, onSocketStatus, parseMentions, performHandshake, reconnectSocket, refreshSocketAuth, renderMentionParts, resetAuthStore, resolveSystemMessageText, setApiClientInstance, setTransitSession, socketEmit, syncApi, tryGetSocket, useChatStore, usersApi };
767
+ export { AntzChatAuthError, AntzChatClient, AntzChatConfig, AntzChatError, AntzChatNetworkError, AntzChatPermissionError, AntzChatServerError, AntzChatValidationError, AppConfig, AuthResponse, AuthTokens, BatchUploadResult, CompletedPart, Conversation, ConversationListParams, ConversationSyncResponse, ConversationUnreadCount, type CreateDirectData, type CreateGroupData, CrossConversationSyncResponse, CursorPaginatedResponse, FileResponse, FileType, type ForwardResult, HIGHLY_FORWARDED_DEPTH_THRESHOLD, type LastReadEntry, type ListMessagesParams, LoginCredentials, MAX_FORWARD_TARGETS, type MentionPart, type MentionSegment, Message, MessageReactionsResponse, MessageReceiptsResponse, type MobileDeviceToken, PaginatedResponse, type ParsedMention, 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, buildMentionText, connectSocket, conversationsApi, createAuthStore, createRestTransitSession, decryptPayload, devicesApi, disconnectSocket, encryptPayload, extractMentionIds, fetchServerKeys, generateEphemeralKey, getApiClient, getAuthStore, getCompressionStrategy, getSessionId, getSessionKey, getSocket, getSocketStatus, initApiClient, initAuthStore, isMentionAll, isTransitEnvelope, messagesApi, normalizeAxiosError, normalizeConversation, onSocketStatus, parseMentions, performHandshake, reconnectSocket, refreshSocketAuth, renderMentionParts, resetAuthStore, resolveSystemMessageText, setApiClientInstance, setTransitSession, socketEmit, syncApi, tryGetSocket, useChatStore, usersApi };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ResolvedCompressionConfig, L as LoginCredentials, A as AuthResponse, a as RegisterData, b as AuthTokens, U as User, C as CrossConversationSyncResponse, c as ConversationSyncResponse, d as AppConfig, S as SendMessagePayload, e as CursorPaginatedResponse, M as Message, f as MessageReactionsResponse, P as PaginatedResponse, g as MessageReceiptsResponse, h as ConversationListParams, i as Conversation, j as Participant, k as ConversationUnreadCount, l as UnreadSummary, m as UserPreferences, n as ResolvedConfig, o as PersistStorage, p as PresignedUrlRequest, q as PresignedUrlResponse, F as FileResponse, r as CompletedPart, s as FileType, t as AntzChatConfig, u as UploadableFile, B as BatchUploadResult } from './storage-Pz2Taipp.js';
2
- export { v as Attachment, w as CompressedFile, x as CompressionAlgorithm, y as CompressionConfig, z as ConversationType, D as ConversationUpdatedEvent, E as FileSizeLimits, G as LastReaction, H as MENTION_ALL_ID, I as MessageAckEvent, J as MessageContent, K as MessageDeletedEvent, N as MessageDeletedForMeEvent, O as MessageDeliveredEvent, Q as MessageMetadata, T as MessageReaction, V as MessageReceiptEntry, W as MessageReplyReference, X as MessageStarUpdatedEvent, Y as MessageUpdatedEvent, Z as MessagesDeliveredEvent, _ as MultipartPartUrl, $ as MultipartUploadInfo, a0 as NewMessageEvent, a1 as OptimisticAttachment, a2 as PlatformCompressFn, a3 as PlatformUploadFn, a4 as PlatformUploadPartFn, a5 as QuietHours, a6 as ReactionGroup, a7 as ReactionUpdatedEvent, a8 as ReactionUser, a9 as ReadReceiptEvent, aa as ReplyAttachmentSnapshot, ab as ResolvedFileSizeLimits, ac as SendMessageAttachment, ad as SyncDeletedForMe, ae as SyncDeliveredReceipt, af as SyncParticipantChange, ag as SyncReactionEntry, ah as SyncReactions, ai as SyncReadReceipt, aj as SyncStarEntry, ak as SystemMessageMetadata, al as TypingIndicatorEvent, am as UploadConfig, an as UploadProgress, ao as UserStatusEvent, ap as resolveConfig, aq as storageApi, ar as uploadBatch } from './storage-Pz2Taipp.js';
1
+ import { R as ResolvedCompressionConfig, L as LoginCredentials, A as AuthResponse, a as RegisterData, b as AuthTokens, U as User, C as CrossConversationSyncResponse, c as ConversationSyncResponse, d as AppConfig, S as SendMessagePayload, M as Message, e as CursorPaginatedResponse, f as MessageReactionsResponse, P as PaginatedResponse, g as MessageReceiptsResponse, h as ConversationListParams, i as Conversation, j as Participant, k as ConversationUnreadCount, l as UnreadSummary, m as UserPreferences, n as ResolvedConfig, o as PersistStorage, p as PresignedUrlRequest, q as PresignedUrlResponse, F as FileResponse, r as CompletedPart, s as FileType, t as AntzChatConfig, u as UploadableFile, B as BatchUploadResult } from './storage-D7GPq-Mm.js';
2
+ export { v as Attachment, w as CompressedFile, x as CompressionAlgorithm, y as CompressionConfig, z as ConversationType, D as ConversationUpdatedEvent, E as FileSizeLimits, G as LastReaction, H as MENTION_ALL_ID, I as MessageAckEvent, J as MessageContent, K as MessageDeletedEvent, N as MessageDeletedForMeEvent, O as MessageDeliveredEvent, Q as MessageForwardReference, T as MessageMetadata, V as MessageReaction, W as MessageReceiptEntry, X as MessageReplyReference, Y as MessageStarUpdatedEvent, Z as MessageUpdatedEvent, _ as MessagesDeliveredEvent, $ as MultipartPartUrl, a0 as MultipartUploadInfo, a1 as NewMessageEvent, a2 as OptimisticAttachment, a3 as PlatformCompressFn, a4 as PlatformUploadFn, a5 as PlatformUploadPartFn, a6 as QuietHours, a7 as ReactionGroup, a8 as ReactionUpdatedEvent, a9 as ReactionUser, aa as ReadReceiptEvent, ab as ReplyAttachmentSnapshot, ac as ResolvedFileSizeLimits, ad as SendMessageAttachment, ae as SyncDeletedForMe, af as SyncDeliveredReceipt, ag as SyncParticipantChange, ah as SyncReactionEntry, ai as SyncReactions, aj as SyncReadReceipt, ak as SyncStarEntry, al as SystemMessageMetadata, am as TypingIndicatorEvent, an as UploadConfig, ao as UploadProgress, ap as UserStatusEvent, aq as resolveConfig, ar as storageApi, as as uploadBatch } from './storage-D7GPq-Mm.js';
3
3
  import { AxiosInstance } from 'axios';
4
4
  import { Socket } from 'socket.io-client';
5
5
  import * as zustand_middleware from 'zustand/middleware';
@@ -75,6 +75,21 @@ interface SendData {
75
75
  replyTo?: string;
76
76
  tempId?: string;
77
77
  }
78
+ /** Matches the server-enforced cap in messages/dto/create-message.dto.ts (MAX_FORWARD_TARGETS). */
79
+ declare const MAX_FORWARD_TARGETS = 5;
80
+ /**
81
+ * Matches the server's HIGHLY_FORWARDED_DEPTH_THRESHOLD in messages.service.ts — the
82
+ * same forwardDepth value that triggers the server's fan-out-to-1 cap. Also used as
83
+ * the "Forwarded many times" label threshold so the label and the cap agree on what
84
+ * "highly forwarded" means; do not use a different number for the label alone.
85
+ */
86
+ declare const HIGHLY_FORWARDED_DEPTH_THRESHOLD = 5;
87
+ interface ForwardResult {
88
+ conversationId: string;
89
+ success: boolean;
90
+ message?: Message;
91
+ error?: string;
92
+ }
78
93
  declare const messagesApi: {
79
94
  list(conversationId: string, params?: ListMessagesParams): Promise<CursorPaginatedResponse<Message>>;
80
95
  get(messageId: string): Promise<Message>;
@@ -102,6 +117,18 @@ declare const messagesApi: {
102
117
  unpin(messageId: string): Promise<Message>;
103
118
  getPinned(conversationId: string): Promise<Message[]>;
104
119
  getReceipts(messageId: string): Promise<MessageReceiptsResponse>;
120
+ /**
121
+ * Forwards a message into one or more target conversations (max MAX_FORWARD_TARGETS
122
+ * per call, also enforced server-side). Each target is independent — one failing
123
+ * (e.g. no longer a participant) does not block the others; check `success`/`error`
124
+ * per entry in the returned array.
125
+ *
126
+ * Pass `attachmentIds` to forward only a subset of the source message's attachments
127
+ * (e.g. one image out of a multi-image message) — omit it to forward the whole
128
+ * message, including all its attachments, unchanged. An ID not present on the
129
+ * source message is ignored server-side.
130
+ */
131
+ forward(messageId: string, targetConversationIds: string[], attachmentIds?: string[]): Promise<ForwardResult[]>;
105
132
  };
106
133
 
107
134
  declare function normalizeConversation(conv: any): Conversation;
@@ -457,6 +484,10 @@ interface ChatState {
457
484
  lastSeen: Record<string, string>;
458
485
  replyingTo: Message | null;
459
486
  editingMessage: Message | null;
487
+ /** Message staged in the forward picker, null = picker closed. Unlike replyingTo,
488
+ * this does not fold into the next composer send — forwarding targets a different
489
+ * conversation and needs its own conversation-picker UI. */
490
+ forwardingMessage: Message | null;
460
491
  isSidebarOpen: boolean;
461
492
  isGroupInfoOpen: boolean;
462
493
  isStarredPanelOpen: boolean;
@@ -476,6 +507,7 @@ interface ChatState {
476
507
  setLastSeen: (userId: string, lastSeenAt: string | null) => void;
477
508
  setReplyingTo: (message: Message | null) => void;
478
509
  setEditingMessage: (message: Message | null) => void;
510
+ setForwardingMessage: (message: Message | null) => void;
479
511
  toggleSidebar: () => void;
480
512
  setSidebarOpen: (open: boolean) => void;
481
513
  toggleGroupInfo: () => void;
@@ -656,6 +688,7 @@ declare class AntzChatClient {
656
688
  unpin(messageId: string): Promise<Message>;
657
689
  getPinned(conversationId: string): Promise<Message[]>;
658
690
  getReceipts(messageId: string): Promise<MessageReceiptsResponse>;
691
+ forward(messageId: string, targetConversationIds: string[], attachmentIds?: string[]): Promise<ForwardResult[]>;
659
692
  };
660
693
  readonly conversations: {
661
694
  list(params?: ConversationListParams): Promise<PaginatedResponse<Conversation>>;
@@ -731,4 +764,4 @@ declare class AntzChatClient {
731
764
  uploadIcon(conversationId: string, file: UploadableFile): Promise<Conversation>;
732
765
  }
733
766
 
734
- export { AntzChatAuthError, AntzChatClient, AntzChatConfig, AntzChatError, AntzChatNetworkError, AntzChatPermissionError, AntzChatServerError, AntzChatValidationError, AppConfig, AuthResponse, AuthTokens, BatchUploadResult, CompletedPart, Conversation, ConversationListParams, ConversationSyncResponse, ConversationUnreadCount, type CreateDirectData, type CreateGroupData, CrossConversationSyncResponse, CursorPaginatedResponse, FileResponse, FileType, type LastReadEntry, type ListMessagesParams, LoginCredentials, type MentionPart, type MentionSegment, Message, MessageReactionsResponse, MessageReceiptsResponse, type MobileDeviceToken, PaginatedResponse, type ParsedMention, 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, buildMentionText, connectSocket, conversationsApi, createAuthStore, createRestTransitSession, decryptPayload, devicesApi, disconnectSocket, encryptPayload, extractMentionIds, fetchServerKeys, generateEphemeralKey, getApiClient, getAuthStore, getCompressionStrategy, getSessionId, getSessionKey, getSocket, getSocketStatus, initApiClient, initAuthStore, isMentionAll, isTransitEnvelope, messagesApi, normalizeAxiosError, normalizeConversation, onSocketStatus, parseMentions, performHandshake, reconnectSocket, refreshSocketAuth, renderMentionParts, resetAuthStore, resolveSystemMessageText, setApiClientInstance, setTransitSession, socketEmit, syncApi, tryGetSocket, useChatStore, usersApi };
767
+ export { AntzChatAuthError, AntzChatClient, AntzChatConfig, AntzChatError, AntzChatNetworkError, AntzChatPermissionError, AntzChatServerError, AntzChatValidationError, AppConfig, AuthResponse, AuthTokens, BatchUploadResult, CompletedPart, Conversation, ConversationListParams, ConversationSyncResponse, ConversationUnreadCount, type CreateDirectData, type CreateGroupData, CrossConversationSyncResponse, CursorPaginatedResponse, FileResponse, FileType, type ForwardResult, HIGHLY_FORWARDED_DEPTH_THRESHOLD, type LastReadEntry, type ListMessagesParams, LoginCredentials, MAX_FORWARD_TARGETS, type MentionPart, type MentionSegment, Message, MessageReactionsResponse, MessageReceiptsResponse, type MobileDeviceToken, PaginatedResponse, type ParsedMention, 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, buildMentionText, connectSocket, conversationsApi, createAuthStore, createRestTransitSession, decryptPayload, devicesApi, disconnectSocket, encryptPayload, extractMentionIds, fetchServerKeys, generateEphemeralKey, getApiClient, getAuthStore, getCompressionStrategy, getSessionId, getSessionKey, getSocket, getSocketStatus, initApiClient, initAuthStore, isMentionAll, isTransitEnvelope, messagesApi, normalizeAxiosError, normalizeConversation, onSocketStatus, parseMentions, performHandshake, reconnectSocket, refreshSocketAuth, renderMentionParts, resetAuthStore, resolveSystemMessageText, setApiClientInstance, setTransitSession, socketEmit, syncApi, tryGetSocket, useChatStore, usersApi };
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  } from "./chunk-XTQYF5HU.js";
33
33
  import {
34
34
  useChatStore
35
- } from "./chunk-EOL5B7GS.js";
35
+ } from "./chunk-UIYJAOGL.js";
36
36
 
37
37
  // src/config/types.ts
38
38
  function resolveConfig(config) {
@@ -300,6 +300,8 @@ function resolveSystemMessageText(message, currentUserId) {
300
300
  }
301
301
 
302
302
  // src/api/messages.ts
303
+ var MAX_FORWARD_TARGETS = 5;
304
+ var HIGHLY_FORWARDED_DEPTH_THRESHOLD = 5;
303
305
  var messagesApi = {
304
306
  async list(conversationId, params = {}) {
305
307
  const { cursor, direction, ...rest } = params;
@@ -393,6 +395,24 @@ var messagesApi = {
393
395
  async getReceipts(messageId) {
394
396
  const { data } = await getApiClient().get(`/messages/${messageId}/receipts`);
395
397
  return data;
398
+ },
399
+ /**
400
+ * Forwards a message into one or more target conversations (max MAX_FORWARD_TARGETS
401
+ * per call, also enforced server-side). Each target is independent — one failing
402
+ * (e.g. no longer a participant) does not block the others; check `success`/`error`
403
+ * per entry in the returned array.
404
+ *
405
+ * Pass `attachmentIds` to forward only a subset of the source message's attachments
406
+ * (e.g. one image out of a multi-image message) — omit it to forward the whole
407
+ * message, including all its attachments, unchanged. An ID not present on the
408
+ * source message is ignored server-side.
409
+ */
410
+ async forward(messageId, targetConversationIds, attachmentIds) {
411
+ const { data } = await getApiClient().post(
412
+ `/messages/${messageId}/forward`,
413
+ { targetConversationIds, ...attachmentIds ? { attachmentIds } : {} }
414
+ );
415
+ return data;
396
416
  }
397
417
  };
398
418
 
@@ -834,13 +854,13 @@ async function _doConnect(config, getToken) {
834
854
  });
835
855
  }
836
856
  secureOn(_socket, "read_receipt", (event) => {
837
- import("./chat.store-DLNRJ5ZT.js").then(({ useChatStore: useChatStore2 }) => {
857
+ import("./chat.store-UVTDBPEC.js").then(({ useChatStore: useChatStore2 }) => {
838
858
  const e = event;
839
859
  useChatStore2.getState().setLastRead(e.conversationId, e.messageId, e.readAt);
840
860
  });
841
861
  });
842
862
  secureOn(_socket, "user_online", (event) => {
843
- import("./chat.store-DLNRJ5ZT.js").then(({ useChatStore: useChatStore2 }) => {
863
+ import("./chat.store-UVTDBPEC.js").then(({ useChatStore: useChatStore2 }) => {
844
864
  const store = useChatStore2.getState();
845
865
  const e = event;
846
866
  store.setUserOnline(e.userId);
@@ -848,7 +868,7 @@ async function _doConnect(config, getToken) {
848
868
  });
849
869
  });
850
870
  secureOn(_socket, "user_offline", (event) => {
851
- import("./chat.store-DLNRJ5ZT.js").then(({ useChatStore: useChatStore2 }) => {
871
+ import("./chat.store-UVTDBPEC.js").then(({ useChatStore: useChatStore2 }) => {
852
872
  const e = event;
853
873
  const store = useChatStore2.getState();
854
874
  store.setUserOffline(e.userId);
@@ -1208,6 +1228,8 @@ export {
1208
1228
  AntzChatPermissionError,
1209
1229
  AntzChatServerError,
1210
1230
  AntzChatValidationError,
1231
+ HIGHLY_FORWARDED_DEPTH_THRESHOLD,
1232
+ MAX_FORWARD_TARGETS,
1211
1233
  MENTION_ALL_ID,
1212
1234
  appConfigApi,
1213
1235
  authApi,