340 lines
12 KiB
TypeScript
340 lines
12 KiB
TypeScript
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<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
|
|
__InternalSupabase: {
|
|
PostgrestVersion: "14.1"
|
|
}
|
|
public: {
|
|
Tables: {
|
|
card_progress: {
|
|
Row: {
|
|
card_id: string
|
|
due_date: string | null
|
|
ease_factor: number | null
|
|
id: string
|
|
interval: number | null
|
|
lapses: number | null
|
|
learning_step: number | null
|
|
repetitions: number | null
|
|
state: string | null
|
|
updated_at: string | null
|
|
user_id: string
|
|
}
|
|
Insert: {
|
|
card_id: string
|
|
due_date?: string | null
|
|
ease_factor?: number | null
|
|
id?: string
|
|
interval?: number | null
|
|
lapses?: number | null
|
|
learning_step?: number | null
|
|
repetitions?: number | null
|
|
state?: string | null
|
|
updated_at?: string | null
|
|
user_id: string
|
|
}
|
|
Update: {
|
|
card_id?: string
|
|
due_date?: string | null
|
|
ease_factor?: number | null
|
|
id?: string
|
|
interval?: number | null
|
|
lapses?: number | null
|
|
learning_step?: number | null
|
|
repetitions?: number | null
|
|
state?: string | null
|
|
updated_at?: string | null
|
|
user_id?: string
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "card_progress_card_id_fkey"
|
|
columns: ["card_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "cards"
|
|
referencedColumns: ["id"]
|
|
},
|
|
{
|
|
foreignKeyName: "card_progress_user_id_fkey"
|
|
columns: ["user_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "profiles"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
cards: {
|
|
Row: {
|
|
answer: string
|
|
created_at: string | null
|
|
deck_id: string | null
|
|
id: string
|
|
image_url: string | null
|
|
question: string
|
|
sort_order: number | null
|
|
}
|
|
Insert: {
|
|
answer: string
|
|
created_at?: string | null
|
|
deck_id?: string | null
|
|
id?: string
|
|
image_url?: string | null
|
|
question: string
|
|
sort_order?: number | null
|
|
}
|
|
Update: {
|
|
answer?: string
|
|
created_at?: string | null
|
|
deck_id?: string | null
|
|
id?: string
|
|
image_url?: string | null
|
|
question?: string
|
|
sort_order?: number | null
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "cards_deck_id_fkey"
|
|
columns: ["deck_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "decks"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
deck_members: {
|
|
Row: {
|
|
created_at: string | null
|
|
deck_id: string
|
|
id: string
|
|
invited_by: string | null
|
|
role: string | null
|
|
user_id: string
|
|
}
|
|
Insert: {
|
|
created_at?: string | null
|
|
deck_id: string
|
|
id?: string
|
|
invited_by?: string | null
|
|
role?: string | null
|
|
user_id: string
|
|
}
|
|
Update: {
|
|
created_at?: string | null
|
|
deck_id?: string
|
|
id?: string
|
|
invited_by?: string | null
|
|
role?: string | null
|
|
user_id?: string
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "deck_members_deck_id_fkey"
|
|
columns: ["deck_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "decks"
|
|
referencedColumns: ["id"]
|
|
},
|
|
{
|
|
foreignKeyName: "deck_members_invited_by_fkey"
|
|
columns: ["invited_by"]
|
|
isOneToOne: false
|
|
referencedRelation: "profiles"
|
|
referencedColumns: ["id"]
|
|
},
|
|
{
|
|
foreignKeyName: "deck_members_user_id_fkey"
|
|
columns: ["user_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "profiles"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
decks: {
|
|
Row: {
|
|
cover_image_url: string | null
|
|
created_at: string
|
|
creator_id: string | null
|
|
deleted_at: string | null
|
|
description: string | null
|
|
downloads: number | null
|
|
folder_id: string | null
|
|
gradient: string | null
|
|
id: string
|
|
last_studied_at: string | null
|
|
new_cards_per_day: number | null
|
|
original_deck_id: string | null
|
|
share_code: string | null
|
|
sort_order: number | null
|
|
title: string | null
|
|
updated_at: string | null
|
|
visibility: string | null
|
|
}
|
|
Insert: {
|
|
cover_image_url?: string | null
|
|
created_at?: string
|
|
creator_id?: string | null
|
|
deleted_at?: string | null
|
|
description?: string | null
|
|
downloads?: number | null
|
|
folder_id?: string | null
|
|
gradient?: string | null
|
|
id?: string
|
|
last_studied_at?: string | null
|
|
new_cards_per_day?: number | null
|
|
original_deck_id?: string | null
|
|
share_code?: string | null
|
|
sort_order?: number | null
|
|
title?: string | null
|
|
updated_at?: string | null
|
|
visibility?: string | null
|
|
}
|
|
Update: {
|
|
cover_image_url?: string | null
|
|
created_at?: string
|
|
creator_id?: string | null
|
|
deleted_at?: string | null
|
|
description?: string | null
|
|
downloads?: number | null
|
|
folder_id?: string | null
|
|
gradient?: string | null
|
|
id?: string
|
|
last_studied_at?: string | null
|
|
new_cards_per_day?: number | null
|
|
original_deck_id?: string | null
|
|
share_code?: string | null
|
|
sort_order?: number | null
|
|
title?: string | null
|
|
updated_at?: string | null
|
|
visibility?: string | null
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "decks_creator_id_fkey"
|
|
columns: ["creator_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "profiles"
|
|
referencedColumns: ["id"]
|
|
},
|
|
{
|
|
foreignKeyName: "decks_folder_id_fkey"
|
|
columns: ["folder_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "folders"
|
|
referencedColumns: ["id"]
|
|
},
|
|
{
|
|
foreignKeyName: "decks_original_deck_id_fkey"
|
|
columns: ["original_deck_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "decks"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
folders: {
|
|
Row: {
|
|
created_at: string | null
|
|
deleted_at: string | null
|
|
id: string
|
|
name: string
|
|
sort_order: number | null
|
|
user_id: string
|
|
}
|
|
Insert: {
|
|
created_at?: string | null
|
|
deleted_at?: string | null
|
|
id?: string
|
|
name: string
|
|
sort_order?: number | null
|
|
user_id: string
|
|
}
|
|
Update: {
|
|
created_at?: string | null
|
|
deleted_at?: string | null
|
|
id?: string
|
|
name?: string
|
|
sort_order?: number | null
|
|
user_id?: string
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "folders_user_id_fkey"
|
|
columns: ["user_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "profiles"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
profiles: {
|
|
Row: {
|
|
avatar_url: string | null
|
|
created_at: string
|
|
id: string
|
|
selected_folder_id: string | null
|
|
updated_at: string | null
|
|
username: string | null
|
|
}
|
|
Insert: {
|
|
avatar_url?: string | null
|
|
created_at?: string
|
|
id: string
|
|
selected_folder_id?: string | null
|
|
updated_at?: string | null
|
|
username?: string | null
|
|
}
|
|
Update: {
|
|
avatar_url?: string | null
|
|
created_at?: string
|
|
id?: string
|
|
selected_folder_id?: string | null
|
|
updated_at?: string | null
|
|
username?: string | null
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "profiles_selected_folder_id_fkey"
|
|
columns: ["selected_folder_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "folders"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
}
|
|
Views: {
|
|
[_ in never]: never
|
|
}
|
|
Functions: {
|
|
check_daily_reset: {
|
|
Args: Record<PropertyKey, never>
|
|
Returns: undefined
|
|
}
|
|
get_learning_counts: {
|
|
Args: {
|
|
p_user_id: string
|
|
}
|
|
Returns: {
|
|
learning_count: number
|
|
review_count: number
|
|
}[]
|
|
}
|
|
}
|
|
Enums: {
|
|
[_ in never]: never
|
|
}
|
|
CompositeTypes: {
|
|
[_ in never]: never
|
|
}
|
|
}
|
|
}
|