fx-1 / src /integrations /supabase /types.ts
felix-fx's picture
Initial commit from GitHub fx-1
6711fd5 verified
Raw History Blame Contribute Delete
22.9 kB
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.4"
}
public: {
Tables: {
addons: {
Row: {
created_at: string
description: string | null
file_size: number | null
id: string
minecraft_versions: string[] | null
modrinth_id: string | null
modrinth_slug: string | null
project_type: string | null
title: string
upload_status: string | null
user_id: string | null
}
Insert: {
created_at?: string
description?: string | null
file_size?: number | null
id?: string
minecraft_versions?: string[] | null
modrinth_id?: string | null
modrinth_slug?: string | null
project_type?: string | null
title: string
upload_status?: string | null
user_id?: string | null
}
Update: {
created_at?: string
description?: string | null
file_size?: number | null
id?: string
minecraft_versions?: string[] | null
modrinth_id?: string | null
modrinth_slug?: string | null
project_type?: string | null
title?: string
upload_status?: string | null
user_id?: string | null
}
Relationships: []
}
ai_scheduled_tasks: {
Row: {
created_at: string
id: string
is_active: boolean
last_run_at: string | null
next_run_at: string | null
query: string
results_count: number
schedule_hour: number
schedule_type: string
task_type: string
user_id: string
}
Insert: {
created_at?: string
id?: string
is_active?: boolean
last_run_at?: string | null
next_run_at?: string | null
query: string
results_count?: number
schedule_hour?: number
schedule_type?: string
task_type?: string
user_id: string
}
Update: {
created_at?: string
id?: string
is_active?: boolean
last_run_at?: string | null
next_run_at?: string | null
query?: string
results_count?: number
schedule_hour?: number
schedule_type?: string
task_type?: string
user_id?: string
}
Relationships: []
}
api_keys: {
Row: {
created_at: string
daily_credit_limit: number
daily_credits_used: number
id: string
is_active: boolean
key_value: string
last_reset_at: string
user_id: string
}
Insert: {
created_at?: string
daily_credit_limit?: number
daily_credits_used?: number
id?: string
is_active?: boolean
key_value: string
last_reset_at?: string
user_id: string
}
Update: {
created_at?: string
daily_credit_limit?: number
daily_credits_used?: number
id?: string
is_active?: boolean
key_value?: string
last_reset_at?: string
user_id?: string
}
Relationships: []
}
api_rate_blocks: {
Row: {
api_key_value: string | null
blocked_until: string | null
created_at: string
failed_attempts: number
id: string
ip_address: string | null
}
Insert: {
api_key_value?: string | null
blocked_until?: string | null
created_at?: string
failed_attempts?: number
id?: string
ip_address?: string | null
}
Update: {
api_key_value?: string | null
blocked_until?: string | null
created_at?: string
failed_attempts?: number
id?: string
ip_address?: string | null
}
Relationships: []
}
download_history: {
Row: {
downloaded_at: string
id: string
mod_id: string
user_id: string
}
Insert: {
downloaded_at?: string
id?: string
mod_id: string
user_id: string
}
Update: {
downloaded_at?: string
id?: string
mod_id?: string
user_id?: string
}
Relationships: [
{
foreignKeyName: "download_history_mod_id_fkey"
columns: ["mod_id"]
isOneToOne: false
referencedRelation: "mods"
referencedColumns: ["id"]
},
]
}
favorites: {
Row: {
created_at: string
id: string
mod_id: string
user_id: string
}
Insert: {
created_at?: string
id?: string
mod_id: string
user_id: string
}
Update: {
created_at?: string
id?: string
mod_id?: string
user_id?: string
}
Relationships: [
{
foreignKeyName: "favorites_mod_id_fkey"
columns: ["mod_id"]
isOneToOne: false
referencedRelation: "mods"
referencedColumns: ["id"]
},
]
}
follows: {
Row: {
created_at: string
follower_id: string
following_id: string
id: string
notification_pref: string
}
Insert: {
created_at?: string
follower_id: string
following_id: string
id?: string
notification_pref?: string
}
Update: {
created_at?: string
follower_id?: string
following_id?: string
id?: string
notification_pref?: string
}
Relationships: []
}
guides: {
Row: {
content: string
created_at: string
id: string
images: string[] | null
mod_id: string | null
rejection_reason: string | null
status: string
title: string
updated_at: string
user_id: string
}
Insert: {
content: string
created_at?: string
id?: string
images?: string[] | null
mod_id?: string | null
rejection_reason?: string | null
status?: string
title: string
updated_at?: string
user_id: string
}
Update: {
content?: string
created_at?: string
id?: string
images?: string[] | null
mod_id?: string | null
rejection_reason?: string | null
status?: string
title?: string
updated_at?: string
user_id?: string
}
Relationships: [
{
foreignKeyName: "guides_mod_id_fkey"
columns: ["mod_id"]
isOneToOne: false
referencedRelation: "mods"
referencedColumns: ["id"]
},
]
}
messages: {
Row: {
content: string
created_at: string
id: string
is_read: boolean
receiver_id: string
sender_id: string
}
Insert: {
content: string
created_at?: string
id?: string
is_read?: boolean
receiver_id: string
sender_id: string
}
Update: {
content?: string
created_at?: string
id?: string
is_read?: boolean
receiver_id?: string
sender_id?: string
}
Relationships: []
}
mods: {
Row: {
author: string | null
average_rating: number | null
category: string | null
created_at: string
description: string | null
downloads: number | null
file_size: number | null
file_type: string | null
file_url: string | null
id: string
is_approved: boolean | null
minecraft_version: string | null
mod_version: string | null
platform: string | null
screenshots: string[] | null
tags: string[] | null
thumbnail_url: string | null
title: string
updated_at: string
user_id: string | null
}
Insert: {
author?: string | null
average_rating?: number | null
category?: string | null
created_at?: string
description?: string | null
downloads?: number | null
file_size?: number | null
file_type?: string | null
file_url?: string | null
id?: string
is_approved?: boolean | null
minecraft_version?: string | null
mod_version?: string | null
platform?: string | null
screenshots?: string[] | null
tags?: string[] | null
thumbnail_url?: string | null
title: string
updated_at?: string
user_id?: string | null
}
Update: {
author?: string | null
average_rating?: number | null
category?: string | null
created_at?: string
description?: string | null
downloads?: number | null
file_size?: number | null
file_type?: string | null
file_url?: string | null
id?: string
is_approved?: boolean | null
minecraft_version?: string | null
mod_version?: string | null
platform?: string | null
screenshots?: string[] | null
tags?: string[] | null
thumbnail_url?: string | null
title?: string
updated_at?: string
user_id?: string | null
}
Relationships: []
}
notifications: {
Row: {
created_at: string
id: string
is_read: boolean | null
link: string | null
message: string | null
title: string
type: string | null
user_id: string
}
Insert: {
created_at?: string
id?: string
is_read?: boolean | null
link?: string | null
message?: string | null
title: string
type?: string | null
user_id: string
}
Update: {
created_at?: string
id?: string
is_read?: boolean | null
link?: string | null
message?: string | null
title?: string
type?: string | null
user_id?: string
}
Relationships: []
}
profiles: {
Row: {
avatar_url: string | null
bio: string | null
celebrity_verified: boolean | null
created_at: string
developer_verified: boolean | null
display_name: string | null
id: string
is_verified: boolean | null
password_hash: string | null
reputation: number | null
total_uploads: number | null
updated_at: string
user_id: string | null
username: string | null
}
Insert: {
avatar_url?: string | null
bio?: string | null
celebrity_verified?: boolean | null
created_at?: string
developer_verified?: boolean | null
display_name?: string | null
id?: string
is_verified?: boolean | null
password_hash?: string | null
reputation?: number | null
total_uploads?: number | null
updated_at?: string
user_id?: string | null
username?: string | null
}
Update: {
avatar_url?: string | null
bio?: string | null
celebrity_verified?: boolean | null
created_at?: string
developer_verified?: boolean | null
display_name?: string | null
id?: string
is_verified?: boolean | null
password_hash?: string | null
reputation?: number | null
total_uploads?: number | null
updated_at?: string
user_id?: string | null
username?: string | null
}
Relationships: []
}
reply_likes: {
Row: {
created_at: string
id: string
reply_id: string
user_id: string
}
Insert: {
created_at?: string
id?: string
reply_id: string
user_id: string
}
Update: {
created_at?: string
id?: string
reply_id?: string
user_id?: string
}
Relationships: [
{
foreignKeyName: "reply_likes_reply_id_fkey"
columns: ["reply_id"]
isOneToOne: false
referencedRelation: "review_replies"
referencedColumns: ["id"]
},
]
}
reports: {
Row: {
created_at: string
id: string
reason: string | null
reporter_id: string | null
status: string | null
target_id: string | null
target_type: string | null
}
Insert: {
created_at?: string
id?: string
reason?: string | null
reporter_id?: string | null
status?: string | null
target_id?: string | null
target_type?: string | null
}
Update: {
created_at?: string
id?: string
reason?: string | null
reporter_id?: string | null
status?: string | null
target_id?: string | null
target_type?: string | null
}
Relationships: []
}
review_likes: {
Row: {
created_at: string
id: string
review_id: string
user_id: string
}
Insert: {
created_at?: string
id?: string
review_id: string
user_id: string
}
Update: {
created_at?: string
id?: string
review_id?: string
user_id?: string
}
Relationships: [
{
foreignKeyName: "review_likes_review_id_fkey"
columns: ["review_id"]
isOneToOne: false
referencedRelation: "reviews"
referencedColumns: ["id"]
},
]
}
review_replies: {
Row: {
content: string
created_at: string
id: string
review_id: string
user_id: string
}
Insert: {
content: string
created_at?: string
id?: string
review_id: string
user_id: string
}
Update: {
content?: string
created_at?: string
id?: string
review_id?: string
user_id?: string
}
Relationships: [
{
foreignKeyName: "review_replies_review_id_fkey"
columns: ["review_id"]
isOneToOne: false
referencedRelation: "reviews"
referencedColumns: ["id"]
},
]
}
reviews: {
Row: {
content: string | null
created_at: string
id: string
mod_id: string | null
rating: number
updated_at: string
user_id: string | null
}
Insert: {
content?: string | null
created_at?: string
id?: string
mod_id?: string | null
rating: number
updated_at?: string
user_id?: string | null
}
Update: {
content?: string | null
created_at?: string
id?: string
mod_id?: string | null
rating?: number
updated_at?: string
user_id?: string | null
}
Relationships: [
{
foreignKeyName: "reviews_mod_id_fkey"
columns: ["mod_id"]
isOneToOne: false
referencedRelation: "mods"
referencedColumns: ["id"]
},
]
}
security_attempts: {
Row: {
attempt_type: string | null
created_at: string
id: string
ip_address: string | null
success: boolean | null
user_id: string | null
}
Insert: {
attempt_type?: string | null
created_at?: string
id?: string
ip_address?: string | null
success?: boolean | null
user_id?: string | null
}
Update: {
attempt_type?: string | null
created_at?: string
id?: string
ip_address?: string | null
success?: boolean | null
user_id?: string | null
}
Relationships: []
}
user_roles: {
Row: {
created_at: string
id: string
role: Database["public"]["Enums"]["app_role"]
user_id: string
}
Insert: {
created_at?: string
id?: string
role: Database["public"]["Enums"]["app_role"]
user_id: string
}
Update: {
created_at?: string
id?: string
role?: Database["public"]["Enums"]["app_role"]
user_id?: string
}
Relationships: []
}
}
Views: {
[_ in never]: never
}
Functions: {
has_role: {
Args: {
_role: Database["public"]["Enums"]["app_role"]
_user_id: string
}
Returns: boolean
}
}
Enums: {
app_role: "admin" | "moderator" | "user"
}
CompositeTypes: {
[_ in never]: never
}
}
}
type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">
type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">]
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 = {
public: {
Enums: {
app_role: ["admin", "moderator", "user"],
},
},
} as const