This commit is contained in:
2026-04-18 23:11:35 +02:00
commit f7cfd2a86e
196 changed files with 35538 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import type { AppSupabaseClient } from '../supabase/client.js';
export * from './attachments.js';
export * from './conversations.js';
export * from './groups.js';
export * from './messages.js';
export * from './types.js';
// ----- RPC wrappers ---------------------------------------------------------
export async function createDm(
client: AppSupabaseClient,
targetUserId: string,
): Promise<string> {
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<void> {
const { error } = await client.rpc('accept_dm', { conversation_id: conversationId });
if (error) throw error;
}