From 2d59f5df14aae27664100bab5079236e889a7049 Mon Sep 17 00:00:00 2001 From: Babayaga Date: Sat, 28 Mar 2026 12:31:46 +0100 Subject: [PATCH] child searches - wer sucht der findet :) --- packages/ui/shared/src/competitors/schemas.ts | 7 + packages/ui/src/App.tsx | 5 +- packages/ui/src/contexts/WS_Socket.tsx | 4 +- .../ui/src/integrations/supabase/types.ts | 4749 +++++++++-------- .../src/modules/places/CompetitorsMapView.tsx | 35 +- packages/ui/src/modules/places/EmailCell.tsx | 13 +- .../ui/src/modules/places/LocationDetail.tsx | 205 +- packages/ui/src/modules/places/TypeCell.tsx | 7 +- .../src/modules/places/client-gridsearch.ts | 17 + packages/ui/src/modules/places/gridUtils.ts | 2 +- .../modules/places/gridsearch/GridSearch.tsx | 6 +- .../places/gridsearch/GridSearchResults.tsx | 71 +- .../gridsearch/GridSearchStreamContext.tsx | 5 +- .../places/gridsearch/GridSearchWizard.tsx | 70 +- .../modules/places/gridsearch/JobViewer.tsx | 51 +- .../places/gridsearch/OngoingSearches.tsx | 310 +- .../modules/places/useCompetitorSettings.ts | 11 +- .../ui/src/modules/places/useGridColumns.tsx | 181 +- packages/ui/src/services/modbusService.ts | 3 - 19 files changed, 3013 insertions(+), 2739 deletions(-) diff --git a/packages/ui/shared/src/competitors/schemas.ts b/packages/ui/shared/src/competitors/schemas.ts index 57b0dd03..150a8ec8 100644 --- a/packages/ui/shared/src/competitors/schemas.ts +++ b/packages/ui/shared/src/competitors/schemas.ts @@ -211,6 +211,8 @@ export const GoogleMediaSchema = z.object({ // Raw data schema export const LocationSchema = z.object({ position: z.number(), + rating: z.number(), + reviews: z.number(), title: z.string(), description: z.string(), place_id: z.string(), @@ -252,6 +254,11 @@ export const CompetitorSchemaFull = z.object({ thumbnail: z.string().optional().nullable(), types: z.array(z.string()).optional().nullable(), raw_data: LocationSchema.optional().nullable(), + sites: z.array(z.object({ + name: z.string(), + url: z.string(), + content: z.string() + })).optional(), continent: z.string().optional().nullable(), country: z.string().optional().nullable(), city: z.string().optional().nullable(), diff --git a/packages/ui/src/App.tsx b/packages/ui/src/App.tsx index 5757fd09..f97707eb 100644 --- a/packages/ui/src/App.tsx +++ b/packages/ui/src/App.tsx @@ -66,6 +66,7 @@ let FileBrowser: any; let SupportChat: any; GridSearch = React.lazy(() => import("./modules/places/gridsearch/GridSearch")); +LocationDetail = React.lazy(() => import("./modules/places/LocationDetail")); if (enablePlaygrounds) { PlaygroundEditor = React.lazy(() => import("./pages/PlaygroundEditor")); @@ -81,7 +82,7 @@ if (enablePlaygrounds) { VariablePlayground = React.lazy(() => import("./components/variables/VariablesEditor").then(module => ({ default: module.VariablesEditor }))); I18nPlayground = React.lazy(() => import("./components/playground/I18nPlayground")); PlaygroundChat = React.lazy(() => import("./pages/PlaygroundChat")); - LocationDetail = React.lazy(() => import("./modules/places/LocationDetail")); + Tetris = React.lazy(() => import("./apps/tetris/Tetris")); FileBrowser = React.lazy(() => import("./apps/filebrowser/FileBrowser")); SupportChat = React.lazy(() => import("./pages/SupportChat")); @@ -178,7 +179,7 @@ const AppWrapper = () => { Loading...}>} /> Loading...}>} /> - {enablePlaygrounds && Loading...}>} />} + Loading...}>} /> {enablePlaygrounds && Loading...}>} />} {/* Playground Routes */} diff --git a/packages/ui/src/contexts/WS_Socket.tsx b/packages/ui/src/contexts/WS_Socket.tsx index b8193975..bbcfc8eb 100644 --- a/packages/ui/src/contexts/WS_Socket.tsx +++ b/packages/ui/src/contexts/WS_Socket.tsx @@ -109,7 +109,7 @@ export const WebSocketProvider: React.FC = ({ children, ); return newConnectionEstablished; } catch (error) { - logger.logError(error, '[ModbusContext] modbusService.connect() failed'); + // logger.logError(error, '[ModbusContext] modbusService.connect() failed'); return false; } }, [handleWsStatusChange, ensureModbus]); @@ -149,7 +149,7 @@ export const WebSocketProvider: React.FC = ({ children, return isNowConnected; } catch (error: any) { - logger.logError(error, '[ModbusContext] Error in connectToServer'); + // logger.logError(error, '[ModbusContext] Error in connectToServer'); setIsConnected(false); setConnecting(false); return false; diff --git a/packages/ui/src/integrations/supabase/types.ts b/packages/ui/src/integrations/supabase/types.ts index 6b772858..bec1a8c9 100644 --- a/packages/ui/src/integrations/supabase/types.ts +++ b/packages/ui/src/integrations/supabase/types.ts @@ -1,2366 +1,2383 @@ -export type Json = - | string - | number - | boolean - | null - | { [key: string]: Json | undefined } - | Json[] - -export type Database = { - // Allows to automatically instantiate createClient with right options - // instead of createClient(URL, KEY) - __InternalSupabase: { - PostgrestVersion: "13.0.5" - } - graphql_public: { - Tables: { - [_ in never]: never - } - Views: { - [_ in never]: never - } - Functions: { - graphql: { - Args: { - extensions?: Json - operationName?: string - query?: string - variables?: Json - } - Returns: Json - } - } - Enums: { - [_ in never]: never - } - CompositeTypes: { - [_ in never]: never - } - } - public: { - Tables: { - campaigns: { - Row: { - completed_at: string | null - created_at: string - group_ids: string[] - id: string - lang: string | null - meta: Json - name: string - owner_id: string - page_id: string | null - page_slug: string | null - scheduled_at: string | null - started_at: string | null - stats: Json - status: string - subject: string | null - tracking_id: string | null - updated_at: string - vars: Json - } - Insert: { - completed_at?: string | null - created_at?: string - group_ids?: string[] - id?: string - lang?: string | null - meta?: Json - name: string - owner_id: string - page_id?: string | null - page_slug?: string | null - scheduled_at?: string | null - started_at?: string | null - stats?: Json - status?: string - subject?: string | null - tracking_id?: string | null - updated_at?: string - vars?: Json - } - Update: { - completed_at?: string | null - created_at?: string - group_ids?: string[] - id?: string - lang?: string | null - meta?: Json - name?: string - owner_id?: string - page_id?: string | null - page_slug?: string | null - scheduled_at?: string | null - started_at?: string | null - stats?: Json - status?: string - subject?: string | null - tracking_id?: string | null - updated_at?: string - vars?: Json - } - Relationships: [] - } - categories: { - Row: { - created_at: string - description: string | null - id: string - meta: Json | null - name: string - owner_id: string | null - slug: string - updated_at: string - visibility: Database["public"]["Enums"]["category_visibility"] - } - Insert: { - created_at?: string - description?: string | null - id?: string - meta?: Json | null - name: string - owner_id?: string | null - slug: string - updated_at?: string - visibility?: Database["public"]["Enums"]["category_visibility"] - } - Update: { - created_at?: string - description?: string | null - id?: string - meta?: Json | null - name?: string - owner_id?: string | null - slug?: string - updated_at?: string - visibility?: Database["public"]["Enums"]["category_visibility"] - } - Relationships: [] - } - category_relations: { - Row: { - child_category_id: string - created_at: string - parent_category_id: string - relation_type: Database["public"]["Enums"]["category_relation_type"] - } - Insert: { - child_category_id: string - created_at?: string - parent_category_id: string - relation_type: Database["public"]["Enums"]["category_relation_type"] - } - Update: { - child_category_id?: string - created_at?: string - parent_category_id?: string - relation_type?: Database["public"]["Enums"]["category_relation_type"] - } - Relationships: [ - { - foreignKeyName: "category_relations_child_category_id_fkey" - columns: ["child_category_id"] - isOneToOne: false - referencedRelation: "categories" - referencedColumns: ["id"] - }, - { - foreignKeyName: "category_relations_parent_category_id_fkey" - columns: ["parent_category_id"] - isOneToOne: false - referencedRelation: "categories" - referencedColumns: ["id"] - }, - ] - } - collection_pictures: { - Row: { - added_at: string - collection_id: string - id: string - picture_id: string - } - Insert: { - added_at?: string - collection_id: string - id?: string - picture_id: string - } - Update: { - added_at?: string - collection_id?: string - id?: string - picture_id?: string - } - Relationships: [ - { - foreignKeyName: "collection_pictures_collection_id_fkey" - columns: ["collection_id"] - isOneToOne: false - referencedRelation: "collections" - referencedColumns: ["id"] - }, - { - foreignKeyName: "collection_pictures_picture_id_fkey" - columns: ["picture_id"] - isOneToOne: false - referencedRelation: "pictures" - referencedColumns: ["id"] - }, - ] - } - collection_posts: { - Row: { - collection_id: string - created_at: string - id: string - post_id: string - } - Insert: { - collection_id: string - created_at?: string - id?: string - post_id: string - } - Update: { - collection_id?: string - created_at?: string - id?: string - post_id?: string - } - Relationships: [ - { - foreignKeyName: "collection_posts_collection_id_fkey" - columns: ["collection_id"] - isOneToOne: false - referencedRelation: "collections" - referencedColumns: ["id"] - }, - { - foreignKeyName: "collection_posts_post_id_fkey" - columns: ["post_id"] - isOneToOne: false - referencedRelation: "posts" - referencedColumns: ["id"] - }, - ] - } - collections: { - Row: { - content: Json | null - created_at: string - description: string | null - id: string - is_public: boolean - layout: Json | null - name: string - slug: string - updated_at: string - user_id: string - } - Insert: { - content?: Json | null - created_at?: string - description?: string | null - id?: string - is_public?: boolean - layout?: Json | null - name: string - slug: string - updated_at?: string - user_id: string - } - Update: { - content?: Json | null - created_at?: string - description?: string | null - id?: string - is_public?: boolean - layout?: Json | null - name?: string - slug?: string - updated_at?: string - user_id?: string - } - Relationships: [] - } - comment_likes: { - Row: { - comment_id: string - created_at: string - id: string - user_id: string - } - Insert: { - comment_id: string - created_at?: string - id?: string - user_id: string - } - Update: { - comment_id?: string - created_at?: string - id?: string - user_id?: string - } - Relationships: [] - } - comments: { - Row: { - content: string - created_at: string - id: string - likes_count: number | null - parent_comment_id: string | null - picture_id: string - updated_at: string - user_id: string - } - Insert: { - content: string - created_at?: string - id?: string - likes_count?: number | null - parent_comment_id?: string | null - picture_id: string - updated_at?: string - user_id: string - } - Update: { - content?: string - created_at?: string - id?: string - likes_count?: number | null - parent_comment_id?: string | null - picture_id?: string - updated_at?: string - user_id?: string - } - Relationships: [ - { - foreignKeyName: "comments_parent_fk" - columns: ["parent_comment_id"] - isOneToOne: false - referencedRelation: "comments" - referencedColumns: ["id"] - }, - ] - } - contact_group_members: { - Row: { - added_at: string - contact_id: string - group_id: string - } - Insert: { - added_at?: string - contact_id: string - group_id: string - } - Update: { - added_at?: string - contact_id?: string - group_id?: string - } - Relationships: [ - { - foreignKeyName: "contact_group_members_contact_id_fkey" - columns: ["contact_id"] - isOneToOne: false - referencedRelation: "contacts" - referencedColumns: ["id"] - }, - { - foreignKeyName: "contact_group_members_group_id_fkey" - columns: ["group_id"] - isOneToOne: false - referencedRelation: "contact_groups" - referencedColumns: ["id"] - }, - ] - } - contact_groups: { - Row: { - created_at: string - description: string | null - id: string - meta: Json - name: string - owner_id: string - updated_at: string - } - Insert: { - created_at?: string - description?: string | null - id?: string - meta?: Json - name: string - owner_id: string - updated_at?: string - } - Update: { - created_at?: string - description?: string | null - id?: string - meta?: Json - name?: string - owner_id?: string - updated_at?: string - } - Relationships: [] - } - contacts: { - Row: { - address: Json - created_at: string - emails: Json - first_name: string | null - id: string - language: string | null - last_name: string | null - log: Json - meta: Json - name: string | null - notes: string | null - organization: string | null - owner_id: string - phone: string | null - source: string | null - status: string - tags: string[] | null - title: string | null - updated_at: string - } - Insert: { - address?: Json - created_at?: string - emails?: Json - first_name?: string | null - id?: string - language?: string | null - last_name?: string | null - log?: Json - meta?: Json - name?: string | null - notes?: string | null - organization?: string | null - owner_id: string - phone?: string | null - source?: string | null - status?: string - tags?: string[] | null - title?: string | null - updated_at?: string - } - Update: { - address?: Json - created_at?: string - emails?: Json - first_name?: string | null - id?: string - language?: string | null - last_name?: string | null - log?: Json - meta?: Json - name?: string | null - notes?: string | null - organization?: string | null - owner_id?: string - phone?: string | null - source?: string | null - status?: string - tags?: string[] | null - title?: string | null - updated_at?: string - } - Relationships: [] - } - context_definitions: { - Row: { - created_at: string | null - default_filters: Json - default_templates: Json - description: string | null - display_name: string - icon: string | null - id: string - is_active: boolean | null - name: string - updated_at: string | null - } - Insert: { - created_at?: string | null - default_filters?: Json - default_templates?: Json - description?: string | null - display_name: string - icon?: string | null - id?: string - is_active?: boolean | null - name: string - updated_at?: string | null - } - Update: { - created_at?: string | null - default_filters?: Json - default_templates?: Json - description?: string | null - display_name?: string - icon?: string | null - id?: string - is_active?: boolean | null - name?: string - updated_at?: string | null - } - Relationships: [] - } - filter_usage_logs: { - Row: { - context: string - created_at: string | null - error_message: string | null - filters_applied: string[] | null - id: string - input_length: number - model: string - output_length: number - processing_time_ms: number - provider: string - success: boolean - template_id: string | null - user_id: string | null - } - Insert: { - context: string - created_at?: string | null - error_message?: string | null - filters_applied?: string[] | null - id?: string - input_length: number - model: string - output_length: number - processing_time_ms: number - provider: string - success: boolean - template_id?: string | null - user_id?: string | null - } - Update: { - context?: string - created_at?: string | null - error_message?: string | null - filters_applied?: string[] | null - id?: string - input_length?: number - model?: string - output_length?: number - processing_time_ms?: number - provider?: string - success?: boolean - template_id?: string | null - user_id?: string | null - } - Relationships: [ - { - foreignKeyName: "filter_usage_logs_template_id_fkey" - columns: ["template_id"] - isOneToOne: false - referencedRelation: "user_templates" - referencedColumns: ["id"] - }, - ] - } - grid_area_places: { - Row: { - created_at: string - grid_area_id: string - id: string - place_id: string - rank: number | null - } - Insert: { - created_at?: string - grid_area_id: string - id?: string - place_id: string - rank?: number | null - } - Update: { - created_at?: string - grid_area_id?: string - id?: string - place_id?: string - rank?: number | null - } - Relationships: [ - { - foreignKeyName: "grid_area_places_grid_area_id_fkey" - columns: ["grid_area_id"] - isOneToOne: false - referencedRelation: "grid_areas" - referencedColumns: ["id"] - }, - { - foreignKeyName: "grid_area_places_place_id_fkey" - columns: ["place_id"] - isOneToOne: false - referencedRelation: "places" - referencedColumns: ["place_id"] - }, - ] - } - grid_areas: { - Row: { - area_sqkm: number | null - bbox: Json | null - center: Json | null - created_at: string - geometry: Json | null - gid: string - id: string - level: number - max_dist_km: number | null - meta: Json | null - name: string - region: string - stats: Json | null - updated_at: string - user_id: string | null - } - Insert: { - area_sqkm?: number | null - bbox?: Json | null - center?: Json | null - created_at?: string - geometry?: Json | null - gid: string - id?: string - level: number - max_dist_km?: number | null - meta?: Json | null - name: string - region: string - stats?: Json | null - updated_at?: string - user_id?: string | null - } - Update: { - area_sqkm?: number | null - bbox?: Json | null - center?: Json | null - created_at?: string - geometry?: Json | null - gid?: string - id?: string - level?: number - max_dist_km?: number | null - meta?: Json | null - name?: string - region?: string - stats?: Json | null - updated_at?: string - user_id?: string | null - } - Relationships: [] - } - grid_search_runs: { - Row: { - created_at: string - id: string - request: Json - result: Json - run_id: string - updated_at: string - user_id: string - } - Insert: { - created_at?: string - id: string - request: Json - result: Json - run_id: string - updated_at?: string - user_id: string - } - Update: { - created_at?: string - id?: string - request?: Json - result?: Json - run_id?: string - updated_at?: string - user_id?: string - } - Relationships: [] - } - i18n_glossaries: { - Row: { - creation_time: string | null - entry_count: number | null - glossary_id: string - hash: string | null - local_created_at: string | null - local_updated_at: string | null - name: string - ready: boolean | null - source_lang: string - target_lang: string - } - Insert: { - creation_time?: string | null - entry_count?: number | null - glossary_id: string - hash?: string | null - local_created_at?: string | null - local_updated_at?: string | null - name: string - ready?: boolean | null - source_lang: string - target_lang: string - } - Update: { - creation_time?: string | null - entry_count?: number | null - glossary_id?: string - hash?: string | null - local_created_at?: string | null - local_updated_at?: string | null - name?: string - ready?: boolean | null - source_lang?: string - target_lang?: string - } - Relationships: [] - } - i18n_glossary_terms: { - Row: { - created_at: string | null - id: string - source_lang: string - target_lang: string - term: string - translation: string - updated_at: string | null - } - Insert: { - created_at?: string | null - id?: string - source_lang: string - target_lang: string - term: string - translation: string - updated_at?: string | null - } - Update: { - created_at?: string | null - id?: string - source_lang?: string - target_lang?: string - term?: string - translation?: string - updated_at?: string | null - } - Relationships: [] - } - i18n_translations: { - Row: { - created_at: string | null - dst_lang: string - dst_text: string - id: string - meta: Json | null - src_lang: string - src_text: string - updated_at: string | null - } - Insert: { - created_at?: string | null - dst_lang: string - dst_text: string - id?: string - meta?: Json | null - src_lang: string - src_text: string - updated_at?: string | null - } - Update: { - created_at?: string | null - dst_lang?: string - dst_text?: string - id?: string - meta?: Json | null - src_lang?: string - src_text?: string - updated_at?: string | null - } - Relationships: [] - } - layouts: { - Row: { - created_at: string - id: string - is_predefined: boolean | null - layout_json: Json - meta: Json | null - name: string - owner_id: string - type: string | null - updated_at: string - visibility: Database["public"]["Enums"]["layout_visibility"] - } - Insert: { - created_at?: string - id?: string - is_predefined?: boolean | null - layout_json: Json - meta?: Json | null - name: string - owner_id: string - type?: string | null - updated_at?: string - visibility?: Database["public"]["Enums"]["layout_visibility"] - } - Update: { - created_at?: string - id?: string - is_predefined?: boolean | null - layout_json?: Json - meta?: Json | null - name?: string - owner_id?: string - type?: string | null - updated_at?: string - visibility?: Database["public"]["Enums"]["layout_visibility"] - } - Relationships: [] - } - likes: { - Row: { - created_at: string - id: string - picture_id: string - user_id: string - } - Insert: { - created_at?: string - id?: string - picture_id: string - user_id: string - } - Update: { - created_at?: string - id?: string - picture_id?: string - user_id?: string - } - Relationships: [] - } - marketing_emails: { - Row: { - campaign: string | null - created_at: string - email: string - error_message: string | null - from_address: string | null - id: string - lang: string | null - last_retry_at: string | null - meta: Json | null - name: string | null - page_slug: string - retry_count: number - sender_id: string | null - sent_at: string | null - status: string - subject: string | null - tracking_id: string | null - unsubscribe_token: string - unsubscribed: boolean - unsubscribed_at: string | null - updated_at: string - } - Insert: { - campaign?: string | null - created_at?: string - email: string - error_message?: string | null - from_address?: string | null - id?: string - lang?: string | null - last_retry_at?: string | null - meta?: Json | null - name?: string | null - page_slug: string - retry_count?: number - sender_id?: string | null - sent_at?: string | null - status?: string - subject?: string | null - tracking_id?: string | null - unsubscribe_token?: string - unsubscribed?: boolean - unsubscribed_at?: string | null - updated_at?: string - } - Update: { - campaign?: string | null - created_at?: string - email?: string - error_message?: string | null - from_address?: string | null - id?: string - lang?: string | null - last_retry_at?: string | null - meta?: Json | null - name?: string | null - page_slug?: string - retry_count?: number - sender_id?: string | null - sent_at?: string | null - status?: string - subject?: string | null - tracking_id?: string | null - unsubscribe_token?: string - unsubscribed?: boolean - unsubscribed_at?: string | null - updated_at?: string - } - Relationships: [] - } - organizations: { - Row: { - created_at: string - id: string - name: string - slug: string - updated_at: string - } - Insert: { - created_at?: string - id?: string - name: string - slug: string - updated_at?: string - } - Update: { - created_at?: string - id?: string - name?: string - slug?: string - updated_at?: string - } - Relationships: [] - } - page_collaborators: { - Row: { - created_at: string - id: string - page_id: string - role: Database["public"]["Enums"]["collaborator_role"] - user_id: string - } - Insert: { - created_at?: string - id?: string - page_id: string - role?: Database["public"]["Enums"]["collaborator_role"] - user_id: string - } - Update: { - created_at?: string - id?: string - page_id?: string - role?: Database["public"]["Enums"]["collaborator_role"] - user_id?: string - } - Relationships: [ - { - foreignKeyName: "page_collaborators_page_id_fkey" - columns: ["page_id"] - isOneToOne: false - referencedRelation: "pages" - referencedColumns: ["id"] - }, - ] - } - pages: { - Row: { - content: Json | null - created_at: string - id: string - is_public: boolean - is_version_of: string | null - meta: Json | null - owner: string - parent: string | null - slug: string - tags: string[] | null - title: string - type: string | null - updated_at: string - visible: boolean - } - Insert: { - content?: Json | null - created_at?: string - id?: string - is_public?: boolean - is_version_of?: string | null - meta?: Json | null - owner: string - parent?: string | null - slug: string - tags?: string[] | null - title: string - type?: string | null - updated_at?: string - visible?: boolean - } - Update: { - content?: Json | null - created_at?: string - id?: string - is_public?: boolean - is_version_of?: string | null - meta?: Json | null - owner?: string - parent?: string | null - slug?: string - tags?: string[] | null - title?: string - type?: string | null - updated_at?: string - visible?: boolean - } - Relationships: [ - { - foreignKeyName: "pages_is_version_of_fkey" - columns: ["is_version_of"] - isOneToOne: false - referencedRelation: "pages" - referencedColumns: ["id"] - }, - { - foreignKeyName: "pages_parent_fkey" - columns: ["parent"] - isOneToOne: false - referencedRelation: "pages" - referencedColumns: ["id"] - }, - ] - } - pictures: { - Row: { - created_at: string - description: string | null - flags: string[] | null - id: string - image_url: string - is_selected: boolean - likes_count: number | null - meta: Json | null - organization_id: string | null - parent_id: string | null - position: number | null - post_id: string | null - tags: string[] | null - thumbnail_url: string | null - title: string - type: string | null - updated_at: string - user_id: string - visible: boolean - } - Insert: { - created_at?: string - description?: string | null - flags?: string[] | null - id?: string - image_url: string - is_selected?: boolean - likes_count?: number | null - meta?: Json | null - organization_id?: string | null - parent_id?: string | null - position?: number | null - post_id?: string | null - tags?: string[] | null - thumbnail_url?: string | null - title: string - type?: string | null - updated_at?: string - user_id: string - visible?: boolean - } - Update: { - created_at?: string - description?: string | null - flags?: string[] | null - id?: string - image_url?: string - is_selected?: boolean - likes_count?: number | null - meta?: Json | null - organization_id?: string | null - parent_id?: string | null - position?: number | null - post_id?: string | null - tags?: string[] | null - thumbnail_url?: string | null - title?: string - type?: string | null - updated_at?: string - user_id?: string - visible?: boolean - } - Relationships: [ - { - foreignKeyName: "pictures_organization_id_fkey" - columns: ["organization_id"] - isOneToOne: false - referencedRelation: "organizations" - referencedColumns: ["id"] - }, - { - foreignKeyName: "pictures_parent_id_fkey" - columns: ["parent_id"] - isOneToOne: false - referencedRelation: "pictures" - referencedColumns: ["id"] - }, - { - foreignKeyName: "pictures_post_id_fkey" - columns: ["post_id"] - isOneToOne: false - referencedRelation: "posts" - referencedColumns: ["id"] - }, - ] - } - place_searches: { - Row: { - created_at: string - id: string - input_hash: string - input_params: Json - result_place_ids: string[] - user_id: string | null - } - Insert: { - created_at?: string - id?: string - input_hash: string - input_params: Json - result_place_ids: string[] - user_id?: string | null - } - Update: { - created_at?: string - id?: string - input_hash?: string - input_params?: Json - result_place_ids?: string[] - user_id?: string | null - } - Relationships: [] - } - places: { - Row: { - address: string | null - city: string | null - contacts: Json | null - continent: string | null - country: string | null - created_at: string - description: string | null - gps_coordinates: Json | null - media: Json | null - meta: Json | null - operating_hours: Json | null - phone: string | null - place_id: string - raw_data: Json | null - thumbnail: string | null - title: string | null - types: string[] | null - updated_at: string - user_id: string | null - website: string | null - } - Insert: { - address?: string | null - city?: string | null - contacts?: Json | null - continent?: string | null - country?: string | null - created_at?: string - description?: string | null - gps_coordinates?: Json | null - media?: Json | null - meta?: Json | null - operating_hours?: Json | null - phone?: string | null - place_id: string - raw_data?: Json | null - thumbnail?: string | null - title?: string | null - types?: string[] | null - updated_at?: string - user_id?: string | null - website?: string | null - } - Update: { - address?: string | null - city?: string | null - contacts?: Json | null - continent?: string | null - country?: string | null - created_at?: string - description?: string | null - gps_coordinates?: Json | null - media?: Json | null - meta?: Json | null - operating_hours?: Json | null - phone?: string | null - place_id?: string - raw_data?: Json | null - thumbnail?: string | null - title?: string | null - types?: string[] | null - updated_at?: string - user_id?: string | null - website?: string | null - } - Relationships: [] - } - posts: { - Row: { - created_at: string | null - description: string | null - id: string - meta: Json | null - settings: Json | null - title: string - updated_at: string | null - user_id: string - } - Insert: { - created_at?: string | null - description?: string | null - id?: string - meta?: Json | null - settings?: Json | null - title: string - updated_at?: string | null - user_id: string - } - Update: { - created_at?: string | null - description?: string | null - id?: string - meta?: Json | null - settings?: Json | null - title?: string - updated_at?: string | null - user_id?: string - } - Relationships: [] - } - profiles: { - Row: { - aimlapi_api_key: string | null - avatar_url: string | null - bio: string | null - bria_api_key: string | null - created_at: string - display_name: string | null - google_api_key: string | null - huggingface_api_key: string | null - id: string - openai_api_key: string | null - pages: Json | null - replicate_api_key: string | null - settings: Json | null - updated_at: string - user_id: string - username: string | null - } - Insert: { - aimlapi_api_key?: string | null - avatar_url?: string | null - bio?: string | null - bria_api_key?: string | null - created_at?: string - display_name?: string | null - google_api_key?: string | null - huggingface_api_key?: string | null - id?: string - openai_api_key?: string | null - pages?: Json | null - replicate_api_key?: string | null - settings?: Json | null - updated_at?: string - user_id: string - username?: string | null - } - Update: { - aimlapi_api_key?: string | null - avatar_url?: string | null - bio?: string | null - bria_api_key?: string | null - created_at?: string - display_name?: string | null - google_api_key?: string | null - huggingface_api_key?: string | null - id?: string - openai_api_key?: string | null - pages?: Json | null - replicate_api_key?: string | null - settings?: Json | null - updated_at?: string - user_id?: string - username?: string | null - } - Relationships: [] - } - provider_configs: { - Row: { - base_url: string - created_at: string | null - display_name: string - id: string - is_active: boolean | null - models: Json - name: string - rate_limits: Json | null - settings: Json | null - updated_at: string | null - user_id: string | null - } - Insert: { - base_url: string - created_at?: string | null - display_name: string - id?: string - is_active?: boolean | null - models?: Json - name: string - rate_limits?: Json | null - settings?: Json | null - updated_at?: string | null - user_id?: string | null - } - Update: { - base_url?: string - created_at?: string | null - display_name?: string - id?: string - is_active?: boolean | null - models?: Json - name?: string - rate_limits?: Json | null - settings?: Json | null - updated_at?: string | null - user_id?: string | null - } - Relationships: [] - } - resource_acl: { - Row: { - created_at: string | null - group_name: string | null - id: string - log: Json | null - meta: Json | null - path: string | null - permissions: string[] - resource_id: string - resource_owner_id: string | null - resource_type: string - updated_at: string | null - user_id: string | null - } - Insert: { - created_at?: string | null - group_name?: string | null - id?: string - log?: Json | null - meta?: Json | null - path?: string | null - permissions?: string[] - resource_id: string - resource_owner_id?: string | null - resource_type: string - updated_at?: string | null - user_id?: string | null - } - Update: { - created_at?: string | null - group_name?: string | null - id?: string - log?: Json | null - meta?: Json | null - path?: string | null - permissions?: string[] - resource_id?: string - resource_owner_id?: string | null - resource_type?: string - updated_at?: string | null - user_id?: string | null - } - Relationships: [] - } - role_permissions: { - Row: { - created_at: string - id: string - permission: Database["public"]["Enums"]["app_permission"] - role: Database["public"]["Enums"]["app_role"] - } - Insert: { - created_at?: string - id?: string - permission: Database["public"]["Enums"]["app_permission"] - role: Database["public"]["Enums"]["app_role"] - } - Update: { - created_at?: string - id?: string - permission?: Database["public"]["Enums"]["app_permission"] - role?: Database["public"]["Enums"]["app_role"] - } - Relationships: [] - } - searches: { - Row: { - created_at: string - id: string - input_hash: string - input_params: Json - result_place_ids: string[] - } - Insert: { - created_at?: string - id?: string - input_hash: string - input_params: Json - result_place_ids: string[] - } - Update: { - created_at?: string - id?: string - input_hash?: string - input_params?: Json - result_place_ids?: string[] - } - Relationships: [] - } - transactions: { - Row: { - buyer_email: string | null - buyer_ip: unknown - buyer_name: string | null - buyer_profile: Json - created_at: string - currency: string - external_checkout_id: string | null - external_order_id: string | null - id: string - metadata: Json - note: string | null - payment_provider: string | null - product_info: Json - shipping_info: Json - status: string - total_amount: number - updated_at: string - user_id: string - vendor_info: Json - } - Insert: { - buyer_email?: string | null - buyer_ip?: unknown - buyer_name?: string | null - buyer_profile?: Json - created_at?: string - currency?: string - external_checkout_id?: string | null - external_order_id?: string | null - id?: string - metadata?: Json - note?: string | null - payment_provider?: string | null - product_info?: Json - shipping_info?: Json - status?: string - total_amount?: number - updated_at?: string - user_id: string - vendor_info?: Json - } - Update: { - buyer_email?: string | null - buyer_ip?: unknown - buyer_name?: string | null - buyer_profile?: Json - created_at?: string - currency?: string - external_checkout_id?: string | null - external_order_id?: string | null - id?: string - metadata?: Json - note?: string | null - payment_provider?: string | null - product_info?: Json - shipping_info?: Json - status?: string - total_amount?: number - updated_at?: string - user_id?: string - vendor_info?: Json - } - Relationships: [] - } - type_casts: { - Row: { - cast_kind: Database["public"]["Enums"]["cast_kind"] - description: string | null - from_type_id: string - to_type_id: string - } - Insert: { - cast_kind: Database["public"]["Enums"]["cast_kind"] - description?: string | null - from_type_id: string - to_type_id: string - } - Update: { - cast_kind?: Database["public"]["Enums"]["cast_kind"] - description?: string | null - from_type_id?: string - to_type_id?: string - } - Relationships: [ - { - foreignKeyName: "type_casts_from_type_id_fkey" - columns: ["from_type_id"] - isOneToOne: false - referencedRelation: "types" - referencedColumns: ["id"] - }, - { - foreignKeyName: "type_casts_to_type_id_fkey" - columns: ["to_type_id"] - isOneToOne: false - referencedRelation: "types" - referencedColumns: ["id"] - }, - ] - } - type_enum_values: { - Row: { - id: string - label: string - order: number - type_id: string - value: string - } - Insert: { - id?: string - label: string - order?: number - type_id: string - value: string - } - Update: { - id?: string - label?: string - order?: number - type_id?: string - value?: string - } - Relationships: [ - { - foreignKeyName: "type_enum_values_type_id_fkey" - columns: ["type_id"] - isOneToOne: false - referencedRelation: "types" - referencedColumns: ["id"] - }, - ] - } - type_flag_values: { - Row: { - bit: number - id: string - name: string - type_id: string - } - Insert: { - bit: number - id?: string - name: string - type_id: string - } - Update: { - bit?: number - id?: string - name?: string - type_id?: string - } - Relationships: [ - { - foreignKeyName: "type_flag_values_type_id_fkey" - columns: ["type_id"] - isOneToOne: false - referencedRelation: "types" - referencedColumns: ["id"] - }, - ] - } - type_structure_fields: { - Row: { - default_value: Json | null - field_name: string - field_type_id: string - id: string - order: number - required: boolean - structure_type_id: string - } - Insert: { - default_value?: Json | null - field_name: string - field_type_id: string - id?: string - order?: number - required?: boolean - structure_type_id: string - } - Update: { - default_value?: Json | null - field_name?: string - field_type_id?: string - id?: string - order?: number - required?: boolean - structure_type_id?: string - } - Relationships: [ - { - foreignKeyName: "type_structure_fields_field_type_id_fkey" - columns: ["field_type_id"] - isOneToOne: false - referencedRelation: "types" - referencedColumns: ["id"] - }, - { - foreignKeyName: "type_structure_fields_structure_type_id_fkey" - columns: ["structure_type_id"] - isOneToOne: false - referencedRelation: "types" - referencedColumns: ["id"] - }, - ] - } - types: { - Row: { - created_at: string - description: string | null - id: string - json_schema: Json | null - kind: Database["public"]["Enums"]["type_kind"] - meta: Json | null - name: string - owner_id: string | null - parent_type_id: string | null - settings: Json | null - updated_at: string - visibility: Database["public"]["Enums"]["type_visibility"] - } - Insert: { - created_at?: string - description?: string | null - id?: string - json_schema?: Json | null - kind: Database["public"]["Enums"]["type_kind"] - meta?: Json | null - name: string - owner_id?: string | null - parent_type_id?: string | null - settings?: Json | null - updated_at?: string - visibility?: Database["public"]["Enums"]["type_visibility"] - } - Update: { - created_at?: string - description?: string | null - id?: string - json_schema?: Json | null - kind?: Database["public"]["Enums"]["type_kind"] - meta?: Json | null - name?: string - owner_id?: string | null - parent_type_id?: string | null - settings?: Json | null - updated_at?: string - visibility?: Database["public"]["Enums"]["type_visibility"] - } - Relationships: [ - { - foreignKeyName: "types_parent_type_id_fkey" - columns: ["parent_type_id"] - isOneToOne: false - referencedRelation: "types" - referencedColumns: ["id"] - }, - ] - } - user_filter_configs: { - Row: { - context: string - created_at: string | null - custom_filters: Json | null - default_templates: string[] | null - id: string - is_default: boolean | null - model: string - provider: string - updated_at: string | null - user_id: string | null - variables: Json | null - } - Insert: { - context: string - created_at?: string | null - custom_filters?: Json | null - default_templates?: string[] | null - id?: string - is_default?: boolean | null - model?: string - provider?: string - updated_at?: string | null - user_id?: string | null - variables?: Json | null - } - Update: { - context?: string - created_at?: string | null - custom_filters?: Json | null - default_templates?: string[] | null - id?: string - is_default?: boolean | null - model?: string - provider?: string - updated_at?: string | null - user_id?: string | null - variables?: Json | null - } - Relationships: [] - } - user_organizations: { - Row: { - created_at: string - id: string - organization_id: string - role: string - updated_at: string - user_id: string - } - Insert: { - created_at?: string - id?: string - organization_id: string - role?: string - updated_at?: string - user_id: string - } - Update: { - created_at?: string - id?: string - organization_id?: string - role?: string - updated_at?: string - user_id?: string - } - Relationships: [ - { - foreignKeyName: "user_organizations_organization_id_fkey" - columns: ["organization_id"] - isOneToOne: false - referencedRelation: "organizations" - referencedColumns: ["id"] - }, - ] - } - user_roles: { - Row: { - created_at: string - id: string - organization_id: string | null - role: Database["public"]["Enums"]["app_role"] - updated_at: string - user_id: string - } - Insert: { - created_at?: string - id?: string - organization_id?: string | null - role: Database["public"]["Enums"]["app_role"] - updated_at?: string - user_id: string - } - Update: { - created_at?: string - id?: string - organization_id?: string | null - role?: Database["public"]["Enums"]["app_role"] - updated_at?: string - user_id?: string - } - Relationships: [ - { - foreignKeyName: "user_roles_user_id_fkey" - columns: ["user_id"] - isOneToOne: false - referencedRelation: "profiles" - referencedColumns: ["user_id"] - }, - ] - } - user_secrets: { - Row: { - aimlapi_api_key: string | null - bria_api_key: string | null - created_at: string - google_api_key: string | null - huggingface_api_key: string | null - is_admin: boolean | null - openai_api_key: string | null - replicate_api_key: string | null - settings: Json | null - updated_at: string - user_id: string - } - Insert: { - aimlapi_api_key?: string | null - bria_api_key?: string | null - created_at?: string - google_api_key?: string | null - huggingface_api_key?: string | null - is_admin?: boolean | null - openai_api_key?: string | null - replicate_api_key?: string | null - settings?: Json | null - updated_at?: string - user_id: string - } - Update: { - aimlapi_api_key?: string | null - bria_api_key?: string | null - created_at?: string - google_api_key?: string | null - huggingface_api_key?: string | null - is_admin?: boolean | null - openai_api_key?: string | null - replicate_api_key?: string | null - settings?: Json | null - updated_at?: string - user_id?: string - } - Relationships: [] - } - user_templates: { - Row: { - context: string - created_at: string | null - description: string | null - filters: string[] | null - format: string | null - id: string - is_public: boolean | null - model: string - name: string - prompt: string - provider: string - updated_at: string | null - usage_count: number | null - user_id: string | null - } - Insert: { - context: string - created_at?: string | null - description?: string | null - filters?: string[] | null - format?: string | null - id?: string - is_public?: boolean | null - model?: string - name: string - prompt: string - provider?: string - updated_at?: string | null - usage_count?: number | null - user_id?: string | null - } - Update: { - context?: string - created_at?: string | null - description?: string | null - filters?: string[] | null - format?: string | null - id?: string - is_public?: boolean | null - model?: string - name?: string - prompt?: string - provider?: string - updated_at?: string | null - usage_count?: number | null - user_id?: string | null - } - Relationships: [] - } - vfs_document_chunks: { - Row: { - chunk_index: number - content: string - created_at: string | null - embedding: string | null - id: string - vfs_id: string - } - Insert: { - chunk_index: number - content: string - created_at?: string | null - embedding?: string | null - id?: string - vfs_id: string - } - Update: { - chunk_index?: number - content?: string - created_at?: string | null - embedding?: string | null - id?: string - vfs_id?: string - } - Relationships: [ - { - foreignKeyName: "vfs_document_chunks_vfs_id_fkey" - columns: ["vfs_id"] - isOneToOne: false - referencedRelation: "vfs_index" - referencedColumns: ["id"] - }, - ] - } - vfs_index: { - Row: { - content: string | null - fts: unknown - id: string - is_vectorized: boolean | null - mime: string | null - mount: string - mtime: string | null - name: string - path: string - size: number | null - type: string - } - Insert: { - content?: string | null - fts?: unknown - id?: string - is_vectorized?: boolean | null - mime?: string | null - mount: string - mtime?: string | null - name: string - path: string - size?: number | null - type: string - } - Update: { - content?: string | null - fts?: unknown - id?: string - is_vectorized?: boolean | null - mime?: string | null - mount?: string - mtime?: string | null - name?: string - path?: string - size?: number | null - type?: string - } - Relationships: [] - } - widget_translations: { - Row: { - created_at: string | null - entity_id: string | null - entity_type: string | null - id: string - meta: Json | null - prop_path: string | null - source_lang: string - source_text: string | null - source_version: number | null - status: Database["public"]["Enums"]["translation_status"] | null - target_lang: string - translated_text: string | null - updated_at: string | null - widget_id: string | null - } - Insert: { - created_at?: string | null - entity_id?: string | null - entity_type?: string | null - id?: string - meta?: Json | null - prop_path?: string | null - source_lang: string - source_text?: string | null - source_version?: number | null - status?: Database["public"]["Enums"]["translation_status"] | null - target_lang: string - translated_text?: string | null - updated_at?: string | null - widget_id?: string | null - } - Update: { - created_at?: string | null - entity_id?: string | null - entity_type?: string | null - id?: string - meta?: Json | null - prop_path?: string | null - source_lang?: string - source_text?: string | null - source_version?: number | null - status?: Database["public"]["Enums"]["translation_status"] | null - target_lang?: string - translated_text?: string | null - updated_at?: string | null - widget_id?: string | null - } - Relationships: [] - } - wizard_sessions: { - Row: { - created_at: string - generated_image_url: string | null - id: string - input_images: string[] | null - prompt: string - status: string - updated_at: string - user_id: string - } - Insert: { - created_at?: string - generated_image_url?: string | null - id?: string - input_images?: string[] | null - prompt?: string - status?: string - updated_at?: string - user_id: string - } - Update: { - created_at?: string - generated_image_url?: string | null - id?: string - input_images?: string[] | null - prompt?: string - status?: string - updated_at?: string - user_id?: string - } - Relationships: [] - } - } - Views: { - marketing_unsubscribed: { - Row: { - email: string | null - } - Relationships: [] - } - } - Functions: { - authorize: { - Args: { - _role: Database["public"]["Enums"]["app_role"] - _user_id: string - } - Returns: boolean - } - has_permission: { - Args: { - _permission: Database["public"]["Enums"]["app_permission"] - _user_id: string - } - Returns: boolean - } - is_page_collaborator: { Args: { _page_id: string }; Returns: boolean } - is_page_owner: { Args: { _page_id: string }; Returns: boolean } - pages_search_text: { - Args: { rec: Database["public"]["Tables"]["pages"]["Row"] } - Returns: unknown - } - pictures_search_text: { - Args: { rec: Database["public"]["Tables"]["pictures"]["Row"] } - Returns: unknown - } - posts_search_text: { - Args: { rec: Database["public"]["Tables"]["posts"]["Row"] } - Returns: unknown - } - search_pages: { - Args: { result_limit?: number; search_query: string } - Returns: { - created_at: string - id: string - meta: Json - owner: string - rank: number - slug: string - tags: string[] - title: string - type: string - updated_at: string - }[] - } - search_pictures: { - Args: { result_limit?: number; search_query: string } - Returns: { - created_at: string - description: string - id: string - image_url: string - rank: number - tags: string[] - thumbnail_url: string - title: string - type: string - user_id: string - }[] - } - search_posts: { - Args: { result_limit?: number; search_query: string } - Returns: { - created_at: string - description: string - id: string - rank: number - title: string - type: string - user_id: string - }[] - } - } - Enums: { - app_permission: - | "pictures.read" - | "pictures.create" - | "pictures.update" - | "pictures.delete" - | "collections.read" - | "collections.create" - | "collections.update" - | "collections.delete" - | "comments.read" - | "comments.create" - | "comments.update" - | "comments.delete" - | "organization.manage" - app_role: "owner" | "admin" | "member" | "viewer" - cast_kind: "implicit" | "explicit" | "lossy" - category_relation_type: - | "generalization" - | "material_usage" - | "domain" - | "process_step" - | "standard" - | "other" - category_visibility: "public" | "unlisted" | "private" - collaborator_role: "viewer" | "editor" | "owner" - layout_visibility: "public" | "private" | "listed" | "custom" - translation_status: "draft" | "machine" | "reviewed" | "published" - type_kind: - | "primitive" - | "enum" - | "flags" - | "structure" - | "alias" - | "field" - type_visibility: "public" | "private" | "custom" - } - CompositeTypes: { - [_ in never]: never - } - } -} - -type DatabaseWithoutInternals = Omit - -type DefaultSchema = DatabaseWithoutInternals[Extract] - -export type Tables< - DefaultSchemaTableNameOrOptions extends - | keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) - | { schema: keyof DatabaseWithoutInternals }, - TableName extends DefaultSchemaTableNameOrOptions extends { - schema: keyof DatabaseWithoutInternals - } - ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & - DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) - : never = never, -> = DefaultSchemaTableNameOrOptions extends { - schema: keyof DatabaseWithoutInternals -} - ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & - DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends { - Row: infer R - } - ? R - : never - : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & - DefaultSchema["Views"]) - ? (DefaultSchema["Tables"] & - DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends { - Row: infer R - } - ? R - : never - : never - -export type TablesInsert< - DefaultSchemaTableNameOrOptions extends - | keyof DefaultSchema["Tables"] - | { schema: keyof DatabaseWithoutInternals }, - TableName extends DefaultSchemaTableNameOrOptions extends { - schema: keyof DatabaseWithoutInternals - } - ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] - : never = never, -> = DefaultSchemaTableNameOrOptions extends { - schema: keyof DatabaseWithoutInternals -} - ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends { - Insert: infer I - } - ? I - : never - : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] - ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends { - Insert: infer I - } - ? I - : never - : never - -export type TablesUpdate< - DefaultSchemaTableNameOrOptions extends - | keyof DefaultSchema["Tables"] - | { schema: keyof DatabaseWithoutInternals }, - TableName extends DefaultSchemaTableNameOrOptions extends { - schema: keyof DatabaseWithoutInternals - } - ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] - : never = never, -> = DefaultSchemaTableNameOrOptions extends { - schema: keyof DatabaseWithoutInternals -} - ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends { - Update: infer U - } - ? U - : never - : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] - ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends { - Update: infer U - } - ? U - : never - : never - -export type Enums< - DefaultSchemaEnumNameOrOptions extends - | keyof DefaultSchema["Enums"] - | { schema: keyof DatabaseWithoutInternals }, - EnumName extends DefaultSchemaEnumNameOrOptions extends { - schema: keyof DatabaseWithoutInternals - } - ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"] - : never = never, -> = DefaultSchemaEnumNameOrOptions extends { - schema: keyof DatabaseWithoutInternals -} - ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] - : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] - ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] - : never - -export type CompositeTypes< - PublicCompositeTypeNameOrOptions extends - | keyof DefaultSchema["CompositeTypes"] - | { schema: keyof DatabaseWithoutInternals }, - CompositeTypeName extends PublicCompositeTypeNameOrOptions extends { - schema: keyof DatabaseWithoutInternals - } - ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] - : never = never, -> = PublicCompositeTypeNameOrOptions extends { - schema: keyof DatabaseWithoutInternals -} - ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] - : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] - ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] - : never - -export const Constants = { - graphql_public: { - Enums: {}, - }, - public: { - Enums: { - app_permission: [ - "pictures.read", - "pictures.create", - "pictures.update", - "pictures.delete", - "collections.read", - "collections.create", - "collections.update", - "collections.delete", - "comments.read", - "comments.create", - "comments.update", - "comments.delete", - "organization.manage", - ], - app_role: ["owner", "admin", "member", "viewer"], - cast_kind: ["implicit", "explicit", "lossy"], - category_relation_type: [ - "generalization", - "material_usage", - "domain", - "process_step", - "standard", - "other", - ], - category_visibility: ["public", "unlisted", "private"], - collaborator_role: ["viewer", "editor", "owner"], - layout_visibility: ["public", "private", "listed", "custom"], - translation_status: ["draft", "machine", "reviewed", "published"], - type_kind: ["primitive", "enum", "flags", "structure", "alias", "field"], - type_visibility: ["public", "private", "custom"], - }, - }, -} as const +export type Json = + | string + | number + | boolean + | null + | { [key: string]: Json | undefined } + | Json[] + +export type Database = { + // Allows to automatically instantiate createClient with right options + // instead of createClient(URL, KEY) + __InternalSupabase: { + PostgrestVersion: "13.0.5" + } + graphql_public: { + Tables: { + [_ in never]: never + } + Views: { + [_ in never]: never + } + Functions: { + graphql: { + Args: { + extensions?: Json + operationName?: string + query?: string + variables?: Json + } + Returns: Json + } + } + Enums: { + [_ in never]: never + } + CompositeTypes: { + [_ in never]: never + } + } + public: { + Tables: { + campaigns: { + Row: { + completed_at: string | null + created_at: string + group_ids: string[] + id: string + lang: string | null + meta: Json + name: string + owner_id: string + page_id: string | null + page_slug: string | null + scheduled_at: string | null + started_at: string | null + stats: Json + status: string + subject: string | null + tracking_id: string | null + updated_at: string + vars: Json + } + Insert: { + completed_at?: string | null + created_at?: string + group_ids?: string[] + id?: string + lang?: string | null + meta?: Json + name: string + owner_id: string + page_id?: string | null + page_slug?: string | null + scheduled_at?: string | null + started_at?: string | null + stats?: Json + status?: string + subject?: string | null + tracking_id?: string | null + updated_at?: string + vars?: Json + } + Update: { + completed_at?: string | null + created_at?: string + group_ids?: string[] + id?: string + lang?: string | null + meta?: Json + name?: string + owner_id?: string + page_id?: string | null + page_slug?: string | null + scheduled_at?: string | null + started_at?: string | null + stats?: Json + status?: string + subject?: string | null + tracking_id?: string | null + updated_at?: string + vars?: Json + } + Relationships: [] + } + categories: { + Row: { + created_at: string + description: string | null + id: string + meta: Json | null + name: string + owner_id: string | null + slug: string + updated_at: string + visibility: Database["public"]["Enums"]["category_visibility"] + } + Insert: { + created_at?: string + description?: string | null + id?: string + meta?: Json | null + name: string + owner_id?: string | null + slug: string + updated_at?: string + visibility?: Database["public"]["Enums"]["category_visibility"] + } + Update: { + created_at?: string + description?: string | null + id?: string + meta?: Json | null + name?: string + owner_id?: string | null + slug?: string + updated_at?: string + visibility?: Database["public"]["Enums"]["category_visibility"] + } + Relationships: [] + } + category_relations: { + Row: { + child_category_id: string + created_at: string + parent_category_id: string + relation_type: Database["public"]["Enums"]["category_relation_type"] + } + Insert: { + child_category_id: string + created_at?: string + parent_category_id: string + relation_type: Database["public"]["Enums"]["category_relation_type"] + } + Update: { + child_category_id?: string + created_at?: string + parent_category_id?: string + relation_type?: Database["public"]["Enums"]["category_relation_type"] + } + Relationships: [ + { + foreignKeyName: "category_relations_child_category_id_fkey" + columns: ["child_category_id"] + isOneToOne: false + referencedRelation: "categories" + referencedColumns: ["id"] + }, + { + foreignKeyName: "category_relations_parent_category_id_fkey" + columns: ["parent_category_id"] + isOneToOne: false + referencedRelation: "categories" + referencedColumns: ["id"] + }, + ] + } + collection_pictures: { + Row: { + added_at: string + collection_id: string + id: string + picture_id: string + } + Insert: { + added_at?: string + collection_id: string + id?: string + picture_id: string + } + Update: { + added_at?: string + collection_id?: string + id?: string + picture_id?: string + } + Relationships: [ + { + foreignKeyName: "collection_pictures_collection_id_fkey" + columns: ["collection_id"] + isOneToOne: false + referencedRelation: "collections" + referencedColumns: ["id"] + }, + { + foreignKeyName: "collection_pictures_picture_id_fkey" + columns: ["picture_id"] + isOneToOne: false + referencedRelation: "pictures" + referencedColumns: ["id"] + }, + ] + } + collection_posts: { + Row: { + collection_id: string + created_at: string + id: string + post_id: string + } + Insert: { + collection_id: string + created_at?: string + id?: string + post_id: string + } + Update: { + collection_id?: string + created_at?: string + id?: string + post_id?: string + } + Relationships: [ + { + foreignKeyName: "collection_posts_collection_id_fkey" + columns: ["collection_id"] + isOneToOne: false + referencedRelation: "collections" + referencedColumns: ["id"] + }, + { + foreignKeyName: "collection_posts_post_id_fkey" + columns: ["post_id"] + isOneToOne: false + referencedRelation: "posts" + referencedColumns: ["id"] + }, + ] + } + collections: { + Row: { + content: Json | null + created_at: string + description: string | null + id: string + is_public: boolean + layout: Json | null + name: string + slug: string + updated_at: string + user_id: string + } + Insert: { + content?: Json | null + created_at?: string + description?: string | null + id?: string + is_public?: boolean + layout?: Json | null + name: string + slug: string + updated_at?: string + user_id: string + } + Update: { + content?: Json | null + created_at?: string + description?: string | null + id?: string + is_public?: boolean + layout?: Json | null + name?: string + slug?: string + updated_at?: string + user_id?: string + } + Relationships: [] + } + comment_likes: { + Row: { + comment_id: string + created_at: string + id: string + user_id: string + } + Insert: { + comment_id: string + created_at?: string + id?: string + user_id: string + } + Update: { + comment_id?: string + created_at?: string + id?: string + user_id?: string + } + Relationships: [] + } + comments: { + Row: { + content: string + created_at: string + id: string + likes_count: number | null + parent_comment_id: string | null + picture_id: string + updated_at: string + user_id: string + } + Insert: { + content: string + created_at?: string + id?: string + likes_count?: number | null + parent_comment_id?: string | null + picture_id: string + updated_at?: string + user_id: string + } + Update: { + content?: string + created_at?: string + id?: string + likes_count?: number | null + parent_comment_id?: string | null + picture_id?: string + updated_at?: string + user_id?: string + } + Relationships: [ + { + foreignKeyName: "comments_parent_fk" + columns: ["parent_comment_id"] + isOneToOne: false + referencedRelation: "comments" + referencedColumns: ["id"] + }, + ] + } + contact_group_members: { + Row: { + added_at: string + contact_id: string + group_id: string + } + Insert: { + added_at?: string + contact_id: string + group_id: string + } + Update: { + added_at?: string + contact_id?: string + group_id?: string + } + Relationships: [ + { + foreignKeyName: "contact_group_members_contact_id_fkey" + columns: ["contact_id"] + isOneToOne: false + referencedRelation: "contacts" + referencedColumns: ["id"] + }, + { + foreignKeyName: "contact_group_members_group_id_fkey" + columns: ["group_id"] + isOneToOne: false + referencedRelation: "contact_groups" + referencedColumns: ["id"] + }, + ] + } + contact_groups: { + Row: { + created_at: string + description: string | null + id: string + meta: Json + name: string + owner_id: string + updated_at: string + } + Insert: { + created_at?: string + description?: string | null + id?: string + meta?: Json + name: string + owner_id: string + updated_at?: string + } + Update: { + created_at?: string + description?: string | null + id?: string + meta?: Json + name?: string + owner_id?: string + updated_at?: string + } + Relationships: [] + } + contacts: { + Row: { + address: Json + created_at: string + emails: Json + first_name: string | null + id: string + language: string | null + last_name: string | null + log: Json + meta: Json + name: string | null + notes: string | null + organization: string | null + owner_id: string + phone: string | null + source: string | null + status: string + tags: string[] | null + title: string | null + updated_at: string + } + Insert: { + address?: Json + created_at?: string + emails?: Json + first_name?: string | null + id?: string + language?: string | null + last_name?: string | null + log?: Json + meta?: Json + name?: string | null + notes?: string | null + organization?: string | null + owner_id: string + phone?: string | null + source?: string | null + status?: string + tags?: string[] | null + title?: string | null + updated_at?: string + } + Update: { + address?: Json + created_at?: string + emails?: Json + first_name?: string | null + id?: string + language?: string | null + last_name?: string | null + log?: Json + meta?: Json + name?: string | null + notes?: string | null + organization?: string | null + owner_id?: string + phone?: string | null + source?: string | null + status?: string + tags?: string[] | null + title?: string | null + updated_at?: string + } + Relationships: [] + } + context_definitions: { + Row: { + created_at: string | null + default_filters: Json + default_templates: Json + description: string | null + display_name: string + icon: string | null + id: string + is_active: boolean | null + name: string + updated_at: string | null + } + Insert: { + created_at?: string | null + default_filters?: Json + default_templates?: Json + description?: string | null + display_name: string + icon?: string | null + id?: string + is_active?: boolean | null + name: string + updated_at?: string | null + } + Update: { + created_at?: string | null + default_filters?: Json + default_templates?: Json + description?: string | null + display_name?: string + icon?: string | null + id?: string + is_active?: boolean | null + name?: string + updated_at?: string | null + } + Relationships: [] + } + filter_usage_logs: { + Row: { + context: string + created_at: string | null + error_message: string | null + filters_applied: string[] | null + id: string + input_length: number + model: string + output_length: number + processing_time_ms: number + provider: string + success: boolean + template_id: string | null + user_id: string | null + } + Insert: { + context: string + created_at?: string | null + error_message?: string | null + filters_applied?: string[] | null + id?: string + input_length: number + model: string + output_length: number + processing_time_ms: number + provider: string + success: boolean + template_id?: string | null + user_id?: string | null + } + Update: { + context?: string + created_at?: string | null + error_message?: string | null + filters_applied?: string[] | null + id?: string + input_length?: number + model?: string + output_length?: number + processing_time_ms?: number + provider?: string + success?: boolean + template_id?: string | null + user_id?: string | null + } + Relationships: [ + { + foreignKeyName: "filter_usage_logs_template_id_fkey" + columns: ["template_id"] + isOneToOne: false + referencedRelation: "user_templates" + referencedColumns: ["id"] + }, + ] + } + grid_area_places: { + Row: { + created_at: string + grid_area_id: string + id: string + place_id: string + rank: number | null + } + Insert: { + created_at?: string + grid_area_id: string + id?: string + place_id: string + rank?: number | null + } + Update: { + created_at?: string + grid_area_id?: string + id?: string + place_id?: string + rank?: number | null + } + Relationships: [ + { + foreignKeyName: "grid_area_places_grid_area_id_fkey" + columns: ["grid_area_id"] + isOneToOne: false + referencedRelation: "grid_areas" + referencedColumns: ["id"] + }, + { + foreignKeyName: "grid_area_places_place_id_fkey" + columns: ["place_id"] + isOneToOne: false + referencedRelation: "places" + referencedColumns: ["place_id"] + }, + ] + } + grid_areas: { + Row: { + area_sqkm: number | null + bbox: Json | null + center: Json | null + created_at: string + geometry: Json | null + gid: string + id: string + level: number + max_dist_km: number | null + meta: Json | null + name: string + region: string + stats: Json | null + updated_at: string + user_id: string | null + } + Insert: { + area_sqkm?: number | null + bbox?: Json | null + center?: Json | null + created_at?: string + geometry?: Json | null + gid: string + id?: string + level: number + max_dist_km?: number | null + meta?: Json | null + name: string + region: string + stats?: Json | null + updated_at?: string + user_id?: string | null + } + Update: { + area_sqkm?: number | null + bbox?: Json | null + center?: Json | null + created_at?: string + geometry?: Json | null + gid?: string + id?: string + level?: number + max_dist_km?: number | null + meta?: Json | null + name?: string + region?: string + stats?: Json | null + updated_at?: string + user_id?: string | null + } + Relationships: [] + } + grid_search_runs: { + Row: { + created_at: string + id: string + parent: string | null + request: Json + result: Json | null + run_id: string + status: string + updated_at: string + user_id: string + } + Insert: { + created_at?: string + id: string + parent?: string | null + request: Json + result?: Json | null + run_id: string + status?: string + updated_at?: string + user_id: string + } + Update: { + created_at?: string + id?: string + parent?: string | null + request?: Json + result?: Json | null + run_id?: string + status?: string + updated_at?: string + user_id?: string + } + Relationships: [ + { + foreignKeyName: "grid_search_runs_parent_fkey" + columns: ["parent"] + isOneToOne: false + referencedRelation: "grid_search_runs" + referencedColumns: ["id"] + }, + ] + } + i18n_glossaries: { + Row: { + creation_time: string | null + entry_count: number | null + glossary_id: string + hash: string | null + local_created_at: string | null + local_updated_at: string | null + name: string + ready: boolean | null + source_lang: string + target_lang: string + } + Insert: { + creation_time?: string | null + entry_count?: number | null + glossary_id: string + hash?: string | null + local_created_at?: string | null + local_updated_at?: string | null + name: string + ready?: boolean | null + source_lang: string + target_lang: string + } + Update: { + creation_time?: string | null + entry_count?: number | null + glossary_id?: string + hash?: string | null + local_created_at?: string | null + local_updated_at?: string | null + name?: string + ready?: boolean | null + source_lang?: string + target_lang?: string + } + Relationships: [] + } + i18n_glossary_terms: { + Row: { + created_at: string | null + id: string + source_lang: string + target_lang: string + term: string + translation: string + updated_at: string | null + } + Insert: { + created_at?: string | null + id?: string + source_lang: string + target_lang: string + term: string + translation: string + updated_at?: string | null + } + Update: { + created_at?: string | null + id?: string + source_lang?: string + target_lang?: string + term?: string + translation?: string + updated_at?: string | null + } + Relationships: [] + } + i18n_translations: { + Row: { + created_at: string | null + dst_lang: string + dst_text: string + id: string + meta: Json | null + src_lang: string + src_text: string + updated_at: string | null + } + Insert: { + created_at?: string | null + dst_lang: string + dst_text: string + id?: string + meta?: Json | null + src_lang: string + src_text: string + updated_at?: string | null + } + Update: { + created_at?: string | null + dst_lang?: string + dst_text?: string + id?: string + meta?: Json | null + src_lang?: string + src_text?: string + updated_at?: string | null + } + Relationships: [] + } + layouts: { + Row: { + created_at: string + id: string + is_predefined: boolean | null + layout_json: Json + meta: Json | null + name: string + owner_id: string + type: string | null + updated_at: string + visibility: Database["public"]["Enums"]["layout_visibility"] + } + Insert: { + created_at?: string + id?: string + is_predefined?: boolean | null + layout_json: Json + meta?: Json | null + name: string + owner_id: string + type?: string | null + updated_at?: string + visibility?: Database["public"]["Enums"]["layout_visibility"] + } + Update: { + created_at?: string + id?: string + is_predefined?: boolean | null + layout_json?: Json + meta?: Json | null + name?: string + owner_id?: string + type?: string | null + updated_at?: string + visibility?: Database["public"]["Enums"]["layout_visibility"] + } + Relationships: [] + } + likes: { + Row: { + created_at: string + id: string + picture_id: string + user_id: string + } + Insert: { + created_at?: string + id?: string + picture_id: string + user_id: string + } + Update: { + created_at?: string + id?: string + picture_id?: string + user_id?: string + } + Relationships: [] + } + marketing_emails: { + Row: { + campaign: string | null + created_at: string + email: string + error_message: string | null + from_address: string | null + id: string + lang: string | null + last_retry_at: string | null + meta: Json | null + name: string | null + page_slug: string + retry_count: number + sender_id: string | null + sent_at: string | null + status: string + subject: string | null + tracking_id: string | null + unsubscribe_token: string + unsubscribed: boolean + unsubscribed_at: string | null + updated_at: string + } + Insert: { + campaign?: string | null + created_at?: string + email: string + error_message?: string | null + from_address?: string | null + id?: string + lang?: string | null + last_retry_at?: string | null + meta?: Json | null + name?: string | null + page_slug: string + retry_count?: number + sender_id?: string | null + sent_at?: string | null + status?: string + subject?: string | null + tracking_id?: string | null + unsubscribe_token?: string + unsubscribed?: boolean + unsubscribed_at?: string | null + updated_at?: string + } + Update: { + campaign?: string | null + created_at?: string + email?: string + error_message?: string | null + from_address?: string | null + id?: string + lang?: string | null + last_retry_at?: string | null + meta?: Json | null + name?: string | null + page_slug?: string + retry_count?: number + sender_id?: string | null + sent_at?: string | null + status?: string + subject?: string | null + tracking_id?: string | null + unsubscribe_token?: string + unsubscribed?: boolean + unsubscribed_at?: string | null + updated_at?: string + } + Relationships: [] + } + organizations: { + Row: { + created_at: string + id: string + name: string + slug: string + updated_at: string + } + Insert: { + created_at?: string + id?: string + name: string + slug: string + updated_at?: string + } + Update: { + created_at?: string + id?: string + name?: string + slug?: string + updated_at?: string + } + Relationships: [] + } + page_collaborators: { + Row: { + created_at: string + id: string + page_id: string + role: Database["public"]["Enums"]["collaborator_role"] + user_id: string + } + Insert: { + created_at?: string + id?: string + page_id: string + role?: Database["public"]["Enums"]["collaborator_role"] + user_id: string + } + Update: { + created_at?: string + id?: string + page_id?: string + role?: Database["public"]["Enums"]["collaborator_role"] + user_id?: string + } + Relationships: [ + { + foreignKeyName: "page_collaborators_page_id_fkey" + columns: ["page_id"] + isOneToOne: false + referencedRelation: "pages" + referencedColumns: ["id"] + }, + ] + } + pages: { + Row: { + content: Json | null + created_at: string + id: string + is_public: boolean + is_version_of: string | null + meta: Json | null + owner: string + parent: string | null + slug: string + tags: string[] | null + title: string + type: string | null + updated_at: string + visible: boolean + } + Insert: { + content?: Json | null + created_at?: string + id?: string + is_public?: boolean + is_version_of?: string | null + meta?: Json | null + owner: string + parent?: string | null + slug: string + tags?: string[] | null + title: string + type?: string | null + updated_at?: string + visible?: boolean + } + Update: { + content?: Json | null + created_at?: string + id?: string + is_public?: boolean + is_version_of?: string | null + meta?: Json | null + owner?: string + parent?: string | null + slug?: string + tags?: string[] | null + title?: string + type?: string | null + updated_at?: string + visible?: boolean + } + Relationships: [ + { + foreignKeyName: "pages_is_version_of_fkey" + columns: ["is_version_of"] + isOneToOne: false + referencedRelation: "pages" + referencedColumns: ["id"] + }, + { + foreignKeyName: "pages_parent_fkey" + columns: ["parent"] + isOneToOne: false + referencedRelation: "pages" + referencedColumns: ["id"] + }, + ] + } + pictures: { + Row: { + created_at: string + description: string | null + flags: string[] | null + id: string + image_url: string + is_selected: boolean + likes_count: number | null + meta: Json | null + organization_id: string | null + parent_id: string | null + position: number | null + post_id: string | null + tags: string[] | null + thumbnail_url: string | null + title: string + type: string | null + updated_at: string + user_id: string + visible: boolean + } + Insert: { + created_at?: string + description?: string | null + flags?: string[] | null + id?: string + image_url: string + is_selected?: boolean + likes_count?: number | null + meta?: Json | null + organization_id?: string | null + parent_id?: string | null + position?: number | null + post_id?: string | null + tags?: string[] | null + thumbnail_url?: string | null + title: string + type?: string | null + updated_at?: string + user_id: string + visible?: boolean + } + Update: { + created_at?: string + description?: string | null + flags?: string[] | null + id?: string + image_url?: string + is_selected?: boolean + likes_count?: number | null + meta?: Json | null + organization_id?: string | null + parent_id?: string | null + position?: number | null + post_id?: string | null + tags?: string[] | null + thumbnail_url?: string | null + title?: string + type?: string | null + updated_at?: string + user_id?: string + visible?: boolean + } + Relationships: [ + { + foreignKeyName: "pictures_organization_id_fkey" + columns: ["organization_id"] + isOneToOne: false + referencedRelation: "organizations" + referencedColumns: ["id"] + }, + { + foreignKeyName: "pictures_parent_id_fkey" + columns: ["parent_id"] + isOneToOne: false + referencedRelation: "pictures" + referencedColumns: ["id"] + }, + { + foreignKeyName: "pictures_post_id_fkey" + columns: ["post_id"] + isOneToOne: false + referencedRelation: "posts" + referencedColumns: ["id"] + }, + ] + } + place_searches: { + Row: { + created_at: string + id: string + input_hash: string + input_params: Json + result_place_ids: string[] + run_id: string | null + user_id: string | null + } + Insert: { + created_at?: string + id?: string + input_hash: string + input_params: Json + result_place_ids: string[] + run_id?: string | null + user_id?: string | null + } + Update: { + created_at?: string + id?: string + input_hash?: string + input_params?: Json + result_place_ids?: string[] + run_id?: string | null + user_id?: string | null + } + Relationships: [] + } + places: { + Row: { + address: string | null + city: string | null + contacts: Json | null + continent: string | null + country: string | null + created_at: string + description: string | null + gps_coordinates: Json | null + media: Json | null + meta: Json | null + operating_hours: Json | null + phone: string | null + place_id: string + raw_data: Json | null + thumbnail: string | null + title: string | null + types: string[] | null + updated_at: string + user_id: string | null + website: string | null + } + Insert: { + address?: string | null + city?: string | null + contacts?: Json | null + continent?: string | null + country?: string | null + created_at?: string + description?: string | null + gps_coordinates?: Json | null + media?: Json | null + meta?: Json | null + operating_hours?: Json | null + phone?: string | null + place_id: string + raw_data?: Json | null + thumbnail?: string | null + title?: string | null + types?: string[] | null + updated_at?: string + user_id?: string | null + website?: string | null + } + Update: { + address?: string | null + city?: string | null + contacts?: Json | null + continent?: string | null + country?: string | null + created_at?: string + description?: string | null + gps_coordinates?: Json | null + media?: Json | null + meta?: Json | null + operating_hours?: Json | null + phone?: string | null + place_id?: string + raw_data?: Json | null + thumbnail?: string | null + title?: string | null + types?: string[] | null + updated_at?: string + user_id?: string | null + website?: string | null + } + Relationships: [] + } + posts: { + Row: { + created_at: string | null + description: string | null + id: string + meta: Json | null + settings: Json | null + title: string + updated_at: string | null + user_id: string + } + Insert: { + created_at?: string | null + description?: string | null + id?: string + meta?: Json | null + settings?: Json | null + title: string + updated_at?: string | null + user_id: string + } + Update: { + created_at?: string | null + description?: string | null + id?: string + meta?: Json | null + settings?: Json | null + title?: string + updated_at?: string | null + user_id?: string + } + Relationships: [] + } + profiles: { + Row: { + aimlapi_api_key: string | null + avatar_url: string | null + bio: string | null + bria_api_key: string | null + created_at: string + display_name: string | null + google_api_key: string | null + huggingface_api_key: string | null + id: string + openai_api_key: string | null + pages: Json | null + replicate_api_key: string | null + settings: Json | null + updated_at: string + user_id: string + username: string | null + } + Insert: { + aimlapi_api_key?: string | null + avatar_url?: string | null + bio?: string | null + bria_api_key?: string | null + created_at?: string + display_name?: string | null + google_api_key?: string | null + huggingface_api_key?: string | null + id?: string + openai_api_key?: string | null + pages?: Json | null + replicate_api_key?: string | null + settings?: Json | null + updated_at?: string + user_id: string + username?: string | null + } + Update: { + aimlapi_api_key?: string | null + avatar_url?: string | null + bio?: string | null + bria_api_key?: string | null + created_at?: string + display_name?: string | null + google_api_key?: string | null + huggingface_api_key?: string | null + id?: string + openai_api_key?: string | null + pages?: Json | null + replicate_api_key?: string | null + settings?: Json | null + updated_at?: string + user_id?: string + username?: string | null + } + Relationships: [] + } + provider_configs: { + Row: { + base_url: string + created_at: string | null + display_name: string + id: string + is_active: boolean | null + models: Json + name: string + rate_limits: Json | null + settings: Json | null + updated_at: string | null + user_id: string | null + } + Insert: { + base_url: string + created_at?: string | null + display_name: string + id?: string + is_active?: boolean | null + models?: Json + name: string + rate_limits?: Json | null + settings?: Json | null + updated_at?: string | null + user_id?: string | null + } + Update: { + base_url?: string + created_at?: string | null + display_name?: string + id?: string + is_active?: boolean | null + models?: Json + name?: string + rate_limits?: Json | null + settings?: Json | null + updated_at?: string | null + user_id?: string | null + } + Relationships: [] + } + resource_acl: { + Row: { + created_at: string | null + group_name: string | null + id: string + log: Json | null + meta: Json | null + path: string | null + permissions: string[] + resource_id: string + resource_owner_id: string | null + resource_type: string + updated_at: string | null + user_id: string | null + } + Insert: { + created_at?: string | null + group_name?: string | null + id?: string + log?: Json | null + meta?: Json | null + path?: string | null + permissions?: string[] + resource_id: string + resource_owner_id?: string | null + resource_type: string + updated_at?: string | null + user_id?: string | null + } + Update: { + created_at?: string | null + group_name?: string | null + id?: string + log?: Json | null + meta?: Json | null + path?: string | null + permissions?: string[] + resource_id?: string + resource_owner_id?: string | null + resource_type?: string + updated_at?: string | null + user_id?: string | null + } + Relationships: [] + } + role_permissions: { + Row: { + created_at: string + id: string + permission: Database["public"]["Enums"]["app_permission"] + role: Database["public"]["Enums"]["app_role"] + } + Insert: { + created_at?: string + id?: string + permission: Database["public"]["Enums"]["app_permission"] + role: Database["public"]["Enums"]["app_role"] + } + Update: { + created_at?: string + id?: string + permission?: Database["public"]["Enums"]["app_permission"] + role?: Database["public"]["Enums"]["app_role"] + } + Relationships: [] + } + searches: { + Row: { + created_at: string + id: string + input_hash: string + input_params: Json + result_place_ids: string[] + } + Insert: { + created_at?: string + id?: string + input_hash: string + input_params: Json + result_place_ids: string[] + } + Update: { + created_at?: string + id?: string + input_hash?: string + input_params?: Json + result_place_ids?: string[] + } + Relationships: [] + } + transactions: { + Row: { + buyer_email: string | null + buyer_ip: unknown + buyer_name: string | null + buyer_profile: Json + created_at: string + currency: string + external_checkout_id: string | null + external_order_id: string | null + id: string + metadata: Json + note: string | null + payment_provider: string | null + product_info: Json + shipping_info: Json + status: string + total_amount: number + updated_at: string + user_id: string + vendor_info: Json + } + Insert: { + buyer_email?: string | null + buyer_ip?: unknown + buyer_name?: string | null + buyer_profile?: Json + created_at?: string + currency?: string + external_checkout_id?: string | null + external_order_id?: string | null + id?: string + metadata?: Json + note?: string | null + payment_provider?: string | null + product_info?: Json + shipping_info?: Json + status?: string + total_amount?: number + updated_at?: string + user_id: string + vendor_info?: Json + } + Update: { + buyer_email?: string | null + buyer_ip?: unknown + buyer_name?: string | null + buyer_profile?: Json + created_at?: string + currency?: string + external_checkout_id?: string | null + external_order_id?: string | null + id?: string + metadata?: Json + note?: string | null + payment_provider?: string | null + product_info?: Json + shipping_info?: Json + status?: string + total_amount?: number + updated_at?: string + user_id?: string + vendor_info?: Json + } + Relationships: [] + } + type_casts: { + Row: { + cast_kind: Database["public"]["Enums"]["cast_kind"] + description: string | null + from_type_id: string + to_type_id: string + } + Insert: { + cast_kind: Database["public"]["Enums"]["cast_kind"] + description?: string | null + from_type_id: string + to_type_id: string + } + Update: { + cast_kind?: Database["public"]["Enums"]["cast_kind"] + description?: string | null + from_type_id?: string + to_type_id?: string + } + Relationships: [ + { + foreignKeyName: "type_casts_from_type_id_fkey" + columns: ["from_type_id"] + isOneToOne: false + referencedRelation: "types" + referencedColumns: ["id"] + }, + { + foreignKeyName: "type_casts_to_type_id_fkey" + columns: ["to_type_id"] + isOneToOne: false + referencedRelation: "types" + referencedColumns: ["id"] + }, + ] + } + type_enum_values: { + Row: { + id: string + label: string + order: number + type_id: string + value: string + } + Insert: { + id?: string + label: string + order?: number + type_id: string + value: string + } + Update: { + id?: string + label?: string + order?: number + type_id?: string + value?: string + } + Relationships: [ + { + foreignKeyName: "type_enum_values_type_id_fkey" + columns: ["type_id"] + isOneToOne: false + referencedRelation: "types" + referencedColumns: ["id"] + }, + ] + } + type_flag_values: { + Row: { + bit: number + id: string + name: string + type_id: string + } + Insert: { + bit: number + id?: string + name: string + type_id: string + } + Update: { + bit?: number + id?: string + name?: string + type_id?: string + } + Relationships: [ + { + foreignKeyName: "type_flag_values_type_id_fkey" + columns: ["type_id"] + isOneToOne: false + referencedRelation: "types" + referencedColumns: ["id"] + }, + ] + } + type_structure_fields: { + Row: { + default_value: Json | null + field_name: string + field_type_id: string + id: string + order: number + required: boolean + structure_type_id: string + } + Insert: { + default_value?: Json | null + field_name: string + field_type_id: string + id?: string + order?: number + required?: boolean + structure_type_id: string + } + Update: { + default_value?: Json | null + field_name?: string + field_type_id?: string + id?: string + order?: number + required?: boolean + structure_type_id?: string + } + Relationships: [ + { + foreignKeyName: "type_structure_fields_field_type_id_fkey" + columns: ["field_type_id"] + isOneToOne: false + referencedRelation: "types" + referencedColumns: ["id"] + }, + { + foreignKeyName: "type_structure_fields_structure_type_id_fkey" + columns: ["structure_type_id"] + isOneToOne: false + referencedRelation: "types" + referencedColumns: ["id"] + }, + ] + } + types: { + Row: { + created_at: string + description: string | null + id: string + json_schema: Json | null + kind: Database["public"]["Enums"]["type_kind"] + meta: Json | null + name: string + owner_id: string | null + parent_type_id: string | null + settings: Json | null + updated_at: string + visibility: Database["public"]["Enums"]["type_visibility"] + } + Insert: { + created_at?: string + description?: string | null + id?: string + json_schema?: Json | null + kind: Database["public"]["Enums"]["type_kind"] + meta?: Json | null + name: string + owner_id?: string | null + parent_type_id?: string | null + settings?: Json | null + updated_at?: string + visibility?: Database["public"]["Enums"]["type_visibility"] + } + Update: { + created_at?: string + description?: string | null + id?: string + json_schema?: Json | null + kind?: Database["public"]["Enums"]["type_kind"] + meta?: Json | null + name?: string + owner_id?: string | null + parent_type_id?: string | null + settings?: Json | null + updated_at?: string + visibility?: Database["public"]["Enums"]["type_visibility"] + } + Relationships: [ + { + foreignKeyName: "types_parent_type_id_fkey" + columns: ["parent_type_id"] + isOneToOne: false + referencedRelation: "types" + referencedColumns: ["id"] + }, + ] + } + user_filter_configs: { + Row: { + context: string + created_at: string | null + custom_filters: Json | null + default_templates: string[] | null + id: string + is_default: boolean | null + model: string + provider: string + updated_at: string | null + user_id: string | null + variables: Json | null + } + Insert: { + context: string + created_at?: string | null + custom_filters?: Json | null + default_templates?: string[] | null + id?: string + is_default?: boolean | null + model?: string + provider?: string + updated_at?: string | null + user_id?: string | null + variables?: Json | null + } + Update: { + context?: string + created_at?: string | null + custom_filters?: Json | null + default_templates?: string[] | null + id?: string + is_default?: boolean | null + model?: string + provider?: string + updated_at?: string | null + user_id?: string | null + variables?: Json | null + } + Relationships: [] + } + user_organizations: { + Row: { + created_at: string + id: string + organization_id: string + role: string + updated_at: string + user_id: string + } + Insert: { + created_at?: string + id?: string + organization_id: string + role?: string + updated_at?: string + user_id: string + } + Update: { + created_at?: string + id?: string + organization_id?: string + role?: string + updated_at?: string + user_id?: string + } + Relationships: [ + { + foreignKeyName: "user_organizations_organization_id_fkey" + columns: ["organization_id"] + isOneToOne: false + referencedRelation: "organizations" + referencedColumns: ["id"] + }, + ] + } + user_roles: { + Row: { + created_at: string + id: string + organization_id: string | null + role: Database["public"]["Enums"]["app_role"] + updated_at: string + user_id: string + } + Insert: { + created_at?: string + id?: string + organization_id?: string | null + role: Database["public"]["Enums"]["app_role"] + updated_at?: string + user_id: string + } + Update: { + created_at?: string + id?: string + organization_id?: string | null + role?: Database["public"]["Enums"]["app_role"] + updated_at?: string + user_id?: string + } + Relationships: [ + { + foreignKeyName: "user_roles_user_id_fkey" + columns: ["user_id"] + isOneToOne: false + referencedRelation: "profiles" + referencedColumns: ["user_id"] + }, + ] + } + user_secrets: { + Row: { + aimlapi_api_key: string | null + bria_api_key: string | null + created_at: string + google_api_key: string | null + huggingface_api_key: string | null + is_admin: boolean | null + openai_api_key: string | null + replicate_api_key: string | null + settings: Json | null + updated_at: string + user_id: string + } + Insert: { + aimlapi_api_key?: string | null + bria_api_key?: string | null + created_at?: string + google_api_key?: string | null + huggingface_api_key?: string | null + is_admin?: boolean | null + openai_api_key?: string | null + replicate_api_key?: string | null + settings?: Json | null + updated_at?: string + user_id: string + } + Update: { + aimlapi_api_key?: string | null + bria_api_key?: string | null + created_at?: string + google_api_key?: string | null + huggingface_api_key?: string | null + is_admin?: boolean | null + openai_api_key?: string | null + replicate_api_key?: string | null + settings?: Json | null + updated_at?: string + user_id?: string + } + Relationships: [] + } + user_templates: { + Row: { + context: string + created_at: string | null + description: string | null + filters: string[] | null + format: string | null + id: string + is_public: boolean | null + model: string + name: string + prompt: string + provider: string + updated_at: string | null + usage_count: number | null + user_id: string | null + } + Insert: { + context: string + created_at?: string | null + description?: string | null + filters?: string[] | null + format?: string | null + id?: string + is_public?: boolean | null + model?: string + name: string + prompt: string + provider?: string + updated_at?: string | null + usage_count?: number | null + user_id?: string | null + } + Update: { + context?: string + created_at?: string | null + description?: string | null + filters?: string[] | null + format?: string | null + id?: string + is_public?: boolean | null + model?: string + name?: string + prompt?: string + provider?: string + updated_at?: string | null + usage_count?: number | null + user_id?: string | null + } + Relationships: [] + } + vfs_document_chunks: { + Row: { + chunk_index: number + content: string + created_at: string | null + embedding: string | null + id: string + vfs_id: string + } + Insert: { + chunk_index: number + content: string + created_at?: string | null + embedding?: string | null + id?: string + vfs_id: string + } + Update: { + chunk_index?: number + content?: string + created_at?: string | null + embedding?: string | null + id?: string + vfs_id?: string + } + Relationships: [ + { + foreignKeyName: "vfs_document_chunks_vfs_id_fkey" + columns: ["vfs_id"] + isOneToOne: false + referencedRelation: "vfs_index" + referencedColumns: ["id"] + }, + ] + } + vfs_index: { + Row: { + content: string | null + fts: unknown + id: string + is_vectorized: boolean | null + mime: string | null + mount: string + mtime: string | null + name: string + path: string + size: number | null + type: string + } + Insert: { + content?: string | null + fts?: unknown + id?: string + is_vectorized?: boolean | null + mime?: string | null + mount: string + mtime?: string | null + name: string + path: string + size?: number | null + type: string + } + Update: { + content?: string | null + fts?: unknown + id?: string + is_vectorized?: boolean | null + mime?: string | null + mount?: string + mtime?: string | null + name?: string + path?: string + size?: number | null + type?: string + } + Relationships: [] + } + widget_translations: { + Row: { + created_at: string | null + entity_id: string | null + entity_type: string | null + id: string + meta: Json | null + prop_path: string | null + source_lang: string + source_text: string | null + source_version: number | null + status: Database["public"]["Enums"]["translation_status"] | null + target_lang: string + translated_text: string | null + updated_at: string | null + widget_id: string | null + } + Insert: { + created_at?: string | null + entity_id?: string | null + entity_type?: string | null + id?: string + meta?: Json | null + prop_path?: string | null + source_lang: string + source_text?: string | null + source_version?: number | null + status?: Database["public"]["Enums"]["translation_status"] | null + target_lang: string + translated_text?: string | null + updated_at?: string | null + widget_id?: string | null + } + Update: { + created_at?: string | null + entity_id?: string | null + entity_type?: string | null + id?: string + meta?: Json | null + prop_path?: string | null + source_lang?: string + source_text?: string | null + source_version?: number | null + status?: Database["public"]["Enums"]["translation_status"] | null + target_lang?: string + translated_text?: string | null + updated_at?: string | null + widget_id?: string | null + } + Relationships: [] + } + wizard_sessions: { + Row: { + created_at: string + generated_image_url: string | null + id: string + input_images: string[] | null + prompt: string + status: string + updated_at: string + user_id: string + } + Insert: { + created_at?: string + generated_image_url?: string | null + id?: string + input_images?: string[] | null + prompt?: string + status?: string + updated_at?: string + user_id: string + } + Update: { + created_at?: string + generated_image_url?: string | null + id?: string + input_images?: string[] | null + prompt?: string + status?: string + updated_at?: string + user_id?: string + } + Relationships: [] + } + } + Views: { + marketing_unsubscribed: { + Row: { + email: string | null + } + Relationships: [] + } + } + Functions: { + authorize: { + Args: { + _role: Database["public"]["Enums"]["app_role"] + _user_id: string + } + Returns: boolean + } + has_permission: { + Args: { + _permission: Database["public"]["Enums"]["app_permission"] + _user_id: string + } + Returns: boolean + } + is_page_collaborator: { Args: { _page_id: string }; Returns: boolean } + is_page_owner: { Args: { _page_id: string }; Returns: boolean } + pages_search_text: { + Args: { rec: Database["public"]["Tables"]["pages"]["Row"] } + Returns: unknown + } + pictures_search_text: { + Args: { rec: Database["public"]["Tables"]["pictures"]["Row"] } + Returns: unknown + } + posts_search_text: { + Args: { rec: Database["public"]["Tables"]["posts"]["Row"] } + Returns: unknown + } + search_pages: { + Args: { result_limit?: number; search_query: string } + Returns: { + created_at: string + id: string + meta: Json + owner: string + rank: number + slug: string + tags: string[] + title: string + type: string + updated_at: string + }[] + } + search_pictures: { + Args: { result_limit?: number; search_query: string } + Returns: { + created_at: string + description: string + id: string + image_url: string + rank: number + tags: string[] + thumbnail_url: string + title: string + type: string + user_id: string + }[] + } + search_posts: { + Args: { result_limit?: number; search_query: string } + Returns: { + created_at: string + description: string + id: string + rank: number + title: string + type: string + user_id: string + }[] + } + } + Enums: { + app_permission: + | "pictures.read" + | "pictures.create" + | "pictures.update" + | "pictures.delete" + | "collections.read" + | "collections.create" + | "collections.update" + | "collections.delete" + | "comments.read" + | "comments.create" + | "comments.update" + | "comments.delete" + | "organization.manage" + app_role: "owner" | "admin" | "member" | "viewer" + cast_kind: "implicit" | "explicit" | "lossy" + category_relation_type: + | "generalization" + | "material_usage" + | "domain" + | "process_step" + | "standard" + | "other" + category_visibility: "public" | "unlisted" | "private" + collaborator_role: "viewer" | "editor" | "owner" + layout_visibility: "public" | "private" | "listed" | "custom" + translation_status: "draft" | "machine" | "reviewed" | "published" + type_kind: + | "primitive" + | "enum" + | "flags" + | "structure" + | "alias" + | "field" + type_visibility: "public" | "private" | "custom" + } + CompositeTypes: { + [_ in never]: never + } + } +} + +type DatabaseWithoutInternals = Omit + +type DefaultSchema = DatabaseWithoutInternals[Extract] + +export type Tables< + DefaultSchemaTableNameOrOptions extends + | keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) + | { schema: keyof DatabaseWithoutInternals }, + TableName extends DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals + } + ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & + DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) + : never = never, +> = DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals +} + ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & + DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends { + Row: infer R + } + ? R + : never + : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & + DefaultSchema["Views"]) + ? (DefaultSchema["Tables"] & + DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends { + Row: infer R + } + ? R + : never + : never + +export type TablesInsert< + DefaultSchemaTableNameOrOptions extends + | keyof DefaultSchema["Tables"] + | { schema: keyof DatabaseWithoutInternals }, + TableName extends DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals + } + ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] + : never = never, +> = DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals +} + ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends { + Insert: infer I + } + ? I + : never + : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] + ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends { + Insert: infer I + } + ? I + : never + : never + +export type TablesUpdate< + DefaultSchemaTableNameOrOptions extends + | keyof DefaultSchema["Tables"] + | { schema: keyof DatabaseWithoutInternals }, + TableName extends DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals + } + ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] + : never = never, +> = DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals +} + ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends { + Update: infer U + } + ? U + : never + : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] + ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends { + Update: infer U + } + ? U + : never + : never + +export type Enums< + DefaultSchemaEnumNameOrOptions extends + | keyof DefaultSchema["Enums"] + | { schema: keyof DatabaseWithoutInternals }, + EnumName extends DefaultSchemaEnumNameOrOptions extends { + schema: keyof DatabaseWithoutInternals + } + ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"] + : never = never, +> = DefaultSchemaEnumNameOrOptions extends { + schema: keyof DatabaseWithoutInternals +} + ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] + : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] + ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] + : never + +export type CompositeTypes< + PublicCompositeTypeNameOrOptions extends + | keyof DefaultSchema["CompositeTypes"] + | { schema: keyof DatabaseWithoutInternals }, + CompositeTypeName extends PublicCompositeTypeNameOrOptions extends { + schema: keyof DatabaseWithoutInternals + } + ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] + : never = never, +> = PublicCompositeTypeNameOrOptions extends { + schema: keyof DatabaseWithoutInternals +} + ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] + : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] + ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] + : never + +export const Constants = { + graphql_public: { + Enums: {}, + }, + public: { + Enums: { + app_permission: [ + "pictures.read", + "pictures.create", + "pictures.update", + "pictures.delete", + "collections.read", + "collections.create", + "collections.update", + "collections.delete", + "comments.read", + "comments.create", + "comments.update", + "comments.delete", + "organization.manage", + ], + app_role: ["owner", "admin", "member", "viewer"], + cast_kind: ["implicit", "explicit", "lossy"], + category_relation_type: [ + "generalization", + "material_usage", + "domain", + "process_step", + "standard", + "other", + ], + category_visibility: ["public", "unlisted", "private"], + collaborator_role: ["viewer", "editor", "owner"], + layout_visibility: ["public", "private", "listed", "custom"], + translation_status: ["draft", "machine", "reviewed", "published"], + type_kind: ["primitive", "enum", "flags", "structure", "alias", "field"], + type_visibility: ["public", "private", "custom"], + }, + }, +} as const diff --git a/packages/ui/src/modules/places/CompetitorsMapView.tsx b/packages/ui/src/modules/places/CompetitorsMapView.tsx index f41777b7..fd705b41 100644 --- a/packages/ui/src/modules/places/CompetitorsMapView.tsx +++ b/packages/ui/src/modules/places/CompetitorsMapView.tsx @@ -20,6 +20,7 @@ import { RegionLayers } from './components/map-layers/RegionLayers'; import { MapLayerToggles } from './components/MapLayerToggles'; import { MapOverlayToolbars } from './components/MapOverlayToolbars'; import { LiveSearchLayers } from './components/map-layers/LiveSearchLayers'; +import { T, translate } from '../../i18n'; const safeSetStyle = (m: maplibregl.Map, style: any) => { const terrain = m.getTerrain(); @@ -62,16 +63,16 @@ export const MAP_PRESETS: Record = { enableLayerToggles: true, enableInfoPanel: true, enableLocationDetails: true, - enableAutoRegions: false, - enableSimulator: false, + enableAutoRegions: true, + enableSimulator: true, canDebug: true, canPlaybackSpeed: true, }, Minimal: { enableSidebarTools: true, // hasTools (minimal = true) - enableRuler: false, - enableEnrichment: false, - enableLayerToggles: false, + enableRuler: true, + enableEnrichment: true, + enableLayerToggles: true, enableInfoPanel: false, enableLocationDetails: true, enableAutoRegions: true, @@ -100,6 +101,7 @@ interface CompetitorsMapViewProps { liveRadii?: any[]; liveNodes?: any[]; liveScanner?: any; + onRegionsChange?: (regions: any[]) => void; } @@ -142,13 +144,13 @@ const renderPopupHtml = (competitor: CompetitorFull) => { const tagsHtml = `
${getTags()}
`; // Contact details - const addressHtml = `
${competitor.address || 'No address'}
`; + const addressHtml = `
${competitor.address || translate('No address')}
`; const phoneHtml = competitor.phone ? `
${competitor.phone}
` : ''; - const websiteHtml = competitor.website ? `` : ''; + const websiteHtml = competitor.website ? `` : ''; - const hoursHtml = competitor.operating_hours ? `
Operating hours available
` : ''; + const hoursHtml = competitor.operating_hours ? `
${translate('Operating hours available')}
` : ''; return `
@@ -171,7 +173,7 @@ const renderPopupHtml = (competitor: CompetitorFull) => { `; }; -export const CompetitorsMapView: React.FC = ({ competitors, onMapCenterUpdate, initialCenter, initialZoom, onMapMove, enrich, isEnriching, enrichmentProgress, initialGadmRegions, initialSimulatorSettings, simulatorSettings, onSimulatorSettingsChange, liveAreas = [], liveRadii = [], liveNodes = [], liveScanner, preset = 'SearchView', customFeatures }) => { +export const CompetitorsMapView: React.FC = ({ competitors, onMapCenterUpdate, initialCenter, initialZoom, onMapMove, enrich, isEnriching, enrichmentProgress, initialGadmRegions, initialSimulatorSettings, simulatorSettings, onSimulatorSettingsChange, liveAreas = [], liveRadii = [], liveNodes = [], liveScanner, preset = 'SearchView', customFeatures, onRegionsChange }) => { const features: MapFeatures = useMemo(() => { return { ...MAP_PRESETS[preset], @@ -249,6 +251,11 @@ export const CompetitorsMapView: React.FC = ({ competit })(); }, [features.enableAutoRegions, initialGadmRegions]); + // Bubble picker regions up to parent + useEffect(() => { + onRegionsChange?.(pickerRegions); + }, [pickerRegions, onRegionsChange]); + // Fit map to loaded region boundaries (waits for map readiness) const hasFittedBoundsRef = useRef(false); useEffect(() => { @@ -521,13 +528,13 @@ export const CompetitorsMapView: React.FC = ({ competit >
- Area Selector - Grid Search + Area Selector + Grid Search @@ -563,7 +570,7 @@ export const CompetitorsMapView: React.FC = ({ competit /> ) : (
- Please select a region using the Area Selector first to define the search bounds. + Please select a region using the Area Selector first to define the search bounds.
)} @@ -694,7 +701,7 @@ export const CompetitorsMapView: React.FC = ({ competit onClick={() => enrich(locationIds.split(','), ['meta'])} disabled={isEnriching || validLocations.length === 0} className={`p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-700 ${isEnriching ? 'text-indigo-600 animate-pulse' : 'text-gray-500'}`} - title="Enrich Visible Locations" + title={translate("Enrich Visible Locations")} > diff --git a/packages/ui/src/modules/places/EmailCell.tsx b/packages/ui/src/modules/places/EmailCell.tsx index 66d5cdd2..9ada71e6 100644 --- a/packages/ui/src/modules/places/EmailCell.tsx +++ b/packages/ui/src/modules/places/EmailCell.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Tooltip, Chip, Popover, Box, Typography, List, ListItem, ListItemButton, ListItemText, ListItemIcon } from '@mui/material'; import { Mail, ContentCopy, CheckCircle } from '@mui/icons-material'; +import { T, translate } from '../../i18n'; export interface EmailCellProps { emails?: Array<{ @@ -79,8 +80,8 @@ export const EmailCell: React.FC = ({ emails, website, isExclude if (isExcluded) { return (
- - Excluded + + Excluded
) @@ -100,7 +101,7 @@ export const EmailCell: React.FC = ({ emails, website, isExclude return (
: } @@ -128,7 +129,7 @@ export const EmailCell: React.FC = ({ emails, website, isExclude > - Found {uniqueEmails.length} emails + {translate('Found')} {uniqueEmails.length} {uniqueEmails.length === 1 ? translate('email') : translate('emails')} {uniqueEmails.map((emailData, index) => ( @@ -147,8 +148,8 @@ export const EmailCell: React.FC = ({ emails, website, isExclude primary={emailData.email} secondary={ <> - {emailData.source && Source: {emailData.source}} - {emailData.foundAt && Found: {new Date(emailData.foundAt).toLocaleDateString()}} + {emailData.source && Source: {emailData.source}} + {emailData.foundAt && Found: {new Date(emailData.foundAt).toLocaleDateString()}} } /> diff --git a/packages/ui/src/modules/places/LocationDetail.tsx b/packages/ui/src/modules/places/LocationDetail.tsx index 1dee0183..e719db0d 100644 --- a/packages/ui/src/modules/places/LocationDetail.tsx +++ b/packages/ui/src/modules/places/LocationDetail.tsx @@ -1,20 +1,26 @@ import React, { useEffect, useState } from 'react'; import { useParams, Link } from 'react-router-dom'; -import { ArrowLeft, MapPin, Globe, Phone, Clock, Calendar, Image as ImageIcon, Instagram, Facebook, Linkedin, Youtube, Twitter } from 'lucide-react'; +import { ArrowLeft, MapPin, Globe, Phone, Clock, Calendar, Image as ImageIcon, Instagram, Facebook, Linkedin, Youtube, Twitter, Star, Fingerprint, ListOrdered } from 'lucide-react'; import Lightbox from "yet-another-react-lightbox"; import "yet-another-react-lightbox/styles.css"; import { API_URL, THUMBNAIL_WIDTH } from '../../constants'; import type { CompetitorFull } from '@polymech/shared'; -import { fetchCompetitorById } from './client-gridsearch'; +import { fetchCompetitorById, fetchPlacePhotos } from './client-gridsearch'; +import MarkdownRenderer from '../../components/MarkdownRenderer'; +import { T, translate } from '../../i18n'; // Extracted Presentation Component -export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose?: () => void }> = ({ competitor, onClose }) => { +export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose?: () => void; livePhotos?: any }> = ({ competitor, onClose, livePhotos }) => { const [lightboxOpen, setLightboxOpen] = useState(false); const [lightboxIndex, setLightboxIndex] = useState(0); - const [activeTab, setActiveTab] = useState<'overview' | 'debug'>('overview'); + const [activeTab, setActiveTab] = useState<'overview' | 'homepage' | 'debug'>('overview'); const showDebug = import.meta.env.VITE_LOCATION_DETAIL_DEBUG === 'true'; - const photos = competitor.raw_data?.google_media?.photos?.map((photo: any) => ({ + console.log(competitor); + + // Prefer live-fetched photos, fall back to DB-cached + const photoSource = livePhotos || competitor.raw_data?.google_media; + const photos = photoSource?.photos?.map((photo: any) => ({ src: photo.image, alt: competitor.title, })) || []; @@ -30,8 +36,8 @@ export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose? ].filter(link => link.url); return ( -
- {onClose ? ( +
+ {onClose && ( // Property Pane Header

{competitor.title}

@@ -41,7 +47,7 @@ export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose? target="_blank" rel="noopener noreferrer" className="p-1 rounded-full hover: text-gray-500" - title="Open details in new tab" + title={translate("Open details in new tab")} > @@ -54,20 +60,12 @@ export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose?
- ) : ( - // Standalone Page Header -
- - - Back to Places - -
)}
{/* Header Section (Title & Tags) - Hide title if in pane header, or show specific layout */} {!onClose && ( -
+

{competitor.title}

@@ -119,7 +117,7 @@ export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose?
)} - {showDebug && ( + {(showDebug || competitor.website) && (
)} @@ -147,11 +158,11 @@ export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose? {activeTab === 'overview' ? ( <> -
+

- Photos ({photos.length}) + Photos ({photos.length})

@@ -185,12 +196,12 @@ export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose?
-
+
- Address + Address
{competitor.address} @@ -201,7 +212,7 @@ export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose? rel="noopener noreferrer" className="inline-flex items-center text-xs text-indigo-600 hover:text-indigo-500 font-medium" > - View on Map + View on Map {competitor.gps_coordinates && ( - Street View + Street View )}
@@ -219,28 +230,28 @@ export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose?
- Website + Website
{competitor.website ? ( - Visit Website + Visit Website - ) : 'N/A'} + ) : N/A}
- Phone + Phone
-
{competitor.phone || 'N/A'}
+
{competitor.phone || N/A}
{socialLinks.length > 0 && (
- Social Profiles + Social Profiles
{socialLinks.map((social) => ( @@ -250,7 +261,7 @@ export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose? target="_blank" rel="noopener noreferrer" className={`p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${social.color}`} - title={social.name} + title={translate(social.name)} > @@ -259,49 +270,129 @@ export const LocationDetailView: React.FC<{ competitor: CompetitorFull; onClose?
)} + {competitor.raw_data?.rating !== undefined && ( +
+
+ Rating +
+
+ {competitor.raw_data.rating} ({competitor.raw_data.reviews || 0} reviews) +
+
+ )} + + {competitor.raw_data?.provider_id && ( +
+
+ Provider ID +
+
+ {competitor.raw_data.provider_id} +
+
+ )} + + {competitor.raw_data?.position !== undefined && ( +
+
+ Search Position +
+
+ #{competitor.raw_data.position} +
+
+ )} + {!onClose && (
- Last Updated + Last Updated
- {competitor.updated_at ? new Date(competitor.updated_at).toLocaleDateString() : 'N/A'} + {competitor.updated_at ? new Date(competitor.updated_at).toLocaleDateString() : N/A}
)}
- Operating Hours + Operating Hours
{competitor.operating_hours ? (
    {Object.entries(competitor.operating_hours).map(([day, hours]) => (
  • - {day} + {(translate(day) !== day) ? translate(day) : day} {hours as string}
  • ))}
- ) : 'Not available'} + ) : Not available}
{competitor.raw_data?.description && (
-
Description
+
Description
{competitor.raw_data.description}
)}
+ + {competitor.sites && competitor.sites.length > 0 && ( +
+
+

+ + Extracted Web Content +

+
+
+ {competitor.sites.map((site: any, idx: number) => ( +
+
+ + + {site.name} Page + + + {site.url} + +
+
+ +
+
+ ))} +
+
+ )} + ) : activeTab === 'homepage' && competitor.website ? ( +
+
+ + {competitor.website} + + + Open in new tab + +
+