Skip to content

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

remove unnecessary config reference for edge functions

Iniana532150109ae
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
index c25afcfab74..c0a6546e6f2 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
@@ -860,7 +860,6 @@ export const self_hosting = {
name: 'Functions Server',
items: [
{ name: 'Reference', url: '/reference/self-hosting-functions/introduction', items: [] },
- { name: 'Configuration', url: '/guides/self-hosting/functions/config', items: [] },
],
},
],
diff --git a/apps/docs/package.json b/apps/docs/package.json
index 0e82a743e26..cfda86a3831 100644
--- a/apps/docs/package.json
+++ b/apps/docs/package.json
@@ -38,10 +38,7 @@
"gen:realtime:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/realtime_v0_config.yaml --output ./docs/reference/realtime/generated/config.mdx",
"gen:analytics": "npm-run-all gen:analytics:config gen:analytics:usage",
"gen:analytics:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/analytics_v0_config.yaml --output ./docs/reference/analytics/generated/config.mdx",
- "gen:analytics:usage": "ts-node ./generator/index.ts gen --type api --input ../../spec/transforms/analytics_v0_openapi_deparsed.json --output ./docs/reference/analytics/generated/usage.mdx",
- "gen:functions": "npm-run-all gen:functions:config gen:functions:usage",
- "gen:functions:config": "ts-node ./generator/index.ts gen --type config --input ../../spec/functions_v0_config.yaml --output ./docs/reference/functions/generated/config.mdx",
- "gen:functions:usage": "ts-node ./generator/index.ts gen --type api --input ../../spec/transforms/functions_v0_openapi_deparsed.json --output ./docs/reference/functions/generated/usage.mdx"
+ "gen:analytics:usage": "ts-node ./generator/index.ts gen --type api --input ../../spec/transforms/analytics_v0_openapi_deparsed.json --output ./docs/reference/analytics/generated/usage.mdx"
},
"dependencies": {
"@algolia/autocomplete-js": "^1.7.2",
diff --git a/apps/docs/pages/reference/functions/[...slug].tsx b/apps/docs/pages/reference/functions/[...slug].tsx
deleted file mode 100644
index e04800c6279..00000000000
--- a/apps/docs/pages/reference/functions/[...slug].tsx
+++ /dev/null
@@ -1,167 +0,0 @@
-import specFile from '~/../../spec/transforms/functions_v0_openapi_deparsed.json' assert { type: 'json' }
-import { gen_v3, enrichedOperation } from '~/lib/refGenerator/helpers'
-import { Tabs, CodeBlock } from 'ui'
-
-import RefSubLayout from '~/layouts/ref/RefSubLayout'
-
-export type AcceptedValue = {
- id: string
- name: string
- type: 'string' | 'boolean' | 'object'
- description?: string
-}
-
-export type Flag = {
- id: string
- name: string
- description: string
- default_value: string
- accepted_values: AcceptedValue[]
-}
-
-export type ApiParameter = {
- example: string
- in: string
- name: string
- required: boolean
- schema: {
- type: string
- example: string
- }
-}
-// @ts-ignore
-const generatedSpec = gen_v3(specFile, 'wat', { apiUrl: 'apiv0' })
-
-export default function Config() {
- return (
- <RefSubLayout>
- <div className="flex my-16">
- <div className="w-full">
- <div className="grid gap-16">
- <h1 className="text-4xl uppercase">{generatedSpec.info.title}</h1>
- <p>{generatedSpec.info.description}</p>
- </div>
-
- <div className="grid gap-32 mx-auto max-w-5xl mt-24">
- {generatedSpec.operations.map((operation: any) => (
- <div className="border-b pb-8">
- <RefSubLayout.Section
- slug={operation.id}
- title={operation.summary}
- id={operation.operationId}
- monoFont={false}
- >
- <RefSubLayout.Details>
- <div className="mt-4">
- <code className="text-md flex gap-4 text-md text-scale-900 break-all">
- <span className="uppercase whitespace-nowrap ">{operation.operation}</span>
- {operation.fullPath}
- </code>
- </div>
- {/* Path Parameters */}
- {operation.parameters &&
- operation.parameters.filter((parameter) => parameter.in === 'path').length >
- 0 && (
- <div className="mt-12">
- <h2 className="border-b pb-2 text-xl">Path parameters</h2>
- <ul className="mt-4">
- {operation.parameters &&
- operation.parameters
- .filter((parameter: any) => parameter.in === 'path')
- .map((parameter: any) => (
- <li className="mt-8 border-b pb-6">
- <div>
- <div className="flex gap-4 items-center">
- <span className="font-bold">{parameter.name}</span>
- <div className="font-mono text-xs break-all">
- {parameter.required && (
- <div className="text-[10px] border border-amber-700 bg-amber-300 text-amber-900 px-2 tracking-wide font-mono py-0.25 rounded-full">
- REQUIRED
- </div>
- )}
- </div>
- </div>
- <p className="mt-4">{parameter.description}</p>
- </div>
- {parameter.example && (
- <div className="mt-4 flex gap-4 items-center">
- <span>Example:</span>
- <span className="font-mono text-xs break-all">
- {parameter.example}
- </span>
- </div>
- )}
- </li>
- ))}
- </ul>
- </div>
- )}
-
- {/* Header Parameters */}
- {operation.parameters &&
- operation.parameters.filter((parameter) => parameter.in === 'header').length >
- 0 && (
- <div className="mt-12">
- <h2 className="border-b pb-2 text-xl">Header parameters</h2>
- <ul className="mt-4">
- {operation.parameters &&
- operation.parameters
- .filter((parameter: any) => parameter.in === 'header')
- .map((parameter: any) => (
- <li className="mt-8 border-b pb-6">
- <div className="flex gap-4 items-center">
- <span className="font-bold">{parameter.name}</span>
- <span className="font-mono text-xs break-all">
- {parameter.required && 'required'}
- </span>
- </div>
- <div className="mt-4 flex gap-4 items-center">
- <span>Example:</span>
- <span className="font-mono text-xs break-all">
- {parameter.example}
- </span>
- </div>
- </li>
- ))}
- </ul>
- </div>
- )}
- </RefSubLayout.Details>
- <RefSubLayout.Examples>
- {operation.responseList.length > 0 && (
- <>
- <h2 className="text-xl">Responses</h2>
- <Tabs
- scrollable
- size="small"
- type="underlined"
- defaultActiveId={
- operation.responseList[0].responseCode ??
- operation.responseList[0].responseCode
- }
- >
- {operation.responseList.map((response: any) => (
- <Tabs.Panel id={response.responseCode} label={response.responseCode}>
- <p>{response.description}</p>
- {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>
- )}
- </Tabs.Panel>
- ))}
- </Tabs>
- </>
- )}
- </RefSubLayout.Examples>
- </RefSubLayout.Section>
- </div>
- ))}
- </div>
- </div>
- </div>
- </RefSubLayout>
- )
-}
diff --git a/apps/docs/pages/reference/functions/config.tsx b/apps/docs/pages/reference/functions/config.tsx
deleted file mode 100644
index 582a91f60c5..00000000000
--- a/apps/docs/pages/reference/functions/config.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-import fs from 'fs'
-import matter from 'gray-matter'
-import components from '~/components/index'
-import { MDXRemote } from 'next-mdx-remote'
-import { serialize } from 'next-mdx-remote/serialize'
-
-// @ts-expect-error
-import specFile from '~/../../spec/functions_v0_config.yaml' assert { type: 'yml' }
-import { Parameter } from '~/lib/refGenerator/refTypes'
-
-import ReactMarkdown from 'react-markdown'
-
-// Parameters are grouped on the page by tag
-const TAGS = ['general', 'database']
-
-export default function Config(props) {
- return (
- <div>
- <div className="flex my-16">
- <div className="w-full prose">
- <h1 className="text-4xl mb-16">{specFile.info.title} Configuration</h1>
- <ReactMarkdown>{specFile.info.description}</ReactMarkdown>
- <div>
- <div>
- {props.docs
- .filter((doc) => doc.introPage)
- .map((item) => (
- <MDXRemote {...item.content} components={components} />
- ))}
- </div>
- {TAGS.map((tag) =>
- specFile.parameters
- .filter((param: Parameter) => param.tags[0] === tag)
- .map((parameter: Parameter, index) => (
- <div>
- {index === 0 && <h2 className="text-xl capitalize">{tag} Settings</h2>}
- <div className="mt-8">
- <div>
- <h2 className="text-xl font-medium text-scale-1200 font-mono">
- <span className="mr-2">$</span>
- {parameter.title}
- </h2>
- <div className="grid" id={parameter.id}>
- <div className="border-b pb-8" key={parameter.id}>
- <div className=" mb-16">
- <p className="mb-4 scroll-mt-16 mt-0 text-scale-1100 text-base">
- <ReactMarkdown>{parameter.description}</ReactMarkdown>
- </p>
- <div className="grid gap-2">
- <div className="flex gap-2">
- Required: <code>{parameter.required.toString()}</code>
- </div>
- <div className="flex gap-2">
- Default:
- <code>
- {parameter.default ? parameter.default.toString() : 'None'}
- </code>
- </div>
- </div>
- </div>
- {parameter.links &&
- parameter.links.map((link) => (
- <div>
- <h3>See also:</h3>
- <li>
- <a href={link.link}>{link.name}</a>
- </li>
- </div>
- ))}
- </div>
- </div>
- </div>
- </div>
- </div>
- ))
- )}
- </div>
- </div>
- </div>
- </div>
- )
-}
-export async function getServerSideProps() {
- // an array of ids of the intro sections for this library
- const introPages = ['functions']
-
- const pages = [...introPages]
-
- // Grab custom markdown intro page files
- const allMarkdownDocs = await Promise.all(
- pages.map(async (x: any, i) => {
- const pathName = `docs/ref/functions/${x}.mdx`
-
- const markdownExists = fs.existsSync(pathName)
-
- const fileContents = markdownExists ? fs.readFileSync(pathName, 'utf8') : ''
- const { data, content } = matter(fileContents)
-
- return {
- id: x,
- title: x,
- // ...content,
- meta: data,
- introPage: introPages.includes(x),
- content: content ? await serialize(content || '') : null,
- }
- })
- )
-
- return {
- props: {
- docs: allMarkdownDocs,
- },
- }
-}
diff --git a/apps/docs/pages/reference/self-hosting-functions/[...slug].tsx b/apps/docs/pages/reference/self-hosting-functions/[...slug].tsx
index e64dd6b1ac5..cf4639365fb 100644
--- a/apps/docs/pages/reference/self-hosting-functions/[...slug].tsx
+++ b/apps/docs/pages/reference/self-hosting-functions/[...slug].tsx
@@ -1,5 +1,5 @@
-import functionsSpec from '~/../../spec/transforms/functions_v0_openapi_deparsed.json' assert { type: 'json' }
import selfHostingFunctionsCommonSections from '~/../../spec/common-self-hosting-functions-sections.json'
+
import RefSectionHandler from '~/components/reference/RefSectionHandler'
import { flattenSections } from '~/lib/helpers'
import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths'
@@ -8,11 +8,8 @@ import { gen_v3 } from '~/lib/refGenerator/helpers'
const sections = flattenSections(selfHostingFunctionsCommonSections)
-// @ts-ignore
-const spec = gen_v3(functionsSpec, 'wat', { apiUrl: 'apiv0' })
-
export default function JSReference(props) {
- return <RefSectionHandler sections={sections} spec={spec} pageProps={props} type="api" />
+ return <RefSectionHandler sections={sections} pageProps={props} type="api" />
}
export async function getStaticProps() {
diff --git a/spec/Makefile b/spec/Makefile
index 6885dbc537e..0b0a5114bae 100644
--- a/spec/Makefile
+++ b/spec/Makefile
@@ -57,7 +57,7 @@ download.analytics.v0:
###############################################################################
# Transform docs into working files
###############################################################################
-transform: dereference.api.v0 dereference.auth.v1 dereference.storage.v0 dereference.tsdoc.v2 combine.tsdoc.v2
+transform: dereference.api.v0 dereference.auth.v1 dereference.storage.v0 dereference.tsdoc.v2 combine.tsdoc.v2
dereference.api.v0:
npx swagger-cli bundle --dereference --outfile $(REPO_DIR)/transforms/api_v0_openapi_deparsed.json $(REPO_DIR)/api_v0_openapi.json
@@ -71,9 +71,6 @@ dereference.storage.v0:
dereference.analytics.v0:
npx swagger-cli bundle --dereference --outfile $(REPO_DIR)/transforms/analytics_v0_openapi_deparsed.json $(REPO_DIR)/analytics_v0_openapi.json
-dereference.functions.v0:
- npx swagger-cli bundle --dereference --outfile $(REPO_DIR)/transforms/functions_v0_openapi_deparsed.json $(REPO_DIR)/functions_v0_openapi.json
-
# No longer updated
# dereference.tsdoc.v1:
# cd $(REPO_DIR)/parser && npm run tsdoc:dereference:functions:v1
@@ -129,9 +126,6 @@ combine-raw.tsdoc.v2:
validate.analytics.v0:
npx swagger-cli validate --no-schema $(REPO_DIR)/analytics_v0_openapi.json
-validate.functions.v0:
- npx swagger-cli validate --no-schema $(REPO_DIR)/functions_v0_openapi.json
-
###############################################################################
# Format everything - easier for git to track changes.
###############################################################################