export type MeetingAttendee = {email?: string | undefined, isInternal?: boolean | undefined, name?: string | undefined}; export type UserProvidedTranscriptSegment = {speaker?: ({name?: string | undefined}) | undefined, text: string, timestampSeconds: number}; export type UserProvidedTranscript = {segments: Array}; export type UserProvidedMeeting = {id?: string | undefined, title: string, callUrl?: string | undefined, recordingUrl?: string | undefined, startTime: string, endTime: string, host: {name: string, email: string}, attendees?: Array | undefined, salesforceAccountId?: string | undefined, salesforceOpportunityId?: string | undefined, transcript?: UserProvidedTranscript | undefined}; export type UserProvidedMeetingBody = {meeting: UserProvidedMeeting, processImportedMeeting: boolean}; export type CreateApiUserProvidedMeetingArgs = {body: UserProvidedMeetingBody}; export type CreateApiUserProvidedMeetingOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Ingest a meeting from any source * * POST /user-provided-meeting */ export const createApiUserProvidedMeeting = async (args: CreateApiUserProvidedMeetingArgs, options?: CreateApiUserProvidedMeetingOptions) => { const {baseUrl = "https://api.momentum.io", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("X-API-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/user-provided-meeting${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };