mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
* docs: add cursor rule for embedding generation process Add documentation for cursor IDE about how docs embeddings are generated, including the workflow for creating and uploading semantic search content. * feat: improve API reference metadata upload with descriptive content - Add preembeddings script to run codegen before embedding generation - Enhance OpenApiReferenceSource to generate more descriptive content including parameters, responses, path information, and better structured documentation * feat: add Management API references to searchDocs GraphQL query - Add ManagementApiReference GraphQL type and model for API endpoint search results - Integrate Management API references into global search results - Update test snapshots and add comprehensive test coverage for Management API search * style: format
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
import { createClient, type SupabaseClient } from '@supabase/supabase-js'
|
|
import { type Database as DatabaseGenerated } from 'common'
|
|
|
|
type Database = {
|
|
content: DatabaseGenerated['content']
|
|
graphql_public: DatabaseGenerated['graphql_public']
|
|
public: {
|
|
Tables: DatabaseGenerated['public']['Tables']
|
|
Views: DatabaseGenerated['public']['Views']
|
|
Functions: Omit<DatabaseGenerated['public']['Functions'], 'search_content'> & {
|
|
search_content: {
|
|
Args: Omit<
|
|
DatabaseGenerated['public']['Functions']['search_content']['Args'],
|
|
'embedding'
|
|
> & { embedding: Array<number> }
|
|
Returns: Array<
|
|
Omit<
|
|
DatabaseGenerated['public']['Functions']['search_content']['Returns'][number],
|
|
'subsections' | 'metadata'
|
|
> & {
|
|
metadata: {
|
|
subtitle?: string
|
|
language?: string
|
|
methodName?: string
|
|
platform?: string
|
|
}
|
|
subsections: Array<{ title?: string; href?: string; content?: string }>
|
|
}
|
|
>
|
|
}
|
|
}
|
|
Enums: DatabaseGenerated['public']['Enums']
|
|
CompositeTypes: DatabaseGenerated['public']['CompositeTypes']
|
|
}
|
|
storage: DatabaseGenerated['storage']
|
|
}
|
|
|
|
let _supabase: SupabaseClient<Database>
|
|
|
|
export function supabase() {
|
|
if (!_supabase) {
|
|
_supabase = createClient(
|
|
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
|
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
|
|
)
|
|
}
|
|
|
|
return _supabase
|
|
}
|
|
|
|
export type { Database as DatabaseCorrected }
|