import type { AppSupabaseClient } from '../supabase/client'; export * from './attachments'; export * from './conversations'; export * from './convKeys'; export * from './groups'; export * from './messages'; export * from './types'; export * from './userKeyMigration'; export * from './pinnedMessages'; export * from './mentions'; export * from './viewOnceAttachments'; export * from './whiteboards'; export * from './soundboards'; export * from './watchTogether'; export * from './games'; // ----- RPC wrappers --------------------------------------------------------- export async function createDm( client: AppSupabaseClient, targetUserId: string, ): Promise { const { data, error } = await client.rpc('create_dm', { target_user_id: targetUserId }); if (error) throw error; if (typeof data !== 'string') throw new Error('create_dm returned non-uuid'); return data; } export async function acceptDm( client: AppSupabaseClient, conversationId: string, ): Promise { const { error } = await client.rpc('accept_dm', { conversation_id: conversationId }); if (error) throw error; }