Skip to content

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

docs: Add deprecated label to mgmt api docs (#33734)

Kamil Ogórek9b7884f50c04
diff --git a/apps/docs/features/docs/Reference.api.utils.ts b/apps/docs/features/docs/Reference.api.utils.ts
index 06c0791b1f9..841c433df0d 100644
--- a/apps/docs/features/docs/Reference.api.utils.ts
+++ b/apps/docs/features/docs/Reference.api.utils.ts
@@ -4,6 +4,7 @@ export interface IApiEndPoint {
method: 'get' | 'post' | 'put' | 'delete' | 'patch'
summary?: string
description?: string
+ deprecated?: boolean
parameters: Array<{
name: string
required: boolean
diff --git a/apps/docs/features/docs/Reference.sections.tsx b/apps/docs/features/docs/Reference.sections.tsx
index c848c6b07ed..220607c92be 100644
--- a/apps/docs/features/docs/Reference.sections.tsx
+++ b/apps/docs/features/docs/Reference.sections.tsx
@@ -297,13 +297,43 @@ async function ApiEndpointSection({ link, section, servicePath }: ApiEndpointSec
return (
<RefSubLayout.Section columns="double" link={link} {...section}>
- <StickyHeader title={endpointDetails.summary} className="col-[1_/_-1]" />
+ <StickyHeader
+ title={
+ <>
+ {endpointDetails.summary}
+ {endpointDetails.deprecated && (
+ <span
+ className="
+ uppercase
+ whitespace-nowrap align-middle inline-block -translate-y-0.5
+ border border-amber-700 bg-amber-300 text-amber-900
+ rounded-full font-mono font-medium text-xs px-2 py-0.5 ml-2"
+ >
+ deprecated
+ </span>
+ )}
+ </>
+ }
+ className="col-[1_/_-1]"
+ />
<div className="flex flex-col gap-12">
<div className="flex items-center gap-2">
- <span className="uppercase text-sm whitespace-nowrap bg-foreground text-background rounded-full font-mono font-medium px-2 py-0.5">
+ <span
+ className={cn(
+ 'uppercase text-sm whitespace-nowrap bg-foreground text-background rounded-full font-mono font-medium px-2 py-0.5',
+ endpointDetails.deprecated && 'line-through'
+ )}
+ >
{endpointDetails.method}
</span>
- <code className="text-foreground-lighter break-all">{endpointDetails.path}</code>
+ <code
+ className={cn(
+ 'text-foreground-lighter break-all',
+ endpointDetails.deprecated && 'line-through'
+ )}
+ >
+ {endpointDetails.path}
+ </code>
</div>
{endpointDetails.description && (
<ReactMarkdown className="prose break-words mb-8">
diff --git a/apps/docs/features/docs/Reference.ui.tsx b/apps/docs/features/docs/Reference.ui.tsx
index ed99b71339b..4cc062daf17 100644
--- a/apps/docs/features/docs/Reference.ui.tsx
+++ b/apps/docs/features/docs/Reference.ui.tsx
@@ -84,7 +84,7 @@ export const RefSubLayout = {
}
interface StickyHeaderProps {
- title?: string
+ title?: React.ReactNode | string
monoFont?: boolean
className?: string
}