UNPKG

@adventurelabs/scout-core

Version:

Core utilities and helpers for Adventure Labs Scout applications

21 lines (20 loc) 1.47 kB
import { SupabaseClient } from "@supabase/supabase-js"; import { Database } from "../types/supabase"; /** * Generates a signed URL for a file in Supabase storage * @param filePath - The path to the file in storage (e.g., "events/123/image.jpg") * @param expiresIn - Number of seconds until the URL expires (default: 3600 = 1 hour) * @param supabaseClient - Optional Supabase client (will create new one if not provided) * @returns Promise<string | null> - The signed URL or null if error */ export declare function generateSignedUrl(filePath: string, expiresIn?: number, supabaseClient?: SupabaseClient<Database>): Promise<string | null>; export declare function generateSignedUrlsBatch(filePaths: string[], expiresIn?: number, supabaseClient?: SupabaseClient<Database>): Promise<Map<string, string | null>>; export declare function addSignedUrlsToEventsBatch(events: any[], supabaseClient?: SupabaseClient<Database>): Promise<any[]>; export declare function addSignedUrlsToEvents(events: any[], supabaseClient?: SupabaseClient<Database>): Promise<any[]>; /** * Generates a signed URL for a single event and sets it as media_url * @param event - Event object that may have file_path * @param supabaseClient - Optional Supabase client (will create new one if not provided) * @returns Promise<Object> - Event with signed URL set as media_url */ export declare function addSignedUrlToEvent(event: any, supabaseClient?: SupabaseClient<Database>): Promise<any>;