/** * Supabase Client * * Connects to senken.pro Supabase for Decibel Studio Cloud Spine. * Uses environment variables for configuration. * * Environment: * SUPABASE_URL - Supabase project URL * SUPABASE_ANON_KEY - Supabase anon/public key * SUPABASE_SERVICE_KEY - Optional service role key for admin operations */ import { SupabaseClient } from '@supabase/supabase-js'; export interface Project { id: string; owner_id: string; name: string; description: string | null; created_at: string; updated_at: string; deleted_at: string | null; } export interface Artifact { id: string; project_id: string; schema_version: string; type: 'image' | 'video' | '3d' | 'audio' | 'text'; status: 'generating' | 'partial' | 'complete' | 'failed'; progress: number | null; platform: 'ios' | 'web' | 'claude-code' | 'macos' | 'android'; app_version: string; package_url: string | null; package_sha256: string | null; prompt: string | null; model: string | null; provider: string | null; parent_artifact_id: string | null; workflow_id: string | null; workflow_step_id: string | null; tags: string[]; is_pinned: boolean; rating: number | null; created_at: string; updated_at: string; deleted_at: string | null; } export interface ArtifactFile { id: string; artifact_id: string; path: string; role: 'preview' | 'render' | 'variant' | 'thumbnail'; mime_type: string; bytes: number; sha256: string; width: number | null; height: number | null; storage_url: string | null; created_at: string; } export interface Device { id: string; user_id: string; name: string; platform: 'ios' | 'web' | 'claude-code' | 'macos' | 'android'; capabilities: Record; push_token: string | null; last_seen_at: string; created_at: string; } export interface Event { seq: number; project_id: string; type: string; payload: Record; device_id: string | null; created_at: string; } export interface Job { id: string; owner_id: string; target_device_id: string | null; claimed_by_device_id: string | null; workflow_id: string | null; project_id: string | null; inputs: Record; status: 'pending' | 'claimed' | 'running' | 'complete' | 'failed' | 'cancelled'; progress: number | null; error_message: string | null; result_artifact_id: string | null; created_at: string; updated_at: string; claimed_at: string | null; completed_at: string | null; expires_at: string | null; } /** * Get the Supabase client (anon key - respects RLS) */ export declare function getSupabaseClient(): SupabaseClient; /** * Get the Supabase service client (service role key - bypasses RLS) * Use only for admin operations that require elevated privileges. */ export declare function getSupabaseServiceClient(): SupabaseClient; /** * Check if Supabase is configured (for service-level operations like voice inbox) * Requires URL and SERVICE_KEY for server-side writes */ export declare function isSupabaseConfigured(): boolean; /** * Set access token for user-scoped requests */ export declare function setAccessToken(token: string): Promise; export interface SupabaseError { error: string; code: string; details?: string; } export declare function isSupabaseError(result: unknown): result is SupabaseError; export declare function formatSupabaseError(error: { message: string; code?: string; }): SupabaseError; //# sourceMappingURL=supabase.d.ts.map