@antzsoft/chat-core 1.2.8 → 1.3.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.
- package/dist/index.cjs +13 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/{storage-CW70b4vi.d.cts → storage-C7amvVjk.d.cts} +19 -1
- package/dist/{storage-CW70b4vi.d.ts → storage-C7amvVjk.d.ts} +19 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -854,14 +854,22 @@ var syncApi = {
|
|
|
854
854
|
},
|
|
855
855
|
/**
|
|
856
856
|
* Per-conversation delta sync — call when a conversation has `needs_refresh = true`
|
|
857
|
-
* or on fresh install (omit
|
|
857
|
+
* or on fresh install (omit both since and afterSeq to receive full history).
|
|
858
858
|
* Covers messages, deletedForMe, full reaction state, stars, participant changes,
|
|
859
859
|
* and read receipts — everything needed to make local SQLite authoritative.
|
|
860
|
+
*
|
|
861
|
+
* Prefer `afterSeq` when available (new server) — paginated, collision-safe.
|
|
862
|
+
* Fall back to `since` timestamp for old servers or first sync on a new install.
|
|
863
|
+
* When `hasMore` is true in the response, call again with the returned `nextSeq`.
|
|
860
864
|
*/
|
|
861
|
-
pullConversation(conversationId,
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
+
pullConversation(conversationId, opts) {
|
|
866
|
+
const params = {};
|
|
867
|
+
if (opts?.afterSeq !== void 0) {
|
|
868
|
+
params.afterSeq = opts.afterSeq;
|
|
869
|
+
} else if (opts?.since) {
|
|
870
|
+
params.since = opts.since;
|
|
871
|
+
}
|
|
872
|
+
return getApiClient().get(`/conversations/${conversationId}/sync`, { params }).then((r) => r.data);
|
|
865
873
|
}
|
|
866
874
|
};
|
|
867
875
|
|