@@ -12,6 +12,7 @@ import type {
1212 GoogleMeetModeInput ,
1313 GoogleMeetTransport ,
1414} from "./config.js" ;
15+ import { normalizeMeetUrl } from "./meet-url.js" ;
1516import { addGoogleMeetSetupCheck , getGoogleMeetSetupStatus } from "./setup.js" ;
1617import {
1718 isSameMeetUrlForReuse ,
@@ -50,6 +51,8 @@ import {
5051 type VoiceCallGateway ,
5152} from "./voice-call-gateway.js" ;
5253
54+ export { normalizeMeetUrl } from "./meet-url.js" ;
55+
5356type ChromeAudioBridgeResult = NonNullable <
5457 | Awaited < ReturnType < typeof launchChromeMeet > > [ "audioBridge" ]
5558 | Awaited < ReturnType < typeof launchChromeMeetOnNode > > [ "audioBridge" ]
@@ -78,26 +81,6 @@ function buildTwilioVoiceCallSessionKey(meetingSessionId: string): string {
7881 return `voice:google-meet:${ meetingSessionId } ` ;
7982}
8083
81- export function normalizeMeetUrl ( input : unknown ) : string {
82- const raw = normalizeOptionalString ( input ) ;
83- if ( ! raw ) {
84- throw new Error ( "url required" ) ;
85- }
86- let url : URL ;
87- try {
88- url = new URL ( raw ) ;
89- } catch {
90- throw new Error ( "url must be a valid Google Meet URL" ) ;
91- }
92- if ( url . protocol !== "https:" || url . hostname . toLowerCase ( ) !== "meet.google.com" ) {
93- throw new Error ( "url must be an explicit https://meet.google.com/... URL" ) ;
94- }
95- if ( ! / ^ \/ [ a - z ] { 3 } - [ a - z ] { 4 } - [ a - z ] { 3 } (?: $ | [ / ? # ] ) / i. test ( url . pathname ) ) {
96- throw new Error ( "url must include a Google Meet meeting code" ) ;
97- }
98- return url . toString ( ) ;
99- }
100-
10184function resolveTransport ( input : GoogleMeetTransport | undefined , config : GoogleMeetConfig ) {
10285 return input ?? config . defaultTransport ;
10386}
0 commit comments