@antzsoft/chat-core 1.3.0 → 1.3.2
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.cjs +13 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -7
- package/dist/index.d.ts +13 -7
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/{storage-C7amvVjk.d.cts → storage-CNoA242G.d.cts} +29 -4
- package/dist/{storage-C7amvVjk.d.ts → storage-CNoA242G.d.ts} +29 -4
- package/package.json +1 -1
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, P as PaginatedResponse,
|
|
2
|
-
export {
|
|
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-CNoA242G.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 MessageAckEvent, I as MessageContent, J as MessageDeletedEvent, K as MessageDeletedForMeEvent, N as MessageDeliveredEvent, O as MessageMetadata, Q as MessageReaction, T as MessageReceiptEntry, V as MessageReplyReference, W as MessageStarUpdatedEvent, X as MessageUpdatedEvent, Y as MessagesDeliveredEvent, Z as MultipartPartUrl, _ as MultipartUploadInfo, $ as NewMessageEvent, a0 as OptimisticAttachment, a1 as PlatformCompressFn, a2 as PlatformUploadFn, a3 as PlatformUploadPartFn, a4 as QuietHours, a5 as ReactionGroup, a6 as ReactionUpdatedEvent, a7 as ReactionUser, a8 as ReadReceiptEvent, a9 as ReplyAttachmentSnapshot, aa as ResolvedFileSizeLimits, ab as SendMessageAttachment, ac as SyncDeletedForMe, ad as SyncParticipantChange, ae as SyncReactionEntry, af as SyncReactions, ag as SyncReadReceipt, ah as SyncStarEntry, ai as SystemMessageMetadata, aj as TypingIndicatorEvent, ak as UploadConfig, al as UploadProgress, am as UserStatusEvent, an as resolveConfig, ao as storageApi, ap as uploadBatch } from './storage-CNoA242G.cjs';
|
|
3
3
|
import { AxiosInstance } from 'axios';
|
|
4
4
|
import { Socket } from 'socket.io-client';
|
|
5
5
|
import * as zustand_middleware from 'zustand/middleware';
|
|
@@ -36,17 +36,21 @@ declare const syncApi: {
|
|
|
36
36
|
pull(since: string): Promise<CrossConversationSyncResponse>;
|
|
37
37
|
/**
|
|
38
38
|
* Per-conversation delta sync — call when a conversation has `needs_refresh = true`
|
|
39
|
-
* or on fresh install (omit
|
|
39
|
+
* or on fresh install (omit all opts to receive full history).
|
|
40
40
|
* Covers messages, deletedForMe, full reaction state, stars, participant changes,
|
|
41
41
|
* and read receipts — everything needed to make local SQLite authoritative.
|
|
42
42
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* Direction:
|
|
44
|
+
* afterSeq — forward (oldest→newest, catch-up/sync). Default when seq is known.
|
|
45
|
+
* beforeSeq — backward (newest→oldest, scroll-back / load history).
|
|
46
|
+
* since — timestamp fallback for old servers or first sync on a new install.
|
|
47
|
+
*
|
|
48
|
+
* When `hasMore` is true, call again with `nextSeq` as the same cursor type you sent.
|
|
46
49
|
*/
|
|
47
50
|
pullConversation(conversationId: string, opts?: {
|
|
48
51
|
since?: string;
|
|
49
52
|
afterSeq?: number;
|
|
53
|
+
beforeSeq?: number;
|
|
50
54
|
}): Promise<ConversationSyncResponse>;
|
|
51
55
|
};
|
|
52
56
|
|
|
@@ -80,6 +84,7 @@ declare const messagesApi: {
|
|
|
80
84
|
deleteForMe(messageId: string): Promise<void>;
|
|
81
85
|
addReaction(messageId: string, emoji: string): Promise<Message>;
|
|
82
86
|
removeReaction(messageId: string, emoji: string): Promise<Message>;
|
|
87
|
+
getReactions(messageId: string): Promise<MessageReactionsResponse>;
|
|
83
88
|
star(messageId: string): Promise<void>;
|
|
84
89
|
unstar(messageId: string): Promise<void>;
|
|
85
90
|
getStarred(params?: {
|
|
@@ -571,6 +576,7 @@ declare class AntzChatClient {
|
|
|
571
576
|
deleteForMe(messageId: string): Promise<void>;
|
|
572
577
|
addReaction(messageId: string, emoji: string): Promise<Message>;
|
|
573
578
|
removeReaction(messageId: string, emoji: string): Promise<Message>;
|
|
579
|
+
getReactions(messageId: string): Promise<MessageReactionsResponse>;
|
|
574
580
|
star(messageId: string): Promise<void>;
|
|
575
581
|
unstar(messageId: string): Promise<void>;
|
|
576
582
|
getStarred(params?: {
|
|
@@ -661,4 +667,4 @@ declare class AntzChatClient {
|
|
|
661
667
|
uploadIcon(conversationId: string, file: UploadableFile): Promise<Conversation>;
|
|
662
668
|
}
|
|
663
669
|
|
|
664
|
-
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, 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, createRestTransitSession, decryptPayload, devicesApi, disconnectSocket, encryptPayload, fetchServerKeys, generateEphemeralKey, getApiClient, getAuthStore, getCompressionStrategy, getSessionId, getSessionKey, getSocket, getSocketStatus, initApiClient, initAuthStore, isTransitEnvelope, messagesApi, normalizeAxiosError, normalizeConversation, onSocketStatus, performHandshake, reconnectSocket, refreshSocketAuth, resetAuthStore, resolveSystemMessageText, setApiClientInstance, setTransitSession, socketEmit, syncApi, tryGetSocket, useChatStore, usersApi };
|
|
670
|
+
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, Message, MessageReactionsResponse, 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, createRestTransitSession, decryptPayload, devicesApi, disconnectSocket, encryptPayload, fetchServerKeys, generateEphemeralKey, getApiClient, getAuthStore, getCompressionStrategy, getSessionId, getSessionKey, getSocket, getSocketStatus, initApiClient, initAuthStore, isTransitEnvelope, messagesApi, normalizeAxiosError, normalizeConversation, onSocketStatus, performHandshake, reconnectSocket, refreshSocketAuth, 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, P as PaginatedResponse,
|
|
2
|
-
export {
|
|
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-CNoA242G.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 MessageAckEvent, I as MessageContent, J as MessageDeletedEvent, K as MessageDeletedForMeEvent, N as MessageDeliveredEvent, O as MessageMetadata, Q as MessageReaction, T as MessageReceiptEntry, V as MessageReplyReference, W as MessageStarUpdatedEvent, X as MessageUpdatedEvent, Y as MessagesDeliveredEvent, Z as MultipartPartUrl, _ as MultipartUploadInfo, $ as NewMessageEvent, a0 as OptimisticAttachment, a1 as PlatformCompressFn, a2 as PlatformUploadFn, a3 as PlatformUploadPartFn, a4 as QuietHours, a5 as ReactionGroup, a6 as ReactionUpdatedEvent, a7 as ReactionUser, a8 as ReadReceiptEvent, a9 as ReplyAttachmentSnapshot, aa as ResolvedFileSizeLimits, ab as SendMessageAttachment, ac as SyncDeletedForMe, ad as SyncParticipantChange, ae as SyncReactionEntry, af as SyncReactions, ag as SyncReadReceipt, ah as SyncStarEntry, ai as SystemMessageMetadata, aj as TypingIndicatorEvent, ak as UploadConfig, al as UploadProgress, am as UserStatusEvent, an as resolveConfig, ao as storageApi, ap as uploadBatch } from './storage-CNoA242G.js';
|
|
3
3
|
import { AxiosInstance } from 'axios';
|
|
4
4
|
import { Socket } from 'socket.io-client';
|
|
5
5
|
import * as zustand_middleware from 'zustand/middleware';
|
|
@@ -36,17 +36,21 @@ declare const syncApi: {
|
|
|
36
36
|
pull(since: string): Promise<CrossConversationSyncResponse>;
|
|
37
37
|
/**
|
|
38
38
|
* Per-conversation delta sync — call when a conversation has `needs_refresh = true`
|
|
39
|
-
* or on fresh install (omit
|
|
39
|
+
* or on fresh install (omit all opts to receive full history).
|
|
40
40
|
* Covers messages, deletedForMe, full reaction state, stars, participant changes,
|
|
41
41
|
* and read receipts — everything needed to make local SQLite authoritative.
|
|
42
42
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* Direction:
|
|
44
|
+
* afterSeq — forward (oldest→newest, catch-up/sync). Default when seq is known.
|
|
45
|
+
* beforeSeq — backward (newest→oldest, scroll-back / load history).
|
|
46
|
+
* since — timestamp fallback for old servers or first sync on a new install.
|
|
47
|
+
*
|
|
48
|
+
* When `hasMore` is true, call again with `nextSeq` as the same cursor type you sent.
|
|
46
49
|
*/
|
|
47
50
|
pullConversation(conversationId: string, opts?: {
|
|
48
51
|
since?: string;
|
|
49
52
|
afterSeq?: number;
|
|
53
|
+
beforeSeq?: number;
|
|
50
54
|
}): Promise<ConversationSyncResponse>;
|
|
51
55
|
};
|
|
52
56
|
|
|
@@ -80,6 +84,7 @@ declare const messagesApi: {
|
|
|
80
84
|
deleteForMe(messageId: string): Promise<void>;
|
|
81
85
|
addReaction(messageId: string, emoji: string): Promise<Message>;
|
|
82
86
|
removeReaction(messageId: string, emoji: string): Promise<Message>;
|
|
87
|
+
getReactions(messageId: string): Promise<MessageReactionsResponse>;
|
|
83
88
|
star(messageId: string): Promise<void>;
|
|
84
89
|
unstar(messageId: string): Promise<void>;
|
|
85
90
|
getStarred(params?: {
|
|
@@ -571,6 +576,7 @@ declare class AntzChatClient {
|
|
|
571
576
|
deleteForMe(messageId: string): Promise<void>;
|
|
572
577
|
addReaction(messageId: string, emoji: string): Promise<Message>;
|
|
573
578
|
removeReaction(messageId: string, emoji: string): Promise<Message>;
|
|
579
|
+
getReactions(messageId: string): Promise<MessageReactionsResponse>;
|
|
574
580
|
star(messageId: string): Promise<void>;
|
|
575
581
|
unstar(messageId: string): Promise<void>;
|
|
576
582
|
getStarred(params?: {
|
|
@@ -661,4 +667,4 @@ declare class AntzChatClient {
|
|
|
661
667
|
uploadIcon(conversationId: string, file: UploadableFile): Promise<Conversation>;
|
|
662
668
|
}
|
|
663
669
|
|
|
664
|
-
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, 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, createRestTransitSession, decryptPayload, devicesApi, disconnectSocket, encryptPayload, fetchServerKeys, generateEphemeralKey, getApiClient, getAuthStore, getCompressionStrategy, getSessionId, getSessionKey, getSocket, getSocketStatus, initApiClient, initAuthStore, isTransitEnvelope, messagesApi, normalizeAxiosError, normalizeConversation, onSocketStatus, performHandshake, reconnectSocket, refreshSocketAuth, resetAuthStore, resolveSystemMessageText, setApiClientInstance, setTransitSession, socketEmit, syncApi, tryGetSocket, useChatStore, usersApi };
|
|
670
|
+
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, Message, MessageReactionsResponse, 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, createRestTransitSession, decryptPayload, devicesApi, disconnectSocket, encryptPayload, fetchServerKeys, generateEphemeralKey, getApiClient, getAuthStore, getCompressionStrategy, getSessionId, getSessionKey, getSocket, getSocketStatus, initApiClient, initAuthStore, isTransitEnvelope, messagesApi, normalizeAxiosError, normalizeConversation, onSocketStatus, performHandshake, reconnectSocket, refreshSocketAuth, resetAuthStore, resolveSystemMessageText, setApiClientInstance, setTransitSession, socketEmit, syncApi, tryGetSocket, useChatStore, usersApi };
|
package/dist/index.js
CHANGED
|
@@ -150,18 +150,23 @@ var syncApi = {
|
|
|
150
150
|
},
|
|
151
151
|
/**
|
|
152
152
|
* Per-conversation delta sync — call when a conversation has `needs_refresh = true`
|
|
153
|
-
* or on fresh install (omit
|
|
153
|
+
* or on fresh install (omit all opts to receive full history).
|
|
154
154
|
* Covers messages, deletedForMe, full reaction state, stars, participant changes,
|
|
155
155
|
* and read receipts — everything needed to make local SQLite authoritative.
|
|
156
156
|
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
157
|
+
* Direction:
|
|
158
|
+
* afterSeq — forward (oldest→newest, catch-up/sync). Default when seq is known.
|
|
159
|
+
* beforeSeq — backward (newest→oldest, scroll-back / load history).
|
|
160
|
+
* since — timestamp fallback for old servers or first sync on a new install.
|
|
161
|
+
*
|
|
162
|
+
* When `hasMore` is true, call again with `nextSeq` as the same cursor type you sent.
|
|
160
163
|
*/
|
|
161
164
|
pullConversation(conversationId, opts) {
|
|
162
165
|
const params = {};
|
|
163
166
|
if (opts?.afterSeq !== void 0) {
|
|
164
167
|
params.afterSeq = opts.afterSeq;
|
|
168
|
+
} else if (opts?.beforeSeq !== void 0) {
|
|
169
|
+
params.beforeSeq = opts.beforeSeq;
|
|
165
170
|
} else if (opts?.since) {
|
|
166
171
|
params.since = opts.since;
|
|
167
172
|
}
|
|
@@ -346,6 +351,10 @@ var messagesApi = {
|
|
|
346
351
|
);
|
|
347
352
|
return data;
|
|
348
353
|
},
|
|
354
|
+
async getReactions(messageId) {
|
|
355
|
+
const { data } = await getApiClient().post(`/messages/${messageId}/reactions/list`);
|
|
356
|
+
return data;
|
|
357
|
+
},
|
|
349
358
|
async star(messageId) {
|
|
350
359
|
await getApiClient().post(`/messages/${messageId}/star`);
|
|
351
360
|
},
|