UNPKG

@daveyplate/supabase-swr-entities

Version:

An entity management library for Supabase and SWR

13 lines (12 loc) 740 B
import { AuthError, PostgrestError, SupabaseClient, User } from '@supabase/supabase-js'; import { IncomingHttpHeaders } from 'http'; import { HTTP_METHOD } from 'next/dist/server/web/http'; export declare const METHOD_MAP: Record<HTTP_METHOD, string>; export declare function authorizeUser(supabase: SupabaseClient, headers: IncomingHttpHeaders): Promise<{ user?: User | Record<string, any>; error?: PostgrestError | AuthError; }>; export declare function authorizeParams(supabase: SupabaseClient, method: HTTP_METHOD, headers: IncomingHttpHeaders, params: Record<string, any>, entitySchema: Record<string, any>, admin?: boolean): Promise<{ user?: User | Record<string, any>; error?: PostgrestError | AuthError | Error; }>;