Files
supabase/apps/docs/pages/reference/api/[...slug].tsx
Hieu d855bfb3f8 feat: automate mgmt api spec update (#26655)
* fix: correct mgmt api naming

* feat: new command to generate mgmt api sections

* feat: sort section items

* chore: tidy up

* fix: add generate sections to the default command

* feat: add gha to auto update mgmt api docs

* chore: tidy up

* fix: operationId logic to support self-hosting references

* chore: update latest mgmt api specs

* chore: update latest mgmt api specs
2024-05-31 08:53:19 +07:00

35 lines
1.1 KiB
TypeScript

import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu'
import RefSectionHandler from '~/components/reference/RefSectionHandler'
import { flattenSections } from '~/lib/helpers'
import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths'
import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps'
import { gen_v3 } from '~/lib/refGenerator/helpers'
import apiCommonSections from '~/spec/common-api-sections.json' assert { type: 'json' }
import specFile from '~/spec/transforms/api_v1_openapi_deparsed.json' assert { type: 'json' }
// @ts-ignore
const generatedSpec = gen_v3(specFile, 'wat', { apiUrl: 'apiv0', type: 'mgmt-api' })
const sections = flattenSections(apiCommonSections)
const libraryPath = '/api'
export default function Config(props) {
return (
<RefSectionHandler
menuId={MenuId.RefApi}
sections={sections}
spec={generatedSpec}
pageProps={props}
type="mgmt-api"
/>
)
}
export async function getStaticProps() {
return handleRefStaticProps(sections, libraryPath)
}
export async function getStaticPaths() {
return handleRefGetStaticPaths(sections)
}