Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore(docs): clean dead code (#34021)

Charis12152c334537
diff --git a/apps/docs/components/ComesFrom.tsx b/apps/docs/components/ComesFrom.tsx
deleted file mode 100644
index 52d55c0c0de..00000000000
--- a/apps/docs/components/ComesFrom.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Search } from 'lucide-react'
-import { FC } from 'react'
-// [Terry] — delete this after development
-// just for making it easy to see where things are coming from
-interface Props {
- link: string
- text: string
- className?: string
-}
-export const ComesFrom: FC<Props> = ({ link, text, className }) => {
- return (
- <div className={`comes-from text-xs flex items-center gap-2 -mb-6 ${className}`}>
- <span className="uppercase bg-slate-100 p-1 text-slate-600 flex gap-2 items-center">
- <Search size={14} />
- Comes from:
- </span>
- <a className="text-slate-600 no-underline hover:underline" href={link}>
- {text}
- </a>
- </div>
- )
-}
diff --git a/apps/docs/components/DateFormat.tsx b/apps/docs/components/DateFormat.tsx
deleted file mode 100644
index ed72ced0f0d..00000000000
--- a/apps/docs/components/DateFormat.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-export function DateFormat({
- date,
- options,
-}: {
- date: string
- options?: Intl.DateTimeFormatOptions
-}) {
- const dateObject = new Date(date)
- return (
- <time dateTime={dateObject.toISOString()} suppressHydrationWarning>
- {dateObject.toLocaleDateString(undefined, options)}
- </time>
- )
-}
diff --git a/apps/docs/components/FooterHelpCallout.tsx b/apps/docs/components/FooterHelpCallout.tsx
deleted file mode 100644
index 82ee40b9a44..00000000000
--- a/apps/docs/components/FooterHelpCallout.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { ReactMarkdown } from 'react-markdown/lib/react-markdown'
-
-export type FooterHelpCalloutType = 'default' | 'postgres'
-
-const content = {
- default: {
- title: 'Need some help?',
- description: `Not to worry, our specialist engineers are here to help. Submit a support ticket through the [Dashboard](https://supabase.com/dashboard/support/new).`,
- },
- postgres: {
- title: 'Looking for Serverless Postgres?',
- description: `Supabase is the fastest way to get started with Postgres in a serverless environment. [Learn more](https://supabase.com/database?utm=postgres-helpers).`,
- },
-}
-
-const FooterHelpCallout = ({
- footerHelpType = 'default',
- title,
-}: {
- footerHelpType: FooterHelpCalloutType
- title: any
-}) => {
- return (
- <div className="mt-32 prose prose--remove-p-margin max-w-none">
- <div
- className="
- min-w-full
- px-8 py-6
- bg-background
- rounded
- text-sm text-foreground-muted
- "
- >
- <h5 className="text-sm text-foreground-light m-0">{content[footerHelpType].title}</h5>
- <ReactMarkdown>{content[footerHelpType].description}</ReactMarkdown>
- </div>
- </div>
- )
-}
-
-export default FooterHelpCallout
diff --git a/apps/docs/components/LinkCard.tsx b/apps/docs/components/LinkCard.tsx
deleted file mode 100644
index bb7ba40f7ef..00000000000
--- a/apps/docs/components/LinkCard.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import Link from 'next/link'
-
-export default function LinkCard({
- title,
- description,
- icon,
- link,
-}: {
- title: string
- description: string
- icon: any
- link: string
-}) {
- return (
- <Link
- href={link || '#'}
- className="border-background hover:border-brand bg-surface-200 m-4 w-full cursor-pointer rounded-md border p-4 shadow-sm hover:shadow-2xl lg:w-2/5"
- >
- {description ? (
- <>
- <h4 className="m-0 mb-4 p-0 text-base font-semibold">{title}</h4>
- <p className="text-foreground-light m-0 p-0">{description}</p>
- </>
- ) : (
- <div className="flex">
- {icon}
- <p className="text-foreground m-0 p-0">{title}</p>
- </div>
- )}
- </Link>
- )
-}
diff --git a/apps/docs/components/LinkCardsWrapper.tsx b/apps/docs/components/LinkCardsWrapper.tsx
deleted file mode 100644
index a268902457d..00000000000
--- a/apps/docs/components/LinkCardsWrapper.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { ReactElement } from 'react'
-
-export default function LinkCardsWrapper({ children }: { children: any }) {
- return <div className="flex w-full flex-col lg:flex-row lg:flex-wrap">{children}</div>
-}
diff --git a/apps/docs/components/Pagination.tsx b/apps/docs/components/Pagination.tsx
deleted file mode 100644
index abf31a8c51e..00000000000
--- a/apps/docs/components/Pagination.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { ArrowLeft, ArrowRight } from 'lucide-react'
-import Link from 'next/link'
-
-const Pagination = ({ currentPage, totalCount }: { currentPage: number; totalCount: number }) => {
- // TODO: not sure if this is the most efficient way to do this. may need to refactor.
- const totalArray = Array.from({ length: totalCount }, (_, i: number) => i + 1)
- const pages = totalArray.filter((page: number) => {
- return page >= currentPage - 2 && page <= currentPage + 2
- })
-
- return (
- <ul className="flex justify-center space-x-1 text-xs font-medium">
- <li>
- <Link
- href={`/discussions?page=${currentPage - 1}`}
- className="border border-control bg-surface-100 inline-flex h-8 w-8 items-center justify-center rounded"
- >
- <ArrowLeft className="stroke-2 transition group-hover:-translate-x-1" height={12.5} />
- </Link>
- </li>
- {pages.map((page: number, i: number) => {
- i = i + 1
- return (
- <li key={i}>
- <Link
- href={`/discussions?page=${page}`}
- className={`border-scale-600 inline-flex h-8 w-8 items-center justify-center rounded border ${
- currentPage === page ? 'bg-brand' : 'bg-surface-100'
- }`}
- >
- {page}
- </Link>
- </li>
- )
- })}
- <li>
- <Link
- href={`/discussions?page=${currentPage + 1}`}
- className="border-control bg-surface-100 inline-flex h-8 w-8 items-center justify-center rounded border"
- >
- <ArrowRight className="stroke-2 transition group-hover:-translate-x-1" height={12.5} />
- </Link>
- </li>
- </ul>
- )
-}
-
-export default Pagination
diff --git a/apps/docs/components/reference/ApiOperationSection.tsx b/apps/docs/components/reference/ApiOperationSection.tsx
deleted file mode 100644
index e1bb2f03efc..00000000000
--- a/apps/docs/components/reference/ApiOperationSection.tsx
+++ /dev/null
@@ -1,117 +0,0 @@
-import { CodeBlock } from 'ui'
-import Param from '~/components/Params'
-import { Tabs, TabPanel } from '~/features/ui/Tabs'
-import RefSubLayout from '~/layouts/ref/RefSubLayout'
-import { ReactMarkdown } from 'react-markdown/lib/react-markdown'
-
-const ApiOperationSection = (props) => {
- const operation = props.spec.operations.find((x: any) => x.operationId === props.funcData.id)
-
- // gracefully return nothing if function does not exist
- if (!operation) return <></>
-
- return (
- <RefSubLayout.Section
- key={operation.operationId}
- slug={operation.operationId}
- title={operation.summary}
- id={operation.operationId}
- scrollSpyHeader={true}
- monoFont={false}
- >
- <RefSubLayout.Details>
- <div className="mt-4">
- <code className="text-md flex gap-4 text-md text-foreground-lighter break-all">
- <span
- className="
- uppercase
- whitespace-nowrap
- bg-foreground text-background
- flex items-center justify-center
- rounded-full font-mono font-medium text-xs px-2 py-0.5"
- >
- {operation.operation}
- </span>
- {operation.path}
- </code>
- </div>
- <div className="prose py-4">
- <p>{operation.description}</p>
- </div>
- {/* Path Parameters */}
- {operation.parameters &&
- operation.parameters.filter((parameter) => parameter.in === 'path').length > 0 && (
- <div className="not-prose mt-12">
- <h5 className="mb-3 text-base text-foreground">Path Parameters</h5>
- <ul className="mt-4">
- {operation.parameters &&
- operation.parameters
- .filter((parameter: any) => parameter.in === 'path')
- .map((parameter: any, index: number) => (
- <Param key={index} {...parameter} isOptional={!parameter.required}></Param>
- ))}
- </ul>
- </div>
- )}
-
- {/* Query Parameters */}
- {operation.parameters &&
- operation.parameters.filter((parameter) => parameter.in === 'query').length > 0 && (
- <div className="not-prose mt-12">
- <h5 className="mb-3 text-base text-foreground">Query Parameters</h5>
- <ul className="mt-4">
- {operation.parameters &&
- operation.parameters
- .filter((parameter: any) => parameter.in === 'query')
- .map((parameter: any, index: number) => (
- <Param key={index} {...parameter} isOptional={!parameter.required}></Param>
- ))}
- </ul>
- </div>
- )}
-
- {/* Header Parameters */}
- {operation.parameters &&
- operation.parameters.filter((parameter) => parameter.in === 'header').length > 0 && (
- <div className="not-prose mt-12">
- <h5 className="mb-3 text-base text-foreground">Query Parameters</h5>
- <ul className="mt-4">
- {operation.parameters &&
- operation.parameters
- .filter((parameter: any) => parameter.in === 'header')
- .map((parameter: any, index) => (
- <Param key={index} {...parameter} isOptional={!parameter.required}></Param>
- ))}
- </ul>
- </div>
- )}
- </RefSubLayout.Details>
- {operation.responseList && operation.responseList.length > 0 && (
- <RefSubLayout.Examples>
- <h5 className="mb-3 text-base text-foreground">Responses</h5>
- <Tabs
- scrollable
- size="small"
- type="underlined"
- defaultActiveId={operation.responseList[0].responseCode}
- queryGroup="response-status"
- >
- {operation.responseList.map((response: any, i: number) => (
- <TabPanel key={i} id={response.responseCode} label={response.responseCode}>
- <ReactMarkdown className="text-foreground">{response.description}</ReactMarkdown>
- {response?.content && response?.content['application/json'] && (
- <div className="mt-8">
- <CodeBlock language="bash" className="relative">
- {JSON.stringify(response.content['application/json'], null, 2)}
- </CodeBlock>
- </div>
- )}
- </TabPanel>
- ))}
- </Tabs>
- </RefSubLayout.Examples>
- )}
- </RefSubLayout.Section>
- )
-}
-export default ApiOperationSection
diff --git a/apps/docs/components/reference/CLICommandSection.tsx b/apps/docs/components/reference/CLICommandSection.tsx
deleted file mode 100644
index 40b654d5576..00000000000
--- a/apps/docs/components/reference/CLICommandSection.tsx
+++ /dev/null
@@ -1,214 +0,0 @@
-import { ChevronRight } from 'lucide-react'
-import ReactMarkdown from 'react-markdown'
-import { CodeBlock } from 'ui'
-import Options from '~/components/Options'
-import Param from '~/components/Params'
-import { TabPanel, Tabs } from '~/features/ui/Tabs'
-import RefSubLayout from '~/layouts/ref/RefSubLayout'
-import spec from '~/spec/cli_v1_commands.yaml' with { type: 'yml' }
-import RefDetailCollapse from './RefDetailCollapse'
-
-export type Flag = {
- id: string
- name: string
- description: string
- default_value: string
- accepted_values: AcceptedValue[]
- required?: boolean
- /** Whether subcommands inherit this flag. */
- inherit?: boolean
-}
-
-export type AcceptedValue = {
- id: string
- name: string
- type: 'string' | 'boolean' | 'object'
- description?: string
-}
-
-export type Example = {
- id: string
- name: string
- code: string
- response: string
- description?: string
-}
-
-export type Command = {
- id: string
- title: string
- description: string
- flags?: Flag[]
- summary: string
- tags?: string[]
- links?: string[]
- subcommands?: string[]
- usage?: string
- examples?: Example[]
-}
-
-const CliCommandSection = (props) => {
- const command = spec.commands.find((x: any) => x.id === props.funcData.id)
- const parentCommand = spec.commands.find(
- (x: any) => x.subcommands && x.subcommands.find((y: any) => y === props.funcData.id)
- )
-
- const commandFlags = [
- ...(parentCommand?.flags?.filter((x: any) => x.inherit) || []),
- ...command.flags,
- ]
-
- return (
- <RefSubLayout.Section
- key={command.id}
- slug={command.id}
- title={'$ ' + command.title}
- id={command.id}
- monoFont={true}
- scrollSpyHeader={true}
- >
- <RefSubLayout.Details>
- <div className="grid ref-container" id={command.id}>
- <div className="border-b pb-8" key={command.id}>
- <header
- className={[
- // 'border-b sticky top-16 z-10',
- ' mb-16',
- ].join(' ')}
- >
- {command.description ? (
- <div className="prose">
- <ReactMarkdown>{command.description}</ReactMarkdown>
- </div>
- ) : (
- <p className="capitalize mb-4 scroll-mt-24 mt-0 text-foreground-light text-base">
- {command.summary}
- </p>
- )}
- </header>
-
- {command.subcommands?.length > 0 && (
- <div className="mb-3">
- <h3 className="text-lg text-foreground mb-3">Available Commands</h3>
- <ul>
- {command.subcommands.map((subcommand) => (
- <li key={subcommand} className="flex items-center gap-3">
- <div className="text-foreground-muted">
- <ChevronRight size={14} strokeWidth={2} />
- </div>
- <a
- href={`#${subcommand}`}
- className="transition text-foreground-light hover:text-brand"
- >
- $ {subcommand.replace(/-/g, ' ')}
- </a>
- </li>
- ))}
- </ul>
- </div>
- )}
- {commandFlags.length > 0 && (
- <>
- <h3 className="text-lg text-foreground mb-3">Flags</h3>
- <ul>
- {commandFlags.map((flag: Flag) => (
- <li key={flag.id} className="mt-0">
- <Param {...flag} isOptional={!flag.required}>
- {flag?.accepted_values && (
- <Options>
- {flag?.accepted_values.map((value) => {
- return <Options.Option key={value.id} {...value} />
- })}
- </Options>
- )}
- </Param>
- </li>
- ))}
- </ul>
- </>
- )}
- </div>
- </div>
- </RefSubLayout.Details>
- {(command.examples || command.usage) && (
- <RefSubLayout.Examples>
- <div className="overflow-hidden w-full">
- <Tabs
- defaultActiveId={`${command.id}-basic-usage`}
- size="tiny"
- type="rounded-pills"
- scrollable
- queryGroup="example"
- >
- {command.examples ? (
- command.examples.map((example) => {
- const exampleId = `${command.id}-${example.id}`
- return (
- <TabPanel
- id={exampleId}
- key={exampleId}
- label={example.name}
- className="flex flex-col gap-3"
- >
- <CodeBlock
- className="useless-code-block-class"
- language="bash"
- hideLineNumbers={true}
- >
- {example.code}
- </CodeBlock>
-
- <RefDetailCollapse
- id={`${exampleId}-response`}
- label="Response"
- defaultOpen={false}
- >
- <CodeBlock
- className="useless-code-block-class rounded !rounded-tl-none !rounded-tr-none border border-DEFAULT"
- language="bash"
- hideLineNumbers={true}
- >
- {example.response}
- </CodeBlock>
- </RefDetailCollapse>
-
- {example.description && (
- <RefDetailCollapse
- id={`${exampleId}-notes`}
- label="Notes"
- defaultOpen={false}
- >
- <div className="bg-overlay border border-overlay rounded !rounded-tl-none !rounded-tr-none prose max-w-none px-5 py-2">
- <ReactMarkdown className="text-sm">{example.description}</ReactMarkdown>
- </div>
- </RefDetailCollapse>
- )}
- </TabPanel>
- )
- })
- ) : (
- // TODO: remove this block once all commands have examples
- <TabPanel
- id={`${command.id}-basic-usage`}
- key={`${command.id}-basic-usage`}
- label="Basic usage"
- className="flex flex-col gap-3"
- >
- <CodeBlock
- className="useless-code-block-class"
- language="bash"
- hideLineNumbers={true}
- >
- {command.usage}
- </CodeBlock>
- </TabPanel>
- )}
- </Tabs>
- </div>
- </RefSubLayout.Examples>
- )}
- </RefSubLayout.Section>
- )
-}
-
-export default CliCommandSection
diff --git a/apps/docs/components/reference/MgmtApiOperationSection.tsx b/apps/docs/components/reference/MgmtApiOperationSection.tsx
deleted file mode 100644
index 7fd16a21fbc..00000000000
--- a/apps/docs/components/reference/MgmtApiOperationSection.tsx
+++ /dev/null
@@ -1,223 +0,0 @@
-import Param from '~/components/Params'
-import RefSubLayout from '~/layouts/ref/RefSubLayout'
-import BodyContentTypeDropdown from '~/components/BodyContentTypeDropdown'
-import { useState } from 'react'
-import Options from '~/components/Options'
-import ApiBodyParam from '~/components/ApiBodyParam'
-import ApiSchema from '~/components/ApiSchema'
-
-const MgmtApiOperationSection = (props) => {
- const operation = props.spec.operations.find((x: any) => x.operationId === props.funcData.id)
- const bodyContentTypes = Object.keys(operation?.requestBody?.content ?? {})
- const [selectedContentType, setSelectedContentType] = useState(bodyContentTypes[0] || undefined)
-
- const hasBodyArray =
- operation?.requestBody?.content[selectedContentType]?.schema?.type === 'array'
- const hasBodyArrayObject =
- operation?.requestBody?.content[selectedContentType]?.schema?.items?.type === 'object'
-
- // gracefully return nothing if function does not exist
- if (!operation) return <></>
-
- const handleSelectType = (value: string) => {
- setSelectedContentType(value)
- }
-
- return (
- <RefSubLayout.Section
- key={operation.operationId}
- slug={operation.operationId}
- title={operation.summary}
- id={operation.operationId}
- scrollSpyHeader={true}
- monoFont={false}
- >
- <RefSubLayout.Details>
- <div className="mt-4">
- <code className="text-md flex gap-4 text-md text-foreground-lighter break-all">
- <span
- className="
- uppercase
- whitespace-nowrap
- bg-foreground text-background
- flex items-center justify-center
- rounded-full font-mono font-medium text-xs px-2 py-0.5"
- >
- {operation.operation}
- </span>
- {operation.path}
- </code>
- </div>
- <div className="prose py-4">
- <p>{operation.description}</p>
- </div>
- {/* Path Parameters */}
- {operation.parameters &&
- operation.parameters.filter((parameter) => parameter.in === 'path').length > 0 && (
- <div className="not-prose mt-12">
- <h5 className="mb-3 text-base text-foreground">Path Parameters</h5>
- <ul className="mt-4">
- {operation.parameters &&
- operation.parameters
- .filter((parameter: any) => parameter.in === 'path')
- .map((parameter: any, index: number) => (
- <Param
- key={index}
- {...parameter}
- type={parameter.schema.type}
- isOptional={!parameter.required}
- ></Param>
- ))}
- </ul>
- </div>
- )}
-
- {/* Query Parameters */}
- {operation.parameters &&
- operation.parameters.filter((parameter) => parameter.in === 'query').length > 0 && (
- <div className="not-prose mt-12">
- <h5 className="mb-3 text-base text-foreground">Query Parameters</h5>
- <ul className="mt-4">
- {operation.parameters &&
- operation.parameters
- .filter((parameter: any) => parameter.in === 'query')
- .map((parameter: any, index: number) => (
- <Param
- key={index}
- {...parameter}
- type={
- parameter.schema.type === 'array'
- ? `${parameter.schema.items?.type} array`
- : parameter.schema.type
- }
- isOptional={!parameter.required}
- >
- {parameter.schema.enum && (
- <Options>
- {parameter.schema.enum.map((value) => {
- return <Options.Option key={value} name={value} isEnum={true} />
- })}
- </Options>
- )}
- {parameter.schema.items?.enum && (
- <Options>
- {parameter.schema.items?.enum.map((value) => {
- return <Options.Option key={value} name={value} isEnum={true} />
- })}
- </Options>
- )}
- </Param>
- ))}
- </ul>
- </div>
- )}
-
- {/* Header Parameters */}
- {operation.parameters &&
- operation.parameters.filter((parameter) => parameter.in === 'header').length > 0 && (
- <div className="not-prose mt-12">
- <h5 className="mb-3 text-base text-foreground">Header Parameters</h5>
- <ul className="mt-4">
- {operation.parameters &&
- operation.parameters
- .filter((parameter: any) => parameter.in === 'header')
- .map((parameter: any, index) => (
- <Param
- key={index}
- {...parameter}
- type={parameter.schema.type}
- isOptional={!parameter.required}
- ></Param>
- ))}
- </ul>
- </div>
- )}
-
- {/* Body */}
- {operation.requestBody && (
- <div className="not-prose mt-12">
- <div className="mb-3 flex flex-row justify-between">
- <h5 className="text-base text-foreground">Body</h5>
- <BodyContentTypeDropdown
- types={Object.keys(operation.requestBody?.content)}
- onSelect={handleSelectType}
- />
- </div>
- <ul className="mt-4">
- {hasBodyArray ? (
- <div className="space-y-4">
- <span>array of:</span>
- <div className="ml-10">
- {/*object array*/}
- {hasBodyArrayObject &&
- operation?.requestBody?.content[selectedContentType]?.schema?.items
- ?.properties &&
- Object.entries(
- operation?.requestBody?.content[selectedContentType]?.schema?.items
- ?.properties
- ).map(([key, value]) => (
- <ApiBodyParam
- key={key}
- name={key}
- value={value}
- isOptional={
- !operation.requestBody?.content[
- selectedContentType
- ]?.schema?.items?.required?.includes(key)
- }
- />
- ))}
-
- {/*primitive type array*/}
- {!hasBodyArrayObject &&
- operation?.requestBody?.content[selectedContentType]?.schema?.items?.type && (
- <Param
- type={
- operation?.requestBody?.content[selectedContentType]?.schema?.items
- ?.type
- }
- isPrimitive={true}
- ></Param>
- )}
- </div>
- </div>
- ) : (
- operation?.requestBody?.content[selectedContentType]?.schema?.properties &&
- Object.entries(
- operation?.requestBody?.content[selectedContentType]?.schema?.properties
- ).map(([key, value]) => (
- <ApiBodyParam
- key={key}
- name={key}
- value={value}
- isOptional={
- !operation.requestBody?.content[
- selectedContentType
- ]?.schema?.items?.required?.includes(key)
- }
- />
- ))
- )}
- </ul>
- </div>
- )}
- </RefSubLayout.Details>
- {operation.responseList && operation.responseList.length > 0 && (
- <RefSubLayout.Examples>
- <h5 className="mb-3 text-base text-foreground">Response</h5>
- {operation.responseList[0] &&
- operation.responseList[0]?.content &&
- operation.responseList[0]?.content['application/json'] ? (
- <ApiSchema
- id={operation.operationId}
- schema={operation.responseList[0].content['application/json'].schema}
- ></ApiSchema>
- ) : (
- <span className="text-foreground text-sm">[No content]</span>
- )}
- </RefSubLayout.Examples>
- )}
- </RefSubLayout.Section>
- )
-}
-export default MgmtApiOperationSection
diff --git a/apps/docs/components/reference/OldVersionAlert.tsx b/apps/docs/components/reference/OldVersionAlert.tsx
deleted file mode 100644
index 5c3f4a04664..00000000000
--- a/apps/docs/components/reference/OldVersionAlert.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import Link from 'next/link'
-import { usePathname } from 'next/navigation'
-import { Admonition } from 'ui-patterns/admonition'
-
-import { useMenuActiveRefId } from '~/hooks/useMenuState'
-import type { ICommonSection } from './Reference.types'
-
-export interface OldVersionAlertProps {
- sections: ICommonSection[]
-}
-
-const OldVersionAlert = ({ sections }: OldVersionAlertProps) => {
- const pathname = usePathname()
- const activeRefId = useMenuActiveRefId()
-
- const activeSection = sections.find(({ id }) => id === activeRefId)
-
- // Remove the version number from URL to get the latest
- const latestVersionUrl = pathname
- .split('/')
- .slice(0, -2)
- .concat(activeSection ? [activeSection.slug] : [])
- .join('/')
-
- return (
- <div className="sticky top-10 z-10 lg:top-14 lg:w-1/2">
- <Admonition type="caution">
- You&apos;re viewing an older version of this library.
- <br />
- <Link
- href={latestVersionUrl}
- className="underline decoration-brand-400 underline-offset-4 decoration-1"
- >
- Switch to the latest
- </Link>
- .
- </Admonition>
- </div>
- )
-}
-
-export default OldVersionAlert
diff --git a/apps/docs/components/reference/RefDetailCollapse.tsx b/apps/docs/components/reference/RefDetailCollapse.tsx
deleted file mode 100644
index 9c21fd71568..00000000000
--- a/apps/docs/components/reference/RefDetailCollapse.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import * as Accordion from '@radix-ui/react-accordion'
-import { ChevronRight } from 'lucide-react'
-import React from 'react'
-
-const RefDetailCollapse: React.FC<
- React.PropsWithChildren<{ id: string; label: string; defaultOpen?: boolean }>
-> = ({ defaultOpen = true, ...props }) => {
- return (
- <Accordion.Root
- className="AccordionRoot"
- type="single"
- defaultValue={defaultOpen ? `${props.id}` : ''}
- collapsible
- >
- <Accordion.Item className="AccordionItem" value={`${props.id}`}>
- <Accordion.Trigger asChild>
- <button
- className={[
- 'transition-all ease-out',
- 'h-8',
- 'bg-surface-100 data-open:bg-surface-200',
- 'border w-full flex items-center gap-3 px-5',
- 'rounded-tl rounded-tr',
- 'data-closed:rounded-bl data-closed:rounded-br',
- 'text-foreground-light text-xs',
- ].join(' ')}
- >
- <div className="data-open-parent:rotate-90 text-foreground-lighter">
- <ChevronRight size={12} strokeWidth={2} />
- </div>
- {props.label}
- </button>
- </Accordion.Trigger>
- <Accordion.Content className="transition data-open:animate-slide-down data-closed:animate-slide-up">
- {props.children}
- </Accordion.Content>
- </Accordion.Item>
- </Accordion.Root>
- )
-}
-
-export default RefDetailCollapse
diff --git a/apps/docs/components/reference/RefEducationSection.tsx b/apps/docs/components/reference/RefEducationSection.tsx
deleted file mode 100644
index a388c11425c..00000000000
--- a/apps/docs/components/reference/RefEducationSection.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import RefSubLayout from '~/layouts/ref/RefSubLayout'
-import { MDXRemote } from 'next-mdx-remote'
-import components from '~/components'
-
-const RefEducationSection = (props) => {
- // gracefully reject pages we can't render
- if (!props.markdownContent) {
- //console.log(props.item.id)
- return <div></div>
- }
-
- return (
- <RefSubLayout.EducationSection
- key={props.item.id}
- title={props.item.title}
- hideTitle={props.markdownContent.meta.hideTitle}
- id={props.item.id}
- slug={props.item.id}
- scrollSpyHeader={true}
- icon={props.markdownContent.meta.icon}
- >
- <MDXRemote {...props.markdownContent.content} components={components} />
- </RefSubLayout.EducationSection>
- )
-}
-
-export default RefEducationSection
diff --git a/apps/docs/components/reference/RefFunctionSection.tsx b/apps/docs/components/reference/RefFunctionSection.tsx
deleted file mode 100644
index 2a20c914ef7..00000000000
--- a/apps/docs/components/reference/RefFunctionSection.tsx
+++ /dev/null
@@ -1,226 +0,0 @@
-import { Fragment } from 'react'
-import ReactMarkdown from 'react-markdown'
-import { CodeBlock, Tabs } from 'ui'
-import components from '~/components'
-import Options from '~/components/Options'
-import Param from '~/components/Params'
-import RefDetailCollapse from '~/components/reference/RefDetailCollapse'
-import RefSubLayout from '~/layouts/ref/RefSubLayout'
-import { extractTsDocNode, generateParameters } from '~/lib/refGenerator/helpers'
-import type { IRefFunctionSection } from './Reference.types'
-import { Database } from 'icons'
-
-const RefFunctionSection: React.FC<IRefFunctionSection> = (props) => {
- const item = props.spec.functions.find((x: any) => x.id === props.funcData.id)
- if (!item) return <></>
-
- const hasTsRef = item['$ref'] || null
-
- const tsDefinition =
- hasTsRef && props.typeSpec ? extractTsDocNode(hasTsRef, props.typeSpec) : null
- const parameters =
- item.overwriteParams ??
- (hasTsRef && tsDefinition ? generateParameters(tsDefinition) : item.params)
- const shortText = hasTsRef && tsDefinition ? tsDefinition.signatures[0].comment?.shortText : ''
-
- return (
- <>
- <RefSubLayout.Section
- key={item.id}
- title={`${props.commonFuncData.title}`}
- id={item.id}
- slug={props.commonFuncData.slug}
- scrollSpyHeader={true}
- >
- <RefSubLayout.Details>
- <>
- <header className={['prose'].join(' ')}>
- {shortText && <ReactMarkdown className="text-sm">{shortText}</ReactMarkdown>}
- </header>
- {item.description && (
- <div className="prose">
- <ReactMarkdown className="text-sm">{item.description}</ReactMarkdown>
- </div>
- )}
- {item.notes && (
- <div className="prose">
- <ReactMarkdown className="text-sm" components={components}>
- {item.notes}
- </ReactMarkdown>
- </div>
- )}
- {/* parameters */}
- {parameters && (
- <div className="not-prose mt-12">
- <h5 className="mb-3 text-base text-foreground">Parameters</h5>
- <ul>
- {parameters.map((param) => {
- return (
- <Param {...param} key={param.name}>
- {param.subContent && (
- <div className="mt-3">
- <Options>
- {param.subContent.map((param) => {
- return (
- <Fragment key={param.name + 'subcontent'}>
- <Options.Option {...param}>
- {param.subContent && (
- <Options>
- {param.subContent.map((param) => {
- return (
- <Options.Option
- {...param}
- key={param.name + 'subcontent-option'}
- />
- )
- })}
- </Options>
- )}
- </Options.Option>
- </Fragment>
- )
- })}
- </Options>
- </div>
- )}
- </Param>
- )
- })}
- </ul>
- </div>
- )}
- </>
- </RefSubLayout.Details>
- <RefSubLayout.Examples>
- {item.examples && (
- <>
- <div className="overflow-hidden w-full">
- <Tabs
- defaultActiveId={item.examples[0].id}
- size="tiny"
- type="rounded-pills"
- scrollable
- >
- {item.examples &&
- item.examples.map((example, exampleIndex) => {
- const exampleString =
- '' +
- (example.code &&
- example.code
- .trim()
- .replace(/^```.*/, '')
- .replace(/```$/, ''))
-
- const codeBlockLang = example?.code?.startsWith('```js')
- ? 'js'
- : example?.code?.startsWith('```ts')
- ? 'ts'
- : example?.code?.startsWith('```dart')
- ? 'dart'
- : example?.code?.startsWith('```c#')
- ? 'csharp'
- : example?.code?.startsWith('```kotlin')
- ? 'kotlin'
- : 'js'
- const staticExample = item.examples[exampleIndex]
-
- const response = staticExample.response
- const sql = staticExample?.data?.sql
- const tables = staticExample?.data?.tables
-
- return (
- <Tabs.Panel
- id={example.id}
- key={exampleIndex}
- label={example.name}
- className="flex flex-col gap-3"
- >
- <CodeBlock
- className="useless-code-block-class"
- language={codeBlockLang}
- hideLineNumbers={true}
- >
- {exampleString}
- </CodeBlock>
-
- {((tables && tables.length > 0) || sql) && (
- <RefDetailCollapse
- id={`${example.id}-${exampleIndex}-data`}
- label="Data source"
- defaultOpen={false}
- >
- <>
- {tables &&
- tables.length > 0 &&
- tables.map((table) => {
- return (
- <div className="bg-surface-100 border rounded prose max-w-none">
- <div className="bg-background px-5 py-2">
- <div className="flex gap-2 items-center">
- <div className="text-brand">
- <Database size={16} />
- </div>
- <h5 className="text-xs text-foreground">
- {table.name}
- </h5>
- </div>
- </div>
- </div>
- )
- })}
- {sql && (
- <CodeBlock
- className="useless-code-block-class my-0 border border-t-0 border-default !rounded-tl-none !rounded-tr-none"
- language="sql"
- hideLineNumbers={true}
- >
- {sql.replace(/sql/g, '').replace(/```/g, '')}
- </CodeBlock>
- )}
- </>
- </RefDetailCollapse>
- )}
-
- {response && (
- <RefDetailCollapse
- id={`${example.id}-${exampleIndex}-response`}
- label="Response"
- defaultOpen={false}
- >
- <CodeBlock
- className="useless-code-block-class rounded !rounded-tl-none !rounded-tr-none border border-default"
- language={codeBlockLang}
- hideLineNumbers={true}
- >
- {response.replace(/```/g, '').replace('json', '')}
- </CodeBlock>
- </RefDetailCollapse>
- )}
-
- {example.description && (
- <RefDetailCollapse
- id={`${example.id}-${exampleIndex}-notes`}
- label="Notes"
- defaultOpen={false}
- >
- <div className="bg-surface-100 border border-default rounded !rounded-tl-none !rounded-tr-none prose max-w-none px-5 py-2">
- <ReactMarkdown className="text-sm">
- {example.description}
- </ReactMarkdown>
- </div>
- </RefDetailCollapse>
- )}
- </Tabs.Panel>
- )
- })}
- </Tabs>
- </div>
- </>
- )}
- </RefSubLayout.Examples>
- </RefSubLayout.Section>
- </>
- )
-}
-
-export default RefFunctionSection
diff --git a/apps/docs/components/reference/RefSEO.tsx b/apps/docs/components/reference/RefSEO.tsx
deleted file mode 100644
index 6a468b713c3..00000000000
--- a/apps/docs/components/reference/RefSEO.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { NextSeo } from 'next-seo'
-import { useRouter } from 'next/compat/router'
-
-function RefSEO({ title }) {
- const router = useRouter()
-
- const path = router.asPath.replace('crawlers/', '')
-
- return (
- <NextSeo
- title={title}
- openGraph={{
- title,
- url: `https://supabase.com/docs${path}`,
- images: [
- {
- url: `https://supabase.com/docs/img/supabase-og-image.png`,
- },
- ],
- }}
- />
- )
-}
-
-export default RefSEO
diff --git a/apps/docs/components/reference/RefSectionHandler.tsx b/apps/docs/components/reference/RefSectionHandler.tsx
deleted file mode 100644
index 91e73b90dc4..00000000000
--- a/apps/docs/components/reference/RefSectionHandler.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-import { useRouter } from 'next/compat/router'
-import Head from 'next/head'
-import { useEffect } from 'react'
-
-import { type MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu'
-import RefEducationSection from '~/components/reference/RefEducationSection'
-import RefFunctionSection from '~/components/reference/RefFunctionSection'
-
-import RefSubLayout from '~/layouts/ref/RefSubLayout'
-import ApiOperationSection from './ApiOperationSection'
-import CliCommandSection from './CLICommandSection'
-import OldVersionAlert from './OldVersionAlert'
-import type { IAPISpec, ICommonSection, IRefStaticDoc, ISpec, TypeSpec } from './Reference.types'
-import { SidebarSkeleton, TopNavSkeleton } from '~/layouts/MainSkeleton'
-import MgmtApiOperationSection from '~/components/reference/MgmtApiOperationSection'
-
-interface RefSectionHandlerProps {
- sections: ICommonSection[]
- spec?: ISpec | IAPISpec
- typeSpec?: TypeSpec
- pageProps: { docs: IRefStaticDoc[] }
- type: 'client-lib' | 'cli' | 'api' | 'mgmt-api'
- isOldVersion?: boolean
- menuId: MenuId
-}
-
-const RefSectionHandler = (props: RefSectionHandlerProps) => {
- const router = useRouter()
-
- const [slug] = router.query.slug
-
- // When user lands on a url like http://supabase.com/docs/reference/javascript/sign-up
- // find the #sign-up element and scroll to that
- useEffect(() => {
- document.getElementById(slug)?.scrollIntoView()
- }, [slug])
-
- useEffect(() => {
- function handler() {
- const [slug] = window.location.pathname.split('/').slice(-1)
- document.getElementById(slug)?.scrollIntoView()
- }
-
- window.addEventListener('popstate', handler)
-
- return () => {
- window.removeEventListener('popstate', handler)
- }
- }, [])
-
- function getPageTitle() {
- switch (props.type) {
- case 'client-lib':
- return props.spec.info.title
- case 'cli':
- return 'Supabase CLI reference'
- case 'api':
- case 'mgmt-api':
- return 'Supabase API reference'
- default:
- return 'Supabase Docs'
- }
- }
-
- const pageTitle = getPageTitle()
- const section = props.sections.find((section) => section.slug === slug)
- const fullTitle = `${pageTitle}${section ? ` - ${section.title}` : ''}`
- const path = router.asPath.replace('/crawlers', '')
-
- return (
- <>
- <Head>
- <title>{fullTitle}</title>
- <meta name="description" content={section?.title ?? pageTitle} />
- <meta property="og:image" content={`https://supabase.com/docs/img/supabase-og-image.png`} />
- <meta
- name="twitter:image"
- content={`https://supabase.com/docs/img/supabase-og-image.png`}
- />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <link rel="canonical" href={`https://supabase.com${router.basePath}${path}`} />
- </Head>
- <TopNavSkeleton>
- <SidebarSkeleton menuId={props.menuId}>
- {props.isOldVersion && <OldVersionAlert sections={props.sections} />}
- <RefSubLayout>
- {props.sections.map((section, i) => {
- const sectionType = section.type
- switch (sectionType) {
- case 'markdown':
- const markdownData = props.pageProps.docs.find((doc) => doc.id === section.id)
-
- return (
- <RefEducationSection
- key={section.id + i}
- item={section}
- markdownContent={markdownData}
- />
- )
- case 'function':
- return (
- <RefFunctionSection
- key={section.id + i}
- funcData={section}
- commonFuncData={section}
- spec={props.spec}
- typeSpec={props.typeSpec}
- />
- )
- case 'cli-command':
- return (
- <CliCommandSection
- key={section.id + i}
- funcData={section}
- commonFuncData={section}
- />
- )
- case 'operation':
- if (props.type === 'mgmt-api') {
- return (
- <MgmtApiOperationSection
- key={section.id + i}
- funcData={section}
- commonFuncData={section}
- spec={props.spec}
- />
- )
- } else {
- return (
- <ApiOperationSection
- key={section.id + i}
- funcData={section}
- commonFuncData={section}
- spec={props.spec}
- />
- )
- }
- default:
- throw new Error(`Unknown common section type '${sectionType}'`)
- }
- })}
- </RefSubLayout>
- </SidebarSkeleton>
- </TopNavSkeleton>
- </>
- )
-}
-
-export default RefSectionHandler
diff --git a/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap b/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap
index e5069246e0a..7a943cb80e1 100644
--- a/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap
+++ b/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap
@@ -5957,223 +5957,6 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
}
}
},
- "comment": {
- "tags": [
- {
- "tag": "experimental",
- "text": "This method may change in future versions."
- },
- {
- "tag": "description",
- "text": "Gets the claims from a JWT. If the JWT is symmetric JWTs, it will call getUser() to verify against the server. If the JWT is asymmetric, it will be verified against the JWKS using the WebCrypto API.\\n"
- }
- ]
- }
- },
- "@supabase/auth-js.GoTrueClient.getClaims": {
- "name": "@supabase/auth-js.GoTrueClient.getClaims",
- "params": [
- {
- "name": "jwt",
- "type": {
- "type": "intrinsic",
- "name": "string"
- },
- "isOptional": true
- },
- {
- "name": "jwks",
- "type": {
- "type": "object",
- "properties": [
- {
- "name": "keys",
- "type": {
- "type": "array",
- "elemType": {
- "type": "object",
- "name": "JWK",
- "properties": [
- {
- "name": "alg",
- "type": {
- "type": "intrinsic",
- "name": "string"
- },
- "isOptional": true
- },
- {
- "name": "key_ops",
- "type": {
- "type": "array",
- "elemType": {
- "type": "intrinsic",
- "name": "string"
- }
- }
- },
- {
- "name": "kid",
- "type": {
- "type": "intrinsic",
- "name": "string"
- },
- "isOptional": true
- },
- {
- "name": "kty",
- "type": {
- "type": "union",
- "subTypes": [
- {
- "type": "literal",
- "value": "RSA"
- },
- {
- "type": "literal",
- "value": "EC"
- },
- {
- "type": "literal",
- "value": "oct"
- }
- ]
- }
- }
- ]
- }
- }
- }
- ]
- }
- }
- ],
- "ret": {
- "type": {
- "type": "promise",
- "name": "Promise",
- "awaited": {
- "type": "union",
- "subTypes": [
- {
- "type": "object",
- "properties": [
- {
- "name": "data",
- "type": {
- "type": "object",
- "properties": [
- {
- "name": "claims",
- "type": {
- "type": "nameOnly",
- "name": "JwtPayload"
- }
- },
- {
- "name": "header",
- "type": {
- "name": "JwtHeader",
- "type": "object",
- "properties": [
- {
- "name": "alg",
- "type": {
- "type": "union",
- "subTypes": [
- {
- "type": "literal",
- "value": "RS256"
- },
- {
- "type": "literal",
- "value": "ES256"
- },
- {
- "type": "literal",
- "value": "HS256"
- }
- ]
- }
- },
- {
- "name": "kid",
- "type": {
- "type": "intrinsic",
- "name": "string"
- }
- },
- {
- "name": "typ",
- "type": {
- "type": "intrinsic",
- "name": "string"
- }
- }
- ]
- }
- },
- {
- "name": "signature",
- "type": {
- "type": "nameOnly",
- "name": "Uint8Array"
- }
- }
- ]
- }
- },
- {
- "name": "error",
- "type": {
- "type": "literal",
- "value": null
- }
- }
- ]
- },
- {
- "type": "object",
- "properties": [
- {
- "name": "data",
- "type": {
- "type": "literal",
- "value": null
- }
- },
- {
- "name": "error",
- "type": {
- "type": "nameOnly",
- "name": "AuthError"
- }
- }
- ]
- },
- {
- "type": "object",
- "properties": [
- {
- "name": "data",
- "type": {
- "type": "literal",
- "value": null
- }
- },
- {
- "name": "error",
- "type": {
- "type": "literal",
- "value": null
- }
- }
- ]
- }
- ]
- }
- }
- },
"comment": {}
},
"@supabase/auth-js.GoTrueClient.getSession": {
diff --git a/apps/docs/layouts/DefaultGuideLayout.tsx b/apps/docs/layouts/DefaultGuideLayout.tsx
index 08a632fbc9f..fb2bf310a19 100644
--- a/apps/docs/layouts/DefaultGuideLayout.tsx
+++ b/apps/docs/layouts/DefaultGuideLayout.tsx
@@ -1,5 +1,4 @@
import { FC } from 'react'
-import { FooterHelpCalloutType } from '~/components/FooterHelpCallout'
import { type MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu'
import GuideLayout from './guides'
@@ -9,7 +8,6 @@ interface Props {
description?: string
hide_table_of_contents?: boolean
video?: string
- footerHelpType?: FooterHelpCalloutType
}
children: any
toc?: any