Skip to content

web


web / lib/supabase / supabase

Variable: supabase

const supabase: SupabaseClient<Database, "public", "public", { CompositeTypes: { }; Enums: { }; Functions: { get_listings_with_saved_status: { Args: { auth_user: string; }; Returns: object[]; }; }; Tables: { addresses: { Insert: { address_line_1?: string | null; address_line_2?: string | null; city?: string | null; country?: string | null; id?: number; latitude?: number | null; longitude?: number | null; postal_code?: string | null; state?: string | null; zip_code?: string | null; }; Relationships: []; Row: { address_line_1: string | null; address_line_2: string | null; city: string | null; country: string | null; id: number; latitude: number | null; longitude: number | null; postal_code: string | null; state: string | null; zip_code: string | null; }; Update: { address_line_1?: string | null; address_line_2?: string | null; city?: string | null; country?: string | null; id?: number; latitude?: number | null; longitude?: number | null; postal_code?: string | null; state?: string | null; zip_code?: string | null; }; }; businesses: { Insert: { address_id?: number | null; all_financials_verified?: boolean | null; audited?: boolean | null; business_hours?: string | null; confidential_sale?: boolean | null; customer_type?: string | null; description?: string | null; ebitda?: number | null; gross_margin?: number | null; id?: number; is_online_listing?: boolean | null; market?: string | null; monthly_recurring_revenue?: number | null; naics_code?: string | null; name?: string | null; number_of_employees?: number | null; number_of_managers?: number | null; number_of_owners?: number | null; ownership_type?: string | null; pcs_code?: string | null; physical_location?: string | null; reason_for_sale?: string | null; requires_daily_owner_involvement?: boolean | null; ttm_gross_profit?: number | null; ttm_pre_tax_net_income?: number | null; ttm_revenue?: number | null; type_of_sale?: string | null; website?: string | null; will_stay_post_sale?: boolean | null; yearly_growth_rate?: string | null; years_in_business?: number | null; years_in_operation?: number | null; }; Relationships: [{ columns: ["address_id"]; foreignKeyName: "businesses_address_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "addresses"; }, { columns: ["address_id"]; foreignKeyName: "businesses_address_id_fkey"; isOneToOne: false; referencedColumns: ["address_id"]; referencedRelation: "listings_with_address"; }]; Row: { address_id: number | null; all_financials_verified: boolean | null; audited: boolean | null; business_hours: string | null; confidential_sale: boolean | null; customer_type: string | null; description: string | null; ebitda: number | null; gross_margin: number | null; id: number; is_online_listing: boolean | null; market: string | null; monthly_recurring_revenue: number | null; naics_code: string | null; name: string | null; number_of_employees: number | null; number_of_managers: number | null; number_of_owners: number | null; ownership_type: string | null; pcs_code: string | null; physical_location: string | null; reason_for_sale: string | null; requires_daily_owner_involvement: boolean | null; ttm_gross_profit: number | null; ttm_pre_tax_net_income: number | null; ttm_revenue: number | null; type_of_sale: string | null; website: string | null; will_stay_post_sale: boolean | null; yearly_growth_rate: string | null; years_in_business: number | null; years_in_operation: number | null; }; Update: { address_id?: number | null; all_financials_verified?: boolean | null; audited?: boolean | null; business_hours?: string | null; confidential_sale?: boolean | null; customer_type?: string | null; description?: string | null; ebitda?: number | null; gross_margin?: number | null; id?: number; is_online_listing?: boolean | null; market?: string | null; monthly_recurring_revenue?: number | null; naics_code?: string | null; name?: string | null; number_of_employees?: number | null; number_of_managers?: number | null; number_of_owners?: number | null; ownership_type?: string | null; pcs_code?: string | null; physical_location?: string | null; reason_for_sale?: string | null; requires_daily_owner_involvement?: boolean | null; ttm_gross_profit?: number | null; ttm_pre_tax_net_income?: number | null; ttm_revenue?: number | null; type_of_sale?: string | null; website?: string | null; will_stay_post_sale?: boolean | null; yearly_growth_rate?: string | null; years_in_business?: number | null; years_in_operation?: number | null; }; }; buyers: { Insert: { buyer_type?: string | null; created_at?: string; id?: number; interested_locations?: string[] | null; interested_markets?: string[] | null; investment_range?: number[] | null; ownership?: string | null; reason_for_buying?: string | null; revenue_range?: number[] | null; risk_tolerance?: string | null; timeline?: string | null; user_id?: number | null; }; Relationships: [{ columns: ["user_id"]; foreignKeyName: "buyers_user_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "users"; }]; Row: { buyer_type: string | null; created_at: string; id: number; interested_locations: string[] | null; interested_markets: string[] | null; investment_range: number[] | null; ownership: string | null; reason_for_buying: string | null; revenue_range: number[] | null; risk_tolerance: string | null; timeline: string | null; user_id: number | null; }; Update: { buyer_type?: string | null; created_at?: string; id?: number; interested_locations?: string[] | null; interested_markets?: string[] | null; investment_range?: number[] | null; ownership?: string | null; reason_for_buying?: string | null; revenue_range?: number[] | null; risk_tolerance?: string | null; timeline?: string | null; user_id?: number | null; }; }; documents: { Insert: { business_id?: number | null; document_name?: string | null; document_type?: string | null; file_path?: string | null; id?: number; uploaded_at?: string | null; }; Relationships: [{ columns: ["business_id"]; foreignKeyName: "documents_business_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "businesses"; }, { columns: ["business_id"]; foreignKeyName: "documents_business_id_fkey"; isOneToOne: false; referencedColumns: ["business_id"]; referencedRelation: "listings_with_address"; }]; Row: { business_id: number | null; document_name: string | null; document_type: string | null; file_path: string | null; id: number; uploaded_at: string | null; }; Update: { business_id?: number | null; document_name?: string | null; document_type?: string | null; file_path?: string | null; id?: number; uploaded_at?: string | null; }; }; listing_images: { Insert: { id?: number; image_path?: string | null; listing_id?: number | null; }; Relationships: [{ columns: ["listing_id"]; foreignKeyName: "listing_images_listing_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "listings"; }, { columns: ["listing_id"]; foreignKeyName: "listing_images_listing_id_fkey"; isOneToOne: false; referencedColumns: ["listing_id"]; referencedRelation: "listings_with_address"; }]; Row: { id: number; image_path: string | null; listing_id: number | null; }; Update: { id?: number; image_path?: string | null; listing_id?: number | null; }; }; listings: { Insert: { additional_details?: string | null; badges?: string[] | null; business_id?: number | null; contact_company?: string | null; contact_email?: string | null; contact_method?: string | null; contact_name?: string | null; contact_phone?: string | null; contact_role?: string | null; date_established?: string | null; deal_closing_confirmed?: boolean | null; deal_type?: string | null; desired_selling_price?: string | null; engagement_letter_signed?: boolean | null; has_valuation_firm?: boolean | null; id?: number; is_public?: boolean | null; keywords?: string[] | null; listed_at?: string | null; org_id?: number | null; preferred_contact?: string | null; private_listing?: boolean | null; show_valuation_estimate?: boolean | null; status?: string | null; timeframe_to_sell?: string | null; user_id?: number | null; valuation_estimate?: string | null; views?: number | null; }; Relationships: [{ columns: ["business_id"]; foreignKeyName: "listings_business_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "businesses"; }, { columns: ["business_id"]; foreignKeyName: "listings_business_id_fkey"; isOneToOne: false; referencedColumns: ["business_id"]; referencedRelation: "listings_with_address"; }, { columns: ["org_id"]; foreignKeyName: "listings_org_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "organizations"; }, { columns: ["user_id"]; foreignKeyName: "listings_user_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "users"; }]; Row: { additional_details: string | null; badges: string[] | null; business_id: number | null; contact_company: string | null; contact_email: string | null; contact_method: string | null; contact_name: string | null; contact_phone: string | null; contact_role: string | null; date_established: string | null; deal_closing_confirmed: boolean | null; deal_type: string | null; desired_selling_price: string | null; engagement_letter_signed: boolean | null; has_valuation_firm: boolean | null; id: number; is_public: boolean | null; keywords: string[] | null; listed_at: string | null; org_id: number | null; preferred_contact: string | null; private_listing: boolean | null; show_valuation_estimate: boolean | null; status: string | null; timeframe_to_sell: string | null; user_id: number | null; valuation_estimate: string | null; views: number | null; }; Update: { additional_details?: string | null; badges?: string[] | null; business_id?: number | null; contact_company?: string | null; contact_email?: string | null; contact_method?: string | null; contact_name?: string | null; contact_phone?: string | null; contact_role?: string | null; date_established?: string | null; deal_closing_confirmed?: boolean | null; deal_type?: string | null; desired_selling_price?: string | null; engagement_letter_signed?: boolean | null; has_valuation_firm?: boolean | null; id?: number; is_public?: boolean | null; keywords?: string[] | null; listed_at?: string | null; org_id?: number | null; preferred_contact?: string | null; private_listing?: boolean | null; show_valuation_estimate?: boolean | null; status?: string | null; timeframe_to_sell?: string | null; user_id?: number | null; valuation_estimate?: string | null; views?: number | null; }; }; organization_codes: { Insert: { code?: string | null; created_at?: string; expires_at?: string; id?: number; invited_email?: string | null; inviter_user_id?: number | null; org_id?: number | null; }; Relationships: [{ columns: ["inviter_user_id"]; foreignKeyName: "organization_codes_inviter_user_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "users"; }, { columns: ["org_id"]; foreignKeyName: "organization_codes_org_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "organizations"; }]; Row: { code: string | null; created_at: string; expires_at: string; id: number; invited_email: string | null; inviter_user_id: number | null; org_id: number | null; }; Update: { code?: string | null; created_at?: string; expires_at?: string; id?: number; invited_email?: string | null; inviter_user_id?: number | null; org_id?: number | null; }; }; organization_members: { Insert: { can_invite?: boolean | null; created_at?: string; id?: number; joined_at?: string | null; org_id?: number | null; role?: string | null; user_id?: number | null; }; Relationships: [{ columns: ["org_id"]; foreignKeyName: "organization_members_org_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "organizations"; }, { columns: ["user_id"]; foreignKeyName: "organization_members_user_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "users"; }]; Row: { can_invite: boolean | null; created_at: string; id: number; joined_at: string | null; org_id: number | null; role: string | null; user_id: number | null; }; Update: { can_invite?: boolean | null; created_at?: string; id?: number; joined_at?: string | null; org_id?: number | null; role?: string | null; user_id?: number | null; }; }; organizations: { Insert: { address_id?: number | null; average_deal_size?: number[] | null; brokerage?: string | null; contact_email?: string | null; created_at?: string; description?: string | null; id?: number; industries?: string[] | null; licenses_certs?: string[] | null; locations?: string[] | null; master_user_id?: number | null; naics_code?: string | null; name?: string | null; phone_number?: number | null; plan_id?: string | null; subscription_id?: number | null; url?: string | null; years_of_experience?: string | null; }; Relationships: [{ columns: ["address_id"]; foreignKeyName: "organizations_address_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "addresses"; }, { columns: ["address_id"]; foreignKeyName: "organizations_address_id_fkey"; isOneToOne: false; referencedColumns: ["address_id"]; referencedRelation: "listings_with_address"; }, { columns: ["master_user_id"]; foreignKeyName: "organizations_master_user_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "users"; }, { columns: ["plan_id"]; foreignKeyName: "organizations_plan_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "subscription_plans"; }, { columns: ["subscription_id"]; foreignKeyName: "organizations_subscription_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "subscriptions"; }]; Row: { address_id: number | null; average_deal_size: number[] | null; brokerage: string | null; contact_email: string | null; created_at: string; description: string | null; id: number; industries: string[] | null; licenses_certs: string[] | null; locations: string[] | null; master_user_id: number | null; naics_code: string | null; name: string | null; phone_number: number | null; plan_id: string | null; subscription_id: number | null; url: string | null; years_of_experience: string | null; }; Update: { address_id?: number | null; average_deal_size?: number[] | null; brokerage?: string | null; contact_email?: string | null; created_at?: string; description?: string | null; id?: number; industries?: string[] | null; licenses_certs?: string[] | null; locations?: string[] | null; master_user_id?: number | null; naics_code?: string | null; name?: string | null; phone_number?: number | null; plan_id?: string | null; subscription_id?: number | null; url?: string | null; years_of_experience?: string | null; }; }; product_purchases: { Insert: { amount_paid?: number | null; currency?: string | null; id?: number; payment_status?: string | null; product_id?: number | null; purchased_at?: string | null; stripe_session_id?: string | null; user_id?: number | null; }; Relationships: [{ columns: ["product_id"]; foreignKeyName: "product_purchases_product_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "products"; }, { columns: ["user_id"]; foreignKeyName: "product_purchases_user_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "users"; }]; Row: { amount_paid: number | null; currency: string | null; id: number; payment_status: string | null; product_id: number | null; purchased_at: string | null; stripe_session_id: string | null; user_id: number | null; }; Update: { amount_paid?: number | null; currency?: string | null; id?: number; payment_status?: string | null; product_id?: number | null; purchased_at?: string | null; stripe_session_id?: string | null; user_id?: number | null; }; }; products: { Insert: { category: string; created_at?: string | null; description?: string | null; id?: number; locked?: boolean | null; name: string; popular?: boolean | null; preview_available?: boolean | null; price: number; stripe_price_id?: string | null; tags?: string | null; updated_at?: string | null; }; Relationships: []; Row: { category: string; created_at: string | null; description: string | null; id: number; locked: boolean | null; name: string; popular: boolean | null; preview_available: boolean | null; price: number; stripe_price_id: string | null; tags: string | null; updated_at: string | null; }; Update: { category?: string; created_at?: string | null; description?: string | null; id?: number; locked?: boolean | null; name?: string; popular?: boolean | null; preview_available?: boolean | null; price?: number; stripe_price_id?: string | null; tags?: string | null; updated_at?: string | null; }; }; saved: { Insert: { id?: number; listing_id?: number | null; user_id?: number | null; }; Relationships: [{ columns: ["listing_id"]; foreignKeyName: "favorites_listing_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "listings"; }, { columns: ["listing_id"]; foreignKeyName: "favorites_listing_id_fkey"; isOneToOne: false; referencedColumns: ["listing_id"]; referencedRelation: "listings_with_address"; }, { columns: ["user_id"]; foreignKeyName: "favorites_user_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "users"; }]; Row: { id: number; listing_id: number | null; user_id: number | null; }; Update: { id?: number; listing_id?: number | null; user_id?: number | null; }; }; sellers: { Insert: { business_count?: number | null; business_role?: string | null; created_at?: string; has_sold_before?: boolean | null; id?: number; user_id?: number | null; years_owned?: number | null; }; Relationships: [{ columns: ["user_id"]; foreignKeyName: "sellers_user_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "users"; }]; Row: { business_count: number | null; business_role: string | null; created_at: string; has_sold_before: boolean | null; id: number; user_id: number | null; years_owned: number | null; }; Update: { business_count?: number | null; business_role?: string | null; created_at?: string; has_sold_before?: boolean | null; id?: number; user_id?: number | null; years_owned?: number | null; }; }; subscription_plans: { Insert: { active?: boolean | null; created_at?: string; description?: string | null; displayed_features?: Json; features?: Json; id: string; most_popular?: boolean | null; name?: string | null; price?: number | null; stripe_price_id: string; tier?: number | null; updated_at?: string | null; }; Relationships: []; Row: { active: boolean | null; created_at: string; description: string | null; displayed_features: Json; features: Json; id: string; most_popular: boolean | null; name: string | null; price: number | null; stripe_price_id: string; tier: number | null; updated_at: string | null; }; Update: { active?: boolean | null; created_at?: string; description?: string | null; displayed_features?: Json; features?: Json; id?: string; most_popular?: boolean | null; name?: string | null; price?: number | null; stripe_price_id?: string; tier?: number | null; updated_at?: string | null; }; }; subscriptions: { Insert: { cancel_at_period_end?: boolean | null; created_at?: string | null; current_period_end?: string | null; current_period_start?: string | null; id?: number; plan_id?: string | null; seats?: number | null; stripe_customer_id: string; stripe_subscription_id?: string | null; subscription_status?: string | null; updated_at?: string | null; user_id?: number | null; }; Relationships: [{ columns: ["user_id"]; foreignKeyName: "subscriptions_user_id_fkey"; isOneToOne: true; referencedColumns: ["id"]; referencedRelation: "users"; }]; Row: { cancel_at_period_end: boolean | null; created_at: string | null; current_period_end: string | null; current_period_start: string | null; id: number; plan_id: string | null; seats: number | null; stripe_customer_id: string; stripe_subscription_id: string | null; subscription_status: string | null; updated_at: string | null; user_id: number | null; }; Update: { cancel_at_period_end?: boolean | null; created_at?: string | null; current_period_end?: string | null; current_period_start?: string | null; id?: number; plan_id?: string | null; seats?: number | null; stripe_customer_id?: string; stripe_subscription_id?: string | null; subscription_status?: string | null; updated_at?: string | null; user_id?: number | null; }; }; transactions: { Insert: { buyer_user_id?: number | null; id?: number; listing_id?: number | null; price?: number | null; seller_user_id?: number | null; sold_at?: string | null; }; Relationships: [{ columns: ["buyer_user_id"]; foreignKeyName: "transactions_buyer_user_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "users"; }, { columns: ["listing_id"]; foreignKeyName: "transactions_listing_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "listings"; }, { columns: ["listing_id"]; foreignKeyName: "transactions_listing_id_fkey"; isOneToOne: false; referencedColumns: ["listing_id"]; referencedRelation: "listings_with_address"; }, { columns: ["seller_user_id"]; foreignKeyName: "transactions_seller_user_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "users"; }]; Row: { buyer_user_id: number | null; id: number; listing_id: number | null; price: number | null; seller_user_id: number | null; sold_at: string | null; }; Update: { buyer_user_id?: number | null; id?: number; listing_id?: number | null; price?: number | null; seller_user_id?: number | null; sold_at?: string | null; }; }; users: { Insert: { auth_user_id?: string | null; contact_email?: string | null; created_at?: string | null; description?: string | null; email?: string | null; first_name?: string | null; id?: number; last_name?: string | null; onboarded?: boolean | null; phone_number?: string | null; profile_image_path?: string | null; role?: string | null; stripe_customer_id?: string | null; subscription_id?: number | null; }; Relationships: [{ columns: ["subscription_id"]; foreignKeyName: "users_subscription_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "subscriptions"; }]; Row: { auth_user_id: string | null; contact_email: string | null; created_at: string | null; description: string | null; email: string | null; first_name: string | null; id: number; last_name: string | null; onboarded: boolean | null; phone_number: string | null; profile_image_path: string | null; role: string | null; stripe_customer_id: string | null; subscription_id: number | null; }; Update: { auth_user_id?: string | null; contact_email?: string | null; created_at?: string | null; description?: string | null; email?: string | null; first_name?: string | null; id?: number; last_name?: string | null; onboarded?: boolean | null; phone_number?: string | null; profile_image_path?: string | null; role?: string | null; stripe_customer_id?: string | null; subscription_id?: number | null; }; }; }; Views: { listings_with_address: { Relationships: [{ columns: ["listing_business_id"]; foreignKeyName: "listings_business_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "businesses"; }, { columns: ["listing_business_id"]; foreignKeyName: "listings_business_id_fkey"; isOneToOne: false; referencedColumns: ["business_id"]; referencedRelation: "listings_with_address"; }, { columns: ["user_id"]; foreignKeyName: "listings_user_id_fkey"; isOneToOne: false; referencedColumns: ["id"]; referencedRelation: "users"; }]; Row: { address_id: number | null; address_line_1: string | null; address_line_2: string | null; badges: string[] | null; business_hours: string | null; business_id: number | null; business_name: string | null; city: string | null; contact_company: string | null; contact_email: string | null; contact_method: string | null; contact_name: string | null; contact_phone: string | null; contact_role: string | null; country: string | null; customer_type: string | null; date_established: string | null; deal_type: string | null; description: string | null; desired_selling_price: string | null; ebitda: number | null; gross_margin: number | null; is_public: boolean | null; keywords: string[] | null; latitude: number | null; listed_at: string | null; listing_business_id: number | null; listing_id: number | null; longitude: number | null; market: string | null; monthly_recurring_revenue: number | null; naics_code: string | null; number_of_employees: number | null; number_of_owners: number | null; physical_location: string | null; preferred_contact: string | null; private_listing: boolean | null; reason_for_sale: string | null; state: string | null; status: string | null; timeframe_to_sell: string | null; ttm_gross_profit: number | null; ttm_pre_tax_net_income: number | null; ttm_revenue: number | null; user_id: number | null; views: number | null; website: string | null; years_in_operation: number | null; zip_code: string | null; }; }; }; }, { PostgrestVersion: "13.0.5"; }>

Defined in: lib/supabase.ts:8