Initial project scaffolding
This commit is contained in:
360
app/types/supabase.ts
Normal file
360
app/types/supabase.ts
Normal file
@@ -0,0 +1,360 @@
|
||||
export type Json =
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| null
|
||||
| { [key: string]: Json | undefined }
|
||||
| Json[]
|
||||
|
||||
// Domain types
|
||||
export type MemberRole = 'member' | 'skipper' | 'admin' | 'boatswain' | 'volunteer' | 'instructor'
|
||||
export type ReservationStatus = 'pending' | 'tentative' | 'confirmed'
|
||||
export interface Defect {
|
||||
type: string
|
||||
severity: string
|
||||
description: string
|
||||
detail?: string
|
||||
}
|
||||
// time_tuples shape: [[startHHMM, endHHMM], ...] e.g. [["08:00","12:00"]]
|
||||
export type TimeTuple = [string, string]
|
||||
|
||||
export type Database = {
|
||||
__InternalSupabase: {
|
||||
PostgrestVersion: "14.4"
|
||||
}
|
||||
public: {
|
||||
Tables: {
|
||||
boats: {
|
||||
Row: {
|
||||
id: string
|
||||
name: string
|
||||
display_name: string | null
|
||||
class: string | null
|
||||
year: number | null
|
||||
img_src: string | null
|
||||
icon_src: string | null
|
||||
booking_available: boolean
|
||||
required_certs: string[]
|
||||
max_passengers: number
|
||||
defects: Defect[]
|
||||
created_at: string
|
||||
}
|
||||
Insert: {
|
||||
id?: string
|
||||
name: string
|
||||
display_name?: string | null
|
||||
class?: string | null
|
||||
year?: number | null
|
||||
img_src?: string | null
|
||||
icon_src?: string | null
|
||||
booking_available?: boolean
|
||||
required_certs?: string[]
|
||||
max_passengers?: number
|
||||
defects?: Defect[]
|
||||
created_at?: string
|
||||
}
|
||||
Update: {
|
||||
id?: string
|
||||
name?: string
|
||||
display_name?: string | null
|
||||
class?: string | null
|
||||
year?: number | null
|
||||
img_src?: string | null
|
||||
icon_src?: string | null
|
||||
booking_available?: boolean
|
||||
required_certs?: string[]
|
||||
max_passengers?: number
|
||||
defects?: Defect[]
|
||||
created_at?: string
|
||||
}
|
||||
}
|
||||
members: {
|
||||
Row: {
|
||||
id: string
|
||||
user_id: string
|
||||
first_name: string
|
||||
last_name: string
|
||||
email: string
|
||||
slack_id: string | null
|
||||
certifications: string[]
|
||||
role: MemberRole
|
||||
created_at: string
|
||||
}
|
||||
Insert: {
|
||||
id?: string
|
||||
user_id: string
|
||||
first_name?: string
|
||||
last_name?: string
|
||||
email: string
|
||||
slack_id?: string | null
|
||||
certifications?: string[]
|
||||
role?: MemberRole
|
||||
created_at?: string
|
||||
}
|
||||
Update: {
|
||||
id?: string
|
||||
user_id?: string
|
||||
first_name?: string
|
||||
last_name?: string
|
||||
email?: string
|
||||
slack_id?: string | null
|
||||
certifications?: string[]
|
||||
role?: MemberRole
|
||||
created_at?: string
|
||||
}
|
||||
}
|
||||
interval_templates: {
|
||||
Row: {
|
||||
id: string
|
||||
name: string
|
||||
time_tuples: TimeTuple[]
|
||||
created_at: string
|
||||
}
|
||||
Insert: {
|
||||
id?: string
|
||||
name: string
|
||||
time_tuples?: TimeTuple[]
|
||||
created_at?: string
|
||||
}
|
||||
Update: {
|
||||
id?: string
|
||||
name?: string
|
||||
time_tuples?: TimeTuple[]
|
||||
created_at?: string
|
||||
}
|
||||
}
|
||||
intervals: {
|
||||
Row: {
|
||||
id: string
|
||||
boat_id: string
|
||||
start_time: string
|
||||
end_time: string
|
||||
user_id: string | null
|
||||
created_at: string
|
||||
}
|
||||
Insert: {
|
||||
id?: string
|
||||
boat_id: string
|
||||
start_time: string
|
||||
end_time: string
|
||||
user_id?: string | null
|
||||
created_at?: string
|
||||
}
|
||||
Update: {
|
||||
id?: string
|
||||
boat_id?: string
|
||||
start_time?: string
|
||||
end_time?: string
|
||||
user_id?: string | null
|
||||
created_at?: string
|
||||
}
|
||||
}
|
||||
reservations: {
|
||||
Row: {
|
||||
id: string
|
||||
boat_id: string
|
||||
user_id: string
|
||||
start_time: string
|
||||
end_time: string
|
||||
status: ReservationStatus
|
||||
reason: string
|
||||
comment: string
|
||||
member_ids: string[]
|
||||
guest_ids: string[]
|
||||
created_at: string
|
||||
}
|
||||
Insert: {
|
||||
id?: string
|
||||
boat_id: string
|
||||
user_id: string
|
||||
start_time: string
|
||||
end_time: string
|
||||
status?: ReservationStatus
|
||||
reason?: string
|
||||
comment?: string
|
||||
member_ids?: string[]
|
||||
guest_ids?: string[]
|
||||
created_at?: string
|
||||
}
|
||||
Update: {
|
||||
id?: string
|
||||
boat_id?: string
|
||||
user_id?: string
|
||||
start_time?: string
|
||||
end_time?: string
|
||||
status?: ReservationStatus
|
||||
reason?: string
|
||||
comment?: string
|
||||
member_ids?: string[]
|
||||
guest_ids?: string[]
|
||||
created_at?: string
|
||||
}
|
||||
}
|
||||
reference_docs: {
|
||||
Row: {
|
||||
id: string
|
||||
title: string
|
||||
category: string
|
||||
tags: string[]
|
||||
subtitle: string | null
|
||||
content: string
|
||||
created_at: string
|
||||
}
|
||||
Insert: {
|
||||
id?: string
|
||||
title: string
|
||||
category: string
|
||||
tags?: string[]
|
||||
subtitle?: string | null
|
||||
content: string
|
||||
created_at?: string
|
||||
}
|
||||
Update: {
|
||||
id?: string
|
||||
title?: string
|
||||
category?: string
|
||||
tags?: string[]
|
||||
subtitle?: string | null
|
||||
content?: string
|
||||
created_at?: string
|
||||
}
|
||||
}
|
||||
}
|
||||
Views: {
|
||||
[_ in never]: never
|
||||
}
|
||||
Functions: {
|
||||
[_ in never]: never
|
||||
}
|
||||
Enums: {
|
||||
member_role: MemberRole
|
||||
reservation_status: ReservationStatus
|
||||
}
|
||||
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: {},
|
||||
},
|
||||
} as const
|
||||
Reference in New Issue
Block a user