@ai-matrx/meet 0.11.0 → 0.11.2

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.js CHANGED
@@ -1986,6 +1986,18 @@ function createMeetRepository(options) {
1986
1986
  );
1987
1987
  }
1988
1988
  }
1989
+ async function withRunNoteTaker(meeting) {
1990
+ const response = await db.from(TABLES.sessions).select("note_taker,started_at").eq("meeting_id", meeting.id).order("started_at", { ascending: false }).limit(1);
1991
+ const run = response.error === null ? (response.data ?? [])[0] : void 0;
1992
+ const noteTaker = run?.["note_taker"];
1993
+ if (typeof noteTaker !== "object" || noteTaker === null || Array.isArray(noteTaker)) {
1994
+ return meeting;
1995
+ }
1996
+ return {
1997
+ ...meeting,
1998
+ metadata: { ...meeting.metadata ?? {}, note_taker: noteTaker }
1999
+ };
2000
+ }
1989
2001
  return {
1990
2002
  schema: MEET_SCHEMA,
1991
2003
  tables: TABLES,
@@ -2224,13 +2236,13 @@ function createMeetRepository(options) {
2224
2236
  "meet.meetingBySlug",
2225
2237
  () => db.rpc(RPCS.meetingBySlug, { p_slug: slug })
2226
2238
  );
2227
- return projectMeeting(row);
2239
+ return withRunNoteTaker(projectMeeting(row));
2228
2240
  },
2229
2241
  async meeting(id) {
2230
2242
  const response = await db.from(TABLES.meetings).select(MEETING_COLUMNS).eq("id", id).single();
2231
2243
  if (response.error !== null) throw normalizeMeetError(response.error, "meet.meeting");
2232
2244
  if (response.data === null) throw invalidResponse("meet.meeting", "no such meeting");
2233
- return projectMeeting(response.data);
2245
+ return withRunNoteTaker(projectMeeting(response.data));
2234
2246
  },
2235
2247
  async listMeetings({ organizationId = null, limit = 25, before = null }) {
2236
2248
  let query = db.from(TABLES.meetings).select(MEETING_COLUMNS);