@ai-matrx/messaging 0.6.0 → 0.8.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/react.cjs CHANGED
@@ -39,6 +39,7 @@ __export(react_exports, {
39
39
  EmptyState: () => EmptyState,
40
40
  LinkIcon: () => LinkIcon,
41
41
  MESSAGING_EVENTS: () => MESSAGING_EVENTS,
42
+ MESSAGING_RPC_SCHEMA: () => MESSAGING_RPC_SCHEMA,
42
43
  MESSAGING_SCHEMA: () => MESSAGING_SCHEMA,
43
44
  MessageActionChips: () => MessageActionChips,
44
45
  MessageBubble: () => MessageBubble,
@@ -748,11 +749,13 @@ function projectParticipants(value, operation) {
748
749
  for (const entry of value) {
749
750
  if (typeof entry !== "object" || entry === null) continue;
750
751
  const record = entry;
751
- const id = str(record, "user_id") ?? str(record, "id");
752
+ const nested = typeof record["user"] === "object" && record["user"] !== null ? record["user"] : {};
753
+ const id = str(record, "user_id") ?? str(nested, "user_id") ?? str(record, "id");
752
754
  if (id === null) continue;
753
755
  summaries.push(
754
756
  projectUserSummary({
755
757
  ...record,
758
+ ...nested,
756
759
  user_id: id
757
760
  })
758
761
  );
@@ -1448,6 +1451,7 @@ function createReadCache(options) {
1448
1451
 
1449
1452
  // src/core/repository.ts
1450
1453
  var MESSAGING_SCHEMA = "communication";
1454
+ var MESSAGING_RPC_SCHEMA = "public";
1451
1455
  var TABLES = {
1452
1456
  conversations: "dm_conversations",
1453
1457
  participants: "dm_conversation_participants",
@@ -1482,6 +1486,7 @@ function createMessagingRepository(options) {
1482
1486
  ...options.now !== void 0 ? { now: options.now } : {}
1483
1487
  });
1484
1488
  const db = () => client.schema(MESSAGING_SCHEMA);
1489
+ const rpcDb = () => client.schema(MESSAGING_RPC_SCHEMA);
1485
1490
  async function withSessionRetry(operation, run) {
1486
1491
  try {
1487
1492
  return await run();
@@ -1499,7 +1504,7 @@ function createMessagingRepository(options) {
1499
1504
  }
1500
1505
  }
1501
1506
  async function rpc(fn, args, operation) {
1502
- const { data, error } = await db().rpc(fn, args);
1507
+ const { data, error } = await rpcDb().rpc(fn, args);
1503
1508
  if (error !== null) throw normalizeMessagingError(error, operation);
1504
1509
  return data;
1505
1510
  }