@antzsoft/chat-core 1.3.7 → 1.3.8

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 CHANGED
@@ -2656,6 +2656,7 @@ Returned by `messagesApi.getReceipts()`. Use as the initial load for a "Read by
2656
2656
  ```typescript
2657
2657
  interface MessageReceiptEntry {
2658
2658
  userId: string;
2659
+ externalId?: string; // external system user ID (non-builtin modes)
2659
2660
  displayName: string;
2660
2661
  avatarUrl?: string;
2661
2662
  }
@@ -2685,6 +2686,7 @@ Returned by `messagesApi.getReactions()`. Use as the data source for a reactions
2685
2686
  ```typescript
2686
2687
  interface ReactionUser {
2687
2688
  userId: string;
2689
+ externalId?: string; // external system user ID (non-builtin modes)
2688
2690
  displayName: string;
2689
2691
  avatarUrl?: string;
2690
2692
  }
@@ -2801,6 +2803,7 @@ interface MessageConfig {
2801
2803
  ```typescript
2802
2804
  interface Participant {
2803
2805
  userId: string;
2806
+ externalId?: string; // external system user ID (non-builtin modes); mirrored on user.externalId
2804
2807
  role: 'admin' | 'member';
2805
2808
  joinedAt: string;
2806
2809
  isActive?: boolean;
@@ -2893,6 +2896,7 @@ interface ReactionUpdatedEvent {
2893
2896
  interface TypingIndicatorEvent {
2894
2897
  conversationId: string;
2895
2898
  userId: string;
2899
+ externalId?: string; // external system user ID (non-builtin modes); absent in builtin mode
2896
2900
  username: string;
2897
2901
  displayName: string;
2898
2902
  avatarUrl?: string;
@@ -3056,6 +3060,18 @@ document.querySelectorAll('[data-conv-id]').forEach((el) => {
3056
3060
 
3057
3061
  ## Changelog
3058
3062
 
3063
+ ### v1.3.8
3064
+
3065
+ - **`externalId` now surfaced on every embedded user shape, not just the standalone user profile.** Previously `externalId` (the user's ID in your external system, non-builtin modes) was only present on `User` returned from `usersApi.list/getById/updateProfile`. Every *denormalized* place a user appeared — conversation participants, message sender, reaction users, and read/delivery receipts — dropped it, forcing a separate `usersApi.getById()` call to map a chat user back to your own system. Those shapes now carry `externalId`:
3066
+
3067
+ - **`Participant`** — new top-level `externalId?` field, also mirrored onto `Participant.user.externalId`. (`conversationsApi` + conversation socket events.)
3068
+ - **`Message.sender`** — now includes `externalId` (it is a `User`, so the field was always in the type; the server now populates it on the embed).
3069
+ - **`ReactionUser`** (`messagesApi.getReactions`) — new `externalId?`.
3070
+ - **`MessageReceiptEntry`** (`messagesApi.getReceipts`) — new `externalId?`.
3071
+ - **`TypingIndicatorEvent`** (socket) — new `externalId?`. Present in non-builtin modes; **absent in builtin mode**, where no external identity exists.
3072
+
3073
+ **Backward compatible, additive-only.** Every field is optional (`externalId?`). An older SDK against this server simply ignores the extra field; this SDK against an older server sees `externalId` as `undefined`. Note `externalId` (a string, the chat user's external identity) is distinct from the pre-existing `Participant`-level `externalUserId` (a number) — both are sent; do not confuse them. Requires server v-with-this-change or newer to be populated; safe to upgrade regardless. **No integration changes required** — read `externalId` where you previously had to look it up separately.
3074
+
3059
3075
  ### v1.3.7
3060
3076
 
3061
3077
  - **Docs only — no code changes.** Brought the docs fully up to date: added the missing
package/dist/index.cjs CHANGED
@@ -1105,11 +1105,13 @@ function normalizeParticipant(p) {
1105
1105
  const hasUserDetails = p.displayName || p.username || p.avatarUrl;
1106
1106
  return {
1107
1107
  userId: p.userId,
1108
+ externalId: p.externalId ?? p.user?.externalId,
1108
1109
  role: p.role,
1109
1110
  joinedAt: p.joinedAt,
1110
1111
  isActive: p.isActive,
1111
1112
  user: hasUserDetails ? {
1112
1113
  id: p.userId,
1114
+ externalId: p.externalId,
1113
1115
  tenantId: "",
1114
1116
  email: "",
1115
1117
  username: p.username ?? "",