366 lines
10 KiB
TypeScript
366 lines
10 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: "13.0.5"
|
|
}
|
|
public: {
|
|
Tables: {
|
|
ai_events: {
|
|
Row: {
|
|
client_id: string | null
|
|
created_at: string
|
|
duration_ms: number
|
|
id: string
|
|
kind: string
|
|
note_id: string | null
|
|
request: Json
|
|
response: Json
|
|
}
|
|
Insert: {
|
|
client_id?: string | null
|
|
created_at?: string
|
|
duration_ms?: number
|
|
id?: string
|
|
kind: string
|
|
note_id?: string | null
|
|
request?: Json
|
|
response?: Json
|
|
}
|
|
Update: {
|
|
client_id?: string | null
|
|
created_at?: string
|
|
duration_ms?: number
|
|
id?: string
|
|
kind?: string
|
|
note_id?: string | null
|
|
request?: Json
|
|
response?: Json
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "ai_events_client_id_fkey"
|
|
columns: ["client_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "clients"
|
|
referencedColumns: ["id"]
|
|
},
|
|
{
|
|
foreignKeyName: "ai_events_note_id_fkey"
|
|
columns: ["note_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "intake_notes"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
clients: {
|
|
Row: {
|
|
birth_date: string
|
|
created_at: string
|
|
first_name: string
|
|
id: string
|
|
last_name: string
|
|
updated_at: string
|
|
}
|
|
Insert: {
|
|
birth_date: string
|
|
created_at?: string
|
|
first_name: string
|
|
id?: string
|
|
last_name: string
|
|
updated_at?: string
|
|
}
|
|
Update: {
|
|
birth_date?: string
|
|
created_at?: string
|
|
first_name?: string
|
|
id?: string
|
|
last_name?: string
|
|
updated_at?: string
|
|
}
|
|
Relationships: []
|
|
}
|
|
intake_notes: {
|
|
Row: {
|
|
author: string | null
|
|
client_id: string
|
|
content_json: Json
|
|
content_text: string | null
|
|
created_at: string
|
|
id: string
|
|
tag: string | null
|
|
title: string | null
|
|
updated_at: string
|
|
}
|
|
Insert: {
|
|
author?: string | null
|
|
client_id: string
|
|
content_json?: Json
|
|
content_text?: string | null
|
|
created_at?: string
|
|
id?: string
|
|
tag?: string | null
|
|
title?: string | null
|
|
updated_at?: string
|
|
}
|
|
Update: {
|
|
author?: string | null
|
|
client_id?: string
|
|
content_json?: Json
|
|
content_text?: string | null
|
|
created_at?: string
|
|
id?: string
|
|
tag?: string | null
|
|
title?: string | null
|
|
updated_at?: string
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "intake_notes_client_id_fkey"
|
|
columns: ["client_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "clients"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
problem_profiles: {
|
|
Row: {
|
|
category: string
|
|
client_id: string
|
|
created_at: string
|
|
id: string
|
|
remarks: string | null
|
|
severity: string
|
|
source_note_id: string | null
|
|
updated_at: string
|
|
}
|
|
Insert: {
|
|
category: string
|
|
client_id: string
|
|
created_at?: string
|
|
id?: string
|
|
remarks?: string | null
|
|
severity: string
|
|
source_note_id?: string | null
|
|
updated_at?: string
|
|
}
|
|
Update: {
|
|
category?: string
|
|
client_id?: string
|
|
created_at?: string
|
|
id?: string
|
|
remarks?: string | null
|
|
severity?: string
|
|
source_note_id?: string | null
|
|
updated_at?: string
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "problem_profiles_client_id_fkey"
|
|
columns: ["client_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "clients"
|
|
referencedColumns: ["id"]
|
|
},
|
|
{
|
|
foreignKeyName: "problem_profiles_source_note_id_fkey"
|
|
columns: ["source_note_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "intake_notes"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
treatment_plans: {
|
|
Row: {
|
|
client_id: string
|
|
created_at: string
|
|
created_by: string | null
|
|
id: string
|
|
plan: Json
|
|
published_at: string | null
|
|
status: string
|
|
updated_at: string
|
|
version: number
|
|
}
|
|
Insert: {
|
|
client_id: string
|
|
created_at?: string
|
|
created_by?: string | null
|
|
id?: string
|
|
plan?: Json
|
|
published_at?: string | null
|
|
status?: string
|
|
updated_at?: string
|
|
version?: number
|
|
}
|
|
Update: {
|
|
client_id?: string
|
|
created_at?: string
|
|
created_by?: string | null
|
|
id?: string
|
|
plan?: Json
|
|
published_at?: string | null
|
|
status?: string
|
|
updated_at?: string
|
|
version?: number
|
|
}
|
|
Relationships: [
|
|
{
|
|
foreignKeyName: "treatment_plans_client_id_fkey"
|
|
columns: ["client_id"]
|
|
isOneToOne: false
|
|
referencedRelation: "clients"
|
|
referencedColumns: ["id"]
|
|
},
|
|
]
|
|
}
|
|
}
|
|
Views: {
|
|
[_ in never]: never
|
|
}
|
|
Functions: {
|
|
[_ in never]: never
|
|
}
|
|
Enums: {
|
|
[_ in never]: never
|
|
}
|
|
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
|