@ai-matrx/meet 0.11.0 → 0.11.1

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
@@ -2629,6 +2629,18 @@ function createMeetRepository(options) {
2629
2629
  );
2630
2630
  }
2631
2631
  }
2632
+ async function withRunNoteTaker(meeting) {
2633
+ const response = await db.from(TABLES.sessions).select("note_taker,started_at").eq("meeting_id", meeting.id).order("started_at", { ascending: false }).limit(1);
2634
+ const run = response.error === null ? (response.data ?? [])[0] : void 0;
2635
+ const noteTaker = run?.["note_taker"];
2636
+ if (typeof noteTaker !== "object" || noteTaker === null || Array.isArray(noteTaker)) {
2637
+ return meeting;
2638
+ }
2639
+ return {
2640
+ ...meeting,
2641
+ metadata: { ...meeting.metadata ?? {}, note_taker: noteTaker }
2642
+ };
2643
+ }
2632
2644
  return {
2633
2645
  schema: MEET_SCHEMA,
2634
2646
  tables: TABLES,
@@ -2867,13 +2879,13 @@ function createMeetRepository(options) {
2867
2879
  "meet.meetingBySlug",
2868
2880
  () => db.rpc(RPCS.meetingBySlug, { p_slug: slug })
2869
2881
  );
2870
- return projectMeeting(row);
2882
+ return withRunNoteTaker(projectMeeting(row));
2871
2883
  },
2872
2884
  async meeting(id) {
2873
2885
  const response = await db.from(TABLES.meetings).select(MEETING_COLUMNS).eq("id", id).single();
2874
2886
  if (response.error !== null) throw normalizeMeetError(response.error, "meet.meeting");
2875
2887
  if (response.data === null) throw invalidResponse("meet.meeting", "no such meeting");
2876
- return projectMeeting(response.data);
2888
+ return withRunNoteTaker(projectMeeting(response.data));
2877
2889
  },
2878
2890
  async listMeetings({ organizationId = null, limit = 25, before = null }) {
2879
2891
  let query = db.from(TABLES.meetings).select(MEETING_COLUMNS);