import { SupabaseClient as SupabaseJSClient } from '@supabase/supabase-js'; /** * Configuration for Supabase client */ export interface SupabaseClientConfig { /** Supabase project URL */ url: string; /** Supabase anonymous key */ anonKey: string; /** Service role key (optional, for admin operations) */ serviceRoleKey?: string; /** Enable retry logic for transient failures */ enableRetry?: boolean; /** Maximum number of retry attempts */ maxRetries?: number; /** Enable debug logging */ debug?: boolean; } /** * Result wrapper for operations */ export interface SupabaseResult { success: boolean; data?: T; error?: string; count?: number; } /** * Query filter options */ export interface QueryFilter { column: string; operator: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'in' | 'is'; value: unknown; } /** * Query options */ export interface QueryOptions { select?: string; filters?: QueryFilter[]; orderBy?: { column: string; ascending?: boolean; }; limit?: number; offset?: number; single?: boolean; } /** * Insert options */ export interface InsertOptions { returning?: boolean; upsert?: boolean; } /** * Update options */ export interface UpdateOptions { returning?: boolean; } /** * Delete options */ export interface DeleteOptions { returning?: boolean; } /** * Storage upload options */ export interface StorageUploadOptions { cacheControl?: string; contentType?: string; upsert?: boolean; } /** * Storage download options */ export interface StorageDownloadOptions { transform?: { width?: number; height?: number; quality?: number; }; } /** * Auth sign in options */ export interface AuthSignInOptions { email: string; password: string; } /** * Auth sign up options */ export interface AuthSignUpOptions { email: string; password: string; options?: { data?: Record; emailRedirectTo?: string; }; } /** * RPC function call options */ export interface RPCOptions { params?: Record; count?: 'exact' | 'planned' | 'estimated'; } /** * Internal wrapped Supabase client */ export interface WrappedSupabaseClient { client: SupabaseJSClient; config: SupabaseClientConfig; }