@antzsoft/chat-core 1.3.7 → 1.3.9
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 +95 -1
- package/dist/index.cjs +89 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -3
- package/dist/index.d.ts +63 -3
- package/dist/index.js +83 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/{storage-DJh54pps.d.cts → storage-C_b-SFFH.d.cts} +29 -1
- package/dist/{storage-DJh54pps.d.ts → storage-C_b-SFFH.d.ts} +29 -1
- package/docs/integration-guide.html +68 -3
- package/package.json +1 -1
|
@@ -94,6 +94,18 @@ interface MessageContent {
|
|
|
94
94
|
type: 'text' | 'attachment' | 'system';
|
|
95
95
|
attachments?: Attachment[];
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* A @mention of a user in a group message.
|
|
99
|
+
*
|
|
100
|
+
* The mention is stored inline in `content.text` as a self-describing token
|
|
101
|
+
* `@[DisplayName](userId)` (and, for @all, `@[all](all)`). This flat array is a
|
|
102
|
+
* denormalized copy of the mentioned userIds, used for notification fan-out and
|
|
103
|
+
* "who was mentioned" lookups — it is NOT a positional/offset map.
|
|
104
|
+
*
|
|
105
|
+
* The reserved id `"all"` represents an @all mention (server resolves it to every
|
|
106
|
+
* active participant at send time).
|
|
107
|
+
*/
|
|
108
|
+
declare const MENTION_ALL_ID = "all";
|
|
97
109
|
interface ReplyAttachmentSnapshot {
|
|
98
110
|
type: FileType;
|
|
99
111
|
filename: string;
|
|
@@ -139,6 +151,12 @@ interface Message {
|
|
|
139
151
|
senderId: string;
|
|
140
152
|
content: MessageContent;
|
|
141
153
|
replyTo?: MessageReplyReference;
|
|
154
|
+
/**
|
|
155
|
+
* Flat list of mentioned userIds (denormalized from the `@[name](id)` tokens in
|
|
156
|
+
* `content.text`). Contains `"all"` for an @all mention. Used for fan-out and
|
|
157
|
+
* "mentions me" lookups; not a positional map.
|
|
158
|
+
*/
|
|
159
|
+
mentions?: string[];
|
|
142
160
|
reactions: MessageReaction[];
|
|
143
161
|
lastReaction?: LastReaction | null;
|
|
144
162
|
status: MessageStatus;
|
|
@@ -168,6 +186,8 @@ interface Message {
|
|
|
168
186
|
}
|
|
169
187
|
interface Participant {
|
|
170
188
|
userId: string;
|
|
189
|
+
/** External system user ID of the chat user (non-builtin modes). Mirrors `user.externalId`. */
|
|
190
|
+
externalId?: string;
|
|
171
191
|
role: ParticipantRole;
|
|
172
192
|
joinedAt: string;
|
|
173
193
|
isActive?: boolean;
|
|
@@ -379,6 +399,8 @@ interface MessageStarUpdatedEvent {
|
|
|
379
399
|
interface TypingIndicatorEvent {
|
|
380
400
|
conversationId: string;
|
|
381
401
|
userId: string;
|
|
402
|
+
/** External system user ID (non-builtin modes). Absent in builtin mode. */
|
|
403
|
+
externalId?: string;
|
|
382
404
|
username: string;
|
|
383
405
|
displayName: string;
|
|
384
406
|
avatarUrl?: string;
|
|
@@ -414,6 +436,8 @@ interface MessageDeliveredEvent {
|
|
|
414
436
|
}
|
|
415
437
|
interface MessageReceiptEntry {
|
|
416
438
|
userId: string;
|
|
439
|
+
/** External system user ID (non-builtin modes). */
|
|
440
|
+
externalId?: string;
|
|
417
441
|
displayName: string;
|
|
418
442
|
avatarUrl?: string;
|
|
419
443
|
}
|
|
@@ -508,6 +532,8 @@ interface ConversationSyncResponse {
|
|
|
508
532
|
}
|
|
509
533
|
interface ReactionUser {
|
|
510
534
|
userId: string;
|
|
535
|
+
/** External system user ID (non-builtin modes). */
|
|
536
|
+
externalId?: string;
|
|
511
537
|
displayName: string;
|
|
512
538
|
avatarUrl?: string;
|
|
513
539
|
}
|
|
@@ -550,6 +576,8 @@ interface SendMessagePayload {
|
|
|
550
576
|
attachments?: SendMessageAttachment[];
|
|
551
577
|
replyTo?: string;
|
|
552
578
|
tempId: string;
|
|
579
|
+
/** Mentioned userIds (use `"all"` / MENTION_ALL_ID for @all). Derived from the tokens in `text`. */
|
|
580
|
+
mentions?: string[];
|
|
553
581
|
}
|
|
554
582
|
interface QuietHours {
|
|
555
583
|
enabled: boolean;
|
|
@@ -817,4 +845,4 @@ declare function uploadBatchWithSlots(files: UploadableFile[], platformUploadFn:
|
|
|
817
845
|
slotToFile: Map<string, FileResponse>;
|
|
818
846
|
}>;
|
|
819
847
|
|
|
820
|
-
export { type
|
|
848
|
+
export { type MultipartUploadInfo as $, type AuthResponse as A, type BatchUploadResult as B, type CrossConversationSyncResponse as C, type ConversationUpdatedEvent as D, type FileSizeLimits as E, type FileResponse as F, type LastReaction as G, MENTION_ALL_ID as H, type MessageAckEvent as I, type MessageContent as J, type MessageDeletedEvent as K, type LoginCredentials as L, type Message as M, type MessageDeletedForMeEvent as N, type MessageDeliveredEvent as O, type PaginatedResponse as P, type MessageMetadata as Q, type ResolvedCompressionConfig as R, type SendMessagePayload as S, type MessageReaction as T, type User as U, type MessageReceiptEntry as V, type MessageReplyReference as W, type MessageStarUpdatedEvent as X, type MessageUpdatedEvent as Y, type MessagesDeliveredEvent as Z, type MultipartPartUrl as _, type RegisterData as a, type NewMessageEvent as a0, type OptimisticAttachment as a1, type PlatformCompressFn as a2, type PlatformUploadFn as a3, type PlatformUploadPartFn as a4, type QuietHours as a5, type ReactionGroup as a6, type ReactionUpdatedEvent as a7, type ReactionUser as a8, type ReadReceiptEvent as a9, type ReplyAttachmentSnapshot as aa, type ResolvedFileSizeLimits as ab, type SendMessageAttachment as ac, type SyncDeletedForMe as ad, type SyncDeliveredReceipt as ae, type SyncParticipantChange as af, type SyncReactionEntry as ag, type SyncReactions as ah, type SyncReadReceipt as ai, type SyncStarEntry as aj, type SystemMessageMetadata as ak, type TypingIndicatorEvent as al, type UploadConfig as am, type UploadProgress as an, type UserStatusEvent as ao, resolveConfig as ap, storageApi as aq, uploadBatch as ar, uploadBatchWithSlots as as, type AuthTokens as b, type ConversationSyncResponse as c, type AppConfig as d, type CursorPaginatedResponse as e, type MessageReactionsResponse as f, type MessageReceiptsResponse as g, type ConversationListParams as h, type Conversation as i, type Participant as j, type ConversationUnreadCount as k, type UnreadSummary as l, type UserPreferences as m, type ResolvedConfig as n, type PersistStorage as o, type PresignedUrlRequest as p, type PresignedUrlResponse as q, type CompletedPart as r, type FileType as s, type AntzChatConfig as t, type UploadableFile as u, type Attachment as v, type CompressedFile as w, type CompressionAlgorithm as x, type CompressionConfig as y, type ConversationType as z };
|
|
@@ -94,6 +94,18 @@ interface MessageContent {
|
|
|
94
94
|
type: 'text' | 'attachment' | 'system';
|
|
95
95
|
attachments?: Attachment[];
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* A @mention of a user in a group message.
|
|
99
|
+
*
|
|
100
|
+
* The mention is stored inline in `content.text` as a self-describing token
|
|
101
|
+
* `@[DisplayName](userId)` (and, for @all, `@[all](all)`). This flat array is a
|
|
102
|
+
* denormalized copy of the mentioned userIds, used for notification fan-out and
|
|
103
|
+
* "who was mentioned" lookups — it is NOT a positional/offset map.
|
|
104
|
+
*
|
|
105
|
+
* The reserved id `"all"` represents an @all mention (server resolves it to every
|
|
106
|
+
* active participant at send time).
|
|
107
|
+
*/
|
|
108
|
+
declare const MENTION_ALL_ID = "all";
|
|
97
109
|
interface ReplyAttachmentSnapshot {
|
|
98
110
|
type: FileType;
|
|
99
111
|
filename: string;
|
|
@@ -139,6 +151,12 @@ interface Message {
|
|
|
139
151
|
senderId: string;
|
|
140
152
|
content: MessageContent;
|
|
141
153
|
replyTo?: MessageReplyReference;
|
|
154
|
+
/**
|
|
155
|
+
* Flat list of mentioned userIds (denormalized from the `@[name](id)` tokens in
|
|
156
|
+
* `content.text`). Contains `"all"` for an @all mention. Used for fan-out and
|
|
157
|
+
* "mentions me" lookups; not a positional map.
|
|
158
|
+
*/
|
|
159
|
+
mentions?: string[];
|
|
142
160
|
reactions: MessageReaction[];
|
|
143
161
|
lastReaction?: LastReaction | null;
|
|
144
162
|
status: MessageStatus;
|
|
@@ -168,6 +186,8 @@ interface Message {
|
|
|
168
186
|
}
|
|
169
187
|
interface Participant {
|
|
170
188
|
userId: string;
|
|
189
|
+
/** External system user ID of the chat user (non-builtin modes). Mirrors `user.externalId`. */
|
|
190
|
+
externalId?: string;
|
|
171
191
|
role: ParticipantRole;
|
|
172
192
|
joinedAt: string;
|
|
173
193
|
isActive?: boolean;
|
|
@@ -379,6 +399,8 @@ interface MessageStarUpdatedEvent {
|
|
|
379
399
|
interface TypingIndicatorEvent {
|
|
380
400
|
conversationId: string;
|
|
381
401
|
userId: string;
|
|
402
|
+
/** External system user ID (non-builtin modes). Absent in builtin mode. */
|
|
403
|
+
externalId?: string;
|
|
382
404
|
username: string;
|
|
383
405
|
displayName: string;
|
|
384
406
|
avatarUrl?: string;
|
|
@@ -414,6 +436,8 @@ interface MessageDeliveredEvent {
|
|
|
414
436
|
}
|
|
415
437
|
interface MessageReceiptEntry {
|
|
416
438
|
userId: string;
|
|
439
|
+
/** External system user ID (non-builtin modes). */
|
|
440
|
+
externalId?: string;
|
|
417
441
|
displayName: string;
|
|
418
442
|
avatarUrl?: string;
|
|
419
443
|
}
|
|
@@ -508,6 +532,8 @@ interface ConversationSyncResponse {
|
|
|
508
532
|
}
|
|
509
533
|
interface ReactionUser {
|
|
510
534
|
userId: string;
|
|
535
|
+
/** External system user ID (non-builtin modes). */
|
|
536
|
+
externalId?: string;
|
|
511
537
|
displayName: string;
|
|
512
538
|
avatarUrl?: string;
|
|
513
539
|
}
|
|
@@ -550,6 +576,8 @@ interface SendMessagePayload {
|
|
|
550
576
|
attachments?: SendMessageAttachment[];
|
|
551
577
|
replyTo?: string;
|
|
552
578
|
tempId: string;
|
|
579
|
+
/** Mentioned userIds (use `"all"` / MENTION_ALL_ID for @all). Derived from the tokens in `text`. */
|
|
580
|
+
mentions?: string[];
|
|
553
581
|
}
|
|
554
582
|
interface QuietHours {
|
|
555
583
|
enabled: boolean;
|
|
@@ -817,4 +845,4 @@ declare function uploadBatchWithSlots(files: UploadableFile[], platformUploadFn:
|
|
|
817
845
|
slotToFile: Map<string, FileResponse>;
|
|
818
846
|
}>;
|
|
819
847
|
|
|
820
|
-
export { type
|
|
848
|
+
export { type MultipartUploadInfo as $, type AuthResponse as A, type BatchUploadResult as B, type CrossConversationSyncResponse as C, type ConversationUpdatedEvent as D, type FileSizeLimits as E, type FileResponse as F, type LastReaction as G, MENTION_ALL_ID as H, type MessageAckEvent as I, type MessageContent as J, type MessageDeletedEvent as K, type LoginCredentials as L, type Message as M, type MessageDeletedForMeEvent as N, type MessageDeliveredEvent as O, type PaginatedResponse as P, type MessageMetadata as Q, type ResolvedCompressionConfig as R, type SendMessagePayload as S, type MessageReaction as T, type User as U, type MessageReceiptEntry as V, type MessageReplyReference as W, type MessageStarUpdatedEvent as X, type MessageUpdatedEvent as Y, type MessagesDeliveredEvent as Z, type MultipartPartUrl as _, type RegisterData as a, type NewMessageEvent as a0, type OptimisticAttachment as a1, type PlatformCompressFn as a2, type PlatformUploadFn as a3, type PlatformUploadPartFn as a4, type QuietHours as a5, type ReactionGroup as a6, type ReactionUpdatedEvent as a7, type ReactionUser as a8, type ReadReceiptEvent as a9, type ReplyAttachmentSnapshot as aa, type ResolvedFileSizeLimits as ab, type SendMessageAttachment as ac, type SyncDeletedForMe as ad, type SyncDeliveredReceipt as ae, type SyncParticipantChange as af, type SyncReactionEntry as ag, type SyncReactions as ah, type SyncReadReceipt as ai, type SyncStarEntry as aj, type SystemMessageMetadata as ak, type TypingIndicatorEvent as al, type UploadConfig as am, type UploadProgress as an, type UserStatusEvent as ao, resolveConfig as ap, storageApi as aq, uploadBatch as ar, uploadBatchWithSlots as as, type AuthTokens as b, type ConversationSyncResponse as c, type AppConfig as d, type CursorPaginatedResponse as e, type MessageReactionsResponse as f, type MessageReceiptsResponse as g, type ConversationListParams as h, type Conversation as i, type Participant as j, type ConversationUnreadCount as k, type UnreadSummary as l, type UserPreferences as m, type ResolvedConfig as n, type PersistStorage as o, type PresignedUrlRequest as p, type PresignedUrlResponse as q, type CompletedPart as r, type FileType as s, type AntzChatConfig as t, type UploadableFile as u, type Attachment as v, type CompressedFile as w, type CompressionAlgorithm as x, type CompressionConfig as y, type ConversationType as z };
|
|
@@ -155,7 +155,7 @@ section.sec>h2:hover{color:#fff}
|
|
|
155
155
|
|
|
156
156
|
<div class="section-label">What's New</div>
|
|
157
157
|
<ul>
|
|
158
|
-
<li><a href="#whats-new">v1.3.
|
|
158
|
+
<li><a href="#whats-new">v1.3.9 Release Notes</a></li>
|
|
159
159
|
</ul>
|
|
160
160
|
|
|
161
161
|
<div class="section-label">Getting Started</div>
|
|
@@ -250,12 +250,77 @@ section.sec>h2:hover{color:#fff}
|
|
|
250
250
|
<h2>What's New</h2>
|
|
251
251
|
<p style="color:var(--muted);font-size:13px;margin-bottom:20px">Version history and release notes. Click a version to expand.</p>
|
|
252
252
|
|
|
253
|
-
<!-- ── v1.3.
|
|
253
|
+
<!-- ── v1.3.9 (current) ── -->
|
|
254
|
+
<div class="wn-version open" id="wn-139">
|
|
255
|
+
<div class="wn-header" onclick="toggleVersion('wn-139')">
|
|
256
|
+
<div class="wn-title">
|
|
257
|
+
<span class="wn-ver">v1.3.9</span>
|
|
258
|
+
<span class="wn-badge current">Current</span>
|
|
259
|
+
<span class="wn-date">July 2026</span>
|
|
260
|
+
</div>
|
|
261
|
+
<span class="wn-chevron">▲</span>
|
|
262
|
+
</div>
|
|
263
|
+
<div class="wn-body">
|
|
264
|
+
<div class="wn-item" id="wn-139-mentions">
|
|
265
|
+
<div class="wn-item-header" onclick="toggleItem('wn-139-mentions')">
|
|
266
|
+
<span class="wn-tag new">New</span>
|
|
267
|
+
<span class="wn-item-title">Group @mentions — tag members, @all (admin-gated), pierces mute</span>
|
|
268
|
+
<span class="wn-chevron-sm">▾</span>
|
|
269
|
+
</div>
|
|
270
|
+
<div class="wn-item-body">
|
|
271
|
+
<p>Tag specific members in a group message, or everyone via <code>@all</code> (server-gated to group admins). A mentioned user is notified <strong>even if they muted the group</strong> — the mention pierces mute — while everyone else follows normal mute rules.</p>
|
|
272
|
+
<p><strong>Storage model.</strong> A mention is stored inline in the message text as a self-describing token <code>@[DisplayName](userId)</code> (and <code>@[all](all)</code> for @all), plus a flat <code>mentions: string[]</code> array on the message (denormalized userIds, <code>'all'</code> for @all). No character offsets are stored — the token is self-locating and survives edits; the embedded name is a render fallback while the current name is resolved live.</p>
|
|
273
|
+
<p><strong>New helpers</strong> (exported from the package root):</p>
|
|
274
|
+
<ul>
|
|
275
|
+
<li><code>buildMentionText(segments)</code> → <code>{ text, mentions }</code> — composer: turn picked members into token text + the id array.</li>
|
|
276
|
+
<li><code>parseMentions(text)</code> → <code>ParsedMention[]</code> — locate tokens.</li>
|
|
277
|
+
<li><code>renderMentionParts(text, resolveName?)</code> → <code>MentionPart[]</code> — split into ordered text/mention parts; <code>resolveName(id, fallbackName)</code> supplies the current display name (handles renames), falling back to the token name for departed users.</li>
|
|
278
|
+
<li><code>extractMentionIds(text)</code> — re-derive the id array after an edit.</li>
|
|
279
|
+
<li><code>isMentionAll(mentions)</code> and <code>MENTION_ALL_ID</code> (<code>'all'</code>).</li>
|
|
280
|
+
</ul>
|
|
281
|
+
<p><strong>Type changes:</strong> <code>Message.mentions?: string[]</code> and <code>SendMessagePayload.mentions?: string[]</code> (both optional). <code>conversationsApi.getMembers()</code> now normalizes participants so <code>user.displayName</code>/<code>avatarUrl</code> arrive consistently — a drop-in name source for a mention picker.</p>
|
|
282
|
+
<p><strong>Backward compatible, additive-only.</strong> An older client viewing a mention shows the readable token text (e.g. <code>@[Alice](…)</code>) rather than crashing; a new client renders a styled <code>@Alice</code>. Requires server support to persist/notify mentions; safe to upgrade regardless. <strong>No integration changes required</strong> unless you build a mention composer/renderer.</p>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
</div><!-- /.wn-version -->
|
|
287
|
+
|
|
288
|
+
<!-- ── v1.3.8 ── -->
|
|
289
|
+
<div class="wn-version open" id="wn-138">
|
|
290
|
+
<div class="wn-header" onclick="toggleVersion('wn-138')">
|
|
291
|
+
<div class="wn-title">
|
|
292
|
+
<span class="wn-ver">v1.3.8</span>
|
|
293
|
+
<span class="wn-date">July 2026</span>
|
|
294
|
+
</div>
|
|
295
|
+
<span class="wn-chevron">▲</span>
|
|
296
|
+
</div>
|
|
297
|
+
<div class="wn-body">
|
|
298
|
+
<div class="wn-item" id="wn-138-externalid">
|
|
299
|
+
<div class="wn-item-header" onclick="toggleItem('wn-138-externalid')">
|
|
300
|
+
<span class="wn-tag new">New</span>
|
|
301
|
+
<span class="wn-item-title">externalId now included on every embedded user, not just the standalone profile</span>
|
|
302
|
+
<span class="wn-chevron-sm">▾</span>
|
|
303
|
+
</div>
|
|
304
|
+
<div class="wn-item-body">
|
|
305
|
+
<p>Previously <code>externalId</code> (a user's ID in your external system, non-builtin modes) was only present on the <code>User</code> returned by <code>usersApi.list/getById/updateProfile</code>. Every <em>denormalized</em> place a user appeared dropped it, forcing a separate <code>usersApi.getById()</code> call to map a chat user back to your own system. These shapes now carry it:</p>
|
|
306
|
+
<ul>
|
|
307
|
+
<li><code>Participant</code> — new top-level <code>externalId?</code>, also mirrored on <code>Participant.user.externalId</code> (conversations API + conversation socket events).</li>
|
|
308
|
+
<li><code>Message.sender</code> — the server now populates <code>externalId</code> on the sender embed.</li>
|
|
309
|
+
<li><code>ReactionUser</code> (<code>messagesApi.getReactions</code>) — new <code>externalId?</code>.</li>
|
|
310
|
+
<li><code>MessageReceiptEntry</code> (<code>messagesApi.getReceipts</code>) — new <code>externalId?</code>.</li>
|
|
311
|
+
<li><code>TypingIndicatorEvent</code> (socket) — new <code>externalId?</code>. Present in non-builtin modes; <strong>absent in builtin mode</strong>, where no external identity exists.</li>
|
|
312
|
+
</ul>
|
|
313
|
+
<p><strong>Backward compatible, additive-only.</strong> Every field is optional. An older SDK against this server ignores the extra field; this SDK against an older server sees <code>externalId</code> as <code>undefined</code>. Note <code>externalId</code> (string, the chat user's external identity) is distinct from the pre-existing <code>Participant.externalUserId</code> (number) — both are sent; do not confuse them. Requires a server with this change to be populated; safe to upgrade regardless. <strong>No integration changes required</strong> — read <code>externalId</code> where you previously had to look it up separately.</p>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
</div><!-- /.wn-version -->
|
|
318
|
+
|
|
319
|
+
<!-- ── v1.3.7 ── -->
|
|
254
320
|
<div class="wn-version open" id="wn-137">
|
|
255
321
|
<div class="wn-header" onclick="toggleVersion('wn-137')">
|
|
256
322
|
<div class="wn-title">
|
|
257
323
|
<span class="wn-ver">v1.3.7</span>
|
|
258
|
-
<span class="wn-badge current">Current</span>
|
|
259
324
|
<span class="wn-date">July 2026</span>
|
|
260
325
|
</div>
|
|
261
326
|
<span class="wn-chevron">▲</span>
|
package/package.json
CHANGED