Google Meet: queue a conference import when its transcript is ready

Merged
EH
2d ago
+379-6

Context

Follows https://github.com/twentyhq/twenty/pull/30607 in the Google Meet app series started in https://github.com/twentyhq/twenty/pull/30587.

Each connected Google account now has a Meet event subscription (https://github.com/twentyhq/twenty/pull/30604). When a transcript is ready, Google sends a google.workspace.meet.transcript.v2.fileGenerated event. This PR adds the function that handles that event inside the workspace. The server route that receives the event and forwards it here is the next PR, so nothing calls this function yet.

What this PR does

  • Adds the google-meet-handle-event logic function. It receives the subscription name, the event type and the transcript name. For a transcript event it finds the connection that owns the subscription, reads the conference from Google (the import job needs its start, end and space) and queues the existing google-meet-import-conference job.
  • The job id is derived from the transcript name, so a delivery Pub/Sub repeats does not start a second import, while a second transcript of the same conference does.
  • Other event types are ignored, and an event for a subscription no connection owns is skipped.
  • Adds getGoogleMeetConferenceRecord, getConferenceRecordNameFromTranscriptName and buildGoogleMeetTranscriptImportJob, and moves the import job payload into buildGoogleMeetConferenceImportPayload, shared with the existing per-conference job builder.

Checks

  • yarn lint, yarn typecheck, yarn test:unit (124 tests) and twenty app build pass locally.
  • Not run: integration tests (they need a running server, CI runs them), and no real event from Google was handled.