* Build the current registry. * Export the blocks as JSON and import them into registry.json. * Move the registry.json into public/r. * Fix a prettier error. * Clean up extra files in vue blocks. * Bump shadcn. * Readd shadcn to vue blocks. * Fix the shadcn types. * Remove extra package exclusions.
209 lines
328 KiB
JSON
209 lines
328 KiB
JSON
{
|
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
"name": "platform-kit-nextjs",
|
|
"type": "registry:block",
|
|
"title": "Platform Kit for Nextjs and Supabase",
|
|
"description": "Platform Kit for Nextjs and Supabase",
|
|
"dependencies": [
|
|
"@hookform/resolvers",
|
|
"@monaco-editor/react",
|
|
"@tanstack/react-query",
|
|
"@tanstack/react-table",
|
|
"axios",
|
|
"cmdk",
|
|
"common-tags",
|
|
"openai",
|
|
"openapi-fetch",
|
|
"react-hook-form",
|
|
"react-markdown",
|
|
"recharts",
|
|
"sonner"
|
|
],
|
|
"registryDependencies": [
|
|
"alert",
|
|
"badge",
|
|
"button",
|
|
"card",
|
|
"chart",
|
|
"command",
|
|
"dialog",
|
|
"drawer",
|
|
"form",
|
|
"hover-card",
|
|
"input",
|
|
"label",
|
|
"popover",
|
|
"select",
|
|
"skeleton",
|
|
"switch",
|
|
"table",
|
|
"toggle",
|
|
"toggle-group",
|
|
"tooltip"
|
|
],
|
|
"files": [
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/app/api/ai/sql/route.ts",
|
|
"content": "import type { paths } from '@/registry/default/platform/platform-kit-nextjs/lib/management-api-schema'\nimport { listTablesSql } from '@/registry/default/platform/platform-kit-nextjs/lib/pg-meta'\nimport { NextResponse } from 'next/server'\nimport OpenAI from 'openai'\nimport createClient from 'openapi-fetch'\n\nconst openai = new OpenAI({\n apiKey: process.env.OPENAI_API_KEY,\n})\n\nconst client = createClient<paths>({\n baseUrl: 'https://api.supabase.com',\n headers: {\n Authorization: `Bearer ${process.env.SUPABASE_MANAGEMENT_API_TOKEN}`,\n },\n})\n\n// Function to get database schema\nasync function getDbSchema(projectRef: string) {\n const token = process.env.SUPABASE_MANAGEMENT_API_TOKEN\n if (!token) {\n throw new Error('Supabase Management API token is not configured.')\n }\n\n const sql = listTablesSql()\n\n const { data, error } = await client.POST('/v1/projects/{ref}/database/query', {\n params: {\n path: {\n ref: projectRef,\n },\n },\n body: {\n query: sql,\n read_only: true,\n },\n })\n\n if (error) {\n throw error\n }\n\n return data as any\n}\n\nfunction formatSchemaForPrompt(schema: any) {\n let schemaString = ''\n if (schema && Array.isArray(schema)) {\n schema.forEach((table: any) => {\n const columnInfo = table.columns.map((c: any) => `${c.name} (${c.data_type})`)\n schemaString += `Table \"${table.name}\" has columns: ${columnInfo.join(', ')}.\\n`\n })\n }\n return schemaString\n}\n\nexport async function POST(request: Request) {\n try {\n const { prompt, projectRef } = await request.json()\n\n if (!prompt) {\n return NextResponse.json({ message: 'Prompt is required.' }, { status: 400 })\n }\n if (!projectRef) {\n return NextResponse.json({ message: 'projectRef is required.' }, { status: 400 })\n }\n\n // Implement your permission check here (e.g. check if the user is a member of the project)\n // In this example, everyone can access all projects\n const userHasPermissionForProject = Boolean(projectRef)\n\n if (!userHasPermissionForProject) {\n return NextResponse.json(\n { message: 'You do not have permission to access this project.' },\n { status: 403 }\n )\n }\n\n // 1. Get database schema\n const schema = await getDbSchema(projectRef)\n const formattedSchema = formatSchemaForPrompt(schema)\n\n // 2. Create a prompt for OpenAI\n const systemPrompt = `You are an expert SQL assistant. Given the following database schema, write a SQL query that answers the user's question. Return only the SQL query, do not include any explanations or markdown.\\n\\nSchema:\\n${formattedSchema}`\n\n // 3. Call OpenAI to generate SQL using responses.create (plain text output)\n const response = await openai.responses.create({\n model: 'gpt-4.1',\n instructions: systemPrompt, // Use systemPrompt as instructions\n input: prompt, // User's question\n })\n\n const sql = response.output_text\n\n if (!sql) {\n return NextResponse.json(\n { message: 'Could not generate SQL from the prompt.' },\n { status: 500 }\n )\n }\n\n // 4. Return the generated SQL\n return NextResponse.json({ sql })\n } catch (error: any) {\n console.error('AI SQL generation error:', error)\n const errorMessage = error.message || 'An unexpected error occurred.'\n const status = error.response?.status || 500\n return NextResponse.json({ message: errorMessage }, { status })\n }\n}\n",
|
|
"type": "registry:page",
|
|
"target": "app/api/ai/sql/route.ts"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/app/api/supabase-proxy/[...path]/route.ts",
|
|
"content": "import { NextResponse } from 'next/server'\n\nasync function forwardToSupabaseAPI(request: Request, method: string, params: { path: string[] }) {\n if (!process.env.SUPABASE_MANAGEMENT_API_TOKEN) {\n console.error('Supabase Management API token is not configured.')\n return NextResponse.json({ message: 'Server configuration error.' }, { status: 500 })\n }\n\n const { path } = params\n const apiPath = path.join('/')\n\n const url = new URL(request.url)\n url.protocol = 'https'\n url.hostname = 'api.supabase.com'\n url.port = '443'\n url.pathname = apiPath\n\n const projectRef = path[2]\n\n // Implement your permission check here (e.g. check if the user is a member of the project)\n // In this example, everyone can access all projects\n const userHasPermissionForProject = Boolean(projectRef)\n\n if (!userHasPermissionForProject) {\n return NextResponse.json(\n { message: 'You do not have permission to access this project.' },\n { status: 403 }\n )\n }\n\n try {\n const forwardHeaders: HeadersInit = {\n Authorization: `Bearer ${process.env.SUPABASE_MANAGEMENT_API_TOKEN}`,\n }\n\n // Copy relevant headers from the original request\n const contentType = request.headers.get('content-type')\n if (contentType) {\n forwardHeaders['Content-Type'] = contentType\n }\n\n const fetchOptions: RequestInit = {\n method,\n headers: forwardHeaders,\n }\n\n // Include body for methods that support it\n if (method !== 'GET' && method !== 'HEAD') {\n try {\n const body = await request.text()\n if (body) {\n fetchOptions.body = body\n }\n } catch (error) {\n // Handle cases where body is not readable\n console.warn('Could not read request body:', error)\n }\n }\n\n const response = await fetch(url, fetchOptions)\n\n // Get response body\n const responseText = await response.text()\n let responseData\n\n try {\n responseData = responseText ? JSON.parse(responseText) : null\n } catch {\n responseData = responseText\n }\n\n // Return the response with the same status\n return NextResponse.json(responseData, { status: response.status })\n } catch (error: any) {\n console.error('Supabase API proxy error:', error)\n const errorMessage = error.message || 'An unexpected error occurred.'\n return NextResponse.json({ message: errorMessage }, { status: 500 })\n }\n}\n\nexport async function GET(request: Request, { params }: { params: Promise<{ path: string[] }> }) {\n const resolvedParams = await params\n return forwardToSupabaseAPI(request, 'GET', resolvedParams)\n}\n\nexport async function HEAD(request: Request, { params }: { params: Promise<{ path: string[] }> }) {\n const resolvedParams = await params\n return forwardToSupabaseAPI(request, 'HEAD', resolvedParams)\n}\n\nexport async function POST(request: Request, { params }: { params: Promise<{ path: string[] }> }) {\n const resolvedParams = await params\n return forwardToSupabaseAPI(request, 'POST', resolvedParams)\n}\n\nexport async function PUT(request: Request, { params }: { params: Promise<{ path: string[] }> }) {\n const resolvedParams = await params\n return forwardToSupabaseAPI(request, 'PUT', resolvedParams)\n}\n\nexport async function DELETE(\n request: Request,\n { params }: { params: Promise<{ path: string[] }> }\n) {\n const resolvedParams = await params\n return forwardToSupabaseAPI(request, 'DELETE', resolvedParams)\n}\n\nexport async function PATCH(request: Request, { params }: { params: Promise<{ path: string[] }> }) {\n const resolvedParams = await params\n return forwardToSupabaseAPI(request, 'PATCH', resolvedParams)\n}\n",
|
|
"type": "registry:page",
|
|
"target": "app/api/supabase-proxy/[...path]/route.ts"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/dynamic-form.tsx",
|
|
"content": "'use client'\n\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useForm } from 'react-hook-form'\nimport type { z, ZodTypeAny } from 'zod'\nimport { Button } from '@/registry/default/components/ui/button'\nimport {\n Form,\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/registry/default/components/ui/form'\nimport { Input } from '@/registry/default/components/ui/input'\nimport { Switch } from '@/registry/default/components/ui/switch'\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/registry/default/components/ui/select'\nimport { useEffect, useRef } from 'react'\n\ninterface DynamicFormProps<T extends z.ZodRawShape = z.ZodRawShape> {\n schema: z.ZodObject<T>\n onSubmit: (data: z.infer<z.ZodObject<T>>) => void\n isLoading?: boolean\n initialValues?: Partial<z.infer<z.ZodObject<T>>>\n labels?: Record<string, string | { label: string; options?: Record<string, string> }>\n columnInfo?: Record<string, { data_type: string; is_nullable: boolean }>\n}\n\nconst getZodDef = (schema: ZodTypeAny): Record<string, any> =>\n (schema as any)._def || (schema as any).def\n\nconst unwrapZodType = (fieldSchema: ZodTypeAny): ZodTypeAny => {\n if (\n !fieldSchema ||\n typeof getZodDef(fieldSchema) !== 'object' ||\n getZodDef(fieldSchema) === null\n ) {\n throw new Error(\n `unwrapZodType received an invalid Zod schema object. Check the console for the problematic schema/key.`\n )\n }\n let currentSchema = fieldSchema\n\n // Support both old (typeName) and new (type) Zod formats\n const getTypeName = (def: Record<string, any>) => def.typeName || def.type\n\n while (\n getTypeName(getZodDef(currentSchema)) === 'ZodOptional' ||\n getTypeName(getZodDef(currentSchema)) === 'optional' ||\n getTypeName(getZodDef(currentSchema)) === 'ZodDefault' ||\n getTypeName(getZodDef(currentSchema)) === 'default' ||\n getTypeName(getZodDef(currentSchema)) === 'ZodNullable' ||\n getTypeName(getZodDef(currentSchema)) === 'nullable' ||\n getTypeName(getZodDef(currentSchema)) === 'ZodEffects' ||\n getTypeName(getZodDef(currentSchema)) === 'effects'\n ) {\n const typeName = getTypeName(getZodDef(currentSchema))\n if (typeName === 'ZodEffects' || typeName === 'effects') {\n // For ZodEffects, get the schema inside the effect\n currentSchema = getZodDef(currentSchema).schema\n } else {\n currentSchema = getZodDef(currentSchema).innerType\n }\n }\n return currentSchema\n}\n\nexport function DynamicForm<T extends z.ZodRawShape = z.ZodRawShape>({\n schema,\n onSubmit,\n isLoading = false,\n initialValues,\n labels,\n columnInfo,\n}: DynamicFormProps<T>) {\n const isInitializingRef = useRef(true)\n\n const defaultValues = Object.keys(schema.shape).reduce(\n (acc, key) => {\n const originalFieldSchema = schema.shape[key]\n if (typeof originalFieldSchema === 'undefined') {\n throw new Error(\n `Schema error: schema.shape['${key}'] is undefined. Check schema definition.`\n )\n }\n\n // Support both old (typeName) and new (type) Zod formats\n const getTypeName = (def: Record<string, any>) => def.typeName || def.type\n\n if (\n getTypeName(getZodDef(originalFieldSchema)) === 'ZodDefault' ||\n getTypeName(getZodDef(originalFieldSchema)) === 'default'\n ) {\n acc[key] = getZodDef(originalFieldSchema).defaultValue()\n return acc\n }\n\n const baseType = unwrapZodType(originalFieldSchema)\n\n switch (getTypeName(getZodDef(baseType))) {\n case 'ZodString':\n case 'string':\n acc[key] = ''\n break\n case 'ZodBoolean':\n case 'boolean':\n acc[key] = false // Default optional booleans to false\n break\n case 'ZodEnum':\n case 'enum':\n // For enums, use the first enum value as default\n const enumValues = getZodDef(baseType).values || []\n acc[key] = enumValues.length > 0 ? enumValues[0] : ''\n break\n case 'ZodNumber':\n case 'number':\n acc[key] = 0 // Default optional numbers to 0\n break\n case 'ZodArray':\n case 'array':\n acc[key] = [] // Default arrays to empty array\n break\n default:\n acc[key] = undefined // For other types, or if truly no default makes sense\n break\n }\n return acc\n },\n {} as Record<string, any>\n )\n\n const form = useForm<z.infer<typeof schema>>({\n resolver: zodResolver(schema),\n defaultValues: defaultValues as any,\n })\n\n useEffect(() => {\n if (initialValues) {\n isInitializingRef.current = true\n const schemaKeys = Object.keys(schema.shape)\n const processedInitialValues = schemaKeys.reduce(\n (acc, key) => {\n const fieldDefFromSchema = schema.shape[key]\n if (typeof fieldDefFromSchema === 'undefined') {\n throw new Error(`Schema error in useEffect: schema.shape['${key}'] is undefined.`)\n }\n const value = initialValues.hasOwnProperty(key) ? initialValues[key] : undefined\n const baseFieldType = unwrapZodType(fieldDefFromSchema)\n\n // Support both old (typeName) and new (type) Zod formats\n const getTypeName = (def: Record<string, any>) => def.typeName || def.type\n\n const fieldTypeName = getTypeName(getZodDef(baseFieldType))\n if (fieldTypeName === 'ZodBoolean' || fieldTypeName === 'boolean') {\n acc[key] = !!value\n } else if (fieldTypeName === 'ZodString' || fieldTypeName === 'string') {\n acc[key] = value === null || value === undefined ? '' : String(value)\n } else if (fieldTypeName === 'ZodEnum' || fieldTypeName === 'enum') {\n const enumValues = getZodDef(baseFieldType).values || []\n acc[key] =\n value === null || value === undefined || !enumValues.includes(value)\n ? enumValues[0] || ''\n : String(value)\n } else if (fieldTypeName === 'ZodNumber' || fieldTypeName === 'number') {\n const num = Number(value)\n acc[key] = isNaN(num) ? 0 : num\n } else if (fieldTypeName === 'ZodArray' || fieldTypeName === 'array') {\n // For arrays, the value should already be an array from the database\n // Handle null values properly\n if (Array.isArray(value)) {\n acc[key] = value\n } else if (value === null || value === undefined) {\n acc[key] = []\n } else if (typeof value === 'string' && value.startsWith('{') && value.endsWith('}')) {\n // Parse PostgreSQL array format like {ONE,TWO} into JavaScript array\n try {\n const innerContent = value.slice(1, -1) // Remove { and }\n if (innerContent.trim() === '') {\n acc[key] = []\n } else {\n // Split by comma and trim whitespace\n acc[key] = innerContent.split(',').map((item: string) => item.trim())\n }\n } catch {\n // If parsing fails, default to empty array\n acc[key] = []\n }\n } else {\n acc[key] = []\n }\n } else {\n acc[key] = value\n }\n return acc\n },\n {} as Record<string, any>\n )\n form.reset(processedInitialValues as any)\n setTimeout(() => {\n isInitializingRef.current = false\n }, 0)\n } else {\n isInitializingRef.current = false\n }\n }, [initialValues, form, schema])\n\n const renderField = (fieldName: string, fieldSchema: ZodTypeAny) => {\n const baseType = unwrapZodType(fieldSchema)\n // Support both old (typeName) and new (type) Zod formats\n const getTypeName = (def: Record<string, any>) => def.typeName || def.type\n const typeName = getTypeName(getZodDef(baseType))\n const description = fieldSchema.description\n\n return (\n <FormField\n key={fieldName}\n control={form.control}\n name={fieldName as any}\n render={({ field }) => {\n const labelConfig = labels?.[fieldName]\n const label =\n typeof labelConfig === 'string' ? labelConfig : labelConfig?.label || fieldName\n const typeDisplay = columnInfo?.[fieldName]?.data_type || ''\n switch (typeName) {\n case 'ZodString':\n case 'string':\n return (\n <FormItem className=\"py-6 border-b\">\n <div className=\"w-full flex flex-col lg:flex-row lg:items-center justify-between w-full gap-4 lg:gap-8\">\n <div className=\"flex-1 pr-4\">\n <FormLabel>{label}</FormLabel>\n <div className=\"text-sm text-muted-foreground mt-1\">{typeDisplay}</div>\n {description && <FormDescription>{description}</FormDescription>}\n <FormMessage />\n </div>\n <div className=\"flex-1 lg:max-w-1/2\">\n <FormControl>\n <Input\n placeholder={`Enter your ${fieldName}`}\n {...field}\n value={String(field.value || '')}\n />\n </FormControl>\n </div>\n </div>\n </FormItem>\n )\n case 'ZodNumber':\n case 'number':\n return (\n <FormItem className=\"py-6 border-b\">\n <div className=\"w-full flex flex-col lg:flex-row lg:items-center justify-between w-full gap-4 lg:gap-8\">\n <div className=\"flex-1 pr-4\">\n <FormLabel>{label}</FormLabel>\n <div className=\"text-sm text-muted-foreground\">{typeDisplay}</div>\n {description && <FormDescription>{description}</FormDescription>}\n <FormMessage />\n </div>\n <div className=\"flex-1 lg:max-w-1/2\">\n <FormControl>\n <Input\n type=\"number\"\n placeholder={`Enter value for ${fieldName}`}\n {...field}\n value={String(field.value ?? '')}\n onChange={(e) => {\n const value = e.target.value\n const num = parseInt(value, 10)\n field.onChange(isNaN(num) ? undefined : num)\n }}\n />\n </FormControl>\n </div>\n </div>\n </FormItem>\n )\n case 'ZodBoolean':\n case 'boolean':\n return (\n <FormItem className=\"py-6 border-b flex flex-row items-center justify-between gap-8\">\n <div>\n <FormLabel>{label}</FormLabel>\n <div className=\"text-sm text-muted-foreground\">{typeDisplay}</div>\n {description && <FormDescription>{description}</FormDescription>}\n <FormMessage />\n </div>\n <FormControl>\n <Switch checked={!!field.value} onCheckedChange={field.onChange} />\n </FormControl>\n </FormItem>\n )\n case 'ZodEnum':\n case 'enum':\n const options = getZodDef(baseType).values\n const optionLabels = typeof labelConfig === 'object' ? labelConfig.options : undefined\n return (\n <FormItem className=\"py-6 border-b\">\n <div className=\"w-full flex flex-col lg:flex-row lg:items-center justify-between w-full gap-4 lg:gap-8\">\n <div className=\"flex-1 pr-4\">\n <FormLabel>{label}</FormLabel>\n <div className=\"text-sm text-muted-foreground\">{typeDisplay}</div>\n {description && <FormDescription>{description}</FormDescription>}\n <FormMessage />\n </div>\n <div className=\"flex-1 lg:max-w-1/2\">\n <Select\n onValueChange={(value) => {\n if (!isInitializingRef.current) {\n field.onChange(value)\n }\n }}\n value={String(field.value || '')}\n >\n <FormControl>\n <SelectTrigger>\n <SelectValue placeholder={`Select a ${fieldName}`} />\n </SelectTrigger>\n </FormControl>\n <SelectContent>\n {options.map((option: string) => (\n <SelectItem key={option} value={option}>\n {optionLabels?.[option] || option}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n </FormItem>\n )\n case 'ZodArray':\n case 'array':\n return (\n <FormItem className=\"py-6 border-b\">\n <div className=\"flex flex-row items-center justify-between w-full gap-8\">\n <div className=\"flex-1 pr-4\">\n <FormLabel>{label}</FormLabel>\n <div className=\"text-sm text-muted-foreground\">\n Enter as JSON array: ["item1", "item2"]\n {columnInfo?.[fieldName]?.is_nullable && ' (leave empty for null)'}\n </div>\n\n {description && <FormDescription>{description}</FormDescription>}\n <FormMessage />\n </div>\n <div className=\"flex-1\">\n <FormControl>\n <Input\n placeholder={\n columnInfo?.[fieldName]?.is_nullable\n ? `["item1", "item2"] or leave empty for null`\n : `["item1", "item2"]`\n }\n {...field}\n value={\n field.value === null || field.value === undefined\n ? ''\n : Array.isArray(field.value)\n ? JSON.stringify(field.value)\n : String(field.value || '')\n }\n onChange={(e) => {\n const value = e.target.value\n if (value.trim() === '') {\n // Empty string means null (for nullable) or empty array (for non-nullable)\n field.onChange(null)\n } else {\n try {\n const parsed = JSON.parse(value)\n if (Array.isArray(parsed)) {\n field.onChange(parsed)\n } else {\n // If it's not an array, treat as invalid input\n field.onChange(value)\n }\n } catch {\n // Invalid JSON, keep the string value to show error\n field.onChange(value)\n }\n }\n }}\n />\n </FormControl>\n </div>\n </div>\n </FormItem>\n )\n default:\n return <></>\n }\n }}\n />\n )\n }\n\n return (\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)}>\n {Object.keys(schema.shape).map((fieldName) =>\n renderField(fieldName, schema.shape[fieldName])\n )}\n <div className=\"pt-6\">\n <Button type=\"submit\" disabled={isLoading}>\n {isLoading ? 'Saving...' : 'Save'}\n </Button>\n </div>\n </form>\n </Form>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/logo-supabase.tsx",
|
|
"content": "export function LogoSupabase({ className, size = 24 }: { className?: string; size?: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 109 113\"\n className={className}\n style={{ width: size, height: size }}\n >\n <path\n fill=\"url(#supabase_svg__a)\"\n d=\"M63.708 110.284c-2.86 3.601-8.658 1.628-8.727-2.97l-1.007-67.251h45.22c8.19 0 12.758 9.46 7.665 15.874z\"\n ></path>\n <path\n fill=\"url(#supabase_svg__b)\"\n fillOpacity=\"0.2\"\n d=\"M63.708 110.284c-2.86 3.601-8.658 1.628-8.727-2.97l-1.007-67.251h45.22c8.19 0 12.758 9.46 7.665 15.874z\"\n ></path>\n <path\n fill=\"#3ECF8E\"\n d=\"M45.317 2.071c2.86-3.601 8.657-1.628 8.726 2.97l.442 67.251H9.83c-8.19 0-12.759-9.46-7.665-15.875z\"\n ></path>\n <defs>\n <linearGradient\n id=\"supabase_svg__a\"\n x1=\"53.974\"\n x2=\"94.163\"\n y1=\"54.974\"\n y2=\"71.829\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor=\"#249361\"></stop>\n <stop offset=\"1\" stopColor=\"#3ECF8E\"></stop>\n </linearGradient>\n <linearGradient\n id=\"supabase_svg__b\"\n x1=\"36.156\"\n x2=\"54.484\"\n y1=\"30.578\"\n y2=\"65.081\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop></stop>\n <stop offset=\"1\" stopOpacity=\"0\"></stop>\n </linearGradient>\n </defs>\n </svg>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/results-table.tsx",
|
|
"content": "'use client'\n\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/registry/default/components/ui/table'\nimport { cn } from '@/lib/utils'\n\ninterface ResultsTableProps {\n data: any[]\n onRowClick?: (row: any) => void\n}\n\nexport function ResultsTable({ data, onRowClick }: ResultsTableProps) {\n if (!data || data.length === 0) {\n return <p className=\"p-4 text-center\">The query returned no results.</p>\n }\n\n const headers = Object.keys(data[0])\n\n return (\n <div className=\"overflow-auto\">\n <Table>\n <TableHeader>\n <TableRow className=\"hover:bg-transparent\">\n {headers.map((header) => (\n <TableHead className=\"first:pl-6 lg:first:pl-8 last:pr-6 lg:last:pr-8\" key={header}>\n {header}\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {data.map((row, rowIndex) => (\n <TableRow\n key={rowIndex}\n onClick={() => onRowClick?.(row)}\n className={cn(onRowClick && 'cursor-pointer hover:bg-muted/50 group')}\n >\n {headers.map((header) => (\n <TableCell\n className=\"first:pl-6 lg:first:pl-8 last:pr-6 lg:last:pr-8 text-xs text-muted-foreground group-hover:text-foreground min-w-[8rem]\"\n key={`${rowIndex}-${header}`}\n >\n <div className=\"text-xs font-mono w-fit max-w-96 truncate\">\n {JSON.stringify(row[header]).replace(/^\"|\"$/g, '')}\n </div>\n </TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/sql-editor.tsx",
|
|
"content": "'use client'\n\nimport { useState, useEffect, useCallback, useMemo } from 'react'\nimport { Editor } from '@monaco-editor/react'\nimport { Button } from '@/registry/default/components/ui/button'\nimport { ResultsTable } from '@/registry/default/platform/platform-kit-nextjs/components/results-table'\nimport { Label } from '@/registry/default/components/ui/label'\nimport { useRunQuery } from '@/registry/default/platform/platform-kit-nextjs/hooks/use-run-query'\nimport {\n ArrowUp,\n Loader2,\n BarChart as BarChartIcon,\n Wand,\n FileText,\n AlertTriangle,\n} from 'lucide-react'\nimport { Input } from '@/registry/default/components/ui/input'\nimport { Skeleton } from '@/registry/default/components/ui/skeleton'\nimport { Popover, PopoverContent, PopoverTrigger } from '@/registry/default/components/ui/popover'\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/registry/default/components/ui/select'\nimport { Bar, BarChart, CartesianGrid, XAxis, YAxis } from 'recharts'\nimport {\n ChartConfig,\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n} from '@/registry/default/components/ui/chart'\nimport { ToggleGroup, ToggleGroupItem } from '@/registry/default/components/ui/toggle-group'\nimport { Switch } from '@/registry/default/components/ui/switch'\nimport { Alert, AlertDescription, AlertTitle } from '@/registry/default/components/ui/alert'\n\ninterface SqlEditorProps {\n projectRef: string\n initialSql?: string\n queryKey?: any\n label?: string\n onResults?: (data: any[] | undefined) => void\n onRowClick?: (row: any, queryKey?: any) => void\n hideSql?: boolean\n readOnly?: boolean\n runAutomatically?: boolean\n refetch?: number\n initialNaturalLanguageMode?: boolean\n hideChartOption?: boolean\n}\n\nexport function SqlEditor({\n projectRef,\n initialSql,\n queryKey,\n onResults,\n onRowClick,\n label = 'Query your data',\n hideSql = false,\n readOnly = false,\n runAutomatically = false,\n refetch,\n initialNaturalLanguageMode = false,\n hideChartOption = false,\n}: SqlEditorProps) {\n const [sql, setSql] = useState(initialSql || '')\n const [isSqlVisible, setIsSqlVisible] = useState(!hideSql)\n const [isNaturalLanguageMode, setIsNaturalLanguageMode] = useState(\n process.env.NEXT_PUBLIC_ENABLE_AI_QUERIES === 'true' && initialNaturalLanguageMode\n )\n const [naturalLanguageQuery, setNaturalLanguageQuery] = useState('')\n const { mutate: runQuery, data, isPending, error } = useRunQuery()\n const [isGeneratingSql, setIsGeneratingSql] = useState(false)\n const [aiError, setAiError] = useState<string | null>(null)\n const [isChartVisible, setIsChartVisible] = useState(false)\n const [xAxisColumn, setXAxisColumn] = useState<string | null>(null)\n const [yAxisColumn, setYAxisColumn] = useState<string | null>(null)\n\n const columns = useMemo(() => {\n if (!data || data.length === 0) return []\n return Object.keys(data[0])\n }, [data])\n\n useEffect(() => {\n if (initialSql) {\n setSql(initialSql)\n }\n }, [initialSql])\n\n const handleRunNaturalLanguageQuery = async () => {\n if (!naturalLanguageQuery) return\n\n setIsGeneratingSql(true)\n setAiError(null)\n try {\n const response = await fetch('/api/ai/sql', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n prompt: naturalLanguageQuery,\n projectRef,\n }),\n })\n\n if (!response.ok) {\n const errorData = await response.json()\n throw new Error(errorData.message || 'Failed to generate SQL')\n }\n\n const { sql: generatedSql } = await response.json()\n setSql(generatedSql)\n runQuery({ projectRef, query: generatedSql, readOnly: true })\n } catch (error: any) {\n console.error(error)\n setAiError(error.message)\n } finally {\n setIsGeneratingSql(false)\n }\n }\n\n const handleRunQuery = useCallback(() => {\n if (sql) {\n runQuery({ projectRef, query: sql, readOnly: true })\n }\n }, [sql, projectRef, runQuery])\n\n useEffect(() => {\n setIsSqlVisible(!hideSql)\n }, [hideSql])\n\n useEffect(() => {\n if (runAutomatically && initialSql) {\n runQuery({ projectRef, query: initialSql, readOnly: true })\n }\n }, [runAutomatically, initialSql, projectRef, runQuery])\n\n useEffect(() => {\n if (refetch && refetch > 0) {\n handleRunQuery()\n }\n }, [refetch, handleRunQuery])\n\n useEffect(() => {\n if (onResults) {\n onResults(data)\n }\n }, [data, onResults])\n\n useEffect(() => {\n const noResults = !data || (Array.isArray(data) && data.length === 0)\n if (noResults && !isSqlVisible && !isNaturalLanguageMode && !readOnly && !isPending) {\n setIsSqlVisible(true)\n }\n }, [data, isSqlVisible, isNaturalLanguageMode])\n\n const serverErrorMessage = (error as any)?.response?.data?.message || ''\n const isReadOnlyError =\n serverErrorMessage.includes('permission denied') || serverErrorMessage.includes('42501')\n const customReadOnlyError = \"You can't directly alter your database schema, use chat instead\"\n\n // Build the toggle-group selection based on current UI state\n const toggleValues = useMemo(() => {\n const values: string[] = []\n if (isNaturalLanguageMode) values.push('chat')\n if (isSqlVisible) values.push('sql')\n if (!hideChartOption && isChartVisible) values.push('chart')\n return values\n }, [isNaturalLanguageMode, isSqlVisible, isChartVisible, hideChartOption])\n\n const handleToggleGroupChange = (values: string[]) => {\n setIsNaturalLanguageMode(values.includes('chat'))\n setIsSqlVisible(values.includes('sql'))\n if (!hideChartOption) {\n setIsChartVisible(values.includes('chart'))\n }\n }\n\n return (\n <div>\n <div className=\"px-6 pt-4 lg:px-8 lg:pt-8\">\n <div className=\"flex items-center gap-4 mb-4 \">\n <h2 className=\"font-semibold flex-1\">{label}</h2>\n <ToggleGroup\n type=\"multiple\"\n size=\"sm\"\n value={toggleValues}\n onValueChange={handleToggleGroupChange}\n className=\"gap-1\"\n >\n {process.env.NEXT_PUBLIC_ENABLE_AI_QUERIES === 'true' && (\n <ToggleGroupItem value=\"chat\" aria-label=\"Chat\">\n <Wand className=\"h-4 w-4\" />\n </ToggleGroupItem>\n )}\n <ToggleGroupItem value=\"sql\" aria-label=\"SQL\">\n <FileText className=\"h-4 w-4\" />\n </ToggleGroupItem>\n {!hideChartOption && (\n <Popover>\n <PopoverTrigger asChild>\n <ToggleGroupItem value=\"chart\" aria-label=\"Chart\">\n <BarChartIcon className=\"h-4 w-4\" />\n </ToggleGroupItem>\n </PopoverTrigger>\n <PopoverContent className=\"w-80\">\n <div className=\"grid gap-4\">\n <div className=\"grid gap-2\">\n <div className=\"flex items-center space-x-2\">\n <div className=\"flex-1\">\n <Label className=\"flex-1 mb-2 block\">Show Chart</Label>\n <p className=\"text-xs text-muted-foreground\">\n Visualize your data with a chart.\n </p>\n </div>\n <Switch\n id=\"show-chart\"\n size=\"sm\"\n className=\"mb-0\"\n checked={isChartVisible}\n onCheckedChange={setIsChartVisible}\n />\n </div>\n {isChartVisible && (\n <div className=\"mt-2\">\n <div className=\"grid grid-cols-3 items-center gap-4 mb-2\">\n <Label htmlFor=\"x-axis\">X-Axis</Label>\n <Select\n onValueChange={setXAxisColumn}\n defaultValue={xAxisColumn || undefined}\n >\n <SelectTrigger className=\"col-span-2 h-8\">\n <SelectValue placeholder=\"Select column\" />\n </SelectTrigger>\n <SelectContent>\n {columns.map((col) => (\n <SelectItem key={col} value={col}>\n {col}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"grid grid-cols-3 items-center gap-4 mb-2\">\n <Label htmlFor=\"y-axis\">Y-Axis</Label>\n <Select\n onValueChange={setYAxisColumn}\n defaultValue={yAxisColumn || undefined}\n >\n <SelectTrigger className=\"col-span-2 h-8\">\n <SelectValue placeholder=\"Select column\" />\n </SelectTrigger>\n <SelectContent>\n {columns.map((col) => (\n <SelectItem key={col} value={col}>\n {col}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n )}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n )}\n </ToggleGroup>\n </div>\n <div>\n {isNaturalLanguageMode && (\n <div className=\"relative mb-4\">\n <Wand\n strokeWidth={1.5}\n size={16}\n className=\"absolute left-4 top-1/2 -translate-y-1/2\"\n />\n <Input\n placeholder=\"e.g. Show me all users who signed up in the last 7 days\"\n value={naturalLanguageQuery}\n onChange={(e) => setNaturalLanguageQuery(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault()\n handleRunNaturalLanguageQuery()\n }\n }}\n className=\"w-full px-10\"\n />\n <Button\n onClick={handleRunNaturalLanguageQuery}\n disabled={isGeneratingSql || isPending}\n className=\"h-7 w-7 rounded-full p-0 shrink-0 absolute right-1 top-1/2 -translate-y-1/2\"\n >\n {isGeneratingSql ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : isPending ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : (\n <ArrowUp size={16} />\n )}\n </Button>\n </div>\n )}\n {isSqlVisible && (\n <div className=\"border-t border-b bg-muted overflow-hidden -mx-6 lg:-mx-8 mt-4 relative\">\n <Editor\n height=\"200px\"\n language=\"sql\"\n value={sql}\n onChange={(value) => setSql(value || '')}\n theme=\"vs-dark\"\n className=\"bg-transparent\"\n options={{\n minimap: { enabled: false },\n fontSize: 14,\n readOnly,\n padding: {\n top: 24,\n bottom: 24,\n },\n }}\n />\n <Button\n size=\"sm\"\n onClick={handleRunQuery}\n disabled={isPending}\n className=\"absolute bottom-4 right-4\"\n >\n {isPending ? 'Running...' : 'Run Query'}\n </Button>\n </div>\n )}\n </div>\n </div>\n {isPending && (\n <div className=\"space-y-2 p-4 px-6 lg:px-8\">\n <Skeleton className=\"h-6 w-full\" />\n <Skeleton className=\"h-6 w-full\" />\n <Skeleton className=\"h-6 w-full\" />\n <Skeleton className=\"h-6 w-full\" />\n <Skeleton className=\"h-6 w-full\" />\n <Skeleton className=\"h-6 w-full\" />\n </div>\n )}\n {aiError && (\n <div className=\"px-6 lg:px-8 py-4\">\n <Alert variant=\"destructive\">\n <AlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>Error generating SQL</AlertTitle>\n <AlertDescription>{aiError}</AlertDescription>\n </Alert>\n </div>\n )}\n {error && (\n <div className=\"px-6 lg:px-8 py-4\">\n <Alert variant=\"destructive\">\n <AlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>Query Error</AlertTitle>\n <AlertDescription>\n {isReadOnlyError\n ? customReadOnlyError\n : serverErrorMessage || (error as Error)?.message || 'An unexpected error occurred'}\n </AlertDescription>\n </Alert>\n </div>\n )}\n\n {!hideChartOption && data && isChartVisible && xAxisColumn && yAxisColumn && (\n <div className=\"px-8 mt-8 mb-4\">\n <QueryResultChart data={data} xAxis={xAxisColumn} yAxis={yAxisColumn} />\n </div>\n )}\n\n {data && (\n <div>\n <ResultsTable data={data} onRowClick={(row) => onRowClick?.(row, queryKey)} />\n </div>\n )}\n </div>\n )\n}\n\nfunction QueryResultChart({ data, xAxis, yAxis }: { data: any[]; xAxis: string; yAxis: string }) {\n const chartConfig = {\n [yAxis]: {\n label: yAxis,\n color: 'var(--chart-1)',\n },\n } satisfies ChartConfig\n\n return (\n <ChartContainer config={chartConfig} className=\"aspect-auto h-[250px] w-full\">\n <BarChart\n accessibilityLayer\n data={data}\n margin={{\n left: -24,\n right: 12,\n }}\n >\n <CartesianGrid vertical={false} />\n <XAxis dataKey={xAxis} tickLine={false} axisLine={false} tickMargin={8} minTickGap={32} />\n <YAxis\n dataKey={yAxis}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickCount={5}\n allowDecimals={false}\n />\n <ChartTooltip content={<ChartTooltipContent className=\"w-[150px]\" indicator=\"dot\" />} />\n <Bar dataKey={yAxis} fill={`var(--color-${yAxis})`} />\n </BarChart>\n </ChartContainer>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/supabase-manager/auth.tsx",
|
|
"content": "'use client'\n\nimport { DynamicForm } from '@/registry/default/platform/platform-kit-nextjs/components/dynamic-form'\nimport {\n useGetAuthConfig,\n useUpdateAuthConfig,\n} from '@/registry/default/platform/platform-kit-nextjs/hooks/use-auth'\nimport {\n authEmailProviderSchema,\n authFieldLabels,\n authGeneralSettingsSchema,\n type AuthGeneralSettingsSchema,\n authGoogleProviderSchema,\n authPhoneProviderSchema,\n} from '../../lib/schemas/auth'\nimport { AlertTriangle, ChevronRight, Mail, Phone, User } from 'lucide-react'\nimport { useCallback, useMemo } from 'react'\nimport { z } from 'zod'\nimport { useSheetNavigation } from '@/registry/default/platform/platform-kit-nextjs/contexts/SheetNavigationContext'\nimport { Skeleton } from '@/registry/default/components/ui/skeleton'\nimport { Button } from '@/registry/default/components/ui/button'\nimport { Alert, AlertDescription, AlertTitle } from '@/registry/default/components/ui/alert'\n\nfunction ProviderSettingsView({\n projectRef,\n schema,\n title,\n initialValues: allInitialValues,\n onSuccess,\n}: {\n projectRef: string\n schema: z.ZodObject<any> | z.ZodEffects<z.ZodObject<any>>\n title: string\n initialValues: any\n onSuccess: () => void\n}) {\n const { mutate: updateAuthConfig, isPending: isUpdatingConfig } = useUpdateAuthConfig()\n\n const actualSchema = 'shape' in schema ? schema : (schema._def.schema as z.ZodObject<any>)\n\n const handleUpdateAuthConfig = (formData: z.infer<typeof actualSchema>) => {\n const payload = Object.fromEntries(\n Object.entries(formData).filter(([_, value]) => value !== undefined)\n )\n\n if (Object.keys(payload).length === 0) {\n alert('No changes to submit. Please modify a field to update.')\n return\n }\n\n updateAuthConfig(\n {\n projectRef,\n payload,\n },\n {\n onSuccess,\n }\n )\n }\n\n const formInitialValues = useMemo(() => {\n if (!allInitialValues) {\n return undefined\n }\n const schemaKeys = Object.keys(actualSchema.shape)\n const result = schemaKeys.reduce(\n (acc, key) => {\n if (Object.prototype.hasOwnProperty.call(allInitialValues, key)) {\n acc[key] = allInitialValues[key]\n }\n return acc\n },\n {} as Record<string, any>\n )\n\n return result\n }, [allInitialValues, actualSchema])\n\n return (\n <div className=\"w-full max-w-3xl mx-auto p-6 pt-4 lg:p-12 lg:pt-12\">\n <h2 className=\"lg:text-xl font-semibold mb-2 lg:mb-4\">{title}</h2>\n <DynamicForm\n schema={actualSchema}\n onSubmit={handleUpdateAuthConfig}\n isLoading={isUpdatingConfig}\n initialValues={formInitialValues}\n labels={authFieldLabels}\n />\n </div>\n )\n}\n\nexport function AuthManager({ projectRef }: { projectRef: string }) {\n const {\n data: authConfigData,\n isLoading: isLoadingConfig,\n error: errorLoadingConfig,\n } = useGetAuthConfig(projectRef)\n\n const { mutate: updateAuthConfig, isPending: isUpdatingConfig } = useUpdateAuthConfig()\n const { push, pop } = useSheetNavigation()\n\n const handleUpdateGeneralSettings = (formData: AuthGeneralSettingsSchema) => {\n const payload = Object.fromEntries(\n Object.entries(formData).filter(([_, value]) => value !== undefined)\n )\n\n if (Object.keys(payload).length === 0) {\n alert('No changes to submit. Please modify a field to update.')\n return\n }\n\n updateAuthConfig({\n projectRef,\n payload,\n })\n }\n\n const providers: {\n name: string\n icon: React.ReactNode\n description: string\n schema: z.ZodObject<any> | z.ZodEffects<z.ZodObject<any>>\n }[] = [\n {\n icon: <Mail className=\"h-4 w-4 text-muted-foreground\" />,\n name: 'Email',\n description: 'Sign in with email and password',\n schema: authEmailProviderSchema,\n },\n {\n icon: <Phone className=\"h-4 w-4 text-muted-foreground\" />,\n name: 'Phone',\n description: 'Sign in with phone number',\n schema: authPhoneProviderSchema,\n },\n {\n icon: <User className=\"h-4 w-4 text-muted-foreground\" />,\n name: 'Google',\n description: 'Sign in with Google',\n schema: authGoogleProviderSchema,\n },\n ]\n\n const handleProviderClick = useCallback(\n (provider: { name: string; schema: z.ZodObject<any> | z.ZodEffects<z.ZodObject<any>> }) => {\n push({\n title: `${provider.name} Provider Settings`,\n component: (\n <ProviderSettingsView\n projectRef={projectRef}\n schema={provider.schema}\n title={`${provider.name} Provider Settings`}\n initialValues={authConfigData}\n onSuccess={() => pop()}\n />\n ),\n })\n },\n [projectRef, authConfigData, push, pop]\n )\n\n const formInitialValues = useMemo(() => {\n if (!authConfigData) {\n return undefined\n }\n const schemaKeys = Object.keys(authGeneralSettingsSchema.shape)\n return schemaKeys.reduce(\n (acc, key) => {\n if (Object.prototype.hasOwnProperty.call(authConfigData, key)) {\n acc[key] = authConfigData[key as keyof typeof authConfigData]\n }\n return acc\n },\n {} as Record<string, any>\n )\n }, [authConfigData])\n\n if (errorLoadingConfig) {\n return (\n <div className=\"mx-6 lg:mx-8 mt-8\">\n <Alert variant=\"destructive\">\n <AlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>Error loading auth settings</AlertTitle>\n <AlertDescription>\n There was a problem loading your authentication configuration.\n </AlertDescription>\n </Alert>\n </div>\n )\n }\n\n if (isLoadingConfig)\n return (\n <div className=\"w-full max-w-3xl mx-auto p-12 space-y-2\">\n <Skeleton className=\"h-12 w-full mb-8\" />\n <Skeleton className=\"h-12 w-full\" />\n <Skeleton className=\"h-12 w-full\" />\n </div>\n )\n\n return (\n <div className=\"w-full max-w-3xl mx-auto p-6 pt-4 lg:p-12 lg:pt-12\">\n <div className=\"mb-12\">\n <h2 className=\"text-base lg:text-xl font-semibold\">General Settings</h2>\n <p className=\"text-sm lg:text-base text-muted-foreground mt-1 mb-2\">\n Allow people to sign up to your app\n </p>\n <DynamicForm\n schema={authGeneralSettingsSchema}\n onSubmit={handleUpdateGeneralSettings}\n isLoading={isUpdatingConfig}\n initialValues={formInitialValues}\n labels={authFieldLabels}\n />\n </div>\n <div>\n <h2 className=\"font-semibold lg:text-lg\">Sign in methods</h2>\n <p className=\"text-muted-foreground mb-6 mt-1 text-sm lg:text-base\">\n Configure how people sign in and up to your app.\n </p>\n <div className=\"border rounded-md overflow-hidden bg-background\">\n {providers.map((provider) => (\n <Button\n variant=\"ghost\"\n size=\"lg\"\n onClick={() => handleProviderClick(provider)}\n key={provider.name}\n className=\"rounded-none justify-start flex-row text-left h-auto px-8 py-4 w-full gap-4 border-b last:border-b-0\"\n >\n {provider.icon}\n <div className=\"flex-1\">\n <h3 className=\"font-bold\">{provider.name}</h3>\n <p className=\"text-muted-foreground text-sm\">{provider.description}</p>\n </div>\n <ChevronRight className=\"h-4 w-4 text-muted-foreground\" />\n </Button>\n ))}\n </div>\n </div>\n </div>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/supabase-manager/database.tsx",
|
|
"content": "'use client'\n\nimport { useState, useMemo, useCallback } from 'react'\nimport { z, type ZodTypeAny } from 'zod'\nimport { useListTables } from '@/registry/default/platform/platform-kit-nextjs/hooks/use-tables'\nimport { useRunQuery } from '@/registry/default/platform/platform-kit-nextjs/hooks/use-run-query'\nimport { SqlEditor } from '@/registry/default/platform/platform-kit-nextjs/components/sql-editor'\nimport { DynamicForm } from '@/registry/default/platform/platform-kit-nextjs/components/dynamic-form'\nimport { toast } from 'sonner'\nimport { useSheetNavigation } from '@/registry/default/platform/platform-kit-nextjs/contexts/SheetNavigationContext'\nimport { Skeleton } from '@/registry/default/components/ui/skeleton'\nimport { Button } from '@/registry/default/components/ui/button'\nimport { AlertTriangle, Table, Wand } from 'lucide-react'\nimport { Alert, AlertDescription, AlertTitle } from '@/registry/default/components/ui/alert'\n\n// Helper to generate a Zod schema from the table's column definitions\nfunction generateZodSchema(table: any): z.ZodObject<any, any, any> {\n if (!table || !table.columns) {\n return z.object({})\n }\n\n const shape: Record<string, ZodTypeAny> = {}\n for (const column of table.columns) {\n // We can only edit updatable columns that are not generated\n if (!column.is_updatable || column.is_generated) continue\n\n let fieldSchema: ZodTypeAny\n const dataType = column.data_type.toLowerCase()\n\n if (dataType.includes('array')) {\n fieldSchema = z.array(z.any())\n } else if (dataType.includes('int') || dataType.includes('numeric')) {\n fieldSchema = z.number()\n } else if (dataType.includes('bool')) {\n fieldSchema = z.boolean()\n } else if (\n dataType === 'user-defined' &&\n column.enums &&\n Array.isArray(column.enums) &&\n column.enums.length > 0\n ) {\n // Handle enum types\n fieldSchema = z.enum(column.enums as [string, ...string[]])\n } else {\n // Default to string for text, varchar, timestamp, uuid, etc.\n fieldSchema = z.string()\n }\n\n if (column.is_nullable) {\n fieldSchema = fieldSchema.nullish()\n }\n\n shape[column.name] = fieldSchema\n }\n return z.object(shape)\n}\n\nconst getPrimaryKeys = (table: any): string[] => {\n if (!table || !table.primary_keys) {\n return []\n }\n return table.primary_keys.map((pk: any) => pk.name)\n}\n\nfunction EditRowView({\n projectRef,\n table,\n row,\n onSuccess,\n}: {\n projectRef: string\n table: any\n row: any\n onSuccess: () => void\n}) {\n const { mutate: runUpdateQuery, isPending: isUpdatePending } = useRunQuery()\n const formSchema = useMemo(() => generateZodSchema(table), [table])\n\n const columnInfo = useMemo(() => {\n if (!table || !table.columns) return {}\n\n const info: Record<string, any> = {}\n for (const column of table.columns) {\n // Only include updatable columns that are not generated\n if (!column.is_updatable || column.is_generated) continue\n\n const dataType = column.data_type.toLowerCase()\n const displayType =\n dataType === 'user-defined' &&\n column.enums &&\n Array.isArray(column.enums) &&\n column.enums.length > 0\n ? 'enum'\n : dataType\n\n info[column.name] = {\n data_type: displayType,\n is_nullable: column.is_nullable,\n }\n }\n return info\n }, [table])\n\n const handleFormSubmit = useCallback(\n (formData: any) => {\n const pks = getPrimaryKeys(table)\n if (pks.length === 0) {\n toast.error('Cannot update row. This table does not have a primary key.')\n return\n }\n\n const setClauses = Object.entries(formData)\n .map(([key, value]) => {\n if (JSON.stringify(row[key]) === JSON.stringify(value)) return null\n\n // Find the column type to determine formatting\n const column = table.columns.find((col: any) => col.name === key)\n const dataType = column?.data_type?.toLowerCase() || ''\n const isNullable = column?.is_nullable || false\n\n let formattedValue\n\n // Handle empty/null values\n if (\n value === null ||\n value === undefined ||\n (typeof value === 'string' && value.trim() === '')\n ) {\n if (isNullable) {\n formattedValue = 'NULL'\n } else if (dataType.includes('array')) {\n // Non-nullable array, set to empty array\n const jsonObj = JSON.stringify({ [key]: [] })\n formattedValue = `(select ${key} from json_populate_record(null::public.\"${\n table.name\n }\", '${jsonObj.replace(/'/g, \"''\")}'))`\n } else {\n // Non-nullable text field, set to empty string\n formattedValue = \"''\"\n }\n } else if (Array.isArray(value) && value.length === 0) {\n // Explicitly empty array (different from null)\n const jsonObj = JSON.stringify({ [key]: [] })\n formattedValue = `(select ${key} from json_populate_record(null::public.\"${\n table.name\n }\", '${jsonObj.replace(/'/g, \"''\")}'))`\n } else if (dataType.includes('array')) {\n // Array type with actual values - use json_populate_record syntax\n const jsonObj = JSON.stringify({ [key]: value })\n formattedValue = `(select ${key} from json_populate_record(null::public.\"${\n table.name\n }\", '${jsonObj.replace(/'/g, \"''\")}'))`\n } else if (dataType === 'user-defined' && column?.enums) {\n // Handle enum values - treat as strings with proper escaping\n formattedValue = `'${String(value).replace(/'/g, \"''\")}'`\n } else if (typeof value === 'string') {\n formattedValue = `'${value.replace(/'/g, \"''\")}'`\n } else {\n formattedValue = value\n }\n\n return `\"${key}\" = ${formattedValue}`\n })\n .filter(Boolean)\n .join(', ')\n\n if (!setClauses) {\n toast.error('No changes to save')\n onSuccess()\n return\n }\n\n const whereClauses = pks\n .map((pk) => {\n const value = row[pk]\n const formattedValue =\n typeof value === 'string' ? `'${value.replace(/'/g, \"''\")}'` : value\n return `\"${pk}\" = ${formattedValue}`\n })\n .join(' AND ')\n\n const updateSql = `UPDATE public.\"${table.name}\" SET ${setClauses} WHERE ${whereClauses};`\n\n runUpdateQuery({ projectRef, query: updateSql, readOnly: false }, { onSuccess })\n },\n [projectRef, table, row, runUpdateQuery, onSuccess]\n )\n\n return (\n <div className=\"px-6 pt-4 pb-10 lg:px-12 lg:pt-10\">\n <h2 className=\"text-base lg:text-xl font-semibold mb-4\">Editing row in {table.name}</h2>\n <DynamicForm\n schema={formSchema}\n initialValues={row}\n onSubmit={handleFormSubmit}\n isLoading={isUpdatePending}\n columnInfo={columnInfo}\n />\n </div>\n )\n}\n\nfunction TableRecordsView({ projectRef, table }: { projectRef: string; table: any }) {\n const { push, pop } = useSheetNavigation()\n const [refetchCounter, setRefetchCounter] = useState(0)\n\n const handleRowClick = useCallback(\n (row: any) => {\n push({\n title: `Editing row`,\n component: (\n <EditRowView\n projectRef={projectRef}\n table={table}\n row={row}\n onSuccess={() => {\n pop()\n setRefetchCounter((c) => c + 1)\n }}\n />\n ),\n })\n },\n [push, pop, projectRef, table]\n )\n\n return (\n <SqlEditor\n hideChartOption={true}\n projectRef={projectRef}\n label={`View records in ${table.name}`}\n initialSql={`SELECT * FROM public.\"${table.name}\" LIMIT 100;`}\n queryKey={table.id}\n onRowClick={handleRowClick}\n hideSql={true}\n runAutomatically={true}\n refetch={refetchCounter}\n readOnly\n />\n )\n}\n\nexport function DatabaseManager({ projectRef }: { projectRef: string }) {\n const { push } = useSheetNavigation()\n const { data: tables, isLoading, isError } = useListTables(projectRef, ['public'])\n\n const handleTableClick = useCallback(\n (table: any) => {\n push({\n title: table.name,\n component: <TableRecordsView projectRef={projectRef} table={table} />,\n })\n },\n [push, projectRef]\n )\n\n const handleNaturalLanguageQueryClick = useCallback(() => {\n push({\n title: 'Talk to your database',\n component: (\n <SqlEditor projectRef={projectRef} initialNaturalLanguageMode={true} hideSql={true} />\n ),\n })\n }, [push, projectRef])\n\n return (\n <div className=\"p-6 pt-4 lg:p-8 lg:pt-8\">\n <div className=\"flex items-center justify-between mb-6 gap-6\">\n <div className=\"flex-1\">\n <h1 className=\"text-base lg:text-xl font-semibold\">Database</h1>\n <p className=\"hidden lg:block text-sm lg:text-base text-muted-foreground mt-1\">\n View and manage the data stored in your app.\n </p>\n </div>\n <Button\n variant=\"outline\"\n key=\"talk-to-db\"\n className=\"flex-row justify-between\"\n onClick={handleNaturalLanguageQueryClick}\n >\n <Wand strokeWidth={1.5} size={16} />\n Query your database\n </Button>\n </div>\n\n {isError && (\n <Alert variant=\"destructive\" className=\"mt-8\">\n <AlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>Error loading tables</AlertTitle>\n <AlertDescription>There was a problem loading your database tables.</AlertDescription>\n </Alert>\n )}\n\n {isLoading && (\n <div className=\"mt-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n <Skeleton className=\"h-12 w-full\" />\n <Skeleton className=\"h-12 w-full\" />\n <Skeleton className=\"h-12 w-full\" />\n <Skeleton className=\"h-12 w-full\" />\n </div>\n )}\n\n {tables && tables.length > 0 ? (\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2\">\n {tables.map((table: any) => (\n <Button\n variant=\"outline\"\n key={table.id}\n size=\"lg\"\n className=\"flex-row justify-between text-left\"\n onClick={() => handleTableClick(table)}\n >\n <Table className=\"h-4 w-4 text-muted-foreground\" />\n <h2 className=\"text-sm font-medium font-mono truncate flex-1\">{table.name}</h2>\n <div className=\"text-sm text-muted-foreground font-mono shrink-0\">\n {table.live_rows_estimate} rows\n </div>\n </Button>\n ))}\n </div>\n ) : !isLoading && (!tables || tables.length === 0) ? (\n <Alert className=\"mt-8\">\n <Table className=\"h-4 w-4\" />\n <AlertTitle>No database tables</AlertTitle>\n <AlertDescription>Create tables to store and organize your data.</AlertDescription>\n </Alert>\n ) : null}\n </div>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/supabase-manager/index.tsx",
|
|
"content": "'use client'\n\nimport { useState, ReactNode, useMemo } from 'react'\nimport { Button } from '@/registry/default/components/ui/button'\nimport {\n Dialog,\n DialogContent,\n DialogTitle,\n DialogTrigger,\n} from '@/registry/default/components/ui/dialog'\nimport {\n Drawer,\n DrawerContent,\n DrawerHeader,\n DrawerTitle,\n} from '@/registry/default/components/ui/drawer'\nimport { AuthManager } from '@/registry/default/platform/platform-kit-nextjs/components/supabase-manager/auth'\nimport { DatabaseManager } from '@/registry/default/platform/platform-kit-nextjs/components/supabase-manager/database'\nimport { StorageManager } from '@/registry/default/platform/platform-kit-nextjs/components/supabase-manager/storage'\nimport { LogsManager } from '@/registry/default/platform/platform-kit-nextjs/components/supabase-manager/logs'\nimport { SuggestionsManager } from '@/registry/default/platform/platform-kit-nextjs/components/supabase-manager/suggestions'\nimport { UsersManager } from '@/registry/default/platform/platform-kit-nextjs/components/supabase-manager/users'\nimport { SecretsManager } from '@/registry/default/platform/platform-kit-nextjs/components/supabase-manager/secrets'\nimport {\n SheetNavigationProvider,\n useSheetNavigation,\n} from '@/registry/default/platform/platform-kit-nextjs/contexts/SheetNavigationContext'\nimport {\n ChevronLeft,\n ChevronRight,\n Database,\n ExternalLink,\n HardDrive,\n KeyRound,\n Lightbulb,\n ScrollText,\n Shield,\n Users,\n} from 'lucide-react'\nimport {\n HoverCard,\n HoverCardTrigger,\n HoverCardContent,\n} from '@/registry/default/components/ui/hover-card'\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { LogoSupabase } from '@/registry/default/platform/platform-kit-nextjs/components/logo-supabase'\nimport Link from 'next/link'\n\nconst queryClient = new QueryClient()\n\nfunction DialogView({ projectRef, isMobile }: { projectRef: string; isMobile?: boolean }) {\n const { stack, push, popTo, reset } = useSheetNavigation()\n\n const handleTopLevelNavigation = (title: string, component: ReactNode) => {\n if (stack.length === 1 && stack[0].title === title) {\n return\n }\n reset()\n push({ title, component })\n }\n\n const currentView = stack[stack.length - 1]\n const activeManager = stack.length > 0 ? stack[0].title : null\n\n const navigationItems = useMemo(\n () => [\n {\n title: 'Database',\n icon: Database,\n component: <DatabaseManager projectRef={projectRef} />,\n },\n {\n title: 'Storage',\n icon: HardDrive,\n component: <StorageManager projectRef={projectRef} />,\n },\n {\n title: 'Auth',\n icon: Shield,\n component: <AuthManager projectRef={projectRef} />,\n },\n {\n title: 'Users',\n icon: Users,\n component: <UsersManager projectRef={projectRef} />,\n },\n {\n title: 'Secrets',\n icon: KeyRound,\n component: <SecretsManager projectRef={projectRef} />,\n },\n {\n title: 'Logs',\n icon: ScrollText,\n component: <LogsManager projectRef={projectRef} />,\n },\n {\n title: 'Suggestions',\n icon: Lightbulb,\n component: <SuggestionsManager projectRef={projectRef} />,\n },\n ],\n [projectRef]\n )\n\n if (isMobile) {\n return (\n <div className=\"flex flex-col h-full overflow-hidden\">\n {/* Content Area */}\n <div className=\"flex flex-col overflow-hidden h-full\">\n <div className=\"grow overflow-y-auto\">\n {currentView ? (\n currentView.component\n ) : (\n <div className=\"flex items-center justify-center h-full\">\n <p className=\"text-muted-foreground\">\n Select a manager from the bottom navigation to get started.\n </p>\n </div>\n )}\n </div>\n </div>\n\n {/* Bottom Navigation Bar */}\n <div className=\"border-t bg-background\">\n <div className=\"overflow-x-auto\">\n <div className=\"flex gap-1 p-2 min-w-max\">\n {navigationItems.map((item) => {\n const Icon = item.icon\n return (\n <Button\n key={item.title}\n variant={activeManager === item.title ? 'secondary' : 'ghost'}\n className=\"flex-col h-16 w-20 min-w-16 text-xs gap-1 px-2\"\n onClick={() => handleTopLevelNavigation(item.title, item.component)}\n >\n <Icon className=\"h-5 w-5\" />\n <span className=\"text-[10px] leading-tight text-center\">\n {item.title === 'Auth' ? 'Auth' : item.title}\n </span>\n </Button>\n )\n })}\n </div>\n </div>\n </div>\n </div>\n )\n }\n\n return (\n <div className=\"grid grid-cols-[240px_1fr] h-full overflow-hidden\">\n {/* Sidebar */}\n <div className=\"flex flex-col border-r px-3 py-6 pb-3\">\n <div className=\"px-4 mb-4\">\n <h2 className=\"text-muted-foreground font-semibold text-sm\">Manage your back-end</h2>\n </div>\n <div className=\"grow space-y-0.5\">\n {navigationItems.map((item) => {\n const Icon = item.icon\n return (\n <Button\n key={item.title}\n variant={activeManager === item.title ? 'secondary' : 'ghost'}\n className=\"w-full justify-start text-sm\"\n onClick={() => handleTopLevelNavigation(item.title, item.component)}\n >\n <Icon className=\"mr-2 text-muted-foreground\" />\n {item.title === 'Auth' ? 'Authentication' : item.title}\n </Button>\n )\n })}\n </div>\n <footer className=\"p-0 text-sm text-muted-foreground flex items-center gap-3 -m-3 border-t\">\n <HoverCard>\n <HoverCardTrigger asChild>\n <Link\n href={`https://supabase.com/dashboard/project/${projectRef}`}\n target=\"_blank\"\n className=\"flex items-center px-4 w-full rounded-none text-sm py-4 h-auto justify-start gap-3 text-sm text-left hover:bg-accent\"\n >\n <LogoSupabase size={16} />\n <span className=\"flex-1\">Open in Supabase</span>\n <ExternalLink className=\"ml-2 h-4 w-4 text-muted-foreground/50\" />\n </Link>\n </HoverCardTrigger>\n <HoverCardContent\n sideOffset={8}\n align=\"start\"\n side=\"top\"\n className=\"text-sm bg-muted/50 w-[216px]\"\n >\n <h4 className=\"font-semibold mb-1\">About Supabase</h4>\n <p className=\"text-muted-foreground\">\n Access powerful back-end tools for database, auth, storage, and logs directly in\n Supabase.\n </p>\n </HoverCardContent>\n </HoverCard>\n </footer>\n </div>\n\n {/* Content Area */}\n <div className=\"flex flex-col overflow-hidden h-full\">\n {/* Header with breadcrumbs */}\n <div className=\"flex items-center h-12 shrink-0 px-4 relative border-b\">\n {stack.length > 1 && (\n <Button\n variant=\"outline\"\n size=\"icon\"\n className=\"h-8 w-8 relative z-10\"\n onClick={() => popTo(stack.length - 2)}\n >\n <ChevronLeft className=\"h-4 w-4\" />\n <span className=\"sr-only\">Back</span>\n </Button>\n )}\n {/* Breadcrumbs */}\n <div className=\"ml-4 flex items-center gap-1.5 text-sm text-muted-foreground relative z-10\">\n {stack.map((item: { title: string }, index: number) => (\n <div key={`${item.title}-${index}`} className=\"flex items-center gap-1.5\">\n {index > 0 && <ChevronRight className=\"h-3 w-3\" />}\n {index === stack.length - 1 ? (\n <span className=\"font-semibold text-foreground\">{item.title}</span>\n ) : (\n <button onClick={() => popTo(index)} className=\"hover:underline\">\n {item.title}\n </button>\n )}\n </div>\n ))}\n </div>\n </div>\n\n <div className=\"grow overflow-y-auto\">\n {currentView ? (\n currentView.component\n ) : (\n <div className=\"flex items-center justify-center h-full\">\n <p className=\"text-muted-foreground\">\n Select a manager from the sidebar to get started.\n </p>\n </div>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nexport default function SupabaseManagerDialog({\n projectRef,\n open,\n onOpenChange,\n isMobile,\n}: {\n projectRef: string\n open: boolean\n onOpenChange: (open: boolean) => void\n isMobile: boolean\n}) {\n const content = (\n <SheetNavigationProvider\n onStackEmpty={() => {}}\n initialStack={[\n {\n title: 'Database',\n component: <DatabaseManager projectRef={projectRef} />,\n },\n ]}\n >\n <DialogView projectRef={projectRef} isMobile={isMobile} />\n </SheetNavigationProvider>\n )\n\n if (!isMobile) {\n return (\n <QueryClientProvider client={queryClient}>\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"w-full h-[80vh] max-h-[700px] sm:max-w-[calc(100%-2rem)] w-[1180px] p-0 overflow-hidden sm:rounded-lg\">\n <DialogTitle className=\"sr-only\">Manage your back-end</DialogTitle>\n {content}\n </DialogContent>\n </Dialog>\n </QueryClientProvider>\n )\n }\n\n return (\n <QueryClientProvider client={queryClient}>\n <Drawer open={open} onOpenChange={onOpenChange}>\n <DrawerContent className=\"h-[90vh] p-0 overflow-hidden\">\n <DrawerHeader className=\"sr-only\">\n <DrawerTitle>Manage your back-end</DrawerTitle>\n </DrawerHeader>\n {content}\n </DrawerContent>\n </Drawer>\n </QueryClientProvider>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/supabase-manager/logs.tsx",
|
|
"content": "'use client'\n\nimport { Alert, AlertDescription, AlertTitle } from '@/registry/default/components/ui/alert'\nimport { Button } from '@/registry/default/components/ui/button'\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/registry/default/components/ui/command'\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from '@/registry/default/components/ui/hover-card'\nimport { Popover, PopoverContent, PopoverTrigger } from '@/registry/default/components/ui/popover'\nimport { Skeleton } from '@/registry/default/components/ui/skeleton'\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from '@/registry/default/components/ui/table'\nimport { useGetLogs } from '@/registry/default/platform/platform-kit-nextjs/hooks/use-logs'\nimport { LogsTableName, genDefaultQuery } from '../../lib/logs'\nimport { cn } from '@/lib/utils'\nimport { Check, ChevronsUpDown, Logs, Terminal } from 'lucide-react'\nimport { useMemo, useState } from 'react'\n\n// Define log types with names and descriptions\nconst logTypes = [\n {\n value: LogsTableName.FN_EDGE,\n label: 'Function Edge Logs',\n description: 'Edge function execution logs with request and response metadata',\n },\n {\n value: LogsTableName.AUTH,\n label: 'Authentication Logs',\n description: 'User authentication events and security logs',\n },\n {\n value: LogsTableName.POSTGRES,\n label: 'PostgreSQL Logs',\n description: 'Database queries, errors, and performance metrics',\n },\n {\n value: LogsTableName.REALTIME,\n label: 'Realtime Logs',\n description: 'WebSocket connections and realtime subscriptions',\n },\n {\n value: LogsTableName.STORAGE,\n label: 'Storage Logs',\n description: 'File uploads, downloads, and storage operations',\n },\n {\n value: LogsTableName.PG_CRON,\n label: 'Cron Job Logs',\n description: 'Scheduled job executions and cron task logs',\n },\n {\n value: LogsTableName.EDGE,\n label: 'Edge Logs',\n description: 'HTTP requests and responses from the data API',\n },\n\n {\n value: LogsTableName.FUNCTIONS,\n label: 'Function Logs',\n description: 'Serverless function execution logs and events',\n },\n {\n value: LogsTableName.POSTGREST,\n label: 'PostgREST Logs',\n description: 'API requests to your database through PostgREST',\n },\n {\n value: LogsTableName.SUPAVISOR,\n label: 'Supavisor Logs',\n description: 'Connection pooling and database proxy logs',\n },\n {\n value: LogsTableName.PGBOUNCER,\n label: 'PgBouncer Logs',\n description: 'Legacy connection pooling logs',\n },\n {\n value: LogsTableName.PG_UPGRADE,\n label: 'PostgreSQL Upgrade Logs',\n description: 'Database upgrade processes and migration logs',\n },\n]\n\nexport function LogsManager({ projectRef }: { projectRef: string }) {\n const [activeTab, setActiveTab] = useState<LogsTableName>(LogsTableName.FN_EDGE)\n const [open, setOpen] = useState(false)\n\n const sql = useMemo(() => genDefaultQuery(activeTab), [activeTab])\n\n const { data: logs, isLoading, error } = useGetLogs(projectRef, { sql })\n\n const selectedLogType = logTypes.find((type) => type.value === activeTab)\n\n return (\n <>\n <div className=\"p-6 pt-4 lg:p-8 lg:pt-8 border-b bg-background z-10 sticky top-0 flex items-center justify-between mb-6\">\n <div className=\"flex-1\">\n <h1 className=\"text-base lg:text-xl font-semibold\">Logs</h1>\n <p className=\"hidden lg:block text-sm lg:text-base text-muted-foreground mt-1\">\n Debug errors and track activity in your app\n </p>\n </div>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={open}\n className=\"w-64 justify-between\"\n >\n {selectedLogType ? selectedLogType.label : 'Select log type...'}\n <ChevronsUpDown className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-80 p-0\" align=\"end\">\n <Command>\n <CommandInput placeholder=\"Search log types...\" className=\"h-9\" />\n <CommandList\n className=\"max-h-60 overflow-y-auto\"\n onWheel={(e) => {\n e.stopPropagation()\n }}\n style={{ overscrollBehavior: 'contain' }}\n >\n <CommandEmpty>No log type found.</CommandEmpty>\n <CommandGroup>\n {logTypes.map((logType) => (\n <CommandItem\n key={logType.value}\n value={logType.value}\n onSelect={(currentValue) => {\n setActiveTab(currentValue as LogsTableName)\n setOpen(false)\n }}\n className=\"flex items-center gap-2 p-3\"\n >\n <div className=\"flex-1\">\n <div className=\"text-xs mb-1 font-medium leading-none\">{logType.label}</div>\n <div className=\"text-xs text-muted-foreground leading-snug\">\n {logType.description}\n </div>\n </div>\n <Check\n className={cn(\n 'h-4 w-4 mt-0.5',\n activeTab === logType.value ? 'opacity-100' : 'opacity-0'\n )}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n\n {isLoading && (\n <div className=\"space-y-2 mx-8 mt-8\">\n <Skeleton className=\"h-6 w-full\" />\n <Skeleton className=\"h-6 w-full\" />\n <Skeleton className=\"h-6 w-full\" />\n <Skeleton className=\"h-6 w-full\" />\n </div>\n )}\n {(error || (logs && logs.error)) && (\n <div className=\"mx-6 lg:mx-8 mt-8\">\n <Alert variant=\"destructive\">\n <Terminal className=\"h-4 w-4\" />\n <AlertTitle>Error fetching logs</AlertTitle>\n <AlertDescription>\n {(error as any)?.message ||\n (typeof logs?.error === 'object' && logs.error?.message) ||\n 'An unexpected error occurred. Please try again.'}\n </AlertDescription>\n </Alert>\n </div>\n )}\n {logs && logs.result && logs.result.length > 0 && (\n <div className=\"mt-4 overflow-auto w-full\">\n <Table>\n <TableHeader>\n <TableRow className=\"hover:bg-transparent\">\n {Object.keys(logs.result[0] as object).map((key, idx, arr) => (\n <TableHead\n key={key}\n className={\n (idx === 0 ? 'first:pl-6 lg:first:pl-8 ' : '') +\n (idx === arr.length - 1 ? 'last:pr-6 lg:last:pr-8 ' : '')\n }\n >\n {key.replace(/_/g, ' ').replace(/\\b\\w/g, (l) => l.toUpperCase())}\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {(logs.result as any[]).map((log, index) => (\n <TableRow key={log.id || index} className=\"group hover:bg-muted/50 relative\">\n {Object.keys(logs.result?.[0] ?? []).map((key, idx, arr) => {\n const value = log[key]\n const formattedValue = (() => {\n if (key === 'timestamp' && typeof value === 'number') {\n return new Date(value / 1000).toLocaleString()\n }\n if (value === null) {\n return 'NULL'\n }\n return typeof value === 'object'\n ? JSON.stringify(value, null, 2)\n : String(value)\n })()\n\n return (\n <TableCell\n key={key}\n className=\"first:pl-6 lg:first:pl-8 last:pr-6 lg:last:pr-8 text-xs text-muted-foreground group-hover:text-foreground min-w-[8rem]\"\n >\n <HoverCard>\n <HoverCardTrigger asChild>\n <div className=\"text-xs font-mono w-fit max-w-96 truncate cursor-default\">\n {formattedValue}\n </div>\n </HoverCardTrigger>\n <HoverCardContent className=\"w-96 max-h-96 overflow-auto p-3\">\n <pre className=\"text-xs font-mono whitespace-pre-wrap break-words\">\n {formattedValue}\n </pre>\n </HoverCardContent>\n </HoverCard>\n </TableCell>\n )\n })}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n )}\n {logs && logs.result && logs.result.length === 0 && (\n <div className=\"mt-8 mx-8\">\n <Alert>\n <Logs className=\"h-4 w-4\" />\n <AlertTitle>No logs found</AlertTitle>\n <AlertDescription>\n Logs will appear here when your application generates activity.\n </AlertDescription>\n </Alert>\n </div>\n )}\n </>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/supabase-manager/secrets.tsx",
|
|
"content": "'use client'\n\nimport { Button } from '@/registry/default/components/ui/button'\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/registry/default/components/ui/form'\nimport { Input } from '@/registry/default/components/ui/input'\nimport { Skeleton } from '@/registry/default/components/ui/skeleton'\nimport {\n useCreateSecrets,\n useDeleteSecrets,\n useGetSecrets,\n} from '@/registry/default/platform/platform-kit-nextjs/hooks/use-secrets'\nimport { secretsSchema } from '../../lib/schemas/secrets'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { AlertTriangle, Minus, PlusIcon, Key } from 'lucide-react'\nimport { useFieldArray, useForm } from 'react-hook-form'\nimport { z } from 'zod'\nimport { Alert, AlertDescription, AlertTitle } from '@/registry/default/components/ui/alert'\n\nexport function SecretsManager({ projectRef }: { projectRef: string }) {\n const { data: secrets, isLoading, error } = useGetSecrets(projectRef)\n const { mutate: createSecrets, isPending: isCreating } = useCreateSecrets()\n const { mutate: deleteSecrets, isPending: isDeleting } = useDeleteSecrets()\n const form = useForm<z.infer<typeof secretsSchema>>({\n resolver: zodResolver(secretsSchema),\n defaultValues: {\n secrets: [{ name: '', value: '' }],\n },\n })\n\n const { fields, append, remove } = useFieldArray({\n control: form.control,\n name: 'secrets',\n })\n\n const handleCreateSecrets = (formData: z.infer<typeof secretsSchema>) => {\n createSecrets(\n {\n projectRef,\n secrets: formData.secrets,\n },\n {\n onSuccess: () => {\n form.reset({ secrets: [{ name: '', value: '' }] })\n },\n }\n )\n }\n\n const handleDeleteSecret = (secretName: string) => {\n if (window.confirm(`Are you sure you want to delete the secret \"${secretName}\"?`)) {\n deleteSecrets({\n projectRef,\n secretNames: [secretName],\n })\n }\n }\n\n if (isLoading) {\n return (\n <div className=\"w-full max-w-4xl mx-auto p-12 space-y-4\">\n <Skeleton className=\"h-48 w-full\" />\n <Skeleton className=\"h-16 w-full\" />\n <Skeleton className=\"h-16 w-full\" />\n </div>\n )\n }\n\n if (error) {\n return (\n <div className=\"mx-6 lg:mx-8 mt-8\">\n <Alert variant=\"destructive\">\n <AlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>Error loading secrets</AlertTitle>\n <AlertDescription>\n There was a problem loading your secrets configuration.\n </AlertDescription>\n </Alert>\n </div>\n )\n }\n\n return (\n <div className=\"w-full max-w-3xl mx-auto p-6 pt-4 lg:p-12 lg:pt-12\">\n <div className=\"mb-16\">\n <h2 className=\"text-base lg:text-xl font-semibold mb-1\">Add New Secret</h2>\n <p className=\"text-muted-foreground mb-6 text-sm lg:text-base\">\n Add sensitive information like API keys that your app needs to work securely.\n </p>\n <Form {...form}>\n <form onSubmit={form.handleSubmit(handleCreateSecrets)} className=\"space-y-2\">\n {fields.map((field, index) => (\n <div key={field.id} className=\"flex items-start space-x-2\">\n <FormField\n control={form.control}\n name={`secrets.${index}.name`}\n render={({ field }) => (\n <FormItem className=\"flex-1\">\n {index === 0 && <FormLabel className=\"mb-4\">Name</FormLabel>}\n <FormControl>\n <Input placeholder=\"SECRET_NAME\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <FormField\n control={form.control}\n name={`secrets.${index}.value`}\n render={({ field }) => (\n <FormItem className=\"flex-1\">\n {index === 0 && <FormLabel className=\"mb-4\">Value</FormLabel>}\n <FormControl>\n <Input type=\"password\" placeholder=\"••••••••\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <div className=\"w-8\">\n {index === 0 && <FormLabel className=\"opacity-0 mb-4\">Remove</FormLabel>}\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon\"\n onClick={() => remove(index)}\n disabled={fields.length <= 1}\n >\n <Minus className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n ))}\n <div className=\"flex items-center space-x-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => append({ name: '', value: '' })}\n >\n <PlusIcon className=\"mr-2 h-4 w-4\" />\n Add Secret\n </Button>\n </div>\n\n <Button type=\"submit\" disabled={isCreating} className=\"mt-6\">\n {isCreating ? 'Creating...' : 'Create Secrets'}\n </Button>\n </form>\n </Form>\n </div>\n\n <div>\n <h2 className=\"font-semibold mb-4 lg:text-lg\">Existing secrets</h2>\n {secrets && secrets.length > 0 ? (\n secrets.map((secret) => (\n <div\n key={secret.name}\n className=\"flex items-center justify-between py-4 border-b last:border-b-0\"\n >\n <div>\n <p className=\"font-mono text-sm tracking-wider\">{secret.name}</p>\n {secret.updated_at && (\n <p className=\"text-xs text-muted-foreground mt-1\">\n Last updated: {new Date(secret.updated_at).toLocaleString()}\n </p>\n )}\n </div>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleDeleteSecret(secret.name)}\n disabled={isDeleting}\n >\n Delete\n </Button>\n </div>\n ))\n ) : (\n <Alert>\n <Key className=\"h-4 w-4\" />\n <AlertTitle>No secrets found</AlertTitle>\n <AlertDescription>No secrets found for this project.</AlertDescription>\n </Alert>\n )}\n </div>\n </div>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/supabase-manager/storage.tsx",
|
|
"content": "'use client'\n\nimport { useGetBuckets } from '@/registry/default/platform/platform-kit-nextjs/hooks/use-storage'\nimport { Skeleton } from '@/registry/default/components/ui/skeleton'\nimport { Badge } from '@/registry/default/components/ui/badge'\nimport { Button } from '@/registry/default/components/ui/button'\nimport { AlertTriangle, Folder } from 'lucide-react'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@/registry/default/components/ui/tooltip'\nimport { Alert, AlertDescription, AlertTitle } from '@/registry/default/components/ui/alert'\n\nexport function StorageManager({ projectRef }: { projectRef: string }) {\n const { data: buckets, isLoading, isError } = useGetBuckets(projectRef)\n\n return (\n <div className=\"p-6 pt-4 lg:p-8 lg:pt-8\">\n <h1 className=\"text-base lg:text-xl font-semibold\">Storage</h1>\n <p className=\"hidden lg:block text-sm lg:text-base text-muted-foreground mt-1\">\n View and manage the files stored in your app.\n </p>\n\n {isLoading && (\n <div className=\"mt-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n <Skeleton className=\"h-12 w-full\" />\n <Skeleton className=\"h-12 w-full\" />\n <Skeleton className=\"h-12 w-full\" />\n <Skeleton className=\"h-12 w-full\" />\n </div>\n )}\n {isError && (\n <Alert variant=\"destructive\" className=\"mt-8\">\n <AlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>Error loading buckets</AlertTitle>\n <AlertDescription>There was a problem loading your storage buckets.</AlertDescription>\n </Alert>\n )}\n\n {buckets && buckets.length > 0 ? (\n <div className=\"mt-6 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {buckets.map((bucket: any) => (\n <Tooltip key={bucket.id}>\n <TooltipTrigger asChild>\n <Button\n key={bucket.id}\n variant=\"outline\"\n className=\"flex-row justify-start text-left h-auto p-4 gap-4\"\n >\n <Folder className=\"h-4 w-4 text-muted-foreground\" />\n <div className=\"flex-1\">\n <h2 className=\"font-semibold mb-1\">{bucket.name}</h2>\n\n <p className=\"text-xs text-muted-foreground\">\n Updated {new Date(bucket.updated_at).toLocaleDateString()}\n </p>\n </div>\n <Badge variant={bucket.public ? 'default' : 'secondary'}>\n {bucket.public ? 'Public' : 'Private'}\n </Badge>\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <p>Viewing files is coming soon</p>\n </TooltipContent>\n </Tooltip>\n ))}\n </div>\n ) : buckets && buckets.length === 0 ? (\n <Alert className=\"mt-8\">\n <Folder className=\"h-4 w-4\" />\n <AlertTitle>No storage buckets</AlertTitle>\n <AlertDescription>\n A bucket is a container used to store and protect files in your app.\n </AlertDescription>\n </Alert>\n ) : null}\n </div>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/supabase-manager/suggestions.tsx",
|
|
"content": "'use client'\n\nimport { useGetSuggestions } from '@/registry/default/platform/platform-kit-nextjs/hooks/use-suggestions'\nimport { Alert, AlertDescription, AlertTitle } from '@/registry/default/components/ui/alert'\nimport { Terminal } from 'lucide-react'\nimport { Badge } from '@/registry/default/components/ui/badge'\nimport { useMemo } from 'react'\n\nimport ReactMarkdown from 'react-markdown'\nimport { Skeleton } from '@/registry/default/components/ui/skeleton'\n\nexport function SuggestionsManager({ projectRef }: { projectRef: string }) {\n const { data: suggestions, isLoading, error } = useGetSuggestions(projectRef)\n\n const sortedSuggestions = useMemo(() => {\n if (!suggestions) return []\n const levelOrder = { ERROR: 1, WARN: 2, INFO: 3 }\n return [...suggestions].sort((a: any, b: any) => {\n const levelA = levelOrder[a.level as keyof typeof levelOrder] || 99\n const levelB = levelOrder[b.level as keyof typeof levelOrder] || 99\n return levelA - levelB\n })\n }, [suggestions])\n\n const getBadgeVariant = (level: 'ERROR' | 'WARN' | 'INFO') => {\n switch (level) {\n case 'ERROR':\n return 'destructive'\n case 'WARN':\n return 'secondary'\n default:\n return 'outline'\n }\n }\n\n return (\n <div className=\"p-6 pt-4 lg:p-12 lg:pt-12 max-w-3xl mx-auto\">\n <h2 className=\"text-base lg:text-xl font-semibold mb-1\">Suggestions</h2>\n <p className=\"text-muted-foreground mb-4 lg:mb-8 text-sm lg:text-base\">\n Improve your project's security and performance.\n </p>\n {isLoading && (\n <div className=\"space-y-2\">\n <Skeleton className=\"h-6 w-full\" />\n <Skeleton className=\"h-6 w-full\" />\n <Skeleton className=\"h-6 w-full\" />\n <Skeleton className=\"h-6 w-full\" />\n </div>\n )}\n {error && (\n <Alert variant=\"destructive\" className=\"mt-8\">\n <Terminal className=\"h-4 w-4\" />\n <AlertTitle>Error fetching suggestions</AlertTitle>\n <AlertDescription>\n {(error as any)?.message || 'An unexpected error occurred. Please try again.'}\n </AlertDescription>\n </Alert>\n )}\n {suggestions && (\n <div>\n {sortedSuggestions.length > 0 ? (\n <div>\n {sortedSuggestions.map((suggestion: any) => (\n <div\n key={suggestion.cache_key}\n className=\"py-4 border-b last:border-b-0 group relative\"\n >\n <div className=\"flex-1\">\n <div className=\"flex justify-start items-start gap-4\">\n <h4 className=\"font-semibold text-sm\">{suggestion.title}</h4>\n <div className=\"flex items-center gap-1\">\n <Badge variant={getBadgeVariant(suggestion.level)} className=\"shrink-0\">\n {suggestion.level}\n </Badge>\n {suggestion.type && (\n <Badge\n variant={suggestion.type === 'security' ? 'destructive' : 'secondary'}\n className=\"shrink-0\"\n >\n {suggestion.type.charAt(0).toUpperCase() + suggestion.type.slice(1)}\n </Badge>\n )}\n </div>\n </div>\n <div className=\"text-sm text-muted-foreground mt-2 prose prose-sm max-w-none\">\n <ReactMarkdown\n components={{\n code({ inline, children, ...props }: any) {\n return inline ? (\n <code className=\"bg-muted px-1 rounded\" {...props}>\n {children}\n </code>\n ) : (\n <pre className=\"bg-muted p-2 rounded overflow-x-auto\" {...props}>\n <code>{children}</code>\n </pre>\n )\n },\n }}\n >\n {suggestion.detail}\n </ReactMarkdown>\n </div>\n </div>\n </div>\n ))}\n </div>\n ) : (\n <Alert>\n <Terminal className=\"h-4 w-4\" />\n <AlertTitle>No suggestions found</AlertTitle>\n <AlertDescription>\n Your project looks good! No suggestions at this time.\n </AlertDescription>\n </Alert>\n )}\n </div>\n )}\n </div>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/supabase-manager/users.tsx",
|
|
"content": "'use client'\n\nimport { SqlEditor } from '@/registry/default/platform/platform-kit-nextjs/components/sql-editor'\nimport { useState } from 'react'\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/registry/default/components/ui/select'\nimport { UsersGrowthChart } from '@/registry/default/platform/platform-kit-nextjs/components/users-growth-chart'\n\nexport function UsersManager({ projectRef }: { projectRef: string }) {\n const [timeRange, setTimeRange] = useState(90)\n const defaultSql = `SELECT * FROM auth.users ORDER BY created_at DESC LIMIT 100;`\n\n return (\n <div className=\"pb-8\">\n <div className=\"flex items-center justify-between p-6 pt-4 lg:p-8 lg:pt-8\">\n <div className=\"flex-1\">\n <h1 className=\"text-base lg:text-xl font-semibold\">Users</h1>\n <p className=\"hidden lg:block text-sm lg:text-base text-muted-foreground mt-1\">\n View user signups over time\n </p>\n </div>\n <Select value={String(timeRange)} onValueChange={(value) => setTimeRange(Number(value))}>\n <SelectTrigger className=\"w-[160px] rounded-lg sm:ml-auto\" aria-label=\"Select a value\">\n <SelectValue placeholder=\"Select time range\" />\n </SelectTrigger>\n <SelectContent className=\"rounded-xl\">\n <SelectItem value=\"90\" className=\"rounded-lg\">\n Last 90 days\n </SelectItem>\n <SelectItem value=\"30\" className=\"rounded-lg\">\n Last 30 days\n </SelectItem>\n <SelectItem value=\"7\" className=\"rounded-lg\">\n Last 7 days\n </SelectItem>\n </SelectContent>\n </Select>\n </div>\n <div className=\"px-8\">\n <UsersGrowthChart projectRef={projectRef} timeRange={timeRange} />\n </div>\n <SqlEditor\n hideChartOption\n projectRef={projectRef}\n initialSql={defaultSql}\n initialNaturalLanguageMode={true}\n label=\"Recent users\"\n hideSql={true}\n readOnly={true}\n runAutomatically={true}\n />\n </div>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/components/users-growth-chart.tsx",
|
|
"content": "'use client'\n\nimport * as React from 'react'\nimport { Bar, BarChart, CartesianGrid, XAxis, YAxis } from 'recharts'\nimport {\n ChartConfig,\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n} from '@/registry/default/components/ui/chart'\nimport { useGetUserCountsByDay } from '@/registry/default/platform/platform-kit-nextjs/hooks/use-user-counts'\nimport { Skeleton } from '@/registry/default/components/ui/skeleton'\nimport { AlertTriangle } from 'lucide-react'\nimport { Alert, AlertDescription, AlertTitle } from '@/registry/default/components/ui/alert'\n\nconst chartConfig = {\n users: {\n label: 'New Users',\n color: 'var(--chart-1)',\n },\n} satisfies ChartConfig\n\nexport function UsersGrowthChart({\n projectRef,\n timeRange,\n}: {\n projectRef: string\n timeRange: number\n}) {\n const { data: chartData, isLoading, isError } = useGetUserCountsByDay(projectRef, timeRange)\n\n return (\n <div>\n {isLoading && <Skeleton className=\"h-[250px] w-full\" />}\n {isError && (\n <Alert variant=\"destructive\">\n <AlertTriangle className=\"h-4 w-4\" />\n <AlertTitle>Error loading chart data</AlertTitle>\n <AlertDescription>There was a problem loading your chart data.</AlertDescription>\n </Alert>\n )}\n {chartData && !isLoading && (\n <ChartContainer config={chartConfig} className=\"aspect-auto h-[250px] w-full\">\n <BarChart\n accessibilityLayer\n data={chartData}\n margin={{\n left: -24,\n right: 12,\n }}\n >\n <CartesianGrid vertical={false} />\n <XAxis\n dataKey=\"date\"\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n minTickGap={32}\n tickFormatter={(value) => {\n const date = new Date(value)\n return date.toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n })\n }}\n />\n <YAxis\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickCount={5}\n allowDecimals={false}\n />\n <ChartTooltip\n content={\n <ChartTooltipContent\n className=\"w-[150px]\"\n labelFormatter={(value) => {\n return new Date(value).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })\n }}\n indicator=\"dot\"\n />\n }\n />\n <Bar dataKey=\"users\" fill=\"var(--color-users)\" />\n </BarChart>\n </ChartContainer>\n )}\n </div>\n )\n}\n",
|
|
"type": "registry:component"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/hooks/use-auth.ts",
|
|
"content": "'use client'\n\nimport { client } from '@/registry/default/platform/platform-kit-nextjs/lib/management-api'\nimport type { components } from '@/registry/default/platform/platform-kit-nextjs/lib/management-api-schema'\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'\nimport { type AxiosError } from 'axios'\nimport { toast } from 'sonner'\n\nconst getAuthConfig = async (projectRef: string) => {\n const { data, error } = await client.GET('/v1/projects/{ref}/config/auth', {\n params: {\n path: { ref: projectRef },\n },\n })\n if (error) {\n throw error\n }\n\n return data\n}\n\nexport const useGetAuthConfig = (projectRef: string) => {\n return useQuery({\n queryKey: ['auth-config', projectRef],\n queryFn: () => getAuthConfig(projectRef),\n enabled: !!projectRef,\n retry: false,\n })\n}\n\n// UPDATE Auth Config\nconst updateAuthConfig = async ({\n projectRef,\n payload,\n}: {\n projectRef: string\n payload: components['schemas']['UpdateAuthConfigBody']\n}) => {\n const { data, error } = await client.PATCH('/v1/projects/{ref}/config/auth', {\n params: {\n path: {\n ref: projectRef,\n },\n },\n body: payload,\n })\n if (error) {\n throw error\n }\n\n return data\n}\n\nexport const useUpdateAuthConfig = () => {\n const queryClient = useQueryClient()\n return useMutation({\n mutationFn: updateAuthConfig,\n onSuccess: (data, variables) => {\n toast.success(`Auth config updated.`)\n queryClient.invalidateQueries({\n queryKey: ['auth-config', variables.projectRef],\n })\n },\n onError: (error: AxiosError<{ message: string }>) => {\n toast.error(error.response?.data?.message || 'There was a problem with your request.')\n },\n })\n}\n",
|
|
"type": "registry:hook"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/hooks/use-logs.ts",
|
|
"content": "'use client'\n\nimport { client } from '@/registry/default/platform/platform-kit-nextjs/lib/management-api'\nimport { useQuery } from '@tanstack/react-query'\n\n// GET Logs\nconst getLogs = async ({\n projectRef,\n iso_timestamp_start,\n iso_timestamp_end,\n sql,\n}: {\n projectRef: string\n iso_timestamp_start?: string\n iso_timestamp_end?: string\n sql?: string\n}) => {\n const { data, error } = await client.GET('/v1/projects/{ref}/analytics/endpoints/logs.all', {\n params: {\n path: {\n ref: projectRef,\n },\n query: {\n iso_timestamp_start,\n iso_timestamp_end,\n sql,\n },\n },\n })\n if (error) {\n throw error\n }\n\n return data\n}\n\nexport const useGetLogs = (\n projectRef: string,\n params: {\n iso_timestamp_start?: string\n iso_timestamp_end?: string\n sql?: string\n } = {}\n) => {\n const queryKey = ['logs', projectRef, params.sql]\n\n return useQuery({\n queryKey: queryKey,\n queryFn: () => {\n const now = new Date()\n const oneHourAgo = new Date(now.getTime() - 60 * 60 * 1000)\n\n const queryParams = {\n sql: params.sql,\n iso_timestamp_start: params.iso_timestamp_start ?? oneHourAgo.toISOString(),\n iso_timestamp_end: params.iso_timestamp_end ?? now.toISOString(),\n }\n return getLogs({ projectRef, ...queryParams })\n },\n enabled: !!projectRef,\n retry: false,\n })\n}\n",
|
|
"type": "registry:hook"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/hooks/use-run-query.ts",
|
|
"content": "'use client'\n\nimport { client } from '@/registry/default/platform/platform-kit-nextjs/lib/management-api'\nimport { useMutation } from '@tanstack/react-query'\nimport { type AxiosError } from 'axios'\nimport { toast } from 'sonner'\n\n// RUN SQL Query\nexport const runQuery = async ({\n projectRef,\n query,\n readOnly,\n}: {\n projectRef: string\n query: string\n readOnly?: boolean\n}) => {\n const { data, error } = await client.POST('/v1/projects/{ref}/database/query', {\n params: {\n path: {\n ref: projectRef,\n },\n },\n body: {\n query,\n read_only: readOnly,\n },\n })\n\n if (error) {\n throw error\n }\n\n return data as any\n}\n\nexport const useRunQuery = () => {\n return useMutation({\n mutationFn: runQuery,\n onError: (error: AxiosError<{ message: string }>) => {\n toast.error(error.response?.data?.message || 'There was a problem with your query.')\n },\n })\n}\n",
|
|
"type": "registry:hook"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/hooks/use-secrets.ts",
|
|
"content": "'use client'\n\nimport { client } from '@/registry/default/platform/platform-kit-nextjs/lib/management-api'\nimport type { components } from '@/registry/default/platform/platform-kit-nextjs/lib/management-api-schema'\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'\nimport { type AxiosError } from 'axios'\nimport { toast } from 'sonner'\n\n// GET Secrets\nconst getSecrets = async (projectRef: string) => {\n const { data, error } = await client.GET('/v1/projects/{ref}/secrets', {\n params: {\n path: {\n ref: projectRef,\n },\n },\n })\n if (error) {\n throw error\n }\n\n return data\n}\n\nexport const useGetSecrets = (projectRef: string) => {\n return useQuery({\n queryKey: ['secrets', projectRef],\n queryFn: () => getSecrets(projectRef),\n enabled: !!projectRef,\n retry: false,\n })\n}\n\n// CREATE Secrets\nconst createSecrets = async ({\n projectRef,\n secrets,\n}: {\n projectRef: string\n secrets: components['schemas']['CreateSecretBody']\n}) => {\n const { data, error } = await client.POST('/v1/projects/{ref}/secrets', {\n params: {\n path: {\n ref: projectRef,\n },\n },\n body: secrets,\n })\n if (error) {\n throw error\n }\n\n return data\n}\n\nexport const useCreateSecrets = () => {\n const queryClient = useQueryClient()\n return useMutation({\n mutationFn: createSecrets,\n onSuccess: (data, variables) => {\n toast.success(`Secrets created successfully.`)\n queryClient.refetchQueries({\n queryKey: ['secrets', variables.projectRef],\n })\n },\n onError: (error: AxiosError<{ message: string }>) => {\n toast.error(error.response?.data?.message || 'There was a problem with your request.')\n },\n })\n}\n\n// DELETE Secrets\nconst deleteSecrets = async ({\n projectRef,\n secretNames,\n}: {\n projectRef: string\n secretNames: string[]\n}) => {\n const { data, error } = await client.DELETE('/v1/projects/{ref}/secrets', {\n params: {\n path: {\n ref: projectRef,\n },\n },\n body: secretNames,\n })\n if (error) {\n throw error\n }\n\n return data\n}\n\nexport const useDeleteSecrets = () => {\n const queryClient = useQueryClient()\n return useMutation({\n mutationFn: deleteSecrets,\n onSuccess: (data, variables) => {\n toast.success(`Secrets deleted successfully.`)\n queryClient.invalidateQueries({\n queryKey: ['secrets', variables.projectRef],\n })\n },\n onError: (error: AxiosError<{ message: string }>) => {\n toast.error(error.response?.data?.message || 'There was a problem with your request.')\n },\n })\n}\n",
|
|
"type": "registry:hook"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/hooks/use-storage.ts",
|
|
"content": "'use client'\n\nimport { client } from '@/registry/default/platform/platform-kit-nextjs/lib/management-api'\nimport { useQuery } from '@tanstack/react-query'\n\n// GET Buckets\nconst getBuckets = async (projectRef: string) => {\n const { data, error } = await client.GET('/v1/projects/{ref}/storage/buckets', {\n params: {\n path: {\n ref: projectRef,\n },\n },\n })\n if (error) {\n throw error\n }\n\n return data\n}\n\nexport const useGetBuckets = (projectRef: string) => {\n return useQuery({\n queryKey: ['buckets', projectRef],\n queryFn: () => getBuckets(projectRef),\n enabled: !!projectRef,\n retry: false,\n })\n}\n\n// LIST Objects\nconst listObjects = async ({ projectRef, bucketId }: { projectRef: string; bucketId: string }) => {\n const { data, error } = await client.POST(\n // TODO\n // @ts-expect-error this endpoint is not yet implemented\n '/v1/projects/{ref}/storage/buckets/{bucketId}/objects/list',\n {\n params: {\n path: {\n ref: projectRef,\n bucketId,\n },\n },\n body: {\n path: '',\n options: { limit: 100, offset: 0 },\n },\n }\n )\n if (error) {\n throw error\n }\n\n return data as any\n}\n\nexport const useListObjects = (projectRef: string, bucketId: string) => {\n return useQuery({\n queryKey: ['objects', projectRef, bucketId],\n queryFn: () => listObjects({ projectRef, bucketId }),\n enabled: !!projectRef && !!bucketId,\n })\n}\n",
|
|
"type": "registry:hook"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/hooks/use-suggestions.ts",
|
|
"content": "'use client'\n\nimport { client } from '@/registry/default/platform/platform-kit-nextjs/lib/management-api'\nimport { useQuery } from '@tanstack/react-query'\n\n// GET Suggestions\nconst getSuggestions = async (projectRef: string) => {\n const [\n { data: performanceData, error: performanceError },\n { data: securityData, error: securityError },\n ] = await Promise.all([\n client.GET('/v1/projects/{ref}/advisors/performance', {\n params: {\n path: {\n ref: projectRef,\n },\n },\n }),\n client.GET('/v1/projects/{ref}/advisors/security', {\n params: {\n path: {\n ref: projectRef,\n },\n },\n }),\n ])\n if (performanceError) {\n throw performanceError\n }\n if (securityError) {\n throw securityError\n }\n\n // Add type to each suggestion\n const performanceLints = (performanceData?.lints || []).map((lint) => ({\n ...lint,\n type: 'performance' as const,\n }))\n const securityLints = (securityData?.lints || []).map((lint) => ({\n ...lint,\n type: 'security' as const,\n }))\n return [...performanceLints, ...securityLints]\n}\n\nexport const useGetSuggestions = (projectRef: string) => {\n return useQuery({\n queryKey: ['suggestions', projectRef],\n queryFn: () => getSuggestions(projectRef),\n enabled: !!projectRef,\n retry: false,\n })\n}\n",
|
|
"type": "registry:hook"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/hooks/use-tables.ts",
|
|
"content": "'use client'\n\nimport { listTablesSql } from '@/registry/default/platform/platform-kit-nextjs/lib/pg-meta'\nimport { runQuery } from '@/registry/default/platform/platform-kit-nextjs/hooks/use-run-query'\nimport { useQuery } from '@tanstack/react-query'\n\n// LIST Tables\nconst listTables = ({ projectRef, schemas }: { projectRef: string; schemas?: string[] }) => {\n const sql = listTablesSql(schemas)\n return runQuery({\n projectRef,\n query: sql,\n readOnly: true,\n })\n}\n\nexport const useListTables = (projectRef: string, schemas?: string[]) => {\n return useQuery({\n queryKey: ['tables', projectRef, schemas],\n queryFn: () => listTables({ projectRef, schemas }),\n enabled: !!projectRef,\n })\n}\n",
|
|
"type": "registry:hook"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/hooks/use-user-counts.ts",
|
|
"content": "'use client'\n\nimport { useQuery } from '@tanstack/react-query'\nimport { runQuery } from '@/registry/default/platform/platform-kit-nextjs/hooks/use-run-query'\n\n// GET User Counts by day\nconst getUserCountsByDay = ({ projectRef, days }: { projectRef: string; days: number }) => {\n const sql = `\n WITH days_series AS (\n SELECT generate_series(\n date_trunc('day', now() - interval '${Number(days) - 1} days'),\n date_trunc('day', now()),\n '1 day'::interval\n )::date AS date\n )\n SELECT\n d.date,\n COALESCE(u.users, 0)::int as users\n FROM\n days_series d\n LEFT JOIN (\n SELECT\n date_trunc('day', created_at AT TIME ZONE 'UTC')::date as date,\n count(id) as users\n FROM\n auth.users\n GROUP BY 1\n ) u ON d.date = u.date\n ORDER BY\n d.date ASC;\n `\n\n return runQuery({\n projectRef,\n query: sql,\n readOnly: true,\n })\n}\n\nexport const useGetUserCountsByDay = (projectRef: string, days: number) => {\n return useQuery({\n queryKey: ['user-counts', projectRef, days],\n queryFn: () => getUserCountsByDay({ projectRef, days }),\n enabled: !!projectRef,\n retry: false,\n })\n}\n",
|
|
"type": "registry:hook"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/lib/logs.ts",
|
|
"content": "export enum LogsTableName {\n FN_EDGE = 'function_edge_logs',\n AUTH = 'auth_logs',\n POSTGRES = 'postgres_logs',\n REALTIME = 'realtime_logs',\n STORAGE = 'storage_logs',\n PG_CRON = 'pg_cron_logs',\n EDGE = 'edge_logs',\n FUNCTIONS = 'function_logs',\n POSTGREST = 'postgrest_logs',\n SUPAVISOR = 'supavisor_logs',\n PGBOUNCER = 'pgbouncer_logs',\n PG_UPGRADE = 'pg_upgrade_logs',\n}\n\nconst genCrossJoinUnnests = (table: LogsTableName) => {\n switch (table) {\n case LogsTableName.EDGE:\n return `cross join unnest(metadata) as m\n cross join unnest(m.request) as request\n cross join unnest(m.response) as response`\n case LogsTableName.POSTGRES:\n return `cross join unnest(metadata) as m\n cross join unnest(m.parsed) as parsed`\n case LogsTableName.FUNCTIONS:\n return `cross join unnest(metadata) as metadata`\n case LogsTableName.AUTH:\n return `cross join unnest(metadata) as metadata`\n case LogsTableName.FN_EDGE:\n return `cross join unnest(metadata) as m\n cross join unnest(m.response) as response\n cross join unnest(m.request) as request`\n case LogsTableName.SUPAVISOR:\n return `cross join unnest(metadata) as m`\n default:\n return ''\n }\n}\n\nexport const genDefaultQuery = (table: LogsTableName, limit: number = 100) => {\n const joins = genCrossJoinUnnests(table)\n const orderBy = 'order by timestamp desc'\n\n switch (table) {\n case LogsTableName.EDGE:\n return `select id, ${table}.timestamp, event_message, request.method, request.path, request.search, response.status_code\nfrom ${table}\n${joins}\n${orderBy}\nlimit ${limit}`\n\n case LogsTableName.POSTGRES:\n return `select ${table}.timestamp, id, event_message, parsed.error_severity, parsed.detail, parsed.hint\nfrom ${table}\n${joins}\n${orderBy}\nlimit ${limit}`\n\n case LogsTableName.FUNCTIONS:\n return `select id, ${table}.timestamp, event_message, metadata.event_type, metadata.function_id, metadata.level\nfrom ${table}\n${joins}\n${orderBy}\nlimit ${limit}`\n\n case LogsTableName.AUTH:\n return `select id, ${table}.timestamp, event_message, metadata.level, metadata.status, metadata.path, metadata.msg as msg, metadata.error\nfrom ${table}\n${joins}\n${orderBy}\nlimit ${limit}`\n\n case LogsTableName.FN_EDGE:\n return `select id, ${table}.timestamp, event_message, response.status_code, request.method, m.function_id, m.execution_time_ms, m.deployment_id, m.version\nfrom ${table}\n${joins}\n${orderBy}\nlimit ${limit}`\n\n case LogsTableName.SUPAVISOR:\n return `select id, ${table}.timestamp, event_message\nfrom ${table}\n${joins}\n${orderBy}\nlimit ${limit}`\n\n case LogsTableName.PG_UPGRADE:\n return `select id, ${table}.timestamp, event_message\nfrom ${table}\n${joins}\n${orderBy}\nlimit ${limit}`\n\n case LogsTableName.PG_CRON:\n return `select postgres_logs.timestamp, id, event_message, parsed.error_severity, parsed.query\nfrom postgres_logs\ncross join unnest(metadata) as m\ncross join unnest(m.parsed) as parsed\nwhere (parsed.application_name = 'pg_cron' OR event_message LIKE '%cron job%')\n${orderBy}\nlimit ${limit}`\n\n default:\n return `select id, ${table}.timestamp, event_message\nfrom ${table}\n${joins}\n${orderBy}\nlimit ${limit}`\n }\n}\n",
|
|
"type": "registry:lib"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/lib/management-api-schema.d.ts",
|
|
"content": "/**\n * This file was auto-generated by openapi-typescript.\n * Do not make direct changes to the file.\n */\n\nexport interface paths {\n '/v1/branches/{branch_id_or_ref}': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * Get database branch config\n * @description Fetches configurations of the specified database branch\n */\n get: operations['v1-get-a-branch-config']\n put?: never\n post?: never\n /**\n * Delete a database branch\n * @description Deletes the specified database branch\n */\n delete: operations['v1-delete-a-branch']\n options?: never\n head?: never\n /**\n * Update database branch config\n * @description Updates the configuration of the specified database branch\n */\n patch: operations['v1-update-a-branch-config']\n trace?: never\n }\n '/v1/branches/{branch_id_or_ref}/push': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /**\n * Pushes a database branch\n * @description Pushes the specified database branch\n */\n post: operations['v1-push-a-branch']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/branches/{branch_id_or_ref}/merge': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /**\n * Merges a database branch\n * @description Merges the specified database branch\n */\n post: operations['v1-merge-a-branch']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/branches/{branch_id_or_ref}/reset': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /**\n * Resets a database branch\n * @description Resets the specified database branch\n */\n post: operations['v1-reset-a-branch']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/branches/{branch_id_or_ref}/diff': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * [Beta] Diffs a database branch\n * @description Diffs the specified database branch\n */\n get: operations['v1-diff-a-branch']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * List all projects\n * @description Returns a list of all projects you've previously created.\n */\n get: operations['v1-list-all-projects']\n put?: never\n /** Create a project */\n post: operations['v1-create-a-project']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/organizations': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * List all organizations\n * @description Returns a list of organizations that you currently belong to.\n */\n get: operations['v1-list-all-organizations']\n put?: never\n /** Create an organization */\n post: operations['v1-create-an-organization']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/oauth/authorize': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** [Beta] Authorize user through oauth */\n get: operations['v1-authorize-user']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/oauth/token': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Exchange auth code for user's access and refresh token */\n post: operations['v1-exchange-oauth-token']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/oauth/revoke': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Revoke oauth app authorization and it's corresponding tokens */\n post: operations['v1-revoke-token']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/oauth/authorize/project-claim': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * Authorize user through oauth and claim a project\n * @description Initiates the OAuth authorization flow for the specified provider. After successful authentication, the user can claim ownership of the specified project.\n */\n get: operations['v1-oauth-authorize-project-claim']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/snippets': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Lists SQL snippets for the logged in user */\n get: operations['v1-list-all-snippets']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/snippets/{id}': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets a specific SQL snippet */\n get: operations['v1-get-a-snippet']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/api-keys': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Get project api keys */\n get: operations['v1-get-project-api-keys']\n put?: never\n /** Creates a new API key for the project */\n post: operations['v1-create-project-api-key']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/api-keys/legacy': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Check whether JWT based legacy (anon, service_role) API keys are enabled. This API endpoint will be removed in the future, check for HTTP 404 Not Found. */\n get: operations['v1-get-project-legacy-api-keys']\n /** Disable or re-enable JWT based legacy (anon, service_role) API keys. This API endpoint will be removed in the future, check for HTTP 404 Not Found. */\n put: operations['v1-update-project-legacy-api-keys']\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/api-keys/{id}': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Get API key */\n get: operations['v1-get-project-api-key']\n put?: never\n post?: never\n /** Deletes an API key for the project */\n delete: operations['v1-delete-project-api-key']\n options?: never\n head?: never\n /** Updates an API key for the project */\n patch: operations['v1-update-project-api-key']\n trace?: never\n }\n '/v1/projects/{ref}/branches': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * List all database branches\n * @description Returns all database branches of the specified project.\n */\n get: operations['v1-list-all-branches']\n put?: never\n /**\n * Create a database branch\n * @description Creates a database branch from the specified project.\n */\n post: operations['v1-create-a-branch']\n /**\n * Disables preview branching\n * @description Disables preview branching for the specified project\n */\n delete: operations['v1-disable-preview-branching']\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/custom-hostname': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** [Beta] Gets project's custom hostname config */\n get: operations['v1-get-hostname-config']\n put?: never\n post?: never\n /** [Beta] Deletes a project's custom hostname configuration */\n delete: operations['v1-Delete hostname config']\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/custom-hostname/initialize': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Updates project's custom hostname configuration */\n post: operations['v1-update-hostname-config']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/custom-hostname/reverify': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Attempts to verify the DNS configuration for project's custom hostname configuration */\n post: operations['v1-verify-dns-config']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/custom-hostname/activate': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Activates a custom hostname for a project. */\n post: operations['v1-activate-custom-hostname']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/network-bans/retrieve': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Gets project's network bans */\n post: operations['v1-list-all-network-bans']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/network-bans/retrieve/enriched': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Gets project's network bans with additional information about which databases they affect */\n post: operations['v1-list-all-network-bans-enriched']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/network-bans': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n post?: never\n /** [Beta] Remove network bans. */\n delete: operations['v1-delete-network-bans']\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/network-restrictions': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** [Beta] Gets project's network restrictions */\n get: operations['v1-get-network-restrictions']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/network-restrictions/apply': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Updates project's network restrictions */\n post: operations['v1-update-network-restrictions']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/pgsodium': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** [Beta] Gets project's pgsodium config */\n get: operations['v1-get-pgsodium-config']\n /** [Beta] Updates project's pgsodium config. Updating the root_key can cause all data encrypted with the older key to become inaccessible. */\n put: operations['v1-update-pgsodium-config']\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/postgrest': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets project's postgrest config */\n get: operations['v1-get-postgrest-service-config']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n /** Updates project's postgrest config */\n patch: operations['v1-update-postgrest-service-config']\n trace?: never\n }\n '/v1/projects/{ref}': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets a specific project that belongs to the authenticated user */\n get: operations['v1-get-project']\n put?: never\n post?: never\n /** Deletes the given project */\n delete: operations['v1-delete-a-project']\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/secrets': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * List all secrets\n * @description Returns all secrets you've previously added to the specified project.\n */\n get: operations['v1-list-all-secrets']\n put?: never\n /**\n * Bulk create secrets\n * @description Creates multiple secrets and adds them to the specified project.\n */\n post: operations['v1-bulk-create-secrets']\n /**\n * Bulk delete secrets\n * @description Deletes all secrets with the given names from the specified project\n */\n delete: operations['v1-bulk-delete-secrets']\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/ssl-enforcement': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** [Beta] Get project's SSL enforcement configuration. */\n get: operations['v1-get-ssl-enforcement-config']\n /** [Beta] Update project's SSL enforcement configuration. */\n put: operations['v1-update-ssl-enforcement-config']\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/types/typescript': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * Generate TypeScript types\n * @description Returns the TypeScript types of your schema for use with supabase-js.\n */\n get: operations['v1-generate-typescript-types']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/vanity-subdomain': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** [Beta] Gets current vanity subdomain config */\n get: operations['v1-get-vanity-subdomain-config']\n put?: never\n post?: never\n /** [Beta] Deletes a project's vanity subdomain configuration */\n delete: operations['v1-deactivate-vanity-subdomain-config']\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/vanity-subdomain/check-availability': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Checks vanity subdomain availability */\n post: operations['v1-check-vanity-subdomain-availability']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/vanity-subdomain/activate': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Activates a vanity subdomain for a project. */\n post: operations['v1-activate-vanity-subdomain-config']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/upgrade': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Upgrades the project's Postgres version */\n post: operations['v1-upgrade-postgres-version']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/upgrade/eligibility': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** [Beta] Returns the project's eligibility for upgrades */\n get: operations['v1-get-postgres-upgrade-eligibility']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/upgrade/status': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** [Beta] Gets the latest status of the project's upgrade */\n get: operations['v1-get-postgres-upgrade-status']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/readonly': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Returns project's readonly mode status */\n get: operations['v1-get-readonly-mode-status']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/readonly/temporary-disable': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** Disables project's readonly mode for the next 15 minutes */\n post: operations['v1-disable-readonly-mode-temporarily']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/read-replicas/setup': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Set up a read replica */\n post: operations['v1-setup-a-read-replica']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/read-replicas/remove': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Remove a read replica */\n post: operations['v1-remove-a-read-replica']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/health': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets project's service health status */\n get: operations['v1-get-services-health']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/config/auth/signing-keys': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** [Alpha] List all signing keys for the project */\n get: operations['v1-get-project-signing-keys']\n put?: never\n /** [Alpha] Create a new signing key for the project in standby status */\n post: operations['v1-create-project-signing-key']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/config/auth/signing-keys/{id}': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** [Alpha] Get information about a signing key */\n get: operations['v1-get-project-signing-key']\n put?: never\n post?: never\n /** [Alpha] Remove a signing key from a project, where the status is previously_used */\n delete: operations['v1-remove-project-signing-key']\n options?: never\n head?: never\n /** [Alpha] Update a signing key, mainly its status */\n patch: operations['v1-update-project-signing-key']\n trace?: never\n }\n '/v1/projects/{ref}/config/storage': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets project's storage config */\n get: operations['v1-get-storage-config']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n /** Updates project's storage config */\n patch: operations['v1-update-storage-config']\n trace?: never\n }\n '/v1/projects/{ref}/config/database/postgres': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets project's Postgres config */\n get: operations['v1-get-postgres-config']\n /** Updates project's Postgres config */\n put: operations['v1-update-postgres-config']\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/config/database/pgbouncer': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Get project's pgbouncer config */\n get: operations['v1-get-project-pgbouncer-config']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/config/database/pooler': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets project's supavisor config */\n get: operations['v1-get-pooler-config']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n /** Updates project's supavisor config */\n patch: operations['v1-update-pooler-config']\n trace?: never\n }\n '/v1/projects/{ref}/config/auth': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets project's auth config */\n get: operations['v1-get-auth-service-config']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n /** Updates a project's auth config */\n patch: operations['v1-update-auth-service-config']\n trace?: never\n }\n '/v1/projects/{ref}/config/auth/third-party-auth': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Lists all third-party auth integrations */\n get: operations['v1-list-project-tpa-integrations']\n put?: never\n /** Creates a new third-party auth integration */\n post: operations['v1-create-project-tpa-integration']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/config/auth/third-party-auth/{tpa_id}': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Get a third-party integration */\n get: operations['v1-get-project-tpa-integration']\n put?: never\n post?: never\n /** Removes a third-party auth integration */\n delete: operations['v1-delete-project-tpa-integration']\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/pause': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** Pauses the given project */\n post: operations['v1-pause-a-project']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/restore': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Lists available restore versions for the given project */\n get: operations['v1-list-available-restore-versions']\n put?: never\n /** Restores the given project */\n post: operations['v1-restore-a-project']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/restore/cancel': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** Cancels the given project restoration */\n post: operations['v1-cancel-a-project-restoration']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/billing/addons': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Lists project addons */\n get: operations['v1-list-project-addons']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n /** Applies project addon */\n patch: operations['v1-apply-project-addon']\n trace?: never\n }\n '/v1/projects/{ref}/billing/addons/{addon_variant}': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n post?: never\n /** Removes project addon */\n delete: operations['v1-remove-project-addon']\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/claim-token': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets project claim token */\n get: operations['v1-get-project-claim-token']\n put?: never\n /** Creates project claim token */\n post: operations['v1-create-project-claim-token']\n /** Revokes project claim token */\n delete: operations['v1-delete-project-claim-token']\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/advisors/performance': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * Gets project performance advisors.\n * @deprecated\n * @description This is an **experimental** endpoint. It is subject to change or removal in future versions. Use it with caution, as it may not remain supported or stable.\n */\n get: operations['v1-get-performance-advisors']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/advisors/security': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * Gets project security advisors.\n * @deprecated\n * @description This is an **experimental** endpoint. It is subject to change or removal in future versions. Use it with caution, as it may not remain supported or stable.\n */\n get: operations['v1-get-security-advisors']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/analytics/endpoints/logs.all': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * Gets project's logs\n * @description Executes a SQL query on the project's logs.\n *\n * Either the 'iso_timestamp_start' and 'iso_timestamp_end' parameters must be provided.\n * If both are not provided, only the last 1 minute of logs will be queried.\n * The timestamp range must be no more than 24 hours and is rounded to the nearest minute. If the range is more than 24 hours, a validation error will be thrown.\n *\n */\n get: operations['v1-get-project-logs']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/analytics/endpoints/usage.api-counts': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets project's usage api counts */\n get: operations['v1-get-project-usage-api-count']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/analytics/endpoints/usage.api-requests-count': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets project's usage api requests count */\n get: operations['v1-get-project-usage-request-count']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/database/migrations': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * [Beta] List applied migration versions\n * @description Only available to selected partner OAuth apps\n */\n get: operations['v1-list-migration-history']\n /**\n * [Beta] Upsert a database migration without applying\n * @description Only available to selected partner OAuth apps\n */\n put: operations['v1-upsert-a-migration']\n /**\n * [Beta] Apply a database migration\n * @description Only available to selected partner OAuth apps\n */\n post: operations['v1-apply-a-migration']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/database/query': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Run sql query */\n post: operations['v1-run-a-query']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/database/webhooks/enable': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** [Beta] Enables Database Webhooks on the project */\n post: operations['v1-enable-database-webhook']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/database/context': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * Gets database metadata for the given project.\n * @deprecated\n * @description This is an **experimental** endpoint. It is subject to change or removal in future versions. Use it with caution, as it may not remain supported or stable.\n */\n get: operations['v1-get-database-metadata']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/functions': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * List all functions\n * @description Returns all functions you've previously added to the specified project.\n */\n get: operations['v1-list-all-functions']\n /**\n * Bulk update functions\n * @description Bulk update functions. It will create a new function or replace existing. The operation is idempotent. NOTE: You will need to manually bump the version.\n */\n put: operations['v1-bulk-update-functions']\n /**\n * Create a function\n * @deprecated\n * @description This endpoint is deprecated - use the deploy endpoint. Creates a function and adds it to the specified project.\n */\n post: operations['v1-create-a-function']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/functions/deploy': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /**\n * Deploy a function\n * @description A new endpoint to deploy functions. It will create if function does not exist.\n */\n post: operations['v1-deploy-a-function']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/functions/{function_slug}': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * Retrieve a function\n * @description Retrieves a function with the specified slug and project.\n */\n get: operations['v1-get-a-function']\n put?: never\n post?: never\n /**\n * Delete a function\n * @description Deletes a function with the specified slug from the specified project.\n */\n delete: operations['v1-delete-a-function']\n options?: never\n head?: never\n /**\n * Update a function\n * @description Updates a function with the specified slug and project.\n */\n patch: operations['v1-update-a-function']\n trace?: never\n }\n '/v1/projects/{ref}/functions/{function_slug}/body': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /**\n * Retrieve a function body\n * @description Retrieves a function body for the specified slug and project.\n */\n get: operations['v1-get-a-function-body']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/storage/buckets': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Lists all buckets */\n get: operations['v1-list-all-buckets']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/config/auth/sso/providers': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Lists all SSO providers */\n get: operations['v1-list-all-sso-provider']\n put?: never\n /** Creates a new SSO provider */\n post: operations['v1-create-a-sso-provider']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/config/auth/sso/providers/{provider_id}': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets a SSO provider by its UUID */\n get: operations['v1-get-a-sso-provider']\n /** Updates a SSO provider by its UUID */\n put: operations['v1-update-a-sso-provider']\n post?: never\n /** Removes a SSO provider by its UUID */\n delete: operations['v1-delete-a-sso-provider']\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/database/backups': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Lists all backups */\n get: operations['v1-list-all-backups']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/database/backups/restore-pitr': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** Restores a PITR backup for a database */\n post: operations['v1-restore-pitr-backup']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/database/backups/restore-point': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Get restore points for project */\n get: operations['v1-get-restore-point']\n put?: never\n /** Initiates a creation of a restore point for a database */\n post: operations['v1-create-restore-point']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/projects/{ref}/database/backups/undo': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n get?: never\n put?: never\n /** Initiates an undo to a given restore point */\n post: operations['v1-undo']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/organizations/{slug}/members': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** List members of an organization */\n get: operations['v1-list-organization-members']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/organizations/{slug}': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets information about the organization */\n get: operations['v1-get-an-organization']\n put?: never\n post?: never\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n '/v1/organizations/{slug}/project-claim/{token}': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n /** Gets project details for the specified organization and claim token */\n get: operations['v1-get-organization-project-claim']\n put?: never\n /** Claims project for the specified organization */\n post: operations['v1-claim-project-for-organization']\n delete?: never\n options?: never\n head?: never\n patch?: never\n trace?: never\n }\n}\nexport type webhooks = Record<string, never>\nexport interface components {\n schemas: {\n BranchDetailResponse: {\n ref: string\n postgres_version: string\n postgres_engine: string\n release_channel: string\n /** @enum {string} */\n status:\n | 'INACTIVE'\n | 'ACTIVE_HEALTHY'\n | 'ACTIVE_UNHEALTHY'\n | 'COMING_UP'\n | 'UNKNOWN'\n | 'GOING_DOWN'\n | 'INIT_FAILED'\n | 'REMOVED'\n | 'RESTORING'\n | 'UPGRADING'\n | 'PAUSING'\n | 'RESTORE_FAILED'\n | 'RESTARTING'\n | 'PAUSE_FAILED'\n | 'RESIZING'\n db_host: string\n db_port: number\n db_user?: string\n db_pass?: string\n jwt_secret?: string\n }\n UpdateBranchBody: {\n branch_name?: string\n git_branch?: string\n /**\n * @deprecated\n * @description This field is deprecated and will be ignored. Use v1-reset-a-branch endpoint directly instead.\n */\n reset_on_push?: boolean\n persistent?: boolean\n /** @enum {string} */\n status?:\n | 'CREATING_PROJECT'\n | 'RUNNING_MIGRATIONS'\n | 'MIGRATIONS_PASSED'\n | 'MIGRATIONS_FAILED'\n | 'FUNCTIONS_DEPLOYED'\n | 'FUNCTIONS_FAILED'\n }\n BranchResponse: {\n id: string\n name: string\n project_ref: string\n parent_project_ref: string\n is_default: boolean\n git_branch?: string\n /** Format: int32 */\n pr_number?: number\n /**\n * @deprecated\n * @description This field is deprecated and will not be populated.\n */\n latest_check_run_id?: number\n persistent: boolean\n /** @enum {string} */\n status:\n | 'CREATING_PROJECT'\n | 'RUNNING_MIGRATIONS'\n | 'MIGRATIONS_PASSED'\n | 'MIGRATIONS_FAILED'\n | 'FUNCTIONS_DEPLOYED'\n | 'FUNCTIONS_FAILED'\n created_at: string\n updated_at: string\n }\n BranchDeleteResponse: {\n /** @enum {string} */\n message: 'ok'\n }\n BranchActionBody: {\n migration_version?: string\n }\n BranchUpdateResponse: {\n workflow_run_id: string\n /** @enum {string} */\n message: 'ok'\n }\n V1ProjectWithDatabaseResponse: {\n /** @description Id of your project */\n id: string\n /** @description Slug of your organization */\n organization_id: string\n /** @description Name of your project */\n name: string\n /**\n * @description Region of your project\n * @example us-east-1\n */\n region: string\n /**\n * @description Creation timestamp\n * @example 2023-03-29T16:32:59Z\n */\n created_at: string\n /** @enum {string} */\n status:\n | 'INACTIVE'\n | 'ACTIVE_HEALTHY'\n | 'ACTIVE_UNHEALTHY'\n | 'COMING_UP'\n | 'UNKNOWN'\n | 'GOING_DOWN'\n | 'INIT_FAILED'\n | 'REMOVED'\n | 'RESTORING'\n | 'UPGRADING'\n | 'PAUSING'\n | 'RESTORE_FAILED'\n | 'RESTARTING'\n | 'PAUSE_FAILED'\n | 'RESIZING'\n database: {\n /** @description Database host */\n host: string\n /** @description Database version */\n version: string\n /** @description Database engine */\n postgres_engine: string\n /** @description Release channel */\n release_channel: string\n }\n }\n V1CreateProjectBody: {\n /** @description Database password */\n db_pass: string\n /** @description Name of your project */\n name: string\n /** @description Slug of your organization */\n organization_id: string\n /**\n * @deprecated\n * @description Subscription Plan is now set on organization level and is ignored in this request\n * @enum {string}\n */\n plan?: 'free' | 'pro'\n /**\n * @description Region you want your server to reside in\n * @enum {string}\n */\n region:\n | 'us-east-1'\n | 'us-east-2'\n | 'us-west-1'\n | 'us-west-2'\n | 'ap-east-1'\n | 'ap-southeast-1'\n | 'ap-northeast-1'\n | 'ap-northeast-2'\n | 'ap-southeast-2'\n | 'eu-west-1'\n | 'eu-west-2'\n | 'eu-west-3'\n | 'eu-north-1'\n | 'eu-central-1'\n | 'eu-central-2'\n | 'ca-central-1'\n | 'ap-south-1'\n | 'sa-east-1'\n /**\n * @deprecated\n * @description This field is deprecated and is ignored in this request\n */\n kps_enabled?: boolean\n /** @enum {string} */\n desired_instance_size?:\n | 'pico'\n | 'nano'\n | 'micro'\n | 'small'\n | 'medium'\n | 'large'\n | 'xlarge'\n | '2xlarge'\n | '4xlarge'\n | '8xlarge'\n | '12xlarge'\n | '16xlarge'\n | '24xlarge'\n | '24xlarge_optimized_memory'\n | '24xlarge_optimized_cpu'\n | '24xlarge_high_memory'\n | '48xlarge'\n | '48xlarge_optimized_memory'\n | '48xlarge_optimized_cpu'\n | '48xlarge_high_memory'\n /**\n * Format: uri\n * @description Template URL used to create the project from the CLI.\n * @example https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone\n */\n template_url?: string\n }\n V1ProjectResponse: {\n /** @description Id of your project */\n id: string\n /** @description Slug of your organization */\n organization_id: string\n /** @description Name of your project */\n name: string\n /**\n * @description Region of your project\n * @example us-east-1\n */\n region: string\n /**\n * @description Creation timestamp\n * @example 2023-03-29T16:32:59Z\n */\n created_at: string\n /** @enum {string} */\n status:\n | 'INACTIVE'\n | 'ACTIVE_HEALTHY'\n | 'ACTIVE_UNHEALTHY'\n | 'COMING_UP'\n | 'UNKNOWN'\n | 'GOING_DOWN'\n | 'INIT_FAILED'\n | 'REMOVED'\n | 'RESTORING'\n | 'UPGRADING'\n | 'PAUSING'\n | 'RESTORE_FAILED'\n | 'RESTARTING'\n | 'PAUSE_FAILED'\n | 'RESIZING'\n }\n OrganizationResponseV1: {\n id: string\n name: string\n }\n CreateOrganizationV1: {\n name: string\n }\n OAuthTokenBody: {\n /** @enum {string} */\n grant_type?: 'authorization_code' | 'refresh_token'\n /** Format: uuid */\n client_id?: string\n client_secret?: string\n code?: string\n code_verifier?: string\n redirect_uri?: string\n refresh_token?: string\n }\n OAuthTokenResponse: {\n access_token: string\n refresh_token: string\n expires_in: number\n /** @enum {string} */\n token_type: 'Bearer'\n }\n OAuthRevokeTokenBody: {\n /** Format: uuid */\n client_id: string\n client_secret: string\n refresh_token: string\n }\n SnippetList: {\n data: {\n id: string\n inserted_at: string\n updated_at: string\n /** @enum {string} */\n type: 'sql'\n /** @enum {string} */\n visibility: 'user' | 'project' | 'org' | 'public'\n name: string\n description: string | null\n project: {\n id: number\n name: string\n }\n owner: {\n id: number\n username: string\n }\n updated_by: {\n id: number\n username: string\n }\n }[]\n cursor?: string\n }\n SnippetResponse: {\n id: string\n inserted_at: string\n updated_at: string\n /** @enum {string} */\n type: 'sql'\n /** @enum {string} */\n visibility: 'user' | 'project' | 'org' | 'public'\n name: string\n description: string | null\n project: {\n id: number\n name: string\n }\n owner: {\n id: number\n username: string\n }\n updated_by: {\n id: number\n username: string\n }\n content: {\n favorite: boolean\n schema_version: string\n sql: string\n }\n }\n ApiKeyResponse: {\n api_key: string\n id?: string | null\n /** @enum {string|null} */\n type?: 'publishable' | 'secret' | 'legacy' | null\n prefix?: string | null\n name: string\n description?: string | null\n hash?: string | null\n secret_jwt_template?: {\n role: string\n } | null\n /** Format: date-time */\n inserted_at?: string | null\n /** Format: date-time */\n updated_at?: string | null\n }\n LegacyApiKeysResponse: {\n enabled: boolean\n }\n CreateApiKeyBody: {\n /** @enum {string} */\n type: 'publishable' | 'secret'\n name: string\n description?: string | null\n secret_jwt_template?: {\n role: string\n } | null\n }\n UpdateApiKeyBody: {\n name?: string\n description?: string | null\n secret_jwt_template?: {\n role: string\n } | null\n }\n CreateBranchBody: {\n branch_name: string\n git_branch?: string\n persistent?: boolean\n region?: string\n /** @enum {string} */\n desired_instance_size?:\n | 'pico'\n | 'nano'\n | 'micro'\n | 'small'\n | 'medium'\n | 'large'\n | 'xlarge'\n | '2xlarge'\n | '4xlarge'\n | '8xlarge'\n | '12xlarge'\n | '16xlarge'\n | '24xlarge'\n | '24xlarge_optimized_memory'\n | '24xlarge_optimized_cpu'\n | '24xlarge_high_memory'\n | '48xlarge'\n | '48xlarge_optimized_memory'\n | '48xlarge_optimized_cpu'\n | '48xlarge_high_memory'\n /**\n * @description Release channel. If not provided, GA will be used.\n * @enum {string}\n */\n release_channel?: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview'\n /**\n * @description Postgres engine version. If not provided, the latest version will be used.\n * @enum {string}\n */\n postgres_engine?: '15' | '17' | '17-oriole'\n secrets?: {\n [key: string]: string\n }\n }\n UpdateCustomHostnameResponse: {\n /** @enum {string} */\n status:\n | '1_not_started'\n | '2_initiated'\n | '3_challenge_verified'\n | '4_origin_setup_completed'\n | '5_services_reconfigured'\n custom_hostname: string\n data: {\n success: boolean\n errors: unknown[]\n messages: unknown[]\n result: {\n id: string\n hostname: string\n ssl: {\n status: string\n validation_records: {\n txt_name: string\n txt_value: string\n }[]\n validation_errors?: {\n message: string\n }[]\n }\n ownership_verification: {\n type: string\n name: string\n value: string\n }\n custom_origin_server: string\n verification_errors?: string[]\n status: string\n }\n }\n }\n UpdateCustomHostnameBody: {\n custom_hostname: string\n }\n NetworkBanResponse: {\n banned_ipv4_addresses: string[]\n }\n NetworkBanResponseEnriched: {\n banned_ipv4_addresses: {\n banned_address: string\n identifier: string\n type: string\n }[]\n }\n RemoveNetworkBanRequest: {\n ipv4_addresses: string[]\n identifier?: string\n }\n NetworkRestrictionsResponse: {\n /** @enum {string} */\n entitlement: 'disallowed' | 'allowed'\n /** @description At any given point in time, this is the config that the user has requested be applied to their project. The `status` field indicates if it has been applied to the project, or is pending. When an updated config is received, the applied config is moved to `old_config`. */\n config: {\n dbAllowedCidrs?: string[]\n dbAllowedCidrsV6?: string[]\n }\n /** @description Populated when a new config has been received, but not registered as successfully applied to a project. */\n old_config?: {\n dbAllowedCidrs?: string[]\n dbAllowedCidrsV6?: string[]\n }\n /** @enum {string} */\n status: 'stored' | 'applied'\n }\n NetworkRestrictionsRequest: {\n dbAllowedCidrs?: string[]\n dbAllowedCidrsV6?: string[]\n }\n PgsodiumConfigResponse: {\n root_key: string\n }\n UpdatePgsodiumConfigBody: {\n root_key: string\n }\n PostgrestConfigWithJWTSecretResponse: {\n db_schema: string\n max_rows: number\n db_extra_search_path: string\n /** @description If `null`, the value is automatically configured based on compute size. */\n db_pool: number | null\n jwt_secret?: string\n }\n V1UpdatePostgrestConfigBody: {\n db_extra_search_path?: string\n db_schema?: string\n max_rows?: number\n db_pool?: number\n }\n V1PostgrestConfigResponse: {\n db_schema: string\n max_rows: number\n db_extra_search_path: string\n /** @description If `null`, the value is automatically configured based on compute size. */\n db_pool: number | null\n }\n V1ProjectRefResponse: {\n id: number\n ref: string\n name: string\n }\n SecretResponse: {\n name: string\n value: string\n updated_at?: string\n }\n CreateSecretBody: {\n /**\n * @description Secret name must not start with the SUPABASE_ prefix.\n * @example string\n */\n name: string\n value: string\n }[]\n SslEnforcementResponse: {\n currentConfig: {\n database: boolean\n }\n appliedSuccessfully: boolean\n }\n SslEnforcementRequest: {\n requestedConfig: {\n database: boolean\n }\n }\n TypescriptResponse: {\n types: string\n }\n VanitySubdomainConfigResponse: {\n /** @enum {string} */\n status: 'not-used' | 'custom-domain-used' | 'active'\n custom_domain?: string\n }\n VanitySubdomainBody: {\n vanity_subdomain: string\n }\n SubdomainAvailabilityResponse: {\n available: boolean\n }\n ActivateVanitySubdomainResponse: {\n custom_domain: string\n }\n UpgradeDatabaseBody: {\n target_version: string\n /** @enum {string} */\n release_channel?: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview'\n }\n ProjectUpgradeInitiateResponse: {\n tracking_id: string\n }\n ProjectUpgradeEligibilityResponse: {\n eligible: boolean\n current_app_version: string\n /** @enum {string} */\n current_app_version_release_channel:\n | 'internal'\n | 'alpha'\n | 'beta'\n | 'ga'\n | 'withdrawn'\n | 'preview'\n latest_app_version: string\n target_upgrade_versions: {\n /** @enum {string} */\n postgres_version: '15' | '17' | '17-oriole'\n /** @enum {string} */\n release_channel: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview'\n app_version: string\n }[]\n potential_breaking_changes: string[]\n duration_estimate_hours: number\n legacy_auth_custom_roles: string[]\n extension_dependent_objects: string[]\n }\n DatabaseUpgradeStatusResponse: {\n databaseUpgradeStatus: {\n initiated_at: string\n latest_status_at: string\n target_version: number\n /** @enum {string} */\n error?:\n | '1_upgraded_instance_launch_failed'\n | '2_volume_detachchment_from_upgraded_instance_failed'\n | '3_volume_attachment_to_original_instance_failed'\n | '4_data_upgrade_initiation_failed'\n | '5_data_upgrade_completion_failed'\n | '6_volume_detachchment_from_original_instance_failed'\n | '7_volume_attachment_to_upgraded_instance_failed'\n | '8_upgrade_completion_failed'\n | '9_post_physical_backup_failed'\n /** @enum {string} */\n progress?:\n | '0_requested'\n | '1_started'\n | '2_launched_upgraded_instance'\n | '3_detached_volume_from_upgraded_instance'\n | '4_attached_volume_to_original_instance'\n | '5_initiated_data_upgrade'\n | '6_completed_data_upgrade'\n | '7_detached_volume_from_original_instance'\n | '8_attached_volume_to_upgraded_instance'\n | '9_completed_upgrade'\n | '10_completed_post_physical_backup'\n status: number\n } | null\n }\n ReadOnlyStatusResponse: {\n enabled: boolean\n override_enabled: boolean\n override_active_until: string\n }\n SetUpReadReplicaBody: {\n /**\n * @description Region you want your read replica to reside in\n * @example us-east-1\n * @enum {string}\n */\n read_replica_region:\n | 'us-east-1'\n | 'us-east-2'\n | 'us-west-1'\n | 'us-west-2'\n | 'ap-east-1'\n | 'ap-southeast-1'\n | 'ap-northeast-1'\n | 'ap-northeast-2'\n | 'ap-southeast-2'\n | 'eu-west-1'\n | 'eu-west-2'\n | 'eu-west-3'\n | 'eu-north-1'\n | 'eu-central-1'\n | 'eu-central-2'\n | 'ca-central-1'\n | 'ap-south-1'\n | 'sa-east-1'\n }\n RemoveReadReplicaBody: {\n database_identifier: string\n }\n V1ServiceHealthResponse: {\n /** @enum {string} */\n name: 'auth' | 'db' | 'pooler' | 'realtime' | 'rest' | 'storage'\n healthy: boolean\n /** @enum {string} */\n status: 'COMING_UP' | 'ACTIVE_HEALTHY' | 'UNHEALTHY'\n info?:\n | {\n /** @enum {string} */\n name: 'GoTrue'\n version: string\n description: string\n }\n | {\n healthy: boolean\n db_connected: boolean\n connected_cluster: number\n }\n error?: string\n }\n CreateSigningKeyBody: {\n /** @enum {string} */\n algorithm: 'EdDSA' | 'ES256' | 'RS256' | 'HS256'\n /** @enum {string} */\n status?: 'in_use' | 'standby'\n }\n SigningKeyResponse: {\n /** Format: uuid */\n id: string\n /** @enum {string} */\n algorithm: 'EdDSA' | 'ES256' | 'RS256' | 'HS256'\n /** @enum {string} */\n status: 'in_use' | 'previously_used' | 'revoked' | 'standby'\n public_jwk?: unknown\n /** Format: date-time */\n created_at: string\n /** Format: date-time */\n updated_at: string\n }\n SigningKeysResponse: {\n keys: {\n /** Format: uuid */\n id: string\n /** @enum {string} */\n algorithm: 'EdDSA' | 'ES256' | 'RS256' | 'HS256'\n /** @enum {string} */\n status: 'in_use' | 'previously_used' | 'revoked' | 'standby'\n public_jwk?: unknown\n /** Format: date-time */\n created_at: string\n /** Format: date-time */\n updated_at: string\n }[]\n }\n UpdateSigningKeyBody: {\n /** @enum {string} */\n status: 'in_use' | 'previously_used' | 'revoked' | 'standby'\n }\n StorageConfigResponse: {\n /** Format: int64 */\n fileSizeLimit: number\n features: {\n imageTransformation: {\n enabled: boolean\n }\n s3Protocol: {\n enabled: boolean\n }\n }\n }\n UpdateStorageConfigBody: {\n /** Format: int64 */\n fileSizeLimit?: number\n features?: {\n imageTransformation: {\n enabled: boolean\n }\n s3Protocol: {\n enabled: boolean\n }\n }\n }\n PostgresConfigResponse: {\n effective_cache_size?: string\n logical_decoding_work_mem?: string\n maintenance_work_mem?: string\n track_activity_query_size?: string\n max_connections?: number\n max_locks_per_transaction?: number\n max_parallel_maintenance_workers?: number\n max_parallel_workers?: number\n max_parallel_workers_per_gather?: number\n max_replication_slots?: number\n max_slot_wal_keep_size?: string\n max_standby_archive_delay?: string\n max_standby_streaming_delay?: string\n max_wal_size?: string\n max_wal_senders?: number\n max_worker_processes?: number\n /** @enum {string} */\n session_replication_role?: 'origin' | 'replica' | 'local'\n shared_buffers?: string\n statement_timeout?: string\n track_commit_timestamp?: boolean\n wal_keep_size?: string\n wal_sender_timeout?: string\n work_mem?: string\n }\n UpdatePostgresConfigBody: {\n effective_cache_size?: string\n logical_decoding_work_mem?: string\n maintenance_work_mem?: string\n track_activity_query_size?: string\n max_connections?: number\n max_locks_per_transaction?: number\n max_parallel_maintenance_workers?: number\n max_parallel_workers?: number\n max_parallel_workers_per_gather?: number\n max_replication_slots?: number\n max_slot_wal_keep_size?: string\n max_standby_archive_delay?: string\n max_standby_streaming_delay?: string\n max_wal_size?: string\n max_wal_senders?: number\n max_worker_processes?: number\n /** @enum {string} */\n session_replication_role?: 'origin' | 'replica' | 'local'\n shared_buffers?: string\n statement_timeout?: string\n track_commit_timestamp?: boolean\n wal_keep_size?: string\n wal_sender_timeout?: string\n work_mem?: string\n restart_database?: boolean\n }\n V1PgbouncerConfigResponse: {\n default_pool_size?: number\n ignore_startup_parameters?: string\n max_client_conn?: number\n /** @enum {string} */\n pool_mode?: 'transaction' | 'session' | 'statement'\n connection_string?: string\n }\n SupavisorConfigResponse: {\n identifier: string\n /** @enum {string} */\n database_type: 'PRIMARY' | 'READ_REPLICA'\n is_using_scram_auth: boolean\n db_user: string\n db_host: string\n db_port: number\n db_name: string\n connection_string: string\n /** @description Use connection_string instead */\n connectionString: string\n default_pool_size: number | null\n max_client_conn: number | null\n /** @enum {string} */\n pool_mode: 'transaction' | 'session'\n }\n UpdateSupavisorConfigBody: {\n default_pool_size?: number | null\n /**\n * @description Dedicated pooler mode for the project\n * @enum {string}\n */\n pool_mode?: 'transaction' | 'session'\n }\n UpdateSupavisorConfigResponse: {\n default_pool_size: number | null\n pool_mode: string\n }\n AuthConfigResponse: {\n api_max_request_duration: number | null\n db_max_pool_size: number | null\n disable_signup: boolean | null\n external_anonymous_users_enabled: boolean | null\n external_apple_additional_client_ids: string | null\n external_apple_client_id: string | null\n external_apple_enabled: boolean | null\n external_apple_secret: string | null\n external_azure_client_id: string | null\n external_azure_enabled: boolean | null\n external_azure_secret: string | null\n external_azure_url: string | null\n external_bitbucket_client_id: string | null\n external_bitbucket_enabled: boolean | null\n external_bitbucket_secret: string | null\n external_discord_client_id: string | null\n external_discord_enabled: boolean | null\n external_discord_secret: string | null\n external_email_enabled: boolean | null\n external_facebook_client_id: string | null\n external_facebook_enabled: boolean | null\n external_facebook_secret: string | null\n external_figma_client_id: string | null\n external_figma_enabled: boolean | null\n external_figma_secret: string | null\n external_github_client_id: string | null\n external_github_enabled: boolean | null\n external_github_secret: string | null\n external_gitlab_client_id: string | null\n external_gitlab_enabled: boolean | null\n external_gitlab_secret: string | null\n external_gitlab_url: string | null\n external_google_additional_client_ids: string | null\n external_google_client_id: string | null\n external_google_enabled: boolean | null\n external_google_secret: string | null\n external_google_skip_nonce_check: boolean | null\n external_kakao_client_id: string | null\n external_kakao_enabled: boolean | null\n external_kakao_secret: string | null\n external_keycloak_client_id: string | null\n external_keycloak_enabled: boolean | null\n external_keycloak_secret: string | null\n external_keycloak_url: string | null\n external_linkedin_oidc_client_id: string | null\n external_linkedin_oidc_enabled: boolean | null\n external_linkedin_oidc_secret: string | null\n external_slack_oidc_client_id: string | null\n external_slack_oidc_enabled: boolean | null\n external_slack_oidc_secret: string | null\n external_notion_client_id: string | null\n external_notion_enabled: boolean | null\n external_notion_secret: string | null\n external_phone_enabled: boolean | null\n external_slack_client_id: string | null\n external_slack_enabled: boolean | null\n external_slack_secret: string | null\n external_spotify_client_id: string | null\n external_spotify_enabled: boolean | null\n external_spotify_secret: string | null\n external_twitch_client_id: string | null\n external_twitch_enabled: boolean | null\n external_twitch_secret: string | null\n external_twitter_client_id: string | null\n external_twitter_enabled: boolean | null\n external_twitter_secret: string | null\n external_workos_client_id: string | null\n external_workos_enabled: boolean | null\n external_workos_secret: string | null\n external_workos_url: string | null\n external_web3_solana_enabled: boolean | null\n external_zoom_client_id: string | null\n external_zoom_enabled: boolean | null\n external_zoom_secret: string | null\n hook_custom_access_token_enabled: boolean | null\n hook_custom_access_token_uri: string | null\n hook_custom_access_token_secrets: string | null\n hook_mfa_verification_attempt_enabled: boolean | null\n hook_mfa_verification_attempt_uri: string | null\n hook_mfa_verification_attempt_secrets: string | null\n hook_password_verification_attempt_enabled: boolean | null\n hook_password_verification_attempt_uri: string | null\n hook_password_verification_attempt_secrets: string | null\n hook_send_sms_enabled: boolean | null\n hook_send_sms_uri: string | null\n hook_send_sms_secrets: string | null\n hook_send_email_enabled: boolean | null\n hook_send_email_uri: string | null\n hook_send_email_secrets: string | null\n hook_before_user_created_enabled: boolean | null\n hook_before_user_created_uri: string | null\n hook_before_user_created_secrets: string | null\n jwt_exp: number | null\n mailer_allow_unverified_email_sign_ins: boolean | null\n mailer_autoconfirm: boolean | null\n mailer_otp_exp: number\n mailer_otp_length: number | null\n mailer_secure_email_change_enabled: boolean | null\n mailer_subjects_confirmation: string | null\n mailer_subjects_email_change: string | null\n mailer_subjects_invite: string | null\n mailer_subjects_magic_link: string | null\n mailer_subjects_reauthentication: string | null\n mailer_subjects_recovery: string | null\n mailer_templates_confirmation_content: string | null\n mailer_templates_email_change_content: string | null\n mailer_templates_invite_content: string | null\n mailer_templates_magic_link_content: string | null\n mailer_templates_reauthentication_content: string | null\n mailer_templates_recovery_content: string | null\n mfa_max_enrolled_factors: number | null\n mfa_totp_enroll_enabled: boolean | null\n mfa_totp_verify_enabled: boolean | null\n mfa_phone_enroll_enabled: boolean | null\n mfa_phone_verify_enabled: boolean | null\n mfa_web_authn_enroll_enabled: boolean | null\n mfa_web_authn_verify_enabled: boolean | null\n mfa_phone_otp_length: number\n mfa_phone_template: string | null\n mfa_phone_max_frequency: number | null\n password_hibp_enabled: boolean | null\n password_min_length: number | null\n /** @enum {string|null} */\n password_required_characters:\n | 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789'\n | 'abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789'\n | 'abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};\\'\\\\\\\\:\"|<>?,./`~'\n | ''\n | null\n rate_limit_anonymous_users: number | null\n rate_limit_email_sent: number | null\n rate_limit_sms_sent: number | null\n rate_limit_token_refresh: number | null\n rate_limit_verify: number | null\n rate_limit_otp: number | null\n rate_limit_web3: number | null\n refresh_token_rotation_enabled: boolean | null\n saml_enabled: boolean | null\n saml_external_url: string | null\n saml_allow_encrypted_assertions: boolean | null\n security_captcha_enabled: boolean | null\n /** @enum {string|null} */\n security_captcha_provider: 'turnstile' | 'hcaptcha' | null\n security_captcha_secret: string | null\n security_manual_linking_enabled: boolean | null\n security_refresh_token_reuse_interval: number | null\n security_update_password_require_reauthentication: boolean | null\n sessions_inactivity_timeout: number | null\n sessions_single_per_user: boolean | null\n sessions_tags: string | null\n sessions_timebox: number | null\n site_url: string | null\n sms_autoconfirm: boolean | null\n sms_max_frequency: number | null\n sms_messagebird_access_key: string | null\n sms_messagebird_originator: string | null\n sms_otp_exp: number | null\n sms_otp_length: number\n /** @enum {string|null} */\n sms_provider: 'messagebird' | 'textlocal' | 'twilio' | 'twilio_verify' | 'vonage' | null\n sms_template: string | null\n sms_test_otp: string | null\n /** Format: date-time */\n sms_test_otp_valid_until: string | null\n sms_textlocal_api_key: string | null\n sms_textlocal_sender: string | null\n sms_twilio_account_sid: string | null\n sms_twilio_auth_token: string | null\n sms_twilio_content_sid: string | null\n sms_twilio_message_service_sid: string | null\n sms_twilio_verify_account_sid: string | null\n sms_twilio_verify_auth_token: string | null\n sms_twilio_verify_message_service_sid: string | null\n sms_vonage_api_key: string | null\n sms_vonage_api_secret: string | null\n sms_vonage_from: string | null\n smtp_admin_email: string | null\n smtp_host: string | null\n smtp_max_frequency: number | null\n smtp_pass: string | null\n smtp_port: string | null\n smtp_sender_name: string | null\n smtp_user: string | null\n uri_allow_list: string | null\n }\n UpdateAuthConfigBody: {\n site_url?: string | null\n disable_signup?: boolean | null\n jwt_exp?: number | null\n smtp_admin_email?: string | null\n smtp_host?: string | null\n smtp_port?: string | null\n smtp_user?: string | null\n smtp_pass?: string | null\n smtp_max_frequency?: number | null\n smtp_sender_name?: string | null\n mailer_allow_unverified_email_sign_ins?: boolean | null\n mailer_autoconfirm?: boolean | null\n mailer_subjects_invite?: string | null\n mailer_subjects_confirmation?: string | null\n mailer_subjects_recovery?: string | null\n mailer_subjects_email_change?: string | null\n mailer_subjects_magic_link?: string | null\n mailer_subjects_reauthentication?: string | null\n mailer_templates_invite_content?: string | null\n mailer_templates_confirmation_content?: string | null\n mailer_templates_recovery_content?: string | null\n mailer_templates_email_change_content?: string | null\n mailer_templates_magic_link_content?: string | null\n mailer_templates_reauthentication_content?: string | null\n mfa_max_enrolled_factors?: number | null\n uri_allow_list?: string | null\n external_anonymous_users_enabled?: boolean | null\n external_email_enabled?: boolean | null\n external_phone_enabled?: boolean | null\n saml_enabled?: boolean | null\n saml_external_url?: string | null\n security_captcha_enabled?: boolean | null\n /** @enum {string|null} */\n security_captcha_provider?: 'turnstile' | 'hcaptcha' | null\n security_captcha_secret?: string | null\n sessions_timebox?: number | null\n sessions_inactivity_timeout?: number | null\n sessions_single_per_user?: boolean | null\n sessions_tags?: string | null\n rate_limit_anonymous_users?: number | null\n rate_limit_email_sent?: number | null\n rate_limit_sms_sent?: number | null\n rate_limit_verify?: number | null\n rate_limit_token_refresh?: number | null\n rate_limit_otp?: number | null\n rate_limit_web3?: number | null\n mailer_secure_email_change_enabled?: boolean | null\n refresh_token_rotation_enabled?: boolean | null\n password_hibp_enabled?: boolean | null\n password_min_length?: number | null\n /** @enum {string|null} */\n password_required_characters?:\n | 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789'\n | 'abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789'\n | 'abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};\\'\\\\\\\\:\"|<>?,./`~'\n | ''\n | null\n security_manual_linking_enabled?: boolean | null\n security_update_password_require_reauthentication?: boolean | null\n security_refresh_token_reuse_interval?: number | null\n mailer_otp_exp?: number\n mailer_otp_length?: number | null\n sms_autoconfirm?: boolean | null\n sms_max_frequency?: number | null\n sms_otp_exp?: number | null\n sms_otp_length?: number\n /** @enum {string|null} */\n sms_provider?: 'messagebird' | 'textlocal' | 'twilio' | 'twilio_verify' | 'vonage' | null\n sms_messagebird_access_key?: string | null\n sms_messagebird_originator?: string | null\n sms_test_otp?: string | null\n /** Format: date-time */\n sms_test_otp_valid_until?: string | null\n sms_textlocal_api_key?: string | null\n sms_textlocal_sender?: string | null\n sms_twilio_account_sid?: string | null\n sms_twilio_auth_token?: string | null\n sms_twilio_content_sid?: string | null\n sms_twilio_message_service_sid?: string | null\n sms_twilio_verify_account_sid?: string | null\n sms_twilio_verify_auth_token?: string | null\n sms_twilio_verify_message_service_sid?: string | null\n sms_vonage_api_key?: string | null\n sms_vonage_api_secret?: string | null\n sms_vonage_from?: string | null\n sms_template?: string | null\n hook_mfa_verification_attempt_enabled?: boolean | null\n hook_mfa_verification_attempt_uri?: string | null\n hook_mfa_verification_attempt_secrets?: string | null\n hook_password_verification_attempt_enabled?: boolean | null\n hook_password_verification_attempt_uri?: string | null\n hook_password_verification_attempt_secrets?: string | null\n hook_custom_access_token_enabled?: boolean | null\n hook_custom_access_token_uri?: string | null\n hook_custom_access_token_secrets?: string | null\n hook_send_sms_enabled?: boolean | null\n hook_send_sms_uri?: string | null\n hook_send_sms_secrets?: string | null\n hook_send_email_enabled?: boolean | null\n hook_send_email_uri?: string | null\n hook_send_email_secrets?: string | null\n hook_before_user_created_enabled?: boolean | null\n hook_before_user_created_uri?: string | null\n hook_before_user_created_secrets?: string | null\n external_apple_enabled?: boolean | null\n external_apple_client_id?: string | null\n external_apple_secret?: string | null\n external_apple_additional_client_ids?: string | null\n external_azure_enabled?: boolean | null\n external_azure_client_id?: string | null\n external_azure_secret?: string | null\n external_azure_url?: string | null\n external_bitbucket_enabled?: boolean | null\n external_bitbucket_client_id?: string | null\n external_bitbucket_secret?: string | null\n external_discord_enabled?: boolean | null\n external_discord_client_id?: string | null\n external_discord_secret?: string | null\n external_facebook_enabled?: boolean | null\n external_facebook_client_id?: string | null\n external_facebook_secret?: string | null\n external_figma_enabled?: boolean | null\n external_figma_client_id?: string | null\n external_figma_secret?: string | null\n external_github_enabled?: boolean | null\n external_github_client_id?: string | null\n external_github_secret?: string | null\n external_gitlab_enabled?: boolean | null\n external_gitlab_client_id?: string | null\n external_gitlab_secret?: string | null\n external_gitlab_url?: string | null\n external_google_enabled?: boolean | null\n external_google_client_id?: string | null\n external_google_secret?: string | null\n external_google_additional_client_ids?: string | null\n external_google_skip_nonce_check?: boolean | null\n external_kakao_enabled?: boolean | null\n external_kakao_client_id?: string | null\n external_kakao_secret?: string | null\n external_keycloak_enabled?: boolean | null\n external_keycloak_client_id?: string | null\n external_keycloak_secret?: string | null\n external_keycloak_url?: string | null\n external_linkedin_oidc_enabled?: boolean | null\n external_linkedin_oidc_client_id?: string | null\n external_linkedin_oidc_secret?: string | null\n external_slack_oidc_enabled?: boolean | null\n external_slack_oidc_client_id?: string | null\n external_slack_oidc_secret?: string | null\n external_notion_enabled?: boolean | null\n external_notion_client_id?: string | null\n external_notion_secret?: string | null\n external_slack_enabled?: boolean | null\n external_slack_client_id?: string | null\n external_slack_secret?: string | null\n external_spotify_enabled?: boolean | null\n external_spotify_client_id?: string | null\n external_spotify_secret?: string | null\n external_twitch_enabled?: boolean | null\n external_twitch_client_id?: string | null\n external_twitch_secret?: string | null\n external_twitter_enabled?: boolean | null\n external_twitter_client_id?: string | null\n external_twitter_secret?: string | null\n external_workos_enabled?: boolean | null\n external_workos_client_id?: string | null\n external_workos_secret?: string | null\n external_workos_url?: string | null\n external_web3_solana_enabled?: boolean | null\n external_zoom_enabled?: boolean | null\n external_zoom_client_id?: string | null\n external_zoom_secret?: string | null\n db_max_pool_size?: number | null\n api_max_request_duration?: number | null\n mfa_totp_enroll_enabled?: boolean | null\n mfa_totp_verify_enabled?: boolean | null\n mfa_web_authn_enroll_enabled?: boolean | null\n mfa_web_authn_verify_enabled?: boolean | null\n mfa_phone_enroll_enabled?: boolean | null\n mfa_phone_verify_enabled?: boolean | null\n mfa_phone_max_frequency?: number | null\n mfa_phone_otp_length?: number | null\n mfa_phone_template?: string | null\n }\n CreateThirdPartyAuthBody: {\n oidc_issuer_url?: string\n jwks_url?: string\n custom_jwks?: unknown\n }\n ThirdPartyAuth: {\n /** Format: uuid */\n id: string\n type: string\n oidc_issuer_url?: string | null\n jwks_url?: string | null\n custom_jwks?: unknown\n resolved_jwks?: unknown\n inserted_at: string\n updated_at: string\n resolved_at?: string | null\n }\n GetProjectAvailableRestoreVersionsResponse: {\n available_versions: {\n version: string\n /** @enum {string} */\n release_channel: 'internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview'\n /** @enum {string} */\n postgres_engine: '13' | '14' | '15' | '17' | '17-oriole'\n }[]\n }\n ListProjectAddonsResponse: {\n selected_addons: {\n /** @enum {string} */\n type:\n | 'custom_domain'\n | 'compute_instance'\n | 'pitr'\n | 'ipv4'\n | 'auth_mfa_phone'\n | 'auth_mfa_web_authn'\n | 'log_drain'\n variant: {\n id:\n | (\n | 'ci_micro'\n | 'ci_small'\n | 'ci_medium'\n | 'ci_large'\n | 'ci_xlarge'\n | 'ci_2xlarge'\n | 'ci_4xlarge'\n | 'ci_8xlarge'\n | 'ci_12xlarge'\n | 'ci_16xlarge'\n | 'ci_24xlarge'\n | 'ci_24xlarge_optimized_cpu'\n | 'ci_24xlarge_optimized_memory'\n | 'ci_24xlarge_high_memory'\n | 'ci_48xlarge'\n | 'ci_48xlarge_optimized_cpu'\n | 'ci_48xlarge_optimized_memory'\n | 'ci_48xlarge_high_memory'\n )\n | 'cd_default'\n | ('pitr_7' | 'pitr_14' | 'pitr_28')\n | 'ipv4_default'\n | 'auth_mfa_phone_default'\n | 'auth_mfa_web_authn_default'\n | 'log_drain_default'\n name: string\n price: {\n description: string\n /** @enum {string} */\n type: 'fixed' | 'usage'\n /** @enum {string} */\n interval: 'monthly' | 'hourly'\n amount: number\n }\n /** @description Any JSON-serializable value */\n meta?: unknown\n }\n }[]\n available_addons: {\n /** @enum {string} */\n type:\n | 'custom_domain'\n | 'compute_instance'\n | 'pitr'\n | 'ipv4'\n | 'auth_mfa_phone'\n | 'auth_mfa_web_authn'\n | 'log_drain'\n name: string\n variants: {\n id:\n | (\n | 'ci_micro'\n | 'ci_small'\n | 'ci_medium'\n | 'ci_large'\n | 'ci_xlarge'\n | 'ci_2xlarge'\n | 'ci_4xlarge'\n | 'ci_8xlarge'\n | 'ci_12xlarge'\n | 'ci_16xlarge'\n | 'ci_24xlarge'\n | 'ci_24xlarge_optimized_cpu'\n | 'ci_24xlarge_optimized_memory'\n | 'ci_24xlarge_high_memory'\n | 'ci_48xlarge'\n | 'ci_48xlarge_optimized_cpu'\n | 'ci_48xlarge_optimized_memory'\n | 'ci_48xlarge_high_memory'\n )\n | 'cd_default'\n | ('pitr_7' | 'pitr_14' | 'pitr_28')\n | 'ipv4_default'\n | 'auth_mfa_phone_default'\n | 'auth_mfa_web_authn_default'\n | 'log_drain_default'\n name: string\n price: {\n description: string\n /** @enum {string} */\n type: 'fixed' | 'usage'\n /** @enum {string} */\n interval: 'monthly' | 'hourly'\n amount: number\n }\n /** @description Any JSON-serializable value */\n meta?: unknown\n }[]\n }[]\n }\n ApplyProjectAddonBody: {\n addon_variant:\n | (\n | 'ci_micro'\n | 'ci_small'\n | 'ci_medium'\n | 'ci_large'\n | 'ci_xlarge'\n | 'ci_2xlarge'\n | 'ci_4xlarge'\n | 'ci_8xlarge'\n | 'ci_12xlarge'\n | 'ci_16xlarge'\n | 'ci_24xlarge'\n | 'ci_24xlarge_optimized_cpu'\n | 'ci_24xlarge_optimized_memory'\n | 'ci_24xlarge_high_memory'\n | 'ci_48xlarge'\n | 'ci_48xlarge_optimized_cpu'\n | 'ci_48xlarge_optimized_memory'\n | 'ci_48xlarge_high_memory'\n )\n | 'cd_default'\n | ('pitr_7' | 'pitr_14' | 'pitr_28')\n | 'ipv4_default'\n /** @enum {string} */\n addon_type:\n | 'custom_domain'\n | 'compute_instance'\n | 'pitr'\n | 'ipv4'\n | 'auth_mfa_phone'\n | 'auth_mfa_web_authn'\n | 'log_drain'\n }\n ProjectClaimTokenResponse: {\n token_alias: string\n expires_at: string\n created_at: string\n /** Format: uuid */\n created_by: string\n }\n CreateProjectClaimTokenResponse: {\n token: string\n token_alias: string\n expires_at: string\n created_at: string\n /** Format: uuid */\n created_by: string\n }\n V1ProjectAdvisorsResponse: {\n lints: {\n /** @enum {string} */\n name:\n | 'unindexed_foreign_keys'\n | 'auth_users_exposed'\n | 'auth_rls_initplan'\n | 'no_primary_key'\n | 'unused_index'\n | 'multiple_permissive_policies'\n | 'policy_exists_rls_disabled'\n | 'rls_enabled_no_policy'\n | 'duplicate_index'\n | 'security_definer_view'\n | 'function_search_path_mutable'\n | 'rls_disabled_in_public'\n | 'extension_in_public'\n | 'rls_references_user_metadata'\n | 'materialized_view_in_api'\n | 'foreign_table_in_api'\n | 'unsupported_reg_types'\n | 'auth_otp_long_expiry'\n | 'auth_otp_short_length'\n | 'ssl_not_enforced'\n | 'network_restrictions_not_set'\n | 'password_requirements_min_length'\n | 'pitr_not_enabled'\n | 'auth_leaked_password_protection'\n | 'auth_insufficient_mfa_options'\n | 'auth_password_policy_missing'\n | 'leaked_service_key'\n | 'no_backup_admin'\n title: string\n /** @enum {string} */\n level: 'ERROR' | 'WARN' | 'INFO'\n /** @enum {string} */\n facing: 'EXTERNAL'\n categories: ('PERFORMANCE' | 'SECURITY')[]\n description: string\n detail: string\n remediation: string\n metadata?: {\n schema?: string\n name?: string\n entity?: string\n /** @enum {string} */\n type?: 'table' | 'view' | 'auth' | 'function' | 'extension' | 'compliance'\n fkey_name?: string\n fkey_columns?: number[]\n }\n cache_key: string\n }[]\n }\n AnalyticsResponse: {\n result?: unknown[]\n error?:\n | string\n | {\n code: number\n errors: {\n domain: string\n location: string\n locationType: string\n message: string\n reason: string\n }[]\n message: string\n status: string\n }\n }\n V1ListMigrationsResponse: {\n version: string\n name?: string\n }[]\n V1CreateMigrationBody: {\n query: string\n name?: string\n }\n V1UpsertMigrationBody: {\n query: string\n name?: string\n }\n V1RunQueryBody: {\n query: string\n read_only?: boolean\n }\n GetProjectDbMetadataResponse: {\n databases: ({\n name: string\n schemas: ({\n name: string\n } & {\n [key: string]: unknown\n })[]\n } & {\n [key: string]: unknown\n })[]\n }\n FunctionResponse: {\n id: string\n slug: string\n name: string\n /** @enum {string} */\n status: 'ACTIVE' | 'REMOVED' | 'THROTTLED'\n version: number\n /** Format: int64 */\n created_at: number\n /** Format: int64 */\n updated_at: number\n verify_jwt?: boolean\n import_map?: boolean\n entrypoint_path?: string\n import_map_path?: string\n }\n V1CreateFunctionBody: {\n slug: string\n name: string\n body: string\n verify_jwt?: boolean\n }\n BulkUpdateFunctionBody: {\n id: string\n slug: string\n name: string\n /** @enum {string} */\n status: 'ACTIVE' | 'REMOVED' | 'THROTTLED'\n version: number\n /** Format: int64 */\n created_at?: number\n verify_jwt?: boolean\n import_map?: boolean\n entrypoint_path?: string\n import_map_path?: string\n }[]\n BulkUpdateFunctionResponse: {\n functions: {\n id: string\n slug: string\n name: string\n /** @enum {string} */\n status: 'ACTIVE' | 'REMOVED' | 'THROTTLED'\n version: number\n /** Format: int64 */\n created_at: number\n /** Format: int64 */\n updated_at: number\n verify_jwt?: boolean\n import_map?: boolean\n entrypoint_path?: string\n import_map_path?: string\n }[]\n }\n FunctionDeployBody: {\n file?: string[]\n metadata: {\n entrypoint_path: string\n import_map_path?: string\n static_patterns?: string[]\n verify_jwt?: boolean\n name?: string\n }\n }\n DeployFunctionResponse: {\n id: string\n slug: string\n name: string\n /** @enum {string} */\n status: 'ACTIVE' | 'REMOVED' | 'THROTTLED'\n version: number\n /** Format: int64 */\n created_at?: number\n /** Format: int64 */\n updated_at?: number\n verify_jwt?: boolean\n import_map?: boolean\n entrypoint_path?: string\n import_map_path?: string\n }\n FunctionSlugResponse: {\n id: string\n slug: string\n name: string\n /** @enum {string} */\n status: 'ACTIVE' | 'REMOVED' | 'THROTTLED'\n version: number\n /** Format: int64 */\n created_at: number\n /** Format: int64 */\n updated_at: number\n verify_jwt?: boolean\n import_map?: boolean\n entrypoint_path?: string\n import_map_path?: string\n }\n StreamableFile: Record<string, never>\n V1UpdateFunctionBody: {\n name?: string\n body?: string\n verify_jwt?: boolean\n }\n V1StorageBucketResponse: {\n id: string\n name: string\n owner: string\n created_at: string\n updated_at: string\n public: boolean\n }\n CreateProviderBody: {\n /**\n * @description What type of provider will be created\n * @enum {string}\n */\n type: 'saml'\n metadata_xml?: string\n metadata_url?: string\n domains?: string[]\n attribute_mapping?: {\n keys: {\n [key: string]: {\n name?: string\n names?: string[]\n default?: Record<string, never> | number | string | boolean\n array?: boolean\n }\n }\n }\n }\n CreateProviderResponse: {\n id: string\n saml?: {\n id: string\n entity_id: string\n metadata_url?: string\n metadata_xml?: string\n attribute_mapping?: {\n keys: {\n [key: string]: {\n name?: string\n names?: string[]\n default?: Record<string, never> | number | string | boolean\n array?: boolean\n }\n }\n }\n }\n domains?: {\n id: string\n domain?: string\n created_at?: string\n updated_at?: string\n }[]\n created_at?: string\n updated_at?: string\n }\n ListProvidersResponse: {\n items: {\n id: string\n saml?: {\n id: string\n entity_id: string\n metadata_url?: string\n metadata_xml?: string\n attribute_mapping?: {\n keys: {\n [key: string]: {\n name?: string\n names?: string[]\n default?: Record<string, never> | number | string | boolean\n array?: boolean\n }\n }\n }\n }\n domains?: {\n id: string\n domain?: string\n created_at?: string\n updated_at?: string\n }[]\n created_at?: string\n updated_at?: string\n }[]\n }\n GetProviderResponse: {\n id: string\n saml?: {\n id: string\n entity_id: string\n metadata_url?: string\n metadata_xml?: string\n attribute_mapping?: {\n keys: {\n [key: string]: {\n name?: string\n names?: string[]\n default?: Record<string, never> | number | string | boolean\n array?: boolean\n }\n }\n }\n }\n domains?: {\n id: string\n domain?: string\n created_at?: string\n updated_at?: string\n }[]\n created_at?: string\n updated_at?: string\n }\n UpdateProviderBody: {\n metadata_xml?: string\n metadata_url?: string\n domains?: string[]\n attribute_mapping?: {\n keys: {\n [key: string]: {\n name?: string\n names?: string[]\n default?: Record<string, never> | number | string | boolean\n array?: boolean\n }\n }\n }\n }\n UpdateProviderResponse: {\n id: string\n saml?: {\n id: string\n entity_id: string\n metadata_url?: string\n metadata_xml?: string\n attribute_mapping?: {\n keys: {\n [key: string]: {\n name?: string\n names?: string[]\n default?: Record<string, never> | number | string | boolean\n array?: boolean\n }\n }\n }\n }\n domains?: {\n id: string\n domain?: string\n created_at?: string\n updated_at?: string\n }[]\n created_at?: string\n updated_at?: string\n }\n DeleteProviderResponse: {\n id: string\n saml?: {\n id: string\n entity_id: string\n metadata_url?: string\n metadata_xml?: string\n attribute_mapping?: {\n keys: {\n [key: string]: {\n name?: string\n names?: string[]\n default?: Record<string, never> | number | string | boolean\n array?: boolean\n }\n }\n }\n }\n domains?: {\n id: string\n domain?: string\n created_at?: string\n updated_at?: string\n }[]\n created_at?: string\n updated_at?: string\n }\n V1BackupsResponse: {\n region: string\n walg_enabled: boolean\n pitr_enabled: boolean\n backups: {\n is_physical_backup: boolean\n /** @enum {string} */\n status: 'COMPLETED' | 'FAILED' | 'PENDING' | 'REMOVED' | 'ARCHIVED' | 'CANCELLED'\n inserted_at: string\n }[]\n physical_backup_data: {\n earliest_physical_backup_date_unix?: number\n latest_physical_backup_date_unix?: number\n }\n }\n V1RestorePitrBody: {\n /** Format: int64 */\n recovery_time_target_unix: number\n }\n V1RestorePointPostBody: {\n name: string\n }\n V1RestorePointResponse: {\n name: string\n /** @enum {string} */\n status: 'AVAILABLE' | 'PENDING' | 'REMOVED'\n }\n V1UndoBody: {\n name: string\n }\n V1OrganizationMemberResponse: {\n user_id: string\n user_name: string\n email?: string\n role_name: string\n mfa_enabled: boolean\n }\n V1OrganizationSlugResponse: {\n id: string\n name: string\n /** @enum {string} */\n plan?: 'free' | 'pro' | 'team' | 'enterprise'\n opt_in_tags: (\n | 'AI_SQL_GENERATOR_OPT_IN'\n | 'AI_DATA_GENERATOR_OPT_IN'\n | 'AI_LOG_GENERATOR_OPT_IN'\n )[]\n allowed_release_channels: ('internal' | 'alpha' | 'beta' | 'ga' | 'withdrawn' | 'preview')[]\n }\n OrganizationProjectClaimResponse: {\n project: {\n ref: string\n name: string\n }\n preview: {\n valid: boolean\n warnings: {\n key: string\n message: string\n }[]\n errors: {\n key: string\n message: string\n }[]\n info: {\n key: string\n message: string\n }[]\n members_exceeding_free_project_limit: {\n name: string\n limit: number\n }[]\n target_organization_eligible: boolean | null\n target_organization_has_free_project_slots: boolean | null\n /** @enum {string} */\n source_subscription_plan: 'free' | 'pro' | 'team' | 'enterprise'\n /** @enum {string|null} */\n target_subscription_plan: 'free' | 'pro' | 'team' | 'enterprise' | null\n }\n expires_at: string\n created_at: string\n /** Format: uuid */\n created_by: string\n }\n }\n responses: never\n parameters: never\n requestBodies: never\n headers: never\n pathItems: never\n}\nexport type $defs = Record<string, never>\nexport interface operations {\n 'v1-get-a-branch-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Branch ID */\n branch_id: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['BranchDetailResponse']\n }\n }\n /** @description Failed to retrieve database branch */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-delete-a-branch': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Branch ID */\n branch_id: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['BranchDeleteResponse']\n }\n }\n /** @description Failed to delete database branch */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-a-branch-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Branch ID */\n branch_id: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['UpdateBranchBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['BranchResponse']\n }\n }\n /** @description Failed to update database branch */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-push-a-branch': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Branch ID */\n branch_id: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['BranchActionBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['BranchUpdateResponse']\n }\n }\n /** @description Failed to push database branch */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-merge-a-branch': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Branch ID */\n branch_id: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['BranchActionBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['BranchUpdateResponse']\n }\n }\n /** @description Failed to merge database branch */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-reset-a-branch': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Branch ID */\n branch_id: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['BranchActionBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['BranchUpdateResponse']\n }\n }\n /** @description Failed to reset database branch */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-diff-a-branch': {\n parameters: {\n query?: {\n included_schemas?: string\n }\n header?: never\n path: {\n /** @description Branch ID */\n branch_id: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'text/plain': string\n }\n }\n /** @description Failed to diff database branch */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-all-projects': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1ProjectWithDatabaseResponse'][]\n }\n }\n }\n }\n 'v1-create-a-project': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['V1CreateProjectBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1ProjectResponse']\n }\n }\n }\n }\n 'v1-list-all-organizations': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['OrganizationResponseV1'][]\n }\n }\n /** @description Unexpected error listing organizations */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-create-an-organization': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['CreateOrganizationV1']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['OrganizationResponseV1']\n }\n }\n /** @description Unexpected error creating an organization */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-authorize-user': {\n parameters: {\n query: {\n client_id: string\n response_type: 'code' | 'token' | 'id_token token'\n redirect_uri: string\n scope?: string\n state?: string\n response_mode?: string\n code_challenge?: string\n code_challenge_method?: 'plain' | 'sha256' | 'S256'\n }\n header?: never\n path?: never\n cookie?: never\n }\n requestBody?: never\n responses: {\n 204: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-exchange-oauth-token': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/x-www-form-urlencoded': components['schemas']['OAuthTokenBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['OAuthTokenResponse']\n }\n }\n }\n }\n 'v1-revoke-token': {\n parameters: {\n query?: never\n header?: never\n path?: never\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['OAuthRevokeTokenBody']\n }\n }\n responses: {\n 204: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-oauth-authorize-project-claim': {\n parameters: {\n query: {\n /** @description Project ref */\n project_ref: string\n client_id: string\n response_type: 'code' | 'token' | 'id_token token'\n redirect_uri: string\n state?: string\n response_mode?: string\n code_challenge?: string\n code_challenge_method?: 'plain' | 'sha256' | 'S256'\n }\n header?: never\n path?: never\n cookie?: never\n }\n requestBody?: never\n responses: {\n 204: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-all-snippets': {\n parameters: {\n query?: {\n /** @description Project ref */\n project_ref?: string\n cursor?: string\n limit?: string\n sort_by?: 'name' | 'inserted_at'\n sort_order?: 'asc' | 'desc'\n }\n header?: never\n path?: never\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SnippetList']\n }\n }\n /** @description Failed to list user's SQL snippets */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-a-snippet': {\n parameters: {\n query?: never\n header?: never\n path: {\n id: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SnippetResponse']\n }\n }\n /** @description Failed to retrieve SQL snippet */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project-api-keys': {\n parameters: {\n query?: {\n /** @description Boolean string, true or false */\n reveal?: boolean\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ApiKeyResponse'][]\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-create-project-api-key': {\n parameters: {\n query?: {\n /** @description Boolean string, true or false */\n reveal?: boolean\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['CreateApiKeyBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ApiKeyResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project-legacy-api-keys': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['LegacyApiKeysResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-project-legacy-api-keys': {\n parameters: {\n query: {\n /** @description Boolean string, true or false */\n enabled: boolean\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['LegacyApiKeysResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project-api-key': {\n parameters: {\n query?: {\n /** @description Boolean string, true or false */\n reveal?: boolean\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n id: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ApiKeyResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-delete-project-api-key': {\n parameters: {\n query?: {\n /** @description Boolean string, true or false */\n reveal?: boolean\n /** @description Boolean string, true or false */\n was_compromised?: boolean\n reason?: string\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n id: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ApiKeyResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-project-api-key': {\n parameters: {\n query?: {\n /** @description Boolean string, true or false */\n reveal?: boolean\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n id: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['UpdateApiKeyBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ApiKeyResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-all-branches': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['BranchResponse'][]\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve database branches */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-create-a-branch': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['CreateBranchBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['BranchResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to create database branch */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-disable-preview-branching': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to disable preview branching */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-hostname-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['UpdateCustomHostnameResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's custom hostname config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-Delete hostname config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to delete project custom hostname configuration */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-hostname-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['UpdateCustomHostnameBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['UpdateCustomHostnameResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to update project custom hostname configuration */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-verify-dns-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['UpdateCustomHostnameResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to verify project custom hostname configuration */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-activate-custom-hostname': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['UpdateCustomHostnameResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to activate project custom hostname configuration */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-all-network-bans': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['NetworkBanResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's network bans */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-all-network-bans-enriched': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['NetworkBanResponseEnriched']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's enriched network bans */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-delete-network-bans': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['RemoveNetworkBanRequest']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to remove network bans. */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-network-restrictions': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['NetworkRestrictionsResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's network restrictions */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-network-restrictions': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['NetworkRestrictionsRequest']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['NetworkRestrictionsResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to update project network restrictions */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-pgsodium-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['PgsodiumConfigResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's pgsodium config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-pgsodium-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['UpdatePgsodiumConfigBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['PgsodiumConfigResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to update project's pgsodium config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-postgrest-service-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['PostgrestConfigWithJWTSecretResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's postgrest config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-postgrest-service-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['V1UpdatePostgrestConfigBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1PostgrestConfigResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to update project's postgrest config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1ProjectWithDatabaseResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-delete-a-project': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1ProjectRefResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-all-secrets': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SecretResponse'][]\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's secrets */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-bulk-create-secrets': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['CreateSecretBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to create project's secrets */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-bulk-delete-secrets': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': string[]\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to delete secrets with given names */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-ssl-enforcement-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SslEnforcementResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's SSL enforcement config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-ssl-enforcement-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['SslEnforcementRequest']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SslEnforcementResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to update project's SSL enforcement configuration. */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-generate-typescript-types': {\n parameters: {\n query?: {\n included_schemas?: string\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['TypescriptResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to generate TypeScript types */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-vanity-subdomain-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['VanitySubdomainConfigResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to get project vanity subdomain configuration */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-deactivate-vanity-subdomain-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to delete project vanity subdomain configuration */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-check-vanity-subdomain-availability': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['VanitySubdomainBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SubdomainAvailabilityResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to check project vanity subdomain configuration */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-activate-vanity-subdomain-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['VanitySubdomainBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ActivateVanitySubdomainResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to activate project vanity subdomain configuration */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-upgrade-postgres-version': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['UpgradeDatabaseBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ProjectUpgradeInitiateResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to initiate project upgrade */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-postgres-upgrade-eligibility': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ProjectUpgradeEligibilityResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to determine project upgrade eligibility */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-postgres-upgrade-status': {\n parameters: {\n query?: {\n tracking_id?: string\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['DatabaseUpgradeStatusResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project upgrade status */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-readonly-mode-status': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ReadOnlyStatusResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to get project readonly mode status */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-disable-readonly-mode-temporarily': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to disable project's readonly mode */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-setup-a-read-replica': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['SetUpReadReplicaBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to set up read replica */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-remove-a-read-replica': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['RemoveReadReplicaBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to remove read replica */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-services-health': {\n parameters: {\n query: {\n services: ('auth' | 'db' | 'pooler' | 'realtime' | 'rest' | 'storage')[]\n timeout_ms?: number\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1ServiceHealthResponse'][]\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's service health status */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project-signing-keys': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SigningKeysResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-create-project-signing-key': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['CreateSigningKeyBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SigningKeyResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project-signing-key': {\n parameters: {\n query?: never\n header?: never\n path: {\n id: string\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SigningKeyResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-remove-project-signing-key': {\n parameters: {\n query?: never\n header?: never\n path: {\n id: string\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SigningKeyResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-project-signing-key': {\n parameters: {\n query?: never\n header?: never\n path: {\n id: string\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['UpdateSigningKeyBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SigningKeyResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-storage-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['StorageConfigResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's storage config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-storage-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['UpdateStorageConfigBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to update project's storage config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-postgres-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['PostgresConfigResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's Postgres config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-postgres-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['UpdatePostgresConfigBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['PostgresConfigResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to update project's Postgres config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project-pgbouncer-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1PgbouncerConfigResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's pgbouncer config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-pooler-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['SupavisorConfigResponse'][]\n }\n }\n /** @description Failed to retrieve project's supavisor config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-pooler-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['UpdateSupavisorConfigBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['UpdateSupavisorConfigResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to update project's supavisor config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-auth-service-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['AuthConfigResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's auth config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-auth-service-config': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['UpdateAuthConfigBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['AuthConfigResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to update project's auth config */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-project-tpa-integrations': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ThirdPartyAuth'][]\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-create-project-tpa-integration': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['CreateThirdPartyAuthBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ThirdPartyAuth']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project-tpa-integration': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n tpa_id: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ThirdPartyAuth']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-delete-project-tpa-integration': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n tpa_id: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ThirdPartyAuth']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-pause-a-project': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-available-restore-versions': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['GetProjectAvailableRestoreVersionsResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-restore-a-project': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-cancel-a-project-restoration': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-project-addons': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ListProjectAddonsResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to list project addons */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-apply-project-addon': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['ApplyProjectAddonBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to apply project addon */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-remove-project-addon': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n addon_variant: unknown\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to remove project addon */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project-claim-token': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ProjectClaimTokenResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-create-project-claim-token': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['CreateProjectClaimTokenResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-delete-project-claim-token': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 204: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-performance-advisors': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1ProjectAdvisorsResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-security-advisors': {\n parameters: {\n query?: {\n lint_type?: 'sql'\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1ProjectAdvisorsResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project-logs': {\n parameters: {\n query?: {\n sql?: string\n iso_timestamp_start?: string\n iso_timestamp_end?: string\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['AnalyticsResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project-usage-api-count': {\n parameters: {\n query?: {\n interval?: '15min' | '30min' | '1hr' | '3hr' | '1day' | '3day' | '7day'\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['AnalyticsResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to get project's usage api counts */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-project-usage-request-count': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['AnalyticsResponse']\n }\n }\n /** @description Failed to get project's usage api requests count */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-migration-history': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1ListMigrationsResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to list database migrations */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-upsert-a-migration': {\n parameters: {\n query?: never\n header?: {\n /** @description A unique key to ensure the same migration is tracked only once. */\n 'Idempotency-Key'?: string\n }\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['V1UpsertMigrationBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to upsert database migration */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-apply-a-migration': {\n parameters: {\n query?: never\n header?: {\n /** @description A unique key to ensure the same migration is tracked only once. */\n 'Idempotency-Key'?: string\n }\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['V1CreateMigrationBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to apply database migration */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-run-a-query': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['V1RunQueryBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to run sql query */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-enable-database-webhook': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to enable Database Webhooks on the project */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-database-metadata': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['GetProjectDbMetadataResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-all-functions': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['FunctionResponse'][]\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve project's functions */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-bulk-update-functions': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['BulkUpdateFunctionBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['BulkUpdateFunctionResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to update functions */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-create-a-function': {\n parameters: {\n query?: {\n slug?: string\n name?: string\n /** @description Boolean string, true or false */\n verify_jwt?: boolean\n /** @description Boolean string, true or false */\n import_map?: boolean\n entrypoint_path?: string\n import_map_path?: string\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/vnd.denoland.eszip': string\n 'application/json': components['schemas']['V1CreateFunctionBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['FunctionResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to create project's function */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-deploy-a-function': {\n parameters: {\n query?: {\n slug?: string\n /** @description Boolean string, true or false */\n bundleOnly?: boolean\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'multipart/form-data': components['schemas']['FunctionDeployBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['DeployFunctionResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to deploy function */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-a-function': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n /** @description Function slug */\n function_slug: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['FunctionSlugResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve function with given slug */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-delete-a-function': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n /** @description Function slug */\n function_slug: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to delete function with given slug */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-a-function': {\n parameters: {\n query?: {\n slug?: string\n name?: string\n /** @description Boolean string, true or false */\n verify_jwt?: boolean\n /** @description Boolean string, true or false */\n import_map?: boolean\n entrypoint_path?: string\n import_map_path?: string\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n /** @description Function slug */\n function_slug: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/vnd.denoland.eszip': string\n 'application/json': components['schemas']['V1UpdateFunctionBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['FunctionResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to update function with given slug */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-a-function-body': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n /** @description Function slug */\n function_slug: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['StreamableFile']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to retrieve function body with given slug */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-all-buckets': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1StorageBucketResponse'][]\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to get list of buckets */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-all-sso-provider': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['ListProvidersResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description SAML 2.0 support is not enabled for this project */\n 404: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-create-a-sso-provider': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['CreateProviderBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['CreateProviderResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description SAML 2.0 support is not enabled for this project */\n 404: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-a-sso-provider': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n provider_id: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['GetProviderResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Either SAML 2.0 was not enabled for this project, or the provider does not exist */\n 404: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-update-a-sso-provider': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n provider_id: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['UpdateProviderBody']\n }\n }\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['UpdateProviderResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Either SAML 2.0 was not enabled for this project, or the provider does not exist */\n 404: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-delete-a-sso-provider': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n provider_id: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['DeleteProviderResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Either SAML 2.0 was not enabled for this project, or the provider does not exist */\n 404: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-all-backups': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1BackupsResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to get backups */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-restore-pitr-backup': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['V1RestorePitrBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-restore-point': {\n parameters: {\n query?: {\n name?: string\n }\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1RestorePointResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n /** @description Failed to get requested restore points */\n 500: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-create-restore-point': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['V1RestorePointPostBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1RestorePointResponse']\n }\n }\n }\n }\n 'v1-undo': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Project ref */\n ref: string\n }\n cookie?: never\n }\n requestBody: {\n content: {\n 'application/json': components['schemas']['V1UndoBody']\n }\n }\n responses: {\n 201: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-list-organization-members': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Organization slug */\n slug: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1OrganizationMemberResponse'][]\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-an-organization': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Organization slug */\n slug: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['V1OrganizationSlugResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-get-organization-project-claim': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Organization slug */\n slug: string\n token: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 200: {\n headers: {\n [name: string]: unknown\n }\n content: {\n 'application/json': components['schemas']['OrganizationProjectClaimResponse']\n }\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n 'v1-claim-project-for-organization': {\n parameters: {\n query?: never\n header?: never\n path: {\n /** @description Organization slug */\n slug: string\n token: string\n }\n cookie?: never\n }\n requestBody?: never\n responses: {\n 204: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n 403: {\n headers: {\n [name: string]: unknown\n }\n content?: never\n }\n }\n }\n}\n",
|
|
"type": "registry:lib"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/lib/management-api.ts",
|
|
"content": "import createClient from 'openapi-fetch'\nimport type { paths } from './management-api-schema'\n\nexport const client = createClient<paths>({\n baseUrl: '/api/supabase-proxy',\n})\n",
|
|
"type": "registry:lib"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/lib/pg-meta/sql.ts",
|
|
"content": "export const columnsSql = `\nSELECT\n c.oid :: int8 AS table_id,\n nc.nspname AS schema,\n c.relname AS table,\n (c.oid || '.' || a.attnum) AS id,\n a.attnum AS ordinal_position,\n a.attname AS name,\n CASE\n WHEN a.atthasdef THEN pg_get_expr(ad.adbin, ad.adrelid)\n ELSE NULL\n END AS default_value,\n CASE\n WHEN t.typtype = 'd' THEN CASE\n WHEN bt.typelem <> 0 :: oid\n AND bt.typlen = -1 THEN 'ARRAY'\n WHEN nbt.nspname = 'pg_catalog' THEN format_type(t.typbasetype, NULL)\n ELSE 'USER-DEFINED'\n END\n ELSE CASE\n WHEN t.typelem <> 0 :: oid\n AND t.typlen = -1 THEN 'ARRAY'\n WHEN nt.nspname = 'pg_catalog' THEN format_type(a.atttypid, NULL)\n ELSE 'USER-DEFINED'\n END\n END AS data_type,\n COALESCE(bt.typname, t.typname) AS format,\n a.attidentity IN ('a', 'd') AS is_identity,\n CASE\n a.attidentity\n WHEN 'a' THEN 'ALWAYS'\n WHEN 'd' THEN 'BY DEFAULT'\n ELSE NULL\n END AS identity_generation,\n a.attgenerated IN ('s') AS is_generated,\n NOT (\n a.attnotnull\n OR t.typtype = 'd' AND t.typnotnull\n ) AS is_nullable,\n (\n c.relkind IN ('r', 'p')\n OR c.relkind IN ('v', 'f') AND pg_column_is_updatable(c.oid, a.attnum, FALSE)\n ) AS is_updatable,\n uniques.table_id IS NOT NULL AS is_unique,\n check_constraints.definition AS \"check\",\n array_to_json(\n array(\n SELECT\n enumlabel\n FROM\n pg_catalog.pg_enum enums\n WHERE\n enums.enumtypid = coalesce(bt.oid, t.oid)\n OR enums.enumtypid = coalesce(bt.typelem, t.typelem)\n ORDER BY\n enums.enumsortorder\n )\n ) AS enums,\n col_description(c.oid, a.attnum) AS comment\nFROM\n pg_attribute a\n LEFT JOIN pg_attrdef ad ON a.attrelid = ad.adrelid\n AND a.attnum = ad.adnum\n JOIN (\n pg_class c\n JOIN pg_namespace nc ON c.relnamespace = nc.oid\n ) ON a.attrelid = c.oid\n JOIN (\n pg_type t\n JOIN pg_namespace nt ON t.typnamespace = nt.oid\n ) ON a.atttypid = t.oid\n LEFT JOIN (\n pg_type bt\n JOIN pg_namespace nbt ON bt.typnamespace = nbt.oid\n ) ON t.typtype = 'd'\n AND t.typbasetype = bt.oid\n LEFT JOIN (\n SELECT DISTINCT ON (table_id, ordinal_position)\n conrelid AS table_id,\n conkey[1] AS ordinal_position\n FROM pg_catalog.pg_constraint\n WHERE contype = 'u' AND cardinality(conkey) = 1\n ) AS uniques ON uniques.table_id = c.oid AND uniques.ordinal_position = a.attnum\n LEFT JOIN (\n -- We only select the first column check\n SELECT DISTINCT ON (table_id, ordinal_position)\n conrelid AS table_id,\n conkey[1] AS ordinal_position,\n substring(\n pg_get_constraintdef(pg_constraint.oid, true),\n 8,\n length(pg_get_constraintdef(pg_constraint.oid, true)) - 8\n ) AS \"definition\"\n FROM pg_constraint\n WHERE contype = 'c' AND cardinality(conkey) = 1\n ORDER BY table_id, ordinal_position, oid asc\n ) AS check_constraints ON check_constraints.table_id = c.oid AND check_constraints.ordinal_position = a.attnum\nWHERE\n NOT pg_is_other_temp_schema(nc.oid)\n AND a.attnum > 0\n AND NOT a.attisdropped\n AND (c.relkind IN ('r', 'v', 'm', 'f', 'p'))\n AND (\n pg_has_role(c.relowner, 'USAGE')\n OR has_column_privilege(\n c.oid,\n a.attnum,\n 'SELECT, INSERT, UPDATE, REFERENCES'\n )\n )\n`\n\nexport const tablesSql = `\nSELECT\n c.oid :: int8 AS id,\n nc.nspname AS schema,\n c.relname AS name,\n c.relrowsecurity AS rls_enabled,\n c.relforcerowsecurity AS rls_forced,\n CASE\n WHEN c.relreplident = 'd' THEN 'DEFAULT'\n WHEN c.relreplident = 'i' THEN 'INDEX'\n WHEN c.relreplident = 'f' THEN 'FULL'\n ELSE 'NOTHING'\n END AS replica_identity,\n pg_total_relation_size(format('%I.%I', nc.nspname, c.relname)) :: int8 AS bytes,\n pg_size_pretty(\n pg_total_relation_size(format('%I.%I', nc.nspname, c.relname))\n ) AS size,\n pg_stat_get_live_tuples(c.oid) AS live_rows_estimate,\n pg_stat_get_dead_tuples(c.oid) AS dead_rows_estimate,\n obj_description(c.oid) AS comment,\n coalesce(pk.primary_keys, '[]') as primary_keys,\n coalesce(\n jsonb_agg(relationships) filter (where relationships is not null),\n '[]'\n ) as relationships\nFROM\n pg_namespace nc\n JOIN pg_class c ON nc.oid = c.relnamespace\n left join (\n select\n table_id,\n jsonb_agg(_pk.*) as primary_keys\n from (\n select\n n.nspname as schema,\n c.relname as table_name,\n a.attname as name,\n c.oid :: int8 as table_id\n from\n pg_index i,\n pg_class c,\n pg_attribute a,\n pg_namespace n\n where\n i.indrelid = c.oid\n and c.relnamespace = n.oid\n and a.attrelid = c.oid\n and a.attnum = any (i.indkey)\n and i.indisprimary\n ) as _pk\n group by table_id\n ) as pk\n on pk.table_id = c.oid\n left join (\n select\n c.oid :: int8 as id,\n c.conname as constraint_name,\n nsa.nspname as source_schema,\n csa.relname as source_table_name,\n sa.attname as source_column_name,\n nta.nspname as target_table_schema,\n cta.relname as target_table_name,\n ta.attname as target_column_name\n from\n pg_constraint c\n join (\n pg_attribute sa\n join pg_class csa on sa.attrelid = csa.oid\n join pg_namespace nsa on csa.relnamespace = nsa.oid\n ) on sa.attrelid = c.conrelid and sa.attnum = any (c.conkey)\n join (\n pg_attribute ta\n join pg_class cta on ta.attrelid = cta.oid\n join pg_namespace nta on cta.relnamespace = nta.oid\n ) on ta.attrelid = c.confrelid and ta.attnum = any (c.confkey)\n where\n c.contype = 'f'\n ) as relationships\n on (relationships.source_schema = nc.nspname and relationships.source_table_name = c.relname)\n or (relationships.target_table_schema = nc.nspname and relationships.target_table_name = c.relname)\nWHERE\n c.relkind IN ('r', 'p')\n AND NOT pg_is_other_temp_schema(nc.oid)\n AND (\n pg_has_role(c.relowner, 'USAGE')\n OR has_table_privilege(\n c.oid,\n 'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER'\n )\n OR has_any_column_privilege(c.oid, 'SELECT, INSERT, UPDATE, REFERENCES')\n )\ngroup by\n c.oid,\n c.relname,\n c.relrowsecurity,\n c.relforcerowsecurity,\n c.relreplident,\n nc.nspname,\n pk.primary_keys\n`\n\nexport const extensionsSql = `\nSELECT\n e.name,\n n.nspname AS schema,\n e.default_version,\n x.extversion AS installed_version,\n e.comment\nFROM\n pg_available_extensions() e(name, default_version, comment)\n LEFT JOIN pg_extension x ON e.name = x.extname\n LEFT JOIN pg_namespace n ON x.extnamespace = n.oid\n`\n",
|
|
"type": "registry:lib"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/lib/pg-meta/index.ts",
|
|
"content": "import { stripIndent } from 'common-tags'\n\nimport { columnsSql, extensionsSql, tablesSql } from './sql'\n\nexport const SYSTEM_SCHEMAS = [\n 'information_schema',\n 'pg_catalog',\n 'pg_toast',\n '_timescaledb_internal',\n]\n\n/**\n * Generates the SQL query to list tables in the database.\n */\nexport function listTablesSql(schemas: string[] = []) {\n let sql = stripIndent`\n with\n tables as (${tablesSql}),\n columns as (${columnsSql})\n select\n *,\n ${coalesceRowsToArray('columns', 'columns.table_id = tables.id')}\n from tables\n `\n\n sql += '\\n'\n\n if (schemas.length > 0) {\n sql += `where schema in (${schemas.map((s) => `'${s}'`).join(',')})`\n } else {\n sql += `where schema not in (${SYSTEM_SCHEMAS.map((s) => `'${s}'`).join(',')})`\n }\n\n return sql\n}\n\n/**\n * Generates the SQL query to list all extensions in the database.\n */\nexport function listExtensionsSql() {\n return extensionsSql\n}\n\n/**\n * Generates a SQL segment that coalesces rows into an array of JSON objects.\n */\nexport const coalesceRowsToArray = (source: string, filter: string) => {\n return stripIndent`\n COALESCE(\n (\n SELECT\n array_agg(row_to_json(${source})) FILTER (WHERE ${filter})\n FROM\n ${source}\n ),\n '{}'\n ) AS ${source}\n `\n}\n",
|
|
"type": "registry:lib"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/lib/pg-meta/types.ts",
|
|
"content": "import { z } from 'zod'\n\nexport const postgresPrimaryKeySchema = z.object({\n schema: z.string(),\n table_name: z.string(),\n name: z.string(),\n table_id: z.number().int(),\n})\n\nexport const postgresRelationshipSchema = z.object({\n id: z.number().int(),\n constraint_name: z.string(),\n source_schema: z.string(),\n source_table_name: z.string(),\n source_column_name: z.string(),\n target_table_schema: z.string(),\n target_table_name: z.string(),\n target_column_name: z.string(),\n})\n\nexport const postgresColumnSchema = z.object({\n table_id: z.number().int(),\n schema: z.string(),\n table: z.string(),\n id: z.string().regex(/^(\\d+)\\.(\\d+)$/),\n ordinal_position: z.number().int(),\n name: z.string(),\n default_value: z.any(),\n data_type: z.string(),\n format: z.string(),\n is_identity: z.boolean(),\n identity_generation: z.union([z.literal('ALWAYS'), z.literal('BY DEFAULT'), z.null()]),\n is_generated: z.boolean(),\n is_nullable: z.boolean(),\n is_updatable: z.boolean(),\n is_unique: z.boolean(),\n enums: z.array(z.string()),\n check: z.union([z.string(), z.null()]),\n comment: z.union([z.string(), z.null()]),\n})\n\nexport const postgresTableSchema = z.object({\n id: z.number().int(),\n schema: z.string(),\n name: z.string(),\n rls_enabled: z.boolean(),\n rls_forced: z.boolean(),\n replica_identity: z.union([\n z.literal('DEFAULT'),\n z.literal('INDEX'),\n z.literal('FULL'),\n z.literal('NOTHING'),\n ]),\n bytes: z.number().int(),\n size: z.string(),\n live_rows_estimate: z.number().int(),\n dead_rows_estimate: z.number().int(),\n comment: z.string().nullable(),\n columns: z.array(postgresColumnSchema).optional(),\n primary_keys: z.array(postgresPrimaryKeySchema),\n relationships: z.array(postgresRelationshipSchema),\n})\n\nexport const postgresExtensionSchema = z.object({\n name: z.string(),\n schema: z.union([z.string(), z.null()]),\n default_version: z.string(),\n installed_version: z.union([z.string(), z.null()]),\n comment: z.union([z.string(), z.null()]),\n})\n\nexport type PostgresPrimaryKey = z.infer<typeof postgresPrimaryKeySchema>\nexport type PostgresRelationship = z.infer<typeof postgresRelationshipSchema>\nexport type PostgresColumn = z.infer<typeof postgresColumnSchema>\nexport type PostgresTable = z.infer<typeof postgresTableSchema>\nexport type PostgresExtension = z.infer<typeof postgresExtensionSchema>\n",
|
|
"type": "registry:lib"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/lib/schemas/auth.ts",
|
|
"content": "import { z } from 'zod'\n\n// Field labels mapping for form generation\nexport const authFieldLabels: Record<\n string,\n string | { label: string; options?: Record<string, string> }\n> = {\n // General Settings\n disable_signup: 'Disable Signup',\n external_anonymous_users_enabled: 'Allow Anonymous Sign-ins',\n\n // Email Provider\n external_email_enabled: 'Enable Email Provider',\n mailer_autoconfirm: 'Confirm Email',\n mailer_secure_email_change_enabled: 'Secure Email Change',\n security_update_password_require_reauthentication: 'Secure Password Change',\n password_hibp_enabled: 'Prevent Leaked Passwords',\n password_min_length: 'Minimum Password Length',\n password_required_characters: {\n label: 'Password Requirements',\n options: {\n NO_REQUIRED_CHARS: 'No requirements',\n 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789': 'Letters and numbers',\n 'abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789':\n 'Lowercase, uppercase, and numbers',\n 'abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};\\'\\\\\\\\:\"|<>?,./`~':\n 'Letters, numbers, and symbols',\n },\n },\n mailer_otp_exp: 'Email OTP Expiration (seconds)',\n mailer_otp_length: 'Email OTP Length',\n\n // Phone Provider\n external_phone_enabled: 'Enable Phone Provider',\n sms_provider: {\n label: 'SMS Provider',\n options: {\n twilio: 'Twilio',\n messagebird: 'MessageBird',\n textlocal: 'TextLocal',\n vonage: 'Vonage',\n twilio_verify: 'Twilio Verify',\n },\n },\n sms_twilio_account_sid: 'Twilio Account SID',\n sms_twilio_auth_token: 'Twilio Auth Token',\n sms_twilio_message_service_sid: 'Twilio Message Service SID',\n sms_twilio_content_sid: 'Twilio Content SID',\n sms_twilio_verify_account_sid: 'Twilio Verify Account SID',\n sms_twilio_verify_auth_token: 'Twilio Verify Auth Token',\n sms_twilio_verify_message_service_sid: 'Twilio Verify Message Service SID',\n sms_messagebird_access_key: 'MessageBird Access Key',\n sms_messagebird_originator: 'MessageBird Originator',\n sms_textlocal_api_key: 'TextLocal API Key',\n sms_textlocal_sender: 'TextLocal Sender',\n sms_vonage_api_key: 'Vonage API Key',\n sms_vonage_api_secret: 'Vonage API Secret',\n sms_vonage_from: 'Vonage From Number',\n sms_autoconfirm: 'Enable Phone Confirmations',\n sms_otp_exp: 'SMS OTP Expiry (seconds)',\n sms_otp_length: 'SMS OTP Length',\n sms_template: 'SMS Message Template',\n sms_test_otp: 'Test Phone Numbers and OTPs',\n sms_test_otp_valid_until: 'Test OTPs Valid Until',\n\n // Google Provider\n external_google_enabled: 'Enable Google Sign-in',\n external_google_client_id: 'Google Client ID(s)',\n external_google_secret: 'Google OAuth Client Secret',\n external_google_skip_nonce_check: 'Skip Nonce Check',\n\n // Secrets\n name: 'Secret Name',\n value: 'Secret Value',\n secretNames: 'Secret Names',\n}\n\n// New schemas for auth settings\n\nexport const authGeneralSettingsSchema = z.object({\n disable_signup: z.boolean().optional().describe('This will prevent new users from signing up.'),\n external_anonymous_users_enabled: z\n .boolean()\n .optional()\n .describe('This will enable anonymous users to sign in to your application.'),\n})\nexport type AuthGeneralSettingsSchema = z.infer<typeof authGeneralSettingsSchema>\n\nconst NO_REQUIRED_CHARACTERS = 'NO_REQUIRED_CHARS'\n\nexport const authEmailProviderSchema = z\n .object({\n external_email_enabled: z\n .boolean()\n .optional()\n .describe('This will enable Email based signup and login for your application.'),\n mailer_autoconfirm: z\n .boolean()\n .optional()\n .describe(\n 'Users will need to confirm their email address before signing in for the first time.'\n ),\n mailer_secure_email_change_enabled: z\n .boolean()\n .optional()\n .describe(\n 'Users will be required to confirm any email change on both the old email address and new email address. If disabled, only the new email is required to confirm.'\n ),\n security_update_password_require_reauthentication: z\n .boolean()\n .optional()\n .describe(\n 'Users will need to be recently logged in to change their password without requiring reauthentication. (A user is considered recently logged in if the session was created within the last 24 hours.) If disabled, a user can change their password at any time.'\n ),\n password_hibp_enabled: z\n .boolean()\n .optional()\n .describe(\n 'Rejects the use of known or easy to guess passwords on sign up or password change. Powered by the HaveIBeenPwned.org Pwned Passwords API.'\n ),\n password_min_length: z\n .number()\n .int()\n .min(6, 'Must be greater or equal to 6.')\n .describe(\n 'Passwords shorter than this value will be rejected as weak. Minimum 6, recommended 8 or more.'\n ),\n password_required_characters: z\n .preprocess(\n (val) => (val === '' || val === null || val === undefined ? NO_REQUIRED_CHARACTERS : val),\n z.enum([\n NO_REQUIRED_CHARACTERS,\n 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789',\n 'abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789',\n 'abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:0123456789:!@#$%^&*()_+-=[]{};\\'\\\\\\\\:\"|<>?,./`~',\n ])\n )\n .optional()\n .transform((val) => (val === NO_REQUIRED_CHARACTERS ? '' : val))\n .describe('Passwords that do not have at least one of each will be rejected as weak.'),\n mailer_otp_exp: z\n .number()\n .int()\n .min(0, 'Must be more than 0')\n .max(86400, 'Must be no more than 86400')\n .describe('Duration before an email otp / link expires in seconds.'),\n mailer_otp_length: z\n .number()\n .int()\n .min(6, 'Must be at least 6')\n .max(10, 'Must be no more than 10')\n .optional()\n .describe('Number of digits in the email OTP'),\n })\n .describe('Email provider settings.')\nexport type AuthEmailProviderSchema = z.infer<typeof authEmailProviderSchema>\n\nexport const authPhoneProviderSchema = z\n .object({\n external_phone_enabled: z\n .boolean()\n .optional()\n .describe('This will enable phone based login for your application'),\n sms_provider: z\n .enum(['twilio', 'messagebird', 'textlocal', 'vonage', 'twilio_verify'])\n .optional()\n .describe('External provider that will handle sending SMS messages'),\n // Twilio\n sms_twilio_account_sid: z.string().optional(),\n sms_twilio_auth_token: z.string().optional(),\n sms_twilio_message_service_sid: z.string().optional(),\n sms_twilio_content_sid: z\n .string()\n .optional()\n .describe('Twilio Content SID (Optional, For WhatsApp Only)'),\n // Twilio Verify\n sms_twilio_verify_account_sid: z.string().optional(),\n sms_twilio_verify_auth_token: z.string().optional(),\n sms_twilio_verify_message_service_sid: z.string().optional(),\n // Messagebird\n sms_messagebird_access_key: z.string().optional(),\n sms_messagebird_originator: z.string().optional(),\n // Textlocal\n sms_textlocal_api_key: z.string().optional(),\n sms_textlocal_sender: z.string().optional(),\n // Vonage\n sms_vonage_api_key: z.string().optional(),\n sms_vonage_api_secret: z.string().optional(),\n sms_vonage_from: z.string().optional(),\n // SMS Confirm settings\n sms_autoconfirm: z\n .boolean()\n .optional()\n .describe('Users will need to confirm their phone number before signing in.'),\n sms_otp_exp: z\n .number()\n .int()\n .optional()\n .describe('Duration before an SMS OTP expires in seconds.'),\n sms_otp_length: z.number().int().optional().describe('Number of digits in OTP.'),\n sms_template: z.string().optional().describe('To format the OTP code use `{{ .Code }}`'),\n sms_test_otp: z\n .string()\n .optional()\n .describe(\n 'Register phone number and OTP combinations for testing as a comma separated list of <phone number>=<otp> pairs. Example: `18005550123=789012`'\n ),\n sms_test_otp_valid_until: z\n .string()\n .datetime({ message: 'Invalid datetime string.' })\n .optional()\n .describe(\n \"Test phone number and OTP combinations won't be active past this date and time (local time zone).\"\n ),\n })\n .describe('Phone provider settings.')\nexport type AuthPhoneProviderSchema = z.infer<typeof authPhoneProviderSchema>\n\nexport const authGoogleProviderObject = z.object({\n external_google_enabled: z.boolean().optional().describe('Enable Sign in with Google'),\n external_google_client_id: z\n .string()\n .regex(\n /^([a-z0-9-]+\\.[a-z0-9-]+(\\.[a-z0-9-]+)*(,[a-z0-9-]+\\.[a-z0-9-]+(\\.[a-z0-9-]+)*)*)$/i,\n 'Google Client IDs should be a comma-separated list of domain-like strings.'\n )\n .optional(),\n external_google_secret: z\n .string()\n .regex(\n /^[a-z0-9.\\/_-]*$/i,\n 'Google OAuth Client Secrets usually contain letters, numbers, dots, dashes, and underscores.'\n )\n .optional(),\n external_google_skip_nonce_check: z\n .boolean()\n .optional()\n .describe('Allows ID tokens with any nonce to be accepted, which is less secure.'),\n})\n\nexport const authGoogleProviderSchema = authGoogleProviderObject\n .superRefine((data, ctx) => {\n if (data.external_google_enabled && !data.external_google_client_id) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['external_google_client_id'],\n message: 'At least one Client ID is required when Google sign-in is enabled.',\n })\n }\n if (data.external_google_client_id && data.external_google_client_id.includes(' ')) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['external_google_client_id'],\n message: 'Client IDs should not contain spaces.',\n })\n }\n })\n .describe('Google provider settings.')\nexport type AuthGoogleProviderSchema = z.infer<typeof authGoogleProviderSchema>\n\nexport const authConfigUpdateSchema = authGeneralSettingsSchema\n .merge(authEmailProviderSchema)\n .merge(authPhoneProviderSchema)\n .merge(authGoogleProviderObject)\n\nexport type AuthConfigUpdateSchema = z.infer<typeof authConfigUpdateSchema>\n\n// A version used for partial updates (all fields optional)\nexport const authConfigUpdatePayloadSchema = authConfigUpdateSchema.partial()\n",
|
|
"type": "registry:lib"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/lib/schemas/secrets.ts",
|
|
"content": "import z from 'zod'\n\nexport const secretsSchema = z\n .object({\n secrets: z.array(\n z.object({\n name: z\n .string()\n .min(1, 'Secret name is required.')\n .regex(\n /^[a-zA-Z_][a-zA-Z0-9_]*$/,\n 'Must contain letters, numbers, and underscores, starting with a letter or underscore.'\n ),\n value: z.string().min(1, 'Secret value is required.'),\n })\n ),\n })\n .describe('Secrets schema for managing environment variables.')\n\nexport type SecretsSchema = z.infer<typeof secretsSchema>\n\nexport const deleteSecretsSchema = z\n .object({\n secretNames: z\n .array(z.string().min(1, 'Secret name cannot be empty.'))\n .min(1, 'At least one secret name is required.'),\n })\n .describe('Schema for deleting secrets by name.')\nexport type DeleteSecretsSchema = z.infer<typeof deleteSecretsSchema>\n",
|
|
"type": "registry:lib"
|
|
},
|
|
{
|
|
"path": "registry/default/platform/platform-kit-nextjs/contexts/SheetNavigationContext.tsx",
|
|
"content": "'use client'\n\nimport { createContext, useContext, useState, ReactNode, useMemo, useCallback } from 'react'\n\ntype StackItem = {\n title: string\n component: ReactNode\n}\n\ntype SheetNavigationContextType = {\n stack: StackItem[]\n push: (item: StackItem) => void\n pop: () => void\n popTo: (index: number) => void\n reset: () => void\n}\n\nconst SheetNavigationContext = createContext<SheetNavigationContextType | undefined>(undefined)\n\nexport function SheetNavigationProvider({\n children,\n onStackEmpty,\n initialStack = [],\n}: {\n children: ReactNode\n onStackEmpty?: () => void\n initialStack?: StackItem[]\n}) {\n const [stack, setStack] = useState<StackItem[]>(initialStack)\n\n const push = useCallback((item: StackItem) => {\n setStack((prev) => [...prev, item])\n }, [])\n\n const pop = useCallback(() => {\n setStack((prev) => {\n const newStack = prev.slice(0, -1)\n if (newStack.length === 0) {\n onStackEmpty?.()\n }\n return newStack\n })\n }, [onStackEmpty])\n\n const popTo = useCallback((index: number) => {\n if (index < 0) return\n setStack((prev) => prev.slice(0, index + 1))\n }, [])\n\n const reset = useCallback(() => {\n setStack([])\n onStackEmpty?.()\n }, [onStackEmpty])\n\n const value = useMemo(\n () => ({ stack, push, pop, popTo, reset }),\n [stack, push, pop, popTo, reset]\n )\n\n return <SheetNavigationContext.Provider value={value}>{children}</SheetNavigationContext.Provider>\n}\n\nexport function useSheetNavigation() {\n const context = useContext(SheetNavigationContext)\n if (context === undefined) {\n throw new Error('useSheetNavigation must be used within a SheetNavigationProvider')\n }\n return context\n}\n",
|
|
"type": "registry:component",
|
|
"target": "contexts/SheetNavigationContext.tsx"
|
|
}
|
|
]
|
|
} |