diff --git a/.github/workflows/docs-tests-smoke.yml b/.github/workflows/docs-tests-smoke.yml new file mode 100644 index 00000000000..0ebf7512c19 --- /dev/null +++ b/.github/workflows/docs-tests-smoke.yml @@ -0,0 +1,35 @@ +# Smoke tests against the docs production site, run daily + +name: Docs Production Smoke Tests + +on: + workflow_dispatch: + schedule: + - cron: '0 4 * * *' + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: | + apps/docs + packages + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + + - name: Install deps + run: npm ci + + - name: Run tests + run: npm --prefix="apps/docs" run test:smoke diff --git a/apps/docs/app/api/crawlers/route.smoke.test.ts b/apps/docs/app/api/crawlers/route.smoke.test.ts new file mode 100644 index 00000000000..e2224180cec --- /dev/null +++ b/apps/docs/app/api/crawlers/route.smoke.test.ts @@ -0,0 +1,72 @@ +import { load } from 'cheerio' +import { describe, expect, it } from 'vitest' + +const REFERENCE_DOCS_URL = 'https://supabase.com/docs/reference' +// For dev testing: comment out above and uncomment below +// const REFERENCE_DOCS_URL = 'http://localhost:3001/docs/reference' + +describe('prod smoke test: crawler pages return correct data', () => { + /** + * No special tricks required to spoof the user agent. Tests are correctly + * detected as coming from bots. If they ever aren't, the `h1` test will fail + * as a different `h1` is served to non-bots. + */ + + it('metadata: title, description, canonical, image', async () => { + const result = await fetch(REFERENCE_DOCS_URL + '/javascript/rangelte') + const text = await result.text() + + const $ = load(text) + const title = $('title').text() + expect(title).toBe('JavaScript: Less than or equal to a range | Supabase Docs') + + const metaDescription = $('meta[name="description"]') + expect(metaDescription.attr('content')).toBe( + 'Supabase API reference for JavaScript: Less than or equal to a range' + ) + + const canonical = $('link[rel="canonical"]') + expect(canonical.attr('href')).toBe('https://supabase.com/docs/reference/javascript/rangelte') + + const ogImage = $('meta[name="og:image"]') + expect(ogImage.attr('content')).toBe('https://supabase.com/docs/img/supabase-og-image.png') + + const twitterImage = $('meta[name="twitter:image"]') + expect(twitterImage.attr('content')).toBe('https://supabase.com/docs/img/supabase-og-image.png') + }) + + it('markdown pages', async () => { + const result = await fetch(REFERENCE_DOCS_URL + '/javascript/introduction') + const text = await result.text() + + const $ = load(text) + const h1 = $('h1').text() + expect(h1).toBe('JavaScript: Introduction') + + const firstPara = $('h1').next().text() + expect(/JavaScript library/.test(firstPara)).toBe(true) + expect(/supabase-js/.test(firstPara)).toBe(true) + }) + + it('function pages', async () => { + const result = await fetch(REFERENCE_DOCS_URL + '/javascript/rangelte') + const text = await result.text() + + const $ = load(text) + const h1 = $('h1').text() + expect(h1).toBe('JavaScript: Less than or equal to a range') + + const description = $('h1').next().text() + expect(description).toBe( + 'Only relevant for range columns. Match only rows where every element in column is either contained in range or less than any element in range.' + ) + + const headings = [] as Array + $('h2').map(function () { + headings.push($(this).attr('id')) + }) + + expect(headings.includes('parameters')).toBe(true) + expect(headings.includes('examples')).toBe(true) + }) +}) diff --git a/apps/docs/app/api/crawlers/route.ts b/apps/docs/app/api/crawlers/route.ts new file mode 100644 index 00000000000..b74125beb36 --- /dev/null +++ b/apps/docs/app/api/crawlers/route.ts @@ -0,0 +1,237 @@ +import { toHtml } from 'hast-util-to-html' +import { fromMarkdown } from 'mdast-util-from-markdown' +import { mdxFromMarkdown } from 'mdast-util-mdx' +import { toHast } from 'mdast-util-to-hast' +import { mdxjs } from 'micromark-extension-mdxjs' +import { redirect } from 'next/navigation' +import { visit } from 'unist-util-visit' + +import { REFERENCES } from '~/content/navigation.references' +import { + getFlattenedSections, + getFunctionsList, + getTypeSpec, +} from '~/features/docs/Reference.generated.singleton' +import { getRefMarkdown } from '~/features/docs/Reference.mdx' +import type { MethodTypes } from '~/features/docs/Reference.typeSpec' +import type { AbbrevCommonClientLibSection } from '~/features/docs/Reference.utils' +import { notFoundLink } from '~/features/recommendations/NotFound.utils' +import { BASE_PATH } from '~/lib/constants' + +export async function GET(request: Request) { + const url = new URL(request.url) + let [, , lib, maybeVersion, slug] = url.pathname.split('/') + + const libraryMeta = REFERENCES[lib] + + const isVersion = /^v\d+$/.test(maybeVersion) + const version = isVersion ? maybeVersion : libraryMeta.versions[0] + if (!isVersion) { + slug = maybeVersion + } + + const flattenedSections = await getFlattenedSections(lib, version) + const sectionsWithUrl: Array = + flattenedSections!.map((section) => { + const url = new URL(request.url) + url.pathname = [BASE_PATH, 'reference', lib, isVersion ? version : null, section.slug] + .filter(Boolean) + .join('/') + + return { + ...section, + url, + } + }) + const section = flattenedSections!.find( + (section) => + (section.type === 'markdown' || section.type === 'function') && section.slug === slug + ) + + if (!section) { + redirect(notFoundLink(`${lib}/${slug}`)) + } + + const html = htmlShell( + lib, + isVersion ? version : null, + slug, + section, + libraryNav(sectionsWithUrl) + (await sectionDetails(lib, isVersion ? version : null, section)) + ) + const response = new Response(html) + response.headers.set('Content-Type', 'text/html; charset=utf-8') + + return response +} + +function htmlShell( + lib: string, + version: string | null, + slug: string, + section: AbbrevCommonClientLibSection, + body: string +) { + const libraryName = REFERENCES[lib].name + let title = libraryName + ': ' + section.title ?? '' + + return ( + '' + + '' + + `${title} | Supabase Docs` + + `` + + `` + + `` + + `` + + '' + + '' + + body + + '' + ) +} + +function libraryNav(sections: Array) { + return ( + '' + ) +} + +async function sectionDetails(lib: string, version: string, section: AbbrevCommonClientLibSection) { + const libraryName = REFERENCES[lib].name + let result = '

' + (libraryName + ': ' + section.title ?? '') + '

' + + if (section.type === 'markdown') { + result += await markdown(lib, version, section) + } else { + result += await functionDetails(lib, version, section) + } + + return result +} + +async function markdown( + lib: string, + version: string | null, + section: AbbrevCommonClientLibSection +) { + const dir = !!section.meta?.shared ? 'shared' : lib + (version ? '/' + version : '') + + let content = await getRefMarkdown(dir + '/' + section.slug) + content = mdxToHtml(content) + return content +} + +async function functionDetails( + lib: string, + version: string | null, + section: AbbrevCommonClientLibSection +) { + const libraryMeta = REFERENCES[lib] + + const fns = await getFunctionsList(lib, version ?? libraryMeta.versions[0]) + const fn = fns!.find((fn) => fn.id === section.id) + if (!fn) return '' + + let types: MethodTypes | undefined + if (libraryMeta.typeSpec && '$ref' in fn) { + types = await getTypeSpec(fn['$ref'] as string) + } + + const fullDescription = [ + types?.comment?.shortText, + 'description' in fn && (fn.description as string), + 'notes' in fn && (fn.notes as string), + ] + .filter((x) => typeof x === 'string') + .map(mdxToHtml) + .join('') + + const parameters = parametersToHtml(fn, types) + const examples = examplesToHtml(fn) + + return fullDescription + parameters + examples +} + +function mdxToHtml(markdownUnescaped: string): string { + const markdown = markdownUnescaped.replace(/(? { + node.value = node.value.replace(/\n/g, ' ') + }) + if (!mdast) return '' + + const hast = toHast(mdast) + if (!hast) return '' + + // @ts-ignore + const html = toHtml(hast) + + return html +} + +function parametersToHtml(fn: any, types: MethodTypes | undefined) { + let result = '

Parameters

' + + if ('overwriteParams' in fn || 'params' in fn) { + const params = fn.overwriteParams ?? fn.params + if (params.length === 0) return '' + + result += + '
    ' + + params + .map( + (param) => + '
  • ' + + `

    ${param.name}

    ` + + `${param.isOptional ? '(Optional)' : '(Required)'}` + + `

    ${param.description}

    ` + + '
  • ' + ) + .join('') + + '
' + + return result + } + + if (!types?.params || types.params.length === 0) return '' + + result += + '
    ' + + types.params + .map( + (param) => + '
  • ' + + `

    ${String(param.name)}

    ` + + `${param.isOptional ? '(Optional)' : '(Required)'}` + + `

    ${param.comment?.shortText ?? ''}

    ` + + '
  • ' + ) + .join('') + + '
' + + return result +} + +function examplesToHtml(fn: any) { + if (!fn.examples || fn.examples.length === 0) return '' + + let result = '

Examples

' + + result += fn.examples + .map((example) => `

${example.name ?? ''}

` + mdxToHtml(example.code ?? '')) + .join('') + + return result +} diff --git a/apps/docs/app/reference/[...slug]/page.tsx b/apps/docs/app/reference/[...slug]/page.tsx new file mode 100644 index 00000000000..43f8903399d --- /dev/null +++ b/apps/docs/app/reference/[...slug]/page.tsx @@ -0,0 +1,42 @@ +import { redirect } from 'next/navigation' + +import { REFERENCES } from '~/content/navigation.references' +import { ClientSdkReferencePage } from '~/features/docs/Reference.sdkPage' +import { + generateReferenceMetadata, + generateReferenceStaticParams, + parseReferencePath, + redirectNonexistentReferenceSection, +} from '~/features/docs/Reference.utils' +import { notFoundLink } from '~/features/recommendations/NotFound.utils' + +export default async function ReferencePage({ + params: { slug }, +}: { + params: { slug: Array } +}) { + if (!Object.keys(REFERENCES).includes(slug[0])) { + redirect(notFoundLink(slug.join('/'))) + } + + const parsedPath = parseReferencePath(slug) + const isClientSdkReference = parsedPath.__type === 'clientSdk' + + if (isClientSdkReference) { + const { sdkId, maybeVersion, path } = parsedPath + + const sdkData = REFERENCES[sdkId] + const latestVersion = sdkData.versions[0] + const version = maybeVersion ?? latestVersion + + await redirectNonexistentReferenceSection(sdkId, version, path, version === latestVersion) + + return + } else { + // Unimplemented -- eventually API and CLI + redirect(notFoundLink(slug.join('/'))) + } +} + +export const generateStaticParams = generateReferenceStaticParams +export const generateMetadata = generateReferenceMetadata diff --git a/apps/docs/app/reference/page.tsx b/apps/docs/app/reference/page.tsx new file mode 100644 index 00000000000..2475c34d309 --- /dev/null +++ b/apps/docs/app/reference/page.tsx @@ -0,0 +1,62 @@ +import Link from 'next/link' + +import { REFERENCES, clientSdkIds } from '~/content/navigation.references' +import { IconPanelWithIconPicker } from '~/features/ui/IconPanelWithIconPicker' +import { LayoutMainContent } from '~/layouts/DefaultLayout' +import { SidebarSkeleton } from '~/layouts/MainSkeleton' + +export default function ReferenceIndexPage() { + return ( + + +
+

API References

+

+ The Supabase client libraries help you interact with Supabase products, such as the + Postgres Database, Auth, and Realtime. They are available in several popular programming + languages. +

+

+ Supabase also has a Management API to help with managing your Supabase Platform, and a + CLI for local development and CI workflows. +

+

Client Libraries

+
+ {clientSdkIds.map((sdkId) => { + return ( + + + + ) + })} +
+

Management API and CLI

+
+ + + + + + +
+
+
+
+ ) +} diff --git a/apps/docs/components/Breadcrumbs.tsx b/apps/docs/components/Breadcrumbs.tsx index c8225015f67..cc7e96f3d90 100644 --- a/apps/docs/components/Breadcrumbs.tsx +++ b/apps/docs/components/Breadcrumbs.tsx @@ -1,8 +1,10 @@ 'use client' -import React, { Fragment } from 'react' import Link from 'next/link' import { usePathname } from 'next/navigation' +import React, { Fragment } from 'react' + +import { useBreakpoint } from 'common' import { Breadcrumb_Shadcn_ as Breadcrumb, BreadcrumbList_Shadcn_ as BreadcrumbList, @@ -23,9 +25,9 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from 'ui' + +import * as NavItems from '~/components/Navigation/NavigationMenu/NavigationMenu.constants' import { getMenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu.utils' -import { useBreakpoint } from 'common' -import * as NavItems from './Navigation/NavigationMenu/NavigationMenu.constants' const Breadcrumbs = ({ className }: { className?: string }) => { const pathname = usePathname() diff --git a/apps/docs/components/MDX/partials.tsx b/apps/docs/components/MDX/partials.tsx index f7a6e738c0f..1f6133c6e4f 100644 --- a/apps/docs/components/MDX/partials.tsx +++ b/apps/docs/components/MDX/partials.tsx @@ -1,5 +1,6 @@ 'use client' +import AuthErrorCodesTable from './auth_error_codes_table.mdx' import AuthRateLimits from './auth_rate_limits.mdx' import CreateClientSnippet from './create_client_snippet.mdx' import DatabaseSetup from './database_setup.mdx' @@ -15,6 +16,7 @@ import SocialProviderSettingsSupabase from './social_provider_settings_supabase. import SocialProviderSetup from './social_provider_setup.mdx' export { + AuthErrorCodesTable, AuthRateLimits, CreateClientSnippet, DatabaseSetup, diff --git a/apps/docs/components/Navigation/Navigation.types.ts b/apps/docs/components/Navigation/Navigation.types.ts index dd744fe4b0e..0b8489dacc8 100644 --- a/apps/docs/components/Navigation/Navigation.types.ts +++ b/apps/docs/components/Navigation/Navigation.types.ts @@ -13,16 +13,6 @@ export interface NavMenuSection { items: Partial[] } -export interface References { - [key: string]: { - name: string - library?: string - versions: string[] - icon: string - currentVersion?: string - } -} - type MenuItem = { label: string icon?: string diff --git a/apps/docs/components/Navigation/NavigationMenu/MenuIconPicker.tsx b/apps/docs/components/Navigation/NavigationMenu/MenuIconPicker.tsx index 18fef33a67b..acab4cf6f97 100644 --- a/apps/docs/components/Navigation/NavigationMenu/MenuIconPicker.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/MenuIconPicker.tsx @@ -1,7 +1,6 @@ -'use client' - -import React from 'react' import { + IconBranching, + IconGitHub, IconMenuApi, IconMenuAuth, IconMenuCli, @@ -26,10 +25,8 @@ import { IconMenuKotlin, IconMenuAI, IconMenuDevCli, - IconGitHub, IconSupport, IconTroubleshooting, - IconBranching, } from './MenuIcons' function getMenuIcon(menuKey: string, width: number = 16, height: number = 16, className?: string) { diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 3a8196a9652..2f88badac98 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -1,5 +1,4 @@ -import { IS_DEV } from '~/lib/constants' -import type { GlobalMenuItems, NavMenuConstant, References } from '../Navigation.types' +import type { GlobalMenuItems, NavMenuConstant } from '../Navigation.types' export const GLOBAL_MENU_ITEMS: GlobalMenuItems = [ [ @@ -100,38 +99,38 @@ export const GLOBAL_MENU_ITEMS: GlobalMenuItems = [ { label: 'JavaScript', icon: 'reference-javascript', - href: '/reference/javascript/introduction', + href: '/reference/javascript', level: 'reference_javascript', }, { label: 'Flutter', icon: 'reference-dart', - href: '/reference/dart/introduction', + href: '/reference/dart', level: 'reference_dart', }, { label: 'Swift', icon: 'reference-swift', - href: '/reference/swift/introduction', + href: '/reference/swift', level: 'reference_swift', }, { label: 'Python', icon: 'reference-python', - href: '/reference/python/introduction', + href: '/reference/python', level: 'reference_python', }, { label: 'C#', icon: 'reference-csharp', - href: '/reference/csharp/introduction', + href: '/reference/csharp', level: 'reference_csharp', community: true, }, { label: 'Kotlin', icon: 'reference-kotlin', - href: '/reference/kotlin/introduction', + href: '/reference/kotlin', level: 'reference_kotlin', community: true, }, @@ -202,51 +201,6 @@ export const GLOBAL_MENU_ITEMS: GlobalMenuItems = [ ], ] -export const REFERENCES: References = { - javascript: { - name: 'supabase-js', - library: 'supabase-js', - versions: ['v2', 'v1'], - icon: '/img/libraries/javascript-icon', - }, - dart: { - name: 'Flutter', - library: 'supabase-dart', - versions: ['v2', 'v1'], - icon: '/docs/img/libraries/flutter-icon.svg', - }, - csharp: { - name: 'C#', - library: 'supabase-csharp', - versions: ['v1', 'v0'], - icon: '/docs/img/libraries/c-sharp-icon.svg', - }, - swift: { - name: 'Swift', - library: 'supabase-swift', - versions: ['v2', 'v1'], - icon: '/docs/img/libraries/swift-icon.svg', - }, - kotlin: { - name: 'Kotlin', - library: 'supabase-kt', - versions: ['v2', 'v1'], - icon: '/docs/img/libraries/kotlin-icon.svg', - }, - cli: { - name: 'CLI', - library: undefined, - versions: [], - icon: '/docs/img/icons/cli-icon.svg', - }, - api: { - name: 'API', - library: undefined, - versions: [], - icon: '/docs/img/icons/api-icon.svg', - }, -} - export const gettingstarted: NavMenuConstant = { icon: 'getting-started', title: 'Start with Supabase', @@ -2123,13 +2077,6 @@ export const reference = { items: [], icon: '/img/icons/menu/reference-kotlin', }, - // { - // name: 'supabase-python', - // url: '/reference/python/start', - // level: 'reference_python', - // - // icon: '/img/icons/menu/reference-javascript', - // }, ], }, { @@ -2155,6 +2102,10 @@ export const reference_javascript_v1 = { title: 'JavaScript', url: '/guides/reference/javascript', parent: '/reference', + pkg: { + name: '@supabase/supabase-js', + repo: 'https://github.com/supabase/supabase-js', + }, } export const reference_javascript_v2 = { @@ -2162,6 +2113,10 @@ export const reference_javascript_v2 = { title: 'JavaScript', url: '/guides/reference/javascript', parent: '/reference', + pkg: { + name: '@supabase/supabase-js', + repo: 'https://github.com/supabase/supabase-js', + }, } export const reference_dart_v1 = { @@ -2169,6 +2124,10 @@ export const reference_dart_v1 = { title: 'Flutter', url: '/guides/reference/dart', parent: '/reference', + pkg: { + name: 'supabase_flutter', + repo: 'https://github.com/supabase/supabase-flutter', + }, } export const reference_dart_v2 = { @@ -2176,6 +2135,10 @@ export const reference_dart_v2 = { title: 'Flutter', url: '/guides/reference/dart', parent: '/reference', + pkg: { + name: 'supabase_flutter', + repo: 'https://github.com/supabase/supabase-flutter', + }, } export const reference_csharp_v0 = { @@ -2183,6 +2146,10 @@ export const reference_csharp_v0 = { title: 'C#', url: 'guides/reference/csharp', parent: '/reference', + pkg: { + name: 'supabase', + repo: 'https://github.com/supabase-community/supabase-csharp', + }, } export const reference_csharp_v1 = { @@ -2190,6 +2157,10 @@ export const reference_csharp_v1 = { title: 'C#', url: 'guides/reference/csharp', parent: '/reference', + pkg: { + name: 'supabase', + repo: 'https://github.com/supabase-community/supabase-csharp', + }, } export const reference_python_v2 = { @@ -2197,6 +2168,10 @@ export const reference_python_v2 = { title: 'Python', url: '/guides/reference/python', parent: '/reference', + pkg: { + name: 'supabase-py', + repo: 'https://github.com/supabase/supabase-py', + }, } export const reference_swift_v1 = { @@ -2204,6 +2179,10 @@ export const reference_swift_v1 = { title: 'swift', url: 'guides/reference/swift', parent: '/reference', + pkg: { + name: 'supabase-swift', + repo: 'https://github.com/supabase/supabase-swift', + }, } export const reference_swift_v2 = { @@ -2211,6 +2190,10 @@ export const reference_swift_v2 = { title: 'swift', url: 'guides/reference/swift', parent: '/reference', + pkg: { + name: 'supabase-swift', + repo: 'https://github.com/supabase/supabase-swift', + }, } export const reference_kotlin_v1 = { @@ -2218,6 +2201,10 @@ export const reference_kotlin_v1 = { title: 'kotlin', url: 'guides/reference/kotlin', parent: '/reference', + pkg: { + name: '@supabase-community/supabase-kt', + repo: 'https://github.com/supabase-community/supabase-kt', + }, } export const reference_kotlin_v2 = { @@ -2225,6 +2212,10 @@ export const reference_kotlin_v2 = { title: 'kotlin', url: 'guides/reference/kotlin', parent: '/reference', + pkg: { + name: '@supabase-community/supabase-kt', + repo: 'https://github.com/supabase-community/supabase-kt', + }, } export const reference_cli = { diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx index 95dc17e710f..272443a3498 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.tsx @@ -1,4 +1,5 @@ import { memo } from 'react' + import NavigationMenuGuideList from './NavigationMenuGuideList' import NavigationMenuRefList from './NavigationMenuRefList' import { useCloseMenuOnRouteChange } from './NavigationMenu.utils' @@ -50,8 +51,7 @@ interface GuideMenu extends BaseMenu { interface ReferenceMenu extends BaseMenu { type: 'reference' path: string - commonSectionsFile: string - specFile?: string + commonSectionsFile?: string } type Menu = GuideMenu | ReferenceMenu @@ -115,133 +115,109 @@ const menus: Menu[] = [ }, { id: MenuId.RefJavaScriptV1, - commonSectionsFile: 'common-client-libs-sections.json', - specFile: 'supabase_js_v1.yml', type: 'reference', path: '/reference/javascript/v1', }, { id: MenuId.RefJavaScriptV2, - commonSectionsFile: 'common-client-libs-sections.json', - specFile: 'supabase_js_v2.yml', type: 'reference', path: '/reference/javascript', }, { id: MenuId.RefDartV1, - commonSectionsFile: 'common-client-libs-sections.json', - specFile: 'supabase_dart_v1.yml', type: 'reference', path: '/reference/dart/v1', }, { id: MenuId.RefDartV2, - commonSectionsFile: 'common-client-libs-sections.json', - specFile: 'supabase_dart_v2.yml', type: 'reference', path: '/reference/dart', }, { id: MenuId.RefCSharpV0, - commonSectionsFile: 'common-client-libs-sections.json', - specFile: 'supabase_csharp_v0.yml', type: 'reference', path: '/reference/csharp/v0', }, { id: MenuId.RefCSharpV1, - commonSectionsFile: 'common-client-libs-sections.json', - specFile: 'supabase_csharp_v1.yml', type: 'reference', path: '/reference/csharp', }, { id: MenuId.RefPythonV2, - commonSectionsFile: 'common-client-libs-sections.json', - specFile: 'supabase_py_v2.yml', type: 'reference', path: '/reference/python', }, { id: MenuId.RefSwiftV1, - commonSectionsFile: 'common-client-libs-sections.json', - specFile: 'supabase_swift_v1.yml', type: 'reference', path: '/reference/swift', }, { id: MenuId.RefSwiftV2, - commonSectionsFile: 'common-client-libs-sections.json', - specFile: 'supabase_swift_v2.yml', type: 'reference', path: '/reference/swift', }, { id: MenuId.RefKotlinV1, - commonSectionsFile: 'common-client-libs-sections.json', - specFile: 'supabase_kt_v1.yml', type: 'reference', path: '/reference/kotlin/v1', }, { id: MenuId.RefKotlinV2, - commonSectionsFile: 'common-client-libs-sections.json', - specFile: 'supabase_kt_v2.yml', type: 'reference', path: '/reference/kotlin', }, { id: MenuId.RefCli, - commonSectionsFile: 'common-cli-sections.json', type: 'reference', path: '/reference/cli', + commonSectionsFile: 'common-cli-sections.json', }, { id: MenuId.RefApi, - commonSectionsFile: 'common-api-sections.json', type: 'reference', path: '/reference/api', + commonSectionsFile: 'common-api-sections.json', }, { id: MenuId.SelfHostingAuth, - commonSectionsFile: 'common-self-hosting-auth-sections.json', type: 'reference', path: '/reference/self-hosting-auth', + commonSectionsFile: 'common-self-hosting-auth-sections.json', }, { id: MenuId.SelfHostingStorage, - commonSectionsFile: 'common-self-hosting-storage-sections.json', type: 'reference', path: '/reference/self-hosting-storage', + commonSectionsFile: 'common-self-hosting-storage-sections.json', }, { id: MenuId.SelfHostingRealtime, - commonSectionsFile: 'common-self-hosting-realtime-sections.json', type: 'reference', path: '/reference/self-hosting-realtime', + commonSectionsFile: 'common-self-hosting-realtime-sections.json', }, { id: MenuId.SelfHostingAnalytics, - commonSectionsFile: 'common-self-hosting-analytics-sections.json', type: 'reference', path: '/reference/self-hosting-analytics', + commonSectionsFile: 'common-self-hosting-analytics-sections.json', }, { id: MenuId.SelfHostingFunctions, - commonSectionsFile: 'common-self-hosting-functions-sections.json', type: 'reference', path: '/reference/self-hosting-functions', + commonSectionsFile: 'common-self-hosting-functions-sections.json', }, ] -export function getMenuById(id: MenuId) { +function getMenuById(id: MenuId) { return menus.find((menu) => menu.id === id) } function getMenuElement(menu: Menu | undefined) { - if (!menu) throw Error('No menu found for this menuId') - - const menuType = menu.type + const menuType = menu?.type switch (menuType) { case 'guide': return @@ -251,7 +227,6 @@ function getMenuElement(menu: Menu | undefined) { id={menu.id} basePath={menu.path} commonSectionsFile={menu.commonSectionsFile} - specFile={menu.specFile} /> ) default: @@ -268,5 +243,5 @@ const NavigationMenu = ({ menuId }: { menuId: MenuId }) => { return getMenuElement(menu) } -export { MenuId } +export { MenuId, getMenuById } export default memo(NavigationMenu) diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.utils.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.utils.ts index 28633a25ab9..85934ed317e 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.utils.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.utils.ts @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react' import { usePathname } from 'next/navigation' import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' import type { ICommonItem } from '~/components/reference/Reference.types' -import type { Json } from '~/types' +import type { Json } from '~/features/helpers.types' import { menuState } from '../../../hooks/useMenuState' export function getPathWithoutHash(relativePath: string) { @@ -99,14 +99,6 @@ export function useSpec(specFile?: string) { return spec } -export const useCloseMenuOnRouteChange = () => { - const pathname = usePathname() - - useEffect(() => { - menuState.setMenuMobileOpen(false) - }, [pathname]) -} - export const getMenuId = (pathname: string | null) => { pathname = (pathname ??= '').replace(/^\/guides\//, '') @@ -141,3 +133,11 @@ export const getMenuId = (pathname: string | null) => { return MenuId.GettingStarted } } + +export const useCloseMenuOnRouteChange = () => { + const pathname = usePathname() + + useEffect(() => { + menuState.setMenuMobileOpen(false) + }, [pathname]) +} diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefList.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefList.tsx index af0c26b8050..9725daa229b 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefList.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefList.tsx @@ -28,12 +28,6 @@ const NavigationMenuRefList = ({ } const filteredSections = commonSections.filter((section) => { - if (section.type === 'category') { - section.items = section.items.filter((item) => { - return !item.excludes?.includes(id) - }) - } - return !section.excludes?.includes(id) }) diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx index 4d42b905c1d..fa84e200b06 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx @@ -185,7 +185,6 @@ const NavigationMenuRefListItems = ({
-
    {filteredSections.map((section) => { diff --git a/apps/docs/components/Navigation/SideBar.tsx b/apps/docs/components/Navigation/SideBar.tsx index fcf02a89a98..179b66a333b 100644 --- a/apps/docs/components/Navigation/SideBar.tsx +++ b/apps/docs/components/Navigation/SideBar.tsx @@ -2,7 +2,7 @@ import Link from 'next/link' import Image from 'next/legacy/image' import { usePathname } from 'next/navigation' import { IconChevronRight, IconArrowLeft } from '~/../../packages/ui' -import { REFERENCES } from './NavigationMenu/NavigationMenu.constants' +import { REFERENCES } from '~/content/navigation.references' import { NavMenuGroup, NavMenuSection } from './Navigation.types' import * as Accordion from '@radix-ui/react-accordion' diff --git a/apps/docs/components/RefVersionDropdown.tsx b/apps/docs/components/RefVersionDropdown.tsx index 19c92b28898..9083d286155 100644 --- a/apps/docs/components/RefVersionDropdown.tsx +++ b/apps/docs/components/RefVersionDropdown.tsx @@ -1,4 +1,8 @@ -import { usePathname, useRouter } from 'next/navigation' +'use client' + +import { ChevronDown } from 'lucide-react' +import { useRouter } from 'next/navigation' + import { Badge, DropdownMenu, @@ -6,34 +10,32 @@ import { DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, - IconChevronDown, } from 'ui' -import { REFERENCES } from './Navigation/NavigationMenu/NavigationMenu.constants' -const RevVersionDropdown = () => { - const pathname = usePathname() +import { REFERENCES } from '~/content/navigation.references' + +const RevVersionDropdown = ({ + library, + currentVersion, +}: { + library: string + currentVersion: string +}) => { const { push } = useRouter() - const pathSegments = pathname.split('/') - const library = pathSegments.length >= 3 ? pathSegments[2] : undefined const libraryMeta = REFERENCES?.[library] ?? undefined const versions = libraryMeta?.versions ?? [] - const currentVersion = versions.includes(pathSegments[pathSegments.indexOf(library) + 1]) - ? pathSegments[pathSegments.indexOf(library) + 1] - : versions[0] - - const onSelectVersion = (version: string) => { - if (!library) return - if (version === versions[0]) { - push(`/reference/${library}/start`) - } else { - push(`/reference/${library}/${version}/start`) - } + if (!versions || versions.length <= 1) { + return null } - if (!versions || versions.length === 0) { - return <> + const onSelectVersion = (version: string) => { + if (version === versions[0]) { + push(`/reference/${library}`) + } else { + push(`/reference/${library}/${version}`) + } } return ( @@ -52,11 +54,10 @@ const RevVersionDropdown = () => { flex items-center gap-1 text-foreground-muted text-xs group-hover:text-foreground transition " > - {/* version */} {currentVersion}.0 - + diff --git a/apps/docs/content/navigation.references.ts b/apps/docs/content/navigation.references.ts new file mode 100644 index 00000000000..fb56ab7c6c7 --- /dev/null +++ b/apps/docs/content/navigation.references.ts @@ -0,0 +1,123 @@ +export const REFERENCES = { + javascript: { + type: 'sdk', + name: 'JavaScript', + library: 'supabase-js', + libPath: 'javascript', + versions: ['v2', 'v1'], + typeSpec: true, + icon: 'reference-javascript', + meta: { + v2: { + libId: 'reference_javascript_v2', + specFile: 'supabase_js_v2', + }, + v1: { + libId: 'reference_javascript_v1', + specFile: 'supabase_js_v1', + }, + }, + }, + dart: { + type: 'sdk', + name: 'Flutter', + library: 'supabase-dart', + libPath: 'dart', + versions: ['v2', 'v1'], + icon: 'reference-dart', + meta: { + v2: { + libId: 'reference_dart_v2', + specFile: 'supabase_dart_v2', + }, + v1: { + libId: 'reference_dart_v1', + specFile: 'supabase_dart_v1', + }, + }, + }, + csharp: { + type: 'sdk', + name: 'C#', + library: 'supabase-csharp', + libPath: 'csharp', + versions: ['v1', 'v0'], + icon: 'reference-csharp', + meta: { + v1: { + libId: 'reference_csharp_v1', + specFile: 'supabase_csharp_v1', + }, + v0: { + libId: 'reference_csharp_v0', + specFile: 'supabase_csharp_v0', + }, + }, + }, + swift: { + type: 'sdk', + name: 'Swift', + library: 'supabase-swift', + libPath: 'swift', + versions: ['v2', 'v1'], + icon: 'reference-swift', + meta: { + v2: { + libId: 'reference_swift_v2', + specFile: 'supabase_swift_v2', + }, + v1: { + libId: 'reference_swift_v1', + specFile: 'supabase_swift_v1', + }, + }, + }, + kotlin: { + type: 'sdk', + name: 'Kotlin', + library: 'supabase-kt', + libPath: 'kotlin', + versions: ['v2', 'v1'], + icon: 'reference-kotlin', + meta: { + v2: { + libId: 'reference_kotlin_v2', + specFile: 'supabase_kt_v2', + }, + v1: { + libId: 'reference_kotlin_v1', + specFile: 'supabase_kt_v1', + }, + }, + }, + python: { + type: 'sdk', + name: 'Python', + library: 'supabase-py', + libPath: 'python', + versions: ['v2'], + icon: 'reference-python', + meta: { + v2: { + libId: 'reference_python_v2', + specFile: 'supabase_py_v2', + }, + }, + }, + cli: { + type: 'cli', + name: 'CLI', + versions: [], + icon: 'reference-cli', + }, + api: { + type: 'api', + name: 'API', + versions: [], + icon: 'reference-api', + }, +} as const + +export const clientSdkIds = Object.keys(REFERENCES).filter( + (reference) => REFERENCES[reference].type === 'sdk' +) diff --git a/apps/docs/docs/ref/csharp/introduction.mdx b/apps/docs/docs/ref/csharp/introduction.mdx index 84c307600c9..c3531177427 100644 --- a/apps/docs/docs/ref/csharp/introduction.mdx +++ b/apps/docs/docs/ref/csharp/introduction.mdx @@ -1,29 +1,9 @@ ---- -id: introduction -title: Introduction -hideTitle: true ---- +This reference documents every object and method available in Supabase's C# library, [supabase](https://www.nuget.org/packages/supabase). You can use `Supabase` to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. -
    - -
    -

    C# Client Library

    -

    - @supabase-community/supabase-csharp -

    -
    -
    + -{/* prettier-ignore */} -
    - This reference documents every object and method available in Supabase's C# library, [supabase](https://www.nuget.org/packages/supabase). You can use `Supabase` to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. -
    +The C# client library is created and maintained by the Supabase community, and is not an official library. Please be tolerant of areas where the library is still being developed, and — as with all the libraries — feel free to contribute wherever you find issues. -{/* prettier-ignore */} -
    +Huge thanks to official maintainer, [Joseph Schultz](https://github.com/acupofjose). As well as [Will Iverson](https://github.com/wiverson), [Ben Randall](https://github.com/veleek), and [Rhuan Barros](https://github.com/rhuanbarros) for their help. - The C# client library is created and maintained by the Supabase community, and is not an official library. Please be tolerant of areas where the library is still being developed, and — as with all the libraries — feel free to contribute wherever you find issues. - - Huge thanks to official maintainer, [Joseph Schultz](https://github.com/acupofjose). As well as [Will Iverson](https://github.com/wiverson), [Ben Randall](https://github.com/veleek), and [Rhuan Barros](https://github.com/rhuanbarros) for their help. - -
    +
    diff --git a/apps/docs/docs/ref/csharp/v0/introduction.mdx b/apps/docs/docs/ref/csharp/v0/introduction.mdx index 1fed5441e0f..c428f250498 100644 --- a/apps/docs/docs/ref/csharp/v0/introduction.mdx +++ b/apps/docs/docs/ref/csharp/v0/introduction.mdx @@ -1,29 +1,9 @@ ---- -id: introduction -title: Introduction -hideTitle: true ---- +This reference documents every object and method available in Supabase's C# library, [supabase-csharp](https://www.nuget.org/packages/supabase-csharp). You can use `Supabase` to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. -
    - -
    -

    C# Client Library

    -

    - @supabase-community/supabase-csharp -

    -
    -
    + -{/* prettier-ignore */} -
    - This reference documents every object and method available in Supabase's C# library, [supabase-csharp](https://www.nuget.org/packages/supabase-csharp). You can use `Supabase` to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. -
    +The C# client library is created and maintained by the Supabase community, and is not an official library. Please be tolerant of areas where the library is still being developed, and — as with all the libraries — feel free to contribute wherever you find issues. -{/* prettier-ignore */} -
    +Huge thanks to official maintainer, [Joseph Schultz](https://github.com/acupofjose). As well as [Will Iverson](https://github.com/wiverson), [Ben Randall](https://github.com/veleek), and [Rhuan Barros](https://github.com/rhuanbarros) for their help. - The C# client library is created and maintained by the Supabase community, and is not an official library. Please be tolerant of areas where the library is still being developed, and — as with all the libraries — feel free to contribute wherever you find issues. - - Huge thanks to official maintainer, [Joseph Schultz](https://github.com/acupofjose). As well as [Will Iverson](https://github.com/wiverson), [Ben Randall](https://github.com/veleek), and [Rhuan Barros](https://github.com/rhuanbarros) for their help. - -
    +
    diff --git a/apps/docs/docs/ref/dart/introduction.mdx b/apps/docs/docs/ref/dart/introduction.mdx index c7c7f2f58fd..fd681dcfe91 100644 --- a/apps/docs/docs/ref/dart/introduction.mdx +++ b/apps/docs/docs/ref/dart/introduction.mdx @@ -1,20 +1,3 @@ ---- -id: introduction -title: Introduction -hideTitle: true ---- +This reference documents every object and method available in Supabase's Flutter library, [supabase-flutter](https://pub.dev/packages/supabase_flutter). You can use supabase-flutter to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. -
    - -
    -

    Flutter Client Library

    -

    supabase-flutter

    -
    -
    - -{/* prettier-ignore */} -
    - This reference documents every object and method available in Supabase's Flutter library, [supabase-flutter](https://pub.dev/packages/supabase_flutter). You can use supabase-flutter to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. - - We also provide a [supabase](https://pub.dev/packages/supabase) package for non-Flutter projects. -
    +We also provide a [supabase](https://pub.dev/packages/supabase) package for non-Flutter projects. diff --git a/apps/docs/docs/ref/dart/v0/introduction.mdx b/apps/docs/docs/ref/dart/v0/introduction.mdx index 9be35f2dab5..fd681dcfe91 100644 --- a/apps/docs/docs/ref/dart/v0/introduction.mdx +++ b/apps/docs/docs/ref/dart/v0/introduction.mdx @@ -1,24 +1,3 @@ ---- -id: introduction -title: Introduction -hideTitle: true ---- +This reference documents every object and method available in Supabase's Flutter library, [supabase-flutter](https://pub.dev/packages/supabase_flutter). You can use supabase-flutter to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. -
    - -
    -

    Flutter Client Library

    -

    supabase-flutter

    -
    -
    - -
    - - - You're viewing the docs for an older version of the `supabase-flutter` library. Learn how to [upgrade to the latest version](/docs/reference/dart/v0/upgrade-guide). - - - This reference documents every object and method available in Supabase's Flutter library, [supabase-flutter](https://pub.dev/packages/supabase_flutter). You can use supabase-flutter to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. - - We also provide a [supabase](https://pub.dev/packages/supabase) package for non-Flutter projects. -
    +We also provide a [supabase](https://pub.dev/packages/supabase) package for non-Flutter projects. diff --git a/apps/docs/docs/ref/dart/v1/introduction.mdx b/apps/docs/docs/ref/dart/v1/introduction.mdx index c7c7f2f58fd..fd681dcfe91 100644 --- a/apps/docs/docs/ref/dart/v1/introduction.mdx +++ b/apps/docs/docs/ref/dart/v1/introduction.mdx @@ -1,20 +1,3 @@ ---- -id: introduction -title: Introduction -hideTitle: true ---- +This reference documents every object and method available in Supabase's Flutter library, [supabase-flutter](https://pub.dev/packages/supabase_flutter). You can use supabase-flutter to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. -
    - -
    -

    Flutter Client Library

    -

    supabase-flutter

    -
    -
    - -{/* prettier-ignore */} -
    - This reference documents every object and method available in Supabase's Flutter library, [supabase-flutter](https://pub.dev/packages/supabase_flutter). You can use supabase-flutter to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. - - We also provide a [supabase](https://pub.dev/packages/supabase) package for non-Flutter projects. -
    +We also provide a [supabase](https://pub.dev/packages/supabase) package for non-Flutter projects. diff --git a/apps/docs/docs/ref/javascript/introduction.mdx b/apps/docs/docs/ref/javascript/introduction.mdx index 37835c2498b..ac1adb04ab3 100644 --- a/apps/docs/docs/ref/javascript/introduction.mdx +++ b/apps/docs/docs/ref/javascript/introduction.mdx @@ -4,15 +4,4 @@ title: Introduction hideTitle: true --- -
    - -
    -

    JavaScript Client Library

    -

    @supabase/supabase-js

    -
    -
    - -{/* prettier-ignore */} -
    - This reference documents every object and method available in Supabase's isomorphic JavaScript library, supabase-js. You can use supabase-js to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. -
    +This reference documents every object and method available in Supabase's isomorphic JavaScript library, `supabase-js`. You can use `supabase-js` to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. diff --git a/apps/docs/docs/ref/javascript/v1/introduction.mdx b/apps/docs/docs/ref/javascript/v1/introduction.mdx index ded6df7a760..7060fc0645f 100644 --- a/apps/docs/docs/ref/javascript/v1/introduction.mdx +++ b/apps/docs/docs/ref/javascript/v1/introduction.mdx @@ -1,25 +1 @@ ---- -id: introduction -title: Introduction -hideTitle: true ---- - -
    - -
    -

    JavaScript Client Library

    -

    @supabase/supabase-js

    -
    -
    - -
    - - - You're viewing the docs for an older version of the `supabase-js` library. Learn how to [upgrade to the latest version](/docs/reference/javascript/v1/upgrade-guide). - - - -

    - This reference documents every object and method available in Supabase's isomorphic JavaScript library, supabase-js. You can use supabase-js to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. -

    -
    +This reference documents every object and method available in Supabase's isomorphic JavaScript library, supabase-js. You can use supabase-js to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. diff --git a/apps/docs/docs/ref/javascript/v1/release-notes.mdx b/apps/docs/docs/ref/javascript/v1/release-notes.mdx deleted file mode 100644 index 725cbb5201e..00000000000 --- a/apps/docs/docs/ref/javascript/v1/release-notes.mdx +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: release-notes -title: Release Notes ---- - -## js v1 this is the release notes file. diff --git a/apps/docs/docs/ref/kotlin/introduction.mdx b/apps/docs/docs/ref/kotlin/introduction.mdx index 955aa8d9036..602ed0284ee 100644 --- a/apps/docs/docs/ref/kotlin/introduction.mdx +++ b/apps/docs/docs/ref/kotlin/introduction.mdx @@ -1,30 +1,13 @@ ---- -id: introduction -title: Introduction -hideTitle: true ---- - -
    - -
    -

    Kotlin Client Library

    -

    @supabase-community/supabase-kt

    -
    -
    - -
    - This reference documents every object and method available in Supabase's Kotlin Multiplatform library, [supabase-kt](https://github.com/supabase-community/supabase-kt). You can use supabase-kt to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. To see supported Kotlin targets, check the corresponding module README on [GitHub](https://github.com/supabase-community/supabase-kt). To migrate from version 1.4.X to 2.0.0, see the [migration guide](https://github.com/supabase-community/supabase-kt/blob/master/MIGRATION.md) -
    + -
    The Kotlin client library is created and maintained by the Supabase community, and is not an official library. Please be tolerant of areas where the library is still being developed, and — as with all the libraries — feel free to contribute wherever you find issues. Huge thanks to official maintainer, [jan-tennert](https://github.com/jan-tennert). -
    +
    diff --git a/apps/docs/docs/ref/kotlin/v1/installing.mdx b/apps/docs/docs/ref/kotlin/v1/installing.mdx new file mode 100644 index 00000000000..f6e5c9ba8b3 --- /dev/null +++ b/apps/docs/docs/ref/kotlin/v1/installing.mdx @@ -0,0 +1,393 @@ +--- +id: installing +title: 'Installing & Initialization' +slug: installing +custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml +--- + +### Add one or more modules to your project + + + + + + Add dependency to your build file using the BOM. + + The available modules are: + - [**gotrue-kt**](https://github.com/supabase-community/supabase-kt/tree/master/GoTrue) + - [**realtime-kt**](https://github.com/supabase-community/supabase-kt/tree/master/Realtime) + - [**storage-kt**](https://github.com/supabase-community/supabase-kt/tree/master/Storage) + - [**functions-kt**](https://github.com/supabase-community/supabase-kt/tree/master/Functions) + - [**postgrest-kt**](https://github.com/supabase-community/supabase-kt/tree/master/Postgrest) + - Other plugins also available [here](https://github.com/supabase-community/supabase-kt/tree/master/plugins) + + + + + + + ```kotlin + implementation(platform("io.github.jan-tennert.supabase:bom:VERSION")) + implementation("io.github.jan-tennert.supabase:postgrest-kt") + implementation("io.github.jan-tennert.supabase:gotrue-kt") + implementation("io.github.jan-tennert.supabase:realtime-kt") + ``` + + + + + ```groovy + implementation platform("io.github.jan-tennert.supabase:bom:VERSION") + implementation 'io.github.jan-tennert.supabase:postgrest-kt' + implementation 'io.github.jan-tennert.supabase:gotrue-kt' + implementation 'io.github.jan-tennert.supabase:realtime-kt' + ``` + + + + + ```xml + + io.github.jan-tennert.supabase + bom + VERSION + pom + import + + + io.github.jan-tennert.supabase + postgrest-kt + + + io.github.jan-tennert.supabase + gotrue-kt + + + io.github.jan-tennert.supabase + realtime-kt + + ``` + + + + + + + +### Add Ktor Client Engine to each of your Kotlin targets (required) + + + + + You can find a list of engines [here](https://ktor.io/docs/http-client-engines.html) + + + + + + + ```kotlin + implementation("io.ktor:ktor-client-[engine]:KTOR_VERSION") + ``` + + + + + ```groovy + implementation 'io.ktor:ktor-client-[engine]:KTOR_VERSION' + ``` + + + + + ```xml + + io.ktor + ktor-client-[engine] + KTOR_VERSION + + ``` + + + + + + + + Multiplatform example: + + + + + + + + ```kotlin + val commonMain by getting { + dependencies { + //supabase modules + } + } + val jvmMain by getting { + dependencies { + implementation("io.ktor:ktor-client-cio:KTOR_VERSION") + } + } + val androidMain by getting { + dependsOn(jvmMain) + } + val jsMain by getting { + dependencies { + implementation("io.ktor:ktor-client-js:KTOR_VERSION") + } + } + val iosMain by getting { + dependencies { + implementation("io.ktor:ktor-client-darwin:KTOR_VERSION") + } + } + ``` + + + + + + + + +### Serialization + +supabase-kt provides several different ways to encode and decode your custom objects. +By default, [KotlinX Serialization](https://github.com/Kotlin/kotlinx.serialization) is used. + + + + + Use [KotlinX Serialization](https://github.com/Kotlin/kotlinx.serialization). + + + + + + + + ```kotlin + plugins { + kotlin("plugin.serialization") version "KOTLIN_VERSION" + } + ``` + + + + + ```groovy + plugins { + id 'org.jetbrains.kotlin.plugin.serialization' version 'KOTLIN_VERSION' + } + ``` + + + + + ```xml + + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + compile + compile + + compile + + + + + + kotlinx-serialization + + + + + org.jetbrains.kotlin + kotlin-maven-serialization + ${kotlin.version} + + + + + + ``` + + + + ```kotlin + val supabase = createSupabaseClient(supabaseUrl, supabaseKey) { + //Already the default serializer, but you can provide a custom Json instance (optional): + defaultSerializer = KotlinXSerializer(Json { + //apply your custom config + }) + } + ``` + + + + + + + Use [Moshi](https://github.com/square/moshi). + + + + + + + + ```kotlin + implementation("io.github.jan-tennert.supabase:serializer-moshi:VERSION") + ``` + + + + + ```groovy + implementation 'io.github.jan-tennert.supabase:serializer-moshi:VERSION' + ``` + + + + + ```xml + + io.github.jan-tennert.supabase + serializer-moshi + VERSION + + ``` + + + + ```kotlin + val supabase = createSupabaseClient(supabaseUrl, supabaseKey) { + defaultSerializer = MoshiSerializer() + } + ``` + + + + + + + + Use [Jackson](https://github.com/FasterXML/jackson-module-kotlin). + + + + + + + + ```kotlin + implementation("io.github.jan-tennert.supabase:serializer-jackson:VERSION") + ``` + + + + + ```groovy + implementation 'io.github.jan-tennert.supabase:serializer-jackson:VERSION' + ``` + + + + + ```xml + + io.github.jan-tennert.supabase + serializer-jackson + VERSION + + ``` + + + + ```kotlin + val supabase = createSupabaseClient(supabaseUrl, supabaseKey) { + defaultSerializer = JacksonSerializer() + } + ``` + + + + + + + + Use custom serializer. + + + + + ```kotlin + class CustomSerializer: SupabaseSerializer { + + override fun encode(type: KType, value: T): String { + //encode value to string + } + + override fun decode(type: KType, value: String): T { + //decode value + } + + } + ``` + + ```kotlin + val supabase = createSupabaseClient(supabaseUrl, supabaseKey) { + defaultSerializer = CustomSerializer() + } + ``` + + + + diff --git a/apps/docs/docs/ref/kotlin/v1/introduction.mdx b/apps/docs/docs/ref/kotlin/v1/introduction.mdx new file mode 100644 index 00000000000..602ed0284ee --- /dev/null +++ b/apps/docs/docs/ref/kotlin/v1/introduction.mdx @@ -0,0 +1,13 @@ +This reference documents every object and method available in Supabase's Kotlin Multiplatform library, [supabase-kt](https://github.com/supabase-community/supabase-kt). You can use supabase-kt to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. + +To see supported Kotlin targets, check the corresponding module README on [GitHub](https://github.com/supabase-community/supabase-kt). + +To migrate from version 1.4.X to 2.0.0, see the [migration guide](https://github.com/supabase-community/supabase-kt/blob/master/MIGRATION.md) + + + +The Kotlin client library is created and maintained by the Supabase community, and is not an official library. Please be tolerant of areas where the library is still being developed, and — as with all the libraries — feel free to contribute wherever you find issues. + +Huge thanks to official maintainer, [jan-tennert](https://github.com/jan-tennert). + + diff --git a/apps/docs/docs/ref/python/introduction.mdx b/apps/docs/docs/ref/python/introduction.mdx index c6388a0af63..7927d1b6d75 100644 --- a/apps/docs/docs/ref/python/introduction.mdx +++ b/apps/docs/docs/ref/python/introduction.mdx @@ -1,18 +1 @@ ---- -id: introduction -title: Introduction -hideTitle: true ---- - -
    - -
    -

    Python Client Library

    -

    @supabase/supabase-py

    -
    -
    - -
    - {/* prettier-ignore */} -

    This reference documents every object and method available in Supabase's Python library, [supabase-py](https://github.com/supabase/supabase-py). You can use supabase-py to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files.

    -
    +This reference documents every object and method available in Supabase's Python library, [supabase-py](https://github.com/supabase/supabase-py). You can use supabase-py to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. diff --git a/apps/docs/docs/ref/swift/introduction.mdx b/apps/docs/docs/ref/swift/introduction.mdx index dadc4490275..25c9f79a791 100644 --- a/apps/docs/docs/ref/swift/introduction.mdx +++ b/apps/docs/docs/ref/swift/introduction.mdx @@ -1,20 +1 @@ ---- -id: introduction -title: Introduction -hideTitle: true ---- - -
    - -
    -

    Swift Client Library

    -

    @supabase/supabase-swift

    -
    -
    - -{/* prettier-ignore */} -
    - - This reference documents every object and method available in Supabase's Swift library, [supabase-swift](https://github.com/supabase/supabase-swift). You can use supabase-swift to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. - -
    +This reference documents every object and method available in Supabase's Swift library, [supabase-swift](https://github.com/supabase/supabase-swift). You can use supabase-swift to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. diff --git a/apps/docs/docs/ref/swift/v1/installing.mdx b/apps/docs/docs/ref/swift/v1/installing.mdx new file mode 100644 index 00000000000..cbc57f06a7b --- /dev/null +++ b/apps/docs/docs/ref/swift/v1/installing.mdx @@ -0,0 +1,63 @@ +--- +id: installing +title: 'Installing' +slug: installing +custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml +--- + +### Install using Swift Package Manager + + + + + You can install Supabase package using Swift Package Manager. + + The package exposes multiple libraries, you can choose between adding all of them using Supabase, or some of: + + - `Auth` + - `Realtime` + - `Postgrest` + - `Functions` + - `Storage` + + + + + + + + + ```swift + let package = Package( + ... + dependencies: [ + ... + .package( + url: "https://github.com/supabase/supabase-swift.git", + from: "2.0.0" + ), + ], + targets: [ + .target( + name: "YourTargetName", + dependencies: [ + .product( + name: "Supabase", // Auth, Realtime, Postgrest, Functions, or Storage + package: "supabase-swift" + ), + ] + ) + ] + ) + ``` + + + + + + diff --git a/apps/docs/docs/ref/swift/v1/introduction.mdx b/apps/docs/docs/ref/swift/v1/introduction.mdx new file mode 100644 index 00000000000..25c9f79a791 --- /dev/null +++ b/apps/docs/docs/ref/swift/v1/introduction.mdx @@ -0,0 +1 @@ +This reference documents every object and method available in Supabase's Swift library, [supabase-swift](https://github.com/supabase/supabase-swift). You can use supabase-swift to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files. diff --git a/apps/docs/features/docs/GuidesMdx.utils.tsx b/apps/docs/features/docs/GuidesMdx.utils.tsx index dc3b05f13c6..49a2bf2c7fa 100644 --- a/apps/docs/features/docs/GuidesMdx.utils.tsx +++ b/apps/docs/features/docs/GuidesMdx.utils.tsx @@ -4,10 +4,12 @@ import { redirect } from 'next/navigation' import { readFile, readdir } from 'node:fs/promises' import { extname, join, sep } from 'node:path' +import { pluckPromise } from '~/features/helpers.fn' import { cache_fullProcess_withDevCacheBust, existsFile } from '~/features/helpers.fs' import type { OrPromise } from '~/features/helpers.types' import { notFoundLink } from '~/features/recommendations/NotFound.utils' -import { BASE_PATH, MISC_URL } from '~/lib/constants' +import { generateOpenGraphImageMeta } from '~/features/seo/openGraph' +import { BASE_PATH } from '~/lib/constants' import { GUIDES_DIRECTORY, isValidGuideFrontmatter, type GuideFrontmatter } from '~/lib/docs' import { newEditLink } from './GuidesMdx.template' @@ -108,9 +110,6 @@ const genGuidesStaticParams = (directory?: string) => async () => { return result } -const pluckPromise = (promise: Promise, key: K) => - promise.then((data) => data[key]) - const genGuideMeta = ( generate: (params: Params) => OrPromise<{ meta: GuideFrontmatter; pathname: `/${string}` }> @@ -136,12 +135,11 @@ const genGuideMeta = openGraph: { ...parentOg, url: `${BASE_PATH}${pathname}`, - images: { - url: `${MISC_URL}/functions/v1/og-images?site=docs&type=${encodeURIComponent(ogType)}&title=${encodeURIComponent(meta.title)}&description=${encodeURIComponent(meta.description ?? 'undefined')}`, - width: 800, - height: 600, - alt: meta.title, - }, + images: generateOpenGraphImageMeta({ + type: ogType, + title: meta.title, + description: meta.description, + }), }, } } diff --git a/apps/docs/features/docs/MdxBase.shared.tsx b/apps/docs/features/docs/MdxBase.shared.tsx index 1ae939c5b8a..7bdb4a49675 100644 --- a/apps/docs/features/docs/MdxBase.shared.tsx +++ b/apps/docs/features/docs/MdxBase.shared.tsx @@ -13,6 +13,7 @@ import ButtonCard from '~/components/ButtonCard' import { Extensions } from '~/components/Extensions' import { JwtGenerator } from '~/components/JwtGenerator' import { + AuthErrorCodesTable, AuthRateLimits, CreateClientSnippet, DatabaseSetup, @@ -41,6 +42,7 @@ const components = { Accordion, AccordionItem, Admonition, + AuthErrorCodesTable, AuthRateLimits, AuthSmsProviderConfig, AppleSecretGenerator, diff --git a/apps/docs/features/docs/Reference.generated.script.ts b/apps/docs/features/docs/Reference.generated.script.ts new file mode 100644 index 00000000000..860ac2d272b --- /dev/null +++ b/apps/docs/features/docs/Reference.generated.script.ts @@ -0,0 +1,136 @@ +import { keyBy, isPlainObject } from 'lodash' +import { mkdir, readFile, writeFile } from 'node:fs/promises' +import { dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' +import { parse } from 'yaml' + +import { REFERENCES, clientSdkIds } from '~/content/navigation.references' +import { parseTypeSpec } from '~/features/docs/Reference.typeSpec' +import type { AbbrevCommonClientLibSection } from '~/features/docs/Reference.utils' +import { deepFilterRec } from '~/features/helpers.fn' +import type { Json } from '~/features/helpers.types' +import commonClientLibSections from '~/spec/common-client-libs-sections.json' assert { type: 'json' } + +const DOCS_DIRECTORY = join(dirname(fileURLToPath(import.meta.url)), '../..') +const SPEC_DIRECTORY = join(DOCS_DIRECTORY, 'spec') +const GENERATED_DIRECTORY = join(dirname(fileURLToPath(import.meta.url)), 'generated') + +async function getSpec(specFile: string, { ext = 'yml' }: { ext?: string } = {}) { + const specFullPath = join(SPEC_DIRECTORY, `${specFile}.${ext}`) + const rawSpec = await readFile(specFullPath, 'utf-8') + return ext === 'yml' ? parse(rawSpec) : rawSpec +} + +async function parseFnsList(rawSpec: Json): Promise> { + if (isPlainObject(rawSpec) && 'functions' in (rawSpec as object)) { + const _rawSpec = rawSpec as { functions: unknown } + if (Array.isArray(_rawSpec.functions)) { + return _rawSpec.functions.filter(({ id }) => !!id) + } + } + + return [] +} + +function genClientSdkSectionTree(fns: Array<{ id: unknown }>, excludeName: string) { + const validSections = deepFilterRec( + commonClientLibSections as Array, + 'items', + (section) => + section.type === 'markdown' || section.type === 'category' + ? !('excludes' in section && section.excludes.includes(excludeName)) + : section.type === 'function' + ? fns.some(({ id }) => section.id === id) + : true + ) + return validSections +} + +export function flattenCommonClientLibSections(tree: Array) { + return tree.reduce((acc, elem) => { + if ('items' in elem) { + const prunedElem = { ...elem } + delete prunedElem.items + acc.push(prunedElem) + acc.push(...flattenCommonClientLibSections(elem.items)) + } else { + acc.push(elem) + } + + return acc + }, [] as Array) +} + +async function writeTypes() { + const types = await parseTypeSpec() + + await writeFile( + join(GENERATED_DIRECTORY, 'typeSpec.json'), + JSON.stringify(types, (key, value) => { + if (key === 'methods') { + return Object.fromEntries(value.entries()) + } else { + return value + } + }) + ) +} + +async function writeReferenceSections() { + return Promise.all( + clientSdkIds + .flatMap((sdkId) => { + const versions = REFERENCES[sdkId].versions + return versions.map((version) => ({ + sdkId, + version, + })) + }) + .flatMap(async ({ sdkId, version }) => { + const spec = await getSpec(REFERENCES[sdkId].meta[version].specFile) + + const fnsList = await parseFnsList(spec) + const pendingFnListWrite = writeFile( + join(GENERATED_DIRECTORY, `${sdkId}.${version}.functions.json`), + JSON.stringify(fnsList) + ) + + const sectionTree = genClientSdkSectionTree(fnsList, REFERENCES[sdkId].meta[version].libId) + const pendingSectionTreeWrite = writeFile( + join(GENERATED_DIRECTORY, `${sdkId}.${version}.sections.json`), + JSON.stringify(sectionTree) + ) + + const flattened = flattenCommonClientLibSections(sectionTree) + const pendingFlattenedWrite = writeFile( + join(GENERATED_DIRECTORY, `${sdkId}.${version}.flat.json`), + JSON.stringify(flattened) + ) + + const sectionsBySlug = keyBy(flattened, (section) => section.slug) + const pendingSlugDictionaryWrite = writeFile( + join(GENERATED_DIRECTORY, `${sdkId}.${version}.bySlug.json`), + JSON.stringify(sectionsBySlug) + ) + + return [ + pendingFnListWrite, + pendingSectionTreeWrite, + pendingFlattenedWrite, + pendingSlugDictionaryWrite, + ] + }) + ) +} + +async function run() { + try { + await mkdir(GENERATED_DIRECTORY, { recursive: true }) + + await Promise.all([writeTypes(), writeReferenceSections()]) + } catch (err) { + console.error(err) + } +} + +run() diff --git a/apps/docs/features/docs/Reference.generated.singleton.ts b/apps/docs/features/docs/Reference.generated.singleton.ts new file mode 100644 index 00000000000..27b185b4052 --- /dev/null +++ b/apps/docs/features/docs/Reference.generated.singleton.ts @@ -0,0 +1,100 @@ +import { readFile } from 'node:fs/promises' +import { join } from 'node:path' + +import type { ModuleTypes } from '~/features/docs/Reference.typeSpec' +import type { AbbrevCommonClientLibSection } from '~/features/docs/Reference.utils' + +let typeSpec: Array + +async function _typeSpecSingleton() { + if (!typeSpec) { + const rawJson = await readFile( + join(process.cwd(), 'features/docs', './generated/typeSpec.json'), + 'utf-8' + ) + typeSpec = JSON.parse(rawJson, (key, value) => { + if (key === 'methods') { + return new Map(Object.entries(value)) + } else { + return value + } + }) + } + + return typeSpec +} + +export async function getTypeSpec(ref: string) { + const modules = await _typeSpecSingleton() + + const delimiter = ref.indexOf('.') + const refMod = ref.substring(0, delimiter) + + const mod = modules.find((mod) => mod.name === refMod) + return mod?.methods.get(ref) +} + +const functionsList = new Map>() + +export async function getFunctionsList(sdkId: string, version: string) { + const key = `${sdkId}.${version}` + if (!functionsList.has(key)) { + const data = await readFile( + join(process.cwd(), 'features/docs', `./generated/${sdkId}.${version}.functions.json`), + 'utf-8' + ) + + functionsList.set(key, JSON.parse(data)) + } + + return functionsList.get(key) +} + +const referenceSections = new Map>() + +export async function getReferenceSections(sdkId: string, version: string) { + const key = `${sdkId}.${version}` + if (!referenceSections.has(key)) { + const data = await readFile( + join(process.cwd(), 'features/docs', `./generated/${sdkId}.${version}.sections.json`), + 'utf-8' + ) + + referenceSections.set(key, JSON.parse(data)) + } + + return referenceSections.get(key) +} + +const flatSections = new Map>() + +export async function getFlattenedSections(sdkId: string, version: string) { + const key = `${sdkId}.${version}` + if (!flatSections.has(key)) { + const data = await readFile( + join(process.cwd(), 'features/docs', `./generated/${sdkId}.${version}.flat.json`), + 'utf-8' + ) + + flatSections.set(key, JSON.parse(data)) + } + + return flatSections.get(key) +} + +const sectionsBySlug = new Map>() + +export async function getSectionsBySlug(sdkId: string, version: string) { + const key = `${sdkId}.${version}` + if (!sectionsBySlug.has(key)) { + const data = await readFile( + join(process.cwd(), 'features/docs', `./generated/${sdkId}.${version}.bySlug.json`), + 'utf-8' + ) + const asObject = JSON.parse(data) + + sectionsBySlug.set(key, new Map(Object.entries(asObject))) + } + + return sectionsBySlug.get(key) +} diff --git a/apps/docs/features/docs/Reference.header.tsx b/apps/docs/features/docs/Reference.header.tsx new file mode 100644 index 00000000000..ec602cd33c6 --- /dev/null +++ b/apps/docs/features/docs/Reference.header.tsx @@ -0,0 +1,54 @@ +import { Github } from 'lucide-react' +import Link from 'next/link' + +import { cn } from 'ui' + +import MenuIconPicker from '~/components/Navigation/NavigationMenu/MenuIconPicker' + +interface ClientLibHeaderProps { + menuData: { + title: string + icon?: string + pkg: { + name: string + repo: string + } + } + className?: string +} + +function ClientLibHeader({ menuData, className }: ClientLibHeaderProps) { + return ( +
    + {'icon' in menuData && ( + + )} +
    +

    + {menuData.title} Client Library +

    + + {menuData.pkg.name} + + View on GitHub + + + +
    +
    + ) +} + +export { ClientLibHeader } diff --git a/apps/docs/features/docs/Reference.introduction.tsx b/apps/docs/features/docs/Reference.introduction.tsx new file mode 100644 index 00000000000..c8ae9c7a809 --- /dev/null +++ b/apps/docs/features/docs/Reference.introduction.tsx @@ -0,0 +1,67 @@ +import { AlertTriangle } from 'lucide-react' +import Link from 'next/link' + +import { Alert_Shadcn_, AlertDescription_Shadcn_, AlertTitle_Shadcn_, cn } from 'ui' + +import { MDXRemoteBase } from '~/features/docs/MdxBase' +import { getRefMarkdown } from '~/features/docs/Reference.mdx' +import { ReferenceSectionWrapper } from '~/features/docs/Reference.ui.client' +import commonClientLibSections from '~/spec/common-client-libs-sections.json' assert { type: 'json' } + +function hasIntro(sections: typeof commonClientLibSections, excludeName: string) { + return Boolean( + sections[0]?.type === 'markdown' && + sections[0]?.slug === 'introduction' && + !( + 'excludes' in sections[0] && + Array.isArray(sections[0].excludes) && + sections[0].excludes?.includes(excludeName) + ) + ) +} + +interface ClientLibIntroductionProps { + libPath: string + excludeName: string + version: string + isLatestVersion: boolean +} + +export async function ClientLibIntroduction({ + libPath, + excludeName, + version, + isLatestVersion, +}: ClientLibIntroductionProps) { + if (!hasIntro(commonClientLibSections, excludeName)) return null + + const content = await getRefMarkdown( + `${libPath}/${isLatestVersion ? '' : `${version}/`}introduction` + ) + + return ( + + + + ) +} + +export function OldVersionAlert({ libPath, className }: { libPath: string; className?: string }) { + return ( + + + Version out of date + + There's a newer version of this library! Migrate to the{' '} + + newest version + + . + + + ) +} diff --git a/apps/docs/features/docs/Reference.mdx.client.tsx b/apps/docs/features/docs/Reference.mdx.client.tsx new file mode 100644 index 00000000000..c6bab0d9328 --- /dev/null +++ b/apps/docs/features/docs/Reference.mdx.client.tsx @@ -0,0 +1,20 @@ +'use client' + +/** + * The MDXProvider is necessary so that MDX partials will have access + * to components. + * + * Since the reference pages are so heavy, keep the weight down by only + * including the bare minimum. + */ + +import { MDXProvider } from '@mdx-js/react' +import { type PropsWithChildren } from 'react' + +import { Admonition } from 'ui' + +const components = { Admonition } + +export function MDXProviderReference({ children }: PropsWithChildren) { + return {children} +} diff --git a/apps/docs/features/docs/Reference.mdx.tsx b/apps/docs/features/docs/Reference.mdx.tsx new file mode 100644 index 00000000000..d5d326a1426 --- /dev/null +++ b/apps/docs/features/docs/Reference.mdx.tsx @@ -0,0 +1,49 @@ +import matter from 'gray-matter' +import { readFile } from 'node:fs/promises' +import { join } from 'node:path' + +import { MDXRemoteBase } from '~/features/docs/MdxBase' +import { components } from '~/features/docs/MdxBase.shared' +import { RefSubLayout } from '~/features/docs/Reference.ui' +import { cache_fullProcess_withDevCacheBust } from '~/features/helpers.fs' +import { REF_DOCS_DIRECTORY } from '~/lib/docs' + +async function getRefMarkdownInternal(relPath: string) { + const fullPath = join(REF_DOCS_DIRECTORY, relPath + '.mdx') + + try { + if (!fullPath.startsWith(REF_DOCS_DIRECTORY)) { + throw Error(`Accessing forbidden path outside of REF_DOCS_DIRECTORY: ${fullPath}`) + } + + const mdx = await readFile(fullPath, 'utf-8') + const { content } = matter(mdx) + return content + } catch (err) { + console.error(`Error fetching reference markdown from file: ${fullPath}:\n\n${err}`) + return '' + } +} + +/** + * Caching this for the entire process is fine because the Markdown content is + * baked into each deployment and cannot change. There's also nothing sensitive + * here: this is just reading the public MDX files from the codebase. + */ +const getRefMarkdown = cache_fullProcess_withDevCacheBust( + getRefMarkdownInternal, + REF_DOCS_DIRECTORY, + (filename: string) => JSON.stringify([filename.replace(/\.mdx$/, '')]) +) + +interface MDXRemoteRefsProps { + source: string +} + +function MDXRemoteRefs({ source }: MDXRemoteRefsProps) { + const refComponents = { ...components, RefSubLayout } + + return +} + +export { getRefMarkdown, MDXRemoteRefs } diff --git a/apps/docs/features/docs/Reference.navigation.client.tsx b/apps/docs/features/docs/Reference.navigation.client.tsx new file mode 100644 index 00000000000..ef2c860f0b9 --- /dev/null +++ b/apps/docs/features/docs/Reference.navigation.client.tsx @@ -0,0 +1,240 @@ +'use client' + +import * as Collapsible from '@radix-ui/react-collapsible' +import { debounce } from 'lodash' +import { ChevronUp } from 'lucide-react' +import Link from 'next/link' +import { usePathname } from 'next/navigation' +import type { HTMLAttributes, MouseEvent, PropsWithChildren } from 'react' +import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react' + +import { cn } from 'ui' + +import { BASE_PATH } from '~/lib/constants' +import type { AbbrevCommonClientLibSection } from '~/features/docs/Reference.navigation' +import { isElementInViewport } from '~/features/ui/helpers.dom' + +export const ReferenceContentInitiallyScrolledContext = createContext(false) + +export function ReferenceContentScrollHandler({ + libPath, + version, + isLatestVersion, + children, +}: PropsWithChildren<{ + libPath: string + version: string + isLatestVersion: boolean +}>) { + const checkedPathnameOnLoad = useRef(false) + const [initiallyScrolled, setInitiallyScrolled] = useState(false) + + const pathname = usePathname() + + useEffect(() => { + if (!checkedPathnameOnLoad.current) { + const initialSelectedSection = pathname.replace( + `/reference/${libPath}/${isLatestVersion ? '' : `${version}/`}`, + '' + ) + if (initialSelectedSection) { + const section = document.getElementById(initialSelectedSection) + section?.scrollIntoView() + section?.querySelector('h2')?.focus() + } + + checkedPathnameOnLoad.current = true + setInitiallyScrolled(true) + } + }, [pathname, libPath, version, isLatestVersion]) + + return ( + + {children} + + ) +} + +export function ReferenceNavigationScrollHandler({ + children, + ...rest +}: PropsWithChildren & HTMLAttributes) { + const ref = useRef() + const initialScrollHappened = useContext(ReferenceContentInitiallyScrolledContext) + + const scrollActiveIntoView = useCallback(() => { + const currentLink = ref.current?.querySelector('[aria-current=page]') as HTMLElement + if (currentLink && !isElementInViewport(currentLink)) { + currentLink.scrollIntoView({ + block: 'center', + }) + } + }, []) + + useEffect(() => { + if (initialScrollHappened) { + scrollActiveIntoView() + } + }, [initialScrollHappened, scrollActiveIntoView]) + + useEffect(() => { + const debouncedScrollActiveIntoView = debounce(scrollActiveIntoView, 150) + + window.addEventListener('scrollend', debouncedScrollActiveIntoView) + return () => window.removeEventListener('scrollend', debouncedScrollActiveIntoView) + }, [scrollActiveIntoView]) + + return ( +
    + {children} +
    + ) +} + +function deriveHref(basePath: string, section: AbbrevCommonClientLibSection) { + return 'slug' in section ? `${basePath}/${section.slug}` : '' +} + +function getLinkStyles(isActive: boolean, className?: string) { + return cn( + 'text-sm text-foreground-lighter', + !isActive && 'hover:text-foreground', + isActive && 'text-brand', + 'transition-colors', + className + ) +} + +export function RefLink({ + basePath, + section, + skipChildren = false, + className, +}: { + basePath: string + section: AbbrevCommonClientLibSection + skipChildren?: boolean + className?: string +}) { + const ref = useRef() + + const pathname = usePathname() + const href = deriveHref(basePath, section) + const isActive = + pathname === href || (pathname === basePath && href.replace(basePath, '') === '/introduction') + + if (!('title' in section)) return null + + const isCompoundSection = !skipChildren && 'items' in section && section.items.length > 0 + + return ( + <> + {isCompoundSection ? ( + + ) : ( + { + /* + * We don't actually want to navigate or rerender anything since + * links are all to sections on the same page. + */ + evt.preventDefault() + history.pushState({}, '', `${BASE_PATH}${href}`) + + if ('slug' in section) { + const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches + const domElement = document.getElementById(section.slug) + domElement?.scrollIntoView({ + behavior: reduceMotion ? 'auto' : 'smooth', + }) + domElement?.querySelector('h2')?.focus() + } + }} + > + {section.title} + + )} + + ) +} + +function useCompoundRefLinkActive(basePath: string, section: AbbrevCommonClientLibSection) { + const [open, _setOpen] = useState(false) + + const pathname = usePathname() + const parentHref = deriveHref(basePath, section) + const isParentActive = pathname === parentHref + + const childHrefs = useMemo( + () => new Set(section.items.map((item) => deriveHref(basePath, item))), + [basePath, section] + ) + const isChildActive = childHrefs.has(pathname) + + const isActive = isParentActive || isChildActive + + const setOpen = (open: boolean) => { + // Disable closing if the section is active, to prevent the currently active + // link disappearing + if (open || !isActive) _setOpen(open) + } + + if (isActive && !open) { + setOpen(true) + } + + return { open, setOpen, isActive } +} + +function CompoundRefLink({ + basePath, + section, +}: { + basePath: string + section: AbbrevCommonClientLibSection +}) { + const { open, setOpen, isActive } = useCompoundRefLinkActive(basePath, section) + + return ( + + + + + +
      + + {section.items.map((item, idx) => { + return ( +
    • + +
    • + ) + })} +
    +
    +
    + ) +} diff --git a/apps/docs/features/docs/Reference.navigation.tsx b/apps/docs/features/docs/Reference.navigation.tsx new file mode 100644 index 00000000000..cc74f48821a --- /dev/null +++ b/apps/docs/features/docs/Reference.navigation.tsx @@ -0,0 +1,105 @@ +import { Fragment, type PropsWithChildren } from 'react' + +import { cn } from 'ui' + +import MenuIconPicker from '~/components/Navigation/NavigationMenu/MenuIconPicker' +import RefVersionDropdown from '~/components/RefVersionDropdown' +import { getReferenceSections } from '~/features/docs/Reference.generated.singleton' +import { + RefLink, + ReferenceNavigationScrollHandler, +} from '~/features/docs/Reference.navigation.client' +import { type AbbrevCommonClientLibSection } from '~/features/docs/Reference.utils' + +interface ClientSdkNavigationProps { + sdkId: string + name: string + menuData: { icon?: string } + libPath: string + version: string + isLatestVersion: boolean +} + +async function ClientSdkNavigation({ + sdkId, + name, + menuData, + libPath, + version, + isLatestVersion, +}: ClientSdkNavigationProps) { + const navSections = await getReferenceSections(sdkId, version) + + const basePath = `/reference/${libPath}${isLatestVersion ? '' : `/${version}`}` + + return ( + +
    + {'icon' in menuData && } + {name} + +
    +
      + {navSections.map((section) => ( + + {section.type === 'category' ? ( +
    • + +
    • + ) : ( +
    • + +
    • + )} +
      + ))} +
    +
    + ) +} + +const topLvlRefNavItemStyles = 'leading-5' + +function RefCategory({ + basePath, + section, +}: { + basePath: string + section: AbbrevCommonClientLibSection +}) { + if (!('items' in section && section.items.length > 0)) return null + + return ( + <> + + {'title' in section && {section.title}} +
      + {section.items.map((item) => ( +
    • + +
    • + ))} +
    + + ) +} + +function Divider() { + return
    +} + +function SideMenuTitle({ children, className }: PropsWithChildren<{ className?: string }>) { + return ( +
    + {children} +
    + ) +} + +export { ClientSdkNavigation } +export type { AbbrevCommonClientLibSection } diff --git a/apps/docs/features/docs/Reference.sdkPage.tsx b/apps/docs/features/docs/Reference.sdkPage.tsx new file mode 100644 index 00000000000..30b3d32a9d9 --- /dev/null +++ b/apps/docs/features/docs/Reference.sdkPage.tsx @@ -0,0 +1,64 @@ +import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' +import * as NavItems from '~/components/Navigation/NavigationMenu/NavigationMenu.constants' +import { REFERENCES } from '~/content/navigation.references' +import { ClientLibHeader } from '~/features/docs/Reference.header' +import { ClientLibIntroduction, OldVersionAlert } from '~/features/docs/Reference.introduction' +import { ClientSdkNavigation } from '~/features/docs/Reference.navigation' +import { ReferenceContentScrollHandler } from '~/features/docs/Reference.navigation.client' +import { ClientLibRefSections } from '~/features/docs/Reference.sections' +import { LayoutMainContent } from '~/layouts/DefaultLayout' +import { SidebarSkeleton } from '~/layouts/MainSkeleton' + +interface ClientSdkReferenceProps { + sdkId: string + libVersion: string +} + +export async function ClientSdkReferencePage({ sdkId, libVersion }: ClientSdkReferenceProps) { + const libraryMeta = REFERENCES[sdkId] + const versions = libraryMeta?.versions ?? [] + const isLatestVersion = libVersion === versions[0] + + const menuData = NavItems[libraryMeta.meta[libVersion].libId] + + return ( + + + } + > + + {!isLatestVersion && ( + + )} +
    + + + +
    +
    +
    +
    + ) +} diff --git a/apps/docs/features/docs/Reference.sections.tsx b/apps/docs/features/docs/Reference.sections.tsx new file mode 100644 index 00000000000..16176203f96 --- /dev/null +++ b/apps/docs/features/docs/Reference.sections.tsx @@ -0,0 +1,236 @@ +import { Fragment } from 'react' + +import { Tabs_Shadcn_, TabsContent_Shadcn_, TabsList_Shadcn_, TabsTrigger_Shadcn_, cn } from 'ui' + +import { REFERENCES } from '~/content/navigation.references' +import { MDXRemoteRefs, getRefMarkdown } from '~/features/docs/Reference.mdx' +import { MDXProviderReference } from '~/features/docs/Reference.mdx.client' +import type { MethodTypes } from '~/features/docs/Reference.typeSpec' +import { + getFlattenedSections, + getFunctionsList, + getTypeSpec, +} from '~/features/docs/Reference.generated.singleton' +import { + CollapsibleDetails, + FnParameterDetails, + RefSubLayout, + ReturnTypeDetails, + StickyHeader, +} from '~/features/docs/Reference.ui' +import type { AbbrevCommonClientLibSection } from '~/features/docs/Reference.utils' +import { normalizeMarkdown } from '~/features/docs/Reference.utils' + +type ClientLibRefSectionsProps = { + sdkId: string + version: string +} + +async function ClientLibRefSections({ sdkId, version }: ClientLibRefSectionsProps) { + let flattenedSections = await getFlattenedSections(sdkId, version) + flattenedSections = trimIntro(flattenedSections) + + return ( + +
    + {flattenedSections + .filter((section) => section.type !== 'category') + .map((section, idx) => ( + + + + + ))} +
    +
    + ) +} + +function trimIntro(sections: Array) { + const hasIntro = sections[0]?.type === 'markdown' && sections[0]?.slug === 'introduction' + if (hasIntro) { + return sections.slice(1) + } + return sections +} + +function SectionDivider() { + return
    +} + +type SectionSwitchProps = { + sdkId: string + version: string + section: AbbrevCommonClientLibSection +} + +export function SectionSwitch({ sdkId, version, section }: SectionSwitchProps) { + const libPath = REFERENCES[sdkId].libPath + const isLatestVersion = version === REFERENCES[sdkId].versions[0] + + const sectionLink = `/docs/reference/${libPath}/${isLatestVersion ? '' : `${version}/`}${section.slug}` + + switch (section.type) { + case 'markdown': + return ( + + ) + case 'function': + return ( + + ) + default: + console.error(`Unhandled type in reference sections: ${section.type}`) + return null + } +} + +interface MarkdownSectionProps { + libPath: string + version: string + isLatestVersion: boolean + link: string + section: AbbrevCommonClientLibSection +} + +async function MarkdownSection({ + libPath, + version, + isLatestVersion, + link, + section, +}: MarkdownSectionProps) { + const content = await getRefMarkdown( + section.meta?.shared + ? `shared/${section.id}` + : `${libPath}/${isLatestVersion ? '' : `${version}/`}${section.id}` + ) + + return ( + + + + + ) +} + +interface FunctionSectionProps { + sdkId: string + version: string + link: string + section: AbbrevCommonClientLibSection + useTypeSpec: boolean +} + +async function FunctionSection({ + sdkId, + version, + link, + section, + useTypeSpec, +}: FunctionSectionProps) { + const fns = await getFunctionsList(sdkId, version) + + const fn = fns.find((fn) => fn.id === section.id) + if (!fn) return null + + let types: MethodTypes | undefined + if (useTypeSpec && '$ref' in fn) { + types = await getTypeSpec(fn['$ref'] as string) + } + + const fullDescription = [ + types?.comment?.shortText, + 'description' in fn && (fn.description as string), + 'notes' in fn && (fn.notes as string), + ] + .filter(Boolean) + .map(normalizeMarkdown) + .join('\n\n') + + return ( + + +
    +
    + +
    + ).map((overwrittenParams) => ({ + ...overwrittenParams, + __overwritten: true, + })) + : 'params' in fn + ? (fn.params as Array).map((param) => ({ ...param, __overwritten: true })) + : types?.params + } + altParameters={types?.altSignatures?.map(({ params }) => params)} + className="max-w-[80ch]" + /> + {!!types?.ret && } + +
    + {'examples' in fn && Array.isArray(fn.examples) && fn.examples.length > 0 && ( + + + {fn.examples.map((example) => ( + + {example.name} + + ))} + + {'examples' in fn && + Array.isArray(fn.examples) && + fn.examples.map((example) => ( + + +
    + {!!example.data?.sql && ( + + )} + {!!example.response && ( + + )} + {!!example.description && ( + + )} +
    +
    + ))} +
    + )} +
    + + ) +} + +export { ClientLibRefSections } diff --git a/apps/docs/features/docs/Reference.typeSpec.test.ts b/apps/docs/features/docs/Reference.typeSpec.test.ts index 77eca1a1a74..1e5075030c4 100644 --- a/apps/docs/features/docs/Reference.typeSpec.test.ts +++ b/apps/docs/features/docs/Reference.typeSpec.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it } from 'vitest' -import { __parseTypeSpec } from './Reference.typeSpec' +import { parseTypeSpec } from './Reference.typeSpec' describe('TS type spec parsing', () => { it('matches snapshot', async () => { - const parsed = await __parseTypeSpec() + const parsed = await parseTypeSpec() const json = JSON.stringify( parsed, (key, value) => { diff --git a/apps/docs/features/docs/Reference.typeSpec.ts b/apps/docs/features/docs/Reference.typeSpec.ts index b7dc475a6de..fe1a41962d7 100644 --- a/apps/docs/features/docs/Reference.typeSpec.ts +++ b/apps/docs/features/docs/Reference.typeSpec.ts @@ -6,10 +6,6 @@ * access to a function's type definition, given its name and module. */ -import { join } from 'node:path' - -import { cache_fullProcess_withDevCacheBust } from '~/features/helpers.fs' -import { SPEC_DIRECTORY } from '~/lib/docs' import _typeSpec from '~/spec/enrichments/tsdoc_v2/combined.json' assert { type: 'json' } // [Charis] 2024-07-10 @@ -26,7 +22,7 @@ export const TYPESPEC_NODE_ANONYMOUS = Symbol('anonymous') * Definitions for the methods and types defined in each Supabase JS client * library. */ -interface ModuleTypes { +export interface ModuleTypes { name: string methods: Map } @@ -37,8 +33,14 @@ interface ModuleTypes { export interface MethodTypes { name: string | typeof TYPESPEC_NODE_ANONYMOUS comment?: Comment - params: Array + params: Array ret: ReturnType | undefined + altSignatures?: [ + { + params: Array + ret: ReturnType | undefined + }, + ] } interface Comment { @@ -46,18 +48,19 @@ interface Comment { text?: string } -interface ParamType { +export interface FunctionParameterType { name: string | typeof TYPESPEC_NODE_ANONYMOUS comment?: Comment isOptional?: boolean - type: Type | undefined + type: TypeDetails | undefined } interface ReturnType { - type: Type | undefined + type: TypeDetails | undefined + comment?: Comment } -type Type = IntrinsicType | LiteralType | CustomType +export type TypeDetails = IntrinsicType | LiteralType | CustomType /** * Type definition for an intrinsic (built-in) TypeScript type, for example, @@ -91,24 +94,24 @@ interface NameOnlyType { } interface CustomObjectType { - type: 'customObject' + type: 'object' name?: string | typeof TYPESPEC_NODE_ANONYMOUS comment?: Comment - properties: Array + properties: Array } -interface CustomUnionType { - type: 'customUnion' +export interface CustomUnionType { + type: 'union' name?: string | typeof TYPESPEC_NODE_ANONYMOUS comment?: Comment - subTypes: Array + subTypes: Array } interface CustomFunctionType { type: 'function' name?: string | typeof TYPESPEC_NODE_ANONYMOUS comment?: Comment - params: Array + params: Array ret: ReturnType | undefined } @@ -116,71 +119,43 @@ interface ArrayType { type: 'array' name?: string | typeof TYPESPEC_NODE_ANONYMOUS comment?: Comment - elemType: Type | undefined + elemType: TypeDetails | undefined } interface RecordType { type: 'record' name?: string | typeof TYPESPEC_NODE_ANONYMOUS comment?: Comment - keyType: Type | undefined - valueType: Type | undefined + keyType: TypeDetails | undefined + valueType: TypeDetails | undefined } interface IndexSignatureType { type: 'index signature' name?: string | typeof TYPESPEC_NODE_ANONYMOUS comment?: Comment - keyType: Type | undefined - valueType: Type | undefined + keyType: TypeDetails | undefined + valueType: TypeDetails | undefined } interface PromiseType { type: 'promise' name?: string | typeof TYPESPEC_NODE_ANONYMOUS comment?: Comment - awaited: Type | undefined + awaited: TypeDetails | undefined } /** * Type definition for a property on a custom type definition. */ -interface PropertyType { +export interface CustomTypePropertyType { name?: string | typeof TYPESPEC_NODE_ANONYMOUS comment?: Comment isOptional?: boolean - type: Type | undefined + type: TypeDetails | undefined } -// The following is the API of this module, and the only externally exposed -// piece. Given a reference to a function (method), return its type definition. - -/** - * Get the type definition for a function (a method). - * - * @param ref The method identifier, in the form `@supabase/supabase-js.index.SupabaseClient.constructor`. - */ -export async function getTypeSpec(ref: string) { - const modules = await parseTypeSpec() - - const delimiter = ref.indexOf('.') - const refMod = ref.substring(0, delimiter) - - const mod = modules.find((mod) => mod.name === refMod) - return mod?.methods.get(ref) -} - -const parseTypeSpec = cache_fullProcess_withDevCacheBust( - __parseTypeSpec, - join(SPEC_DIRECTORY, 'enrichments/tsdoc_v2/combined.json'), - () => JSON.stringify([]) -) - -/** - * @private - * Exposed for testing purposes only, PRIVATE DO NOT USE externally. - */ -export function __parseTypeSpec() { +export function parseTypeSpec() { const modules = (typeSpec.children ?? []).map(parseMod) return modules as Array } @@ -316,17 +291,23 @@ function parseMethod( comment, } + if (node.signatures.length > 1) { + types.altSignatures = node.signatures + .slice(1) + .map((signature) => parseSignature(signature, map)) + } + res.methods.set($ref, types) } function parseSignature( signature: any, map: Map -): { params: Array; ret: ReturnType; comment?: Comment } { - const params: Array = (signature.parameters ?? []).map((param: any) => { +): { params: Array; ret: ReturnType; comment?: Comment } { + const params: Array = (signature.parameters ?? []).map((param: any) => { const type = parseType(param.type, map) - const res: ParamType = { + const res: FunctionParameterType = { name: nameOrAnonymous(param), type, } @@ -447,6 +428,14 @@ function parseReferenceType(type: any, map: Map) { return parsePromiseType(type, map) } + if (type.package === 'typescript' && type.qualifiedName === 'Extract') { + return parseExtractType(type, map) + } + + if (type.package === 'typescript' && type.qualifiedName === 'Pick') { + return parsePickType(type, map) + } + if (type.package && type.qualifiedName) { return { type: 'nameOnly', @@ -500,7 +489,7 @@ function parseUnionType(type: any, map: Map): CustomUnionType { const subTypes = type.types.filter(Boolean).map((type) => parseType(type, map)) return { - type: 'customUnion', + type: 'union', name: nameOrAnonymous(type), subTypes, } @@ -525,10 +514,44 @@ function parsePromiseType(type: any, map: Map): PromiseType { } } +function parseExtractType(type: any, map: Map): CustomUnionType { + const extractedUnion = parseUnionType(type.typeArguments[1], map) + return extractedUnion +} + +function parsePickType(type: any, map: Map) { + if (type.typeArguments[0].type === 'reference') { + const dereferencedNode = map.get(type.typeArguments[0].id) + if (!dereferencedNode) return undefined + const dereferencedType = parseType(dereferencedNode, map) + if (!dereferencedType?.properties) return undefined + + switch (type.typeArguments[1].type) { + case 'literal': + return dereferencedType.properties.find( + (property) => property.name === type.typeArguments[1].value + ) + case 'union': + default: + const subTypes = dereferencedType.properties.filter((property) => + type.typeArguments[1].types.some((type) => type.value === property.name) + ) + if (subTypes.length === 0) return undefined + + return { + type: 'union', + subTypes, + } + } + } + + return undefined +} + function parseReflectionType(type: any, map: Map) { if (!type.declaration) return undefined - let res: Type + let res: TypeDetails switch (type.declaration.kindString) { case 'Type literal': res = parseTypeLiteral(type, map) @@ -540,14 +563,14 @@ function parseReflectionType(type: any, map: Map) { return res } -function parseTypeLiteral(type: any, map: Map): Type { +function parseTypeLiteral(type: any, map: Map): TypeDetails { const name = nameOrAnonymous(type) if ('children' in type.declaration) { const properties = type.declaration.children.map((child: any) => parseTypeInternals(child, map)) return { name, - type: 'customObject', + type: 'object', properties, } satisfies CustomObjectType } @@ -582,7 +605,7 @@ function parseTypeLiteral(type: any, map: Map): Type { function parseIndexedAccessType(type: any, map: Map) { return { type: 'nameOnly', - name: `${type.objectType?.name ?? ''}[${type.indexType.value ?? type.indexType.name ?? ''}]`, + name: `${type.objectType?.name ?? ''}['${type.indexType.value ?? type.indexType.name ?? ''}']`, } } @@ -599,7 +622,7 @@ function parseInterface(type: any, map: Map): CustomObjectType { const properties = (type.children ?? []).map((child) => parseTypeInternals(child, map)) return { - type: 'customObject', + type: 'object', name: nameOrAnonymous(type), properties, } @@ -641,7 +664,7 @@ function parseInternalProperty(elem: any, map: Map) { const res = { name, type, - } as PropertyType + } as CustomTypePropertyType if (elem.flags?.isOptional) { res.isOptional = true diff --git a/apps/docs/features/docs/Reference.ui.client.tsx b/apps/docs/features/docs/Reference.ui.client.tsx new file mode 100644 index 00000000000..7797c35fff3 --- /dev/null +++ b/apps/docs/features/docs/Reference.ui.client.tsx @@ -0,0 +1,51 @@ +'use client' + +import type { HTMLAttributes, PropsWithChildren } from 'react' +import { useContext } from 'react' +import { useInView } from 'react-intersection-observer' + +import { cn } from 'ui' + +import { ReferenceContentInitiallyScrolledContext } from '~/features/docs/Reference.navigation.client' + +/** + * Wrap a reference section with client-side functionality: + * + * - Intersection observer to auto-update the URL when the user scrolls the page + * - An ID to scroll to programmatically. This is on the entire section rather + * than the heading to avoid problems with scroll-to position when the heading + * is sticky. + */ +export function ReferenceSectionWrapper({ + id, + link, + children, + className, +}: PropsWithChildren<{ id: string; link: string; className?: string }> & + HTMLAttributes) { + const initialScrollHappened = useContext(ReferenceContentInitiallyScrolledContext) + + const { ref } = useInView({ + threshold: 0, + rootMargin: '-10% 0% -50% 0%', + onChange: (inView) => { + if ( + inView && + initialScrollHappened && + window.scrollY > 0 /* Don't update on first navigation to introduction */ + ) { + window.history.replaceState(null, '', link) + } + }, + }) + + return ( +
    + {children} +
    + ) +} diff --git a/apps/docs/features/docs/Reference.ui.tsx b/apps/docs/features/docs/Reference.ui.tsx new file mode 100644 index 00000000000..32770a45090 --- /dev/null +++ b/apps/docs/features/docs/Reference.ui.tsx @@ -0,0 +1,626 @@ +import { isEqual } from 'lodash' +import { ChevronRight, XCircle } from 'lucide-react' +import type { PropsWithChildren } from 'react' + +import { Collapsible_Shadcn_, CollapsibleContent_Shadcn_, CollapsibleTrigger_Shadcn_, cn } from 'ui' + +import { MDXRemoteBase } from '~/features/docs/MdxBase' +import { MDXRemoteRefs } from '~/features/docs/Reference.mdx' +import type { + CustomTypePropertyType, + FunctionParameterType, + MethodTypes, + TypeDetails, +} from '~/features/docs/Reference.typeSpec' +import { TYPESPEC_NODE_ANONYMOUS } from '~/features/docs/Reference.typeSpec' +import { ReferenceSectionWrapper } from '~/features/docs/Reference.ui.client' +import { normalizeMarkdown } from '~/features/docs/Reference.utils' + +interface SectionProps extends PropsWithChildren { + link: string + slug?: string + columns?: 'single' | 'double' +} + +function Section({ slug, link, columns = 'single', children }: SectionProps) { + const singleColumn = columns === 'single' + + return ( + + {children} + + ) +} + +function Details({ children }: PropsWithChildren) { + /* + * `min-w` is necessary because these are used as grid children, which have + * default `min-w-auto` + */ + return
    {children}
    +} + +function Examples({ children }: PropsWithChildren) { + /* + * `min-w` is necessary because these are used as grid children, which have + * default `min-w-auto` + */ + return
    {children}
    +} + +function EducationSection({ children, slug, ...props }: SectionProps) { + return ( + + {children} + + ) +} + +interface EducationRowProps extends PropsWithChildren { + className?: string +} + +function EducationRow({ className, children }: EducationRowProps) { + return
    {children}
    +} + +export const RefSubLayout = { + Section, + EducationSection, + EducationRow, + Details, + Examples, +} + +interface StickyHeaderProps { + title?: string + monoFont?: boolean + className?: string +} + +export function StickyHeader({ title, monoFont = false, className }: StickyHeaderProps) { + return ( +

    + {title} +

    + ) +} + +export function CollapsibleDetails({ title, content }: { title: string; content: string }) { + return ( + + + + {title} + + + + + + ) +} + +export function FnParameterDetails({ + parameters, + altParameters, + className, +}: { + parameters: Array | undefined + altParameters?: Array> + className?: string +}) { + if (!parameters || parameters.length === 0) return + + const combinedParameters = altParameters + ? mergeAlternateParameters(parameters, altParameters) + : parameters + + return ( +
    +

    Parameters

    +
      + {combinedParameters.map((parameter, index) => ( +
    • + +
    • + ))} +
    +
    + ) +} + +interface SubContent { + name: string + isOptional?: boolean | 'NA' // not applicable + type?: string + description?: string + subContent: Array +} + +function ParamOrTypeDetails({ paramOrType }: { paramOrType: object }) { + if (!('name' in paramOrType)) return + + const description: string = + 'description' in paramOrType + ? (paramOrType.description as string) + : isFromTypespec(paramOrType) + ? paramOrType.comment?.shortText ?? '' + : '' + + const subContent = + 'subContent' in paramOrType + ? (paramOrType.subContent as Array) + : isFromTypespec(paramOrType) + ? getSubDetails(paramOrType) + : undefined + + return ( + <> +
    + + {paramOrType.name === TYPESPEC_NODE_ANONYMOUS + ? '[Anonymous]' + : (paramOrType.name as string)} + + + {/* @ts-ignore */} + {paramOrType?.comment?.tags?.some((tag) => tag.tag === 'deprecated') && ( + Deprecated + )} + {getTypeName(paramOrType)} +
    + {description && ( +
    + +
    + )} + {subContent && subContent.length > 0 && } + + ) +} + +export function ReturnTypeDetails({ returnType }: { returnType: MethodTypes['ret'] }) { + // These custom names that aren't defined aren't particularly meaningful, so + // just don't display them. + const isNameOnlyType = returnType.type.type === 'nameOnly' + if (isNameOnlyType) return + + const subContent = getSubDetails(returnType) + + return ( +
    +

    Return Type

    +
    +
    {getTypeName(returnType)}
    + {returnType.comment?.shortText && ( +
    + +
    + )} + {subContent && subContent.length > 0 && } +
    +
    + ) +} + +function TypeSubDetails({ + details, + className, +}: { + details: Array | Array | Array + className?: string +}) { + return ( + + + + Details + + +
      + {details.map( + (detail: SubContent | CustomTypePropertyType | TypeDetails, index: number) => ( +
    • + +
    • + ) + )} +
    +
    +
    + ) +} + +function RequiredBadge({ isOptional }: { isOptional: boolean | 'NA' }) { + return isOptional === true ? ( + Optional + ) : isOptional === false ? ( + + Required + + ) : undefined +} + +/** + * Whether the param comes from overwritten params in the library spec file or + * directly from the type spec. + * + * We're cheating here, this isn't a full validation but rather just checking + * that it isn't overwritten. + */ +function isFromTypespec(parameter: object): parameter is MethodTypes['params'][number] { + return !('__overwritten' in parameter) +} + +function getTypeName(parameter: object): string { + if (!('type' in parameter)) return '' + + if (typeof parameter.type === 'string') { + return parameter.type + } + + if (typeof parameter.type !== 'object' || !('type' in parameter.type)) { + return '' + } + + const type = parameter.type + + switch (type.type) { + case 'nameOnly': + return nameOrDefault(type, '') + case 'intrinsic': + return nameOrDefault(type, '') + case 'literal': + return 'value' in type ? (type.value === null ? 'null' : `"${type.value as string}"`) : '' + case 'record': + // Needs an extra level of wrapping to fake the wrapping parameter + // @ts-ignore + return `Record<${getTypeName({ type: type.keyType })}, ${getTypeName({ type: type.valueType })}>` + case 'object': + return nameOrDefault(type, 'object') + case 'function': + return 'function' + case 'promise': + // Needs an extra level of wrapping to fake the wrapping parameter + // @ts-ignore + return `Promise<${getTypeName({ type: type.awaited })}>` + case 'union': + return 'Union: expand to see options' + case 'index signature': + // Needs an extra level of wrapping to fake the wrapping parameter + // @ts-ignore + return `{ [key: ${getTypeName({ type: type.keyType })}]: ${getTypeName({ type: type.valueType })} }` + case 'array': + // Needs an extra level of wrapping to fake the wrapping parameter + // @ts-ignore + return `Array<${getTypeName({ type: type.elemType })}>` + } + + return '' +} + +function nameOrDefault(node: object, fallback: string) { + return 'name' in node && node.name !== TYPESPEC_NODE_ANONYMOUS ? (node.name as string) : fallback +} + +function getSubDetails(parentType: MethodTypes['params'][number] | MethodTypes['ret']) { + let subDetails: Array + + switch (parentType.type?.type) { + case 'object': + subDetails = parentType.type.properties + break + case 'function': + subDetails = [ + ...(parentType.type.params.length === 0 + ? [] + : [ + { + name: 'Parameters', + type: 'callback parameters', + isOptional: 'NA', + params: parentType.type.params.map((param) => ({ + ...param, + isOptional: 'NA', + })), + }, + ]), + { name: 'Return', type: parentType.type.ret.type, isOptional: 'NA' }, + ] + break + // @ts-ignore -- Adding these fake types to take advantage of existing recursion + case 'callback parameters': + // @ts-ignore -- Adding these fake types to take advantage of existing recursion + subDetails = parentType.params + break + case 'union': + subDetails = parentType.type.subTypes.map((subType, index) => ({ + name: `union option ${index + 1}`, + type: { ...subType }, + isOptional: 'NA', + })) + break + case 'promise': + if (parentType.type.awaited.type === 'union') { + subDetails = parentType.type.awaited.subTypes.map((subType, index) => ({ + name: `union option ${index + 1}`, + type: { ...subType }, + isOptional: 'NA', + })) + } else if (parentType.type.awaited.type === 'object') { + subDetails = parentType.type.awaited.properties.map((property) => ({ + ...property, + isOptional: 'NA', + })) + } else if (parentType.type.awaited.type === 'array') { + subDetails = [ + { name: 'array element', type: parentType.type.awaited.elemType, isOptional: 'NA' }, + ] + } + break + case 'array': + if (parentType.type.elemType.type === 'union') { + subDetails = parentType.type.elemType.subTypes.map((subType, index) => ({ + name: `union option ${index + 1}`, + type: { ...subType }, + isOptional: 'NA', + })) + } + if (parentType.type.elemType.type === 'object') { + subDetails = parentType.type.elemType.properties + } + break + } + + subDetails?.sort((a, b) => (a.isOptional === true ? 1 : 0) - (b.isOptional === true ? 1 : 0)) + + return subDetails +} + +function mergeAlternateParameters( + parameters: Array, + altParameters: Array> +) { + const combinedParameters = parameters.map((parameter) => { + if (!isFromTypespec(parameter)) return parameter + + const parameterWithoutType = { ...parameter } + if ('type' in parameterWithoutType) { + delete parameterWithoutType.type + } + + for (const alternate of altParameters) { + const match = alternate.find((alternateParam) => { + const alternateWithoutType = { ...alternateParam } + if ('type' in alternateWithoutType) { + delete alternateWithoutType.type + } + + return isEqual(parameterWithoutType, alternateWithoutType) + }) + + if (match) { + // @ts-ignore + parameter = applyParameterMergeStrategy(parameter, match) + } + } + + return parameter + }) + + return combinedParameters +} + +function applyParameterMergeStrategy( + parameter: Pick, + alternateParameter: Pick +) { + if (!alternateParameter.type) { + // Nothing to merge, abort + return parameter as FunctionParameterType + } + + const clonedParameter = JSON.parse(JSON.stringify(parameter)) as FunctionParameterType + + if (!clonedParameter.type) { + clonedParameter.type = alternateParameter.type + return clonedParameter + } + + switch (clonedParameter.type.type) { + case 'nameOnly': + mergeIntoUnion() + break + case 'literal': + mergeIntoUnion() + break + case 'record': + mergeIntoUnion() + break + case 'union': + if (alternateParameter.type.type === 'union') { + // Both unions, merge them + for (const alternateSubType of alternateParameter.type.subTypes) { + if ( + !clonedParameter.type.subTypes.some((subType) => isEqual(subType, alternateSubType)) + ) { + clonedParameter.type.subTypes.push(alternateSubType) + } + } + } else { + if ( + !clonedParameter.type.subTypes.some((subType) => + isEqual(subType, alternateParameter.type) + ) + ) { + clonedParameter.type.subTypes.push(alternateParameter.type) + } + } + break + case 'object': + if (alternateParameter.type.type === 'object') { + // Check if the base and alternate parameters have different sets of + // required properties. If so, they can't be merged without loss of + // meaning and have to be represented as a union. + const requiredOriginalProperties = new Set( + clonedParameter.type.properties.filter( + // @ts-ignore -- NA introduced as an additional flag for display logic + (property) => property.isOptional !== true && property.isOptional !== 'NA' + ) + ) + const requiredAlternateProperties = new Set( + alternateParameter.type.properties.filter( + // @ts-ignore -- NA introduced as an additional flag for display logic + (property) => property.isOptional !== true && property.isOptional !== 'NA' + ) + ) + if (requiredOriginalProperties.size !== requiredAlternateProperties.size) { + mergeIntoUnion() + break + } + const union = new Set([...requiredOriginalProperties, ...requiredAlternateProperties]) + if (union.size !== requiredOriginalProperties.size) { + mergeIntoUnion() + break + } + + const clonedParametersByName = new Map( + clonedParameter.type.properties.map((property) => [property.name, property]) + ) + const alternateParametersByName = new Map( + alternateParameter.type.properties.map((property) => [property.name, property]) + ) + + for (const [key, alternateValue] of alternateParametersByName) { + if (clonedParametersByName.has(key)) { + clonedParametersByName.set( + key, + applyParameterMergeStrategy(clonedParametersByName.get(key), alternateValue) + ) + } else { + clonedParametersByName.set(key, alternateValue) + } + } + + clonedParameter.type.properties = [...clonedParametersByName.values()] + } else { + mergeIntoUnion() + } + } + + return clonedParameter as FunctionParameterType + + /********* + * Utils * + *********/ + + function mergeIntoUnion() { + if (alternateParameter.type.type === 'union') { + const originalType = clonedParameter.type + + if ( + alternateParameter.type.subTypes.some((subType) => isEqual(subType, clonedParameter.type)) + ) { + clonedParameter.type = alternateParameter.type + } else { + clonedParameter.type = { + type: 'union', + subTypes: [originalType, ...alternateParameter.type.subTypes], + } + } + } else { + const originalType = parameter.type + if (!isEqual(originalType, alternateParameter.type)) { + clonedParameter.type = { + type: 'union', + subTypes: [originalType, alternateParameter.type], + } + } + } + } +} diff --git a/apps/docs/features/docs/Reference.utils.ts b/apps/docs/features/docs/Reference.utils.ts new file mode 100644 index 00000000000..bd262da6617 --- /dev/null +++ b/apps/docs/features/docs/Reference.utils.ts @@ -0,0 +1,169 @@ +import { fromMarkdown } from 'mdast-util-from-markdown' +import { toMarkdown } from 'mdast-util-to-markdown' +import { mdxFromMarkdown, mdxToMarkdown } from 'mdast-util-mdx' +import { mdxjs } from 'micromark-extension-mdxjs' +import type { Metadata, ResolvingMetadata } from 'next' +import { redirect } from 'next/navigation' +import { visit } from 'unist-util-visit' + +import { REFERENCES, clientSdkIds } from '~/content/navigation.references' +import { getFlattenedSections } from '~/features/docs/Reference.generated.singleton' +import { generateOpenGraphImageMeta } from '~/features/seo/openGraph' +import { BASE_PATH } from '~/lib/constants' + +export interface AbbrevCommonClientLibSection { + id: string + type: string + title?: string + slug?: string + items?: Array + excludes?: Array + meta?: { + shared?: boolean + } +} + +export function parseReferencePath(slug: Array) { + const isClientSdkReference = clientSdkIds.includes(slug[0]) + + if (isClientSdkReference) { + let [sdkId, maybeVersion, maybeCrawlers, ...path] = slug + if (!/v\d+/.test(maybeVersion)) { + maybeVersion = null + maybeCrawlers = maybeVersion + path = [maybeCrawlers, ...path] + } + if (maybeCrawlers !== 'crawlers') { + maybeCrawlers = null + path = [maybeCrawlers, ...path] + } + + return { + __type: 'clientSdk' as const, + sdkId, + maybeVersion, + maybeCrawlers, + path, + } + } else { + return { + __type: 'UNIMPLEMENTED' as const, + } + } +} + +async function generateStaticParamsForSdkVersion(sdkId: string, version: string) { + const flattenedSections = await getFlattenedSections(sdkId, version) + + return flattenedSections + .filter((section) => section.type !== 'category' && !!section.slug) + .map((section) => ({ + slug: [ + sdkId, + version === REFERENCES[sdkId].versions[0] ? null : version, + 'crawlers', + section.slug, + ].filter(Boolean), + })) +} + +export async function generateReferenceStaticParams() { + const nonCrawlerPages = clientSdkIds + .flatMap((sdkId) => + REFERENCES[sdkId].versions.map((version) => ({ + sdkId, + version, + })) + ) + .map(({ sdkId, version }) => ({ + slug: [sdkId, version === REFERENCES[sdkId].versions[0] ? null : version].filter(Boolean), + })) + + return nonCrawlerPages +} + +export async function generateReferenceMetadata( + { params: { slug } }: { params: { slug: Array } }, + resolvingParent: ResolvingMetadata +): Promise { + const { alternates: parentAlternates, openGraph: parentOg } = await resolvingParent + + const parsedPath = parseReferencePath(slug) + const isClientSdkReference = parsedPath.__type === 'clientSdk' + + if (isClientSdkReference) { + const { sdkId, maybeVersion } = parsedPath + const version = maybeVersion ?? REFERENCES[sdkId].versions[0] + + const flattenedSections = await getFlattenedSections(sdkId, version) + + const displayName = REFERENCES[sdkId].name + const sectionTitle = + slug.length > 0 + ? flattenedSections.find((section) => section.slug === slug[0])?.title + : undefined + const url = [BASE_PATH, 'reference', sdkId, maybeVersion, slug[0]].filter(Boolean).join('/') + + const images = generateOpenGraphImageMeta({ + type: 'API Reference', + title: `${displayName}${sectionTitle ? `: ${sectionTitle}` : ''}`, + }) + + return { + title: `${displayName} API Reference | Supabase Docs`, + description: `API reference for the ${displayName} Supabase SDK`, + ...(slug.length > 0 + ? { + alternates: { + ...parentAlternates, + canonical: url, + }, + } + : {}), + openGraph: { + ...parentOg, + url, + images, + }, + } + } else { + return {} + } +} + +export async function redirectNonexistentReferenceSection( + sdkId: string, + version: string, + path: Array, + isLatestVersion: boolean +) { + const initialSelectedSection = path[0] + + const validSlugs = await generateStaticParamsForSdkVersion(sdkId, version) + + if ( + initialSelectedSection && + !validSlugs.some((params) => params.slug[0] === initialSelectedSection) + ) { + redirect(`/reference/${sdkId}` + (!isLatestVersion ? '/' + version : '')) + } +} + +export function normalizeMarkdown(markdownUnescaped: string): string { + const markdown = markdownUnescaped.replaceAll(/(? { + node.value = node.value.replace(/\n/g, ' ') + }) + + const content = toMarkdown(mdxTree, { + extensions: [mdxToMarkdown()], + }) + + return content +} 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 1d02bea96e6..8daa7a2c106 100644 --- a/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap +++ b/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap @@ -32,12 +32,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "options", "type": { "name": "SupabaseClientOptions", - "type": "customObject", + "type": "object", "properties": [ { "name": "auth", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "autoRefreshToken", @@ -54,7 +54,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "debug", "type": { "type": "nameOnly", - "name": "SupabaseAuthClientOptions[debug]" + "name": "SupabaseAuthClientOptions['debug']" }, "isOptional": true, "comment": { @@ -76,7 +76,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "flowType", "type": { "type": "nameOnly", - "name": "SupabaseAuthClientOptions[flowType]" + "name": "SupabaseAuthClientOptions['flowType']" }, "isOptional": true, "comment": { @@ -87,7 +87,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "lock", "type": { "type": "nameOnly", - "name": "SupabaseAuthClientOptions[lock]" + "name": "SupabaseAuthClientOptions['lock']" }, "isOptional": true, "comment": { @@ -115,7 +115,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "storage", "type": { "type": "nameOnly", - "name": "SupabaseAuthClientOptions[storage]" + "name": "SupabaseAuthClientOptions['storage']" }, "isOptional": true, "comment": { @@ -140,7 +140,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "db", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "schema", @@ -160,7 +160,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "global", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "fetch", @@ -226,7 +226,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -254,7 +254,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "source", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -306,7 +306,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [ { "type": { - "type": "customObject", + "type": "object", "name": "SupabaseAuthClientOptions", "properties": [] } @@ -335,7 +335,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "input", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -438,7 +438,32 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Perform a query on a table or a view." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "relation", + "type": { + "type": "nameOnly", + "name": "ViewName" + }, + "comment": { + "shortText": "The table or view name to query\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "@supabase/postgrest-js.PostgrestQueryBuilder" + } + }, + "comment": { + "shortText": "Perform a query on a table or a view." + } + } + ] }, "@supabase/supabase-js.index.SupabaseClient.getChannels": { "name": "@supabase/supabase-js.index.SupabaseClient.getChannels", @@ -466,7 +491,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "awaited": { "type": "array", "elemType": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -508,7 +533,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -547,7 +572,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "args", "type": { "type": "nameOnly", - "name": "Fn[Args]" + "name": "Fn['Args']" }, "comment": { "shortText": "The arguments to pass to the function call" @@ -556,12 +581,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "count", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -681,7 +706,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -747,14 +772,14 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "details", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", "value": null }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "code", @@ -788,19 +813,19 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "details", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", "value": null }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "code", @@ -869,7 +894,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -911,7 +936,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -951,14 +976,14 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "details", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", "value": null }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "code", @@ -992,19 +1017,19 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "details", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", "value": null }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "code", @@ -1080,7 +1105,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -1122,7 +1147,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -1214,7 +1239,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -1278,7 +1303,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -1310,7 +1335,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [ { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "fetch", @@ -1320,7 +1345,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "input", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -1388,7 +1413,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "attributes", "type": { - "type": "customObject", + "type": "object", "name": "AdminUserAttributes", "properties": [ { @@ -1517,21 +1542,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "UserResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -1545,7 +1570,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -1618,7 +1643,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -1662,7 +1687,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -1702,7 +1727,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -1852,7 +1877,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -1873,12 +1898,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", @@ -1936,21 +1961,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "UserResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -1964,7 +1989,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -2037,7 +2062,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -2081,7 +2106,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -2121,7 +2146,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -2271,7 +2296,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -2292,12 +2317,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", @@ -2332,11 +2357,11 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "params", "type": { - "type": "customUnion", + "type": "union", "name": "GenerateLinkParams", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "email", @@ -2348,8 +2373,32 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "nameOnly", - "name": "Pick" + "type": "union", + "subTypes": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the \`auth.users.raw_user_meta_data\` column.", + "text": "The \`data\` should be a JSON object that includes user-specific info, such as their first and last name.\\n" + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The URL which will be appended to the email link generated." + } + } + ] }, "isOptional": true }, @@ -2370,7 +2419,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "email", @@ -2385,15 +2434,39 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "nameOnly", - "name": "Pick" + "type": "union", + "subTypes": [ + { + "name": "data", + "type": { + "type": "intrinsic", + "name": "object" + }, + "isOptional": true, + "comment": { + "shortText": "A custom data object to store the user's metadata. This maps to the \`auth.users.raw_user_meta_data\` column.", + "text": "The \`data\` should be a JSON object that includes user-specific info, such as their first and last name.\\n" + } + }, + { + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The URL which will be appended to the email link generated." + } + } + ] }, "isOptional": true }, { "name": "type", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -2409,7 +2482,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "email", @@ -2424,8 +2497,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "nameOnly", - "name": "Pick" + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The URL which will be appended to the email link generated." + } }, "isOptional": true }, @@ -2439,7 +2519,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "email", @@ -2464,15 +2544,22 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "nameOnly", - "name": "Pick" + "name": "redirectTo", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The URL which will be appended to the email link generated." + } }, "isOptional": true }, { "name": "type", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -2496,22 +2583,22 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "GenerateLinkResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "properties", "type": { "name": "GenerateLinkProperties", - "type": "customObject", + "type": "object", "properties": [ { "name": "action_link", @@ -2556,7 +2643,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "verification_type", "type": { - "type": "customUnion", + "type": "union", "name": "GenerateLinkType", "subTypes": [ { @@ -2595,7 +2682,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -2609,7 +2696,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -2682,7 +2769,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -2726,7 +2813,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -2766,7 +2853,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -2916,7 +3003,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -2937,12 +3024,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "properties", @@ -2997,21 +3084,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "UserResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -3025,7 +3112,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -3098,7 +3185,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -3142,7 +3229,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -3182,7 +3269,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -3332,7 +3419,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -3353,12 +3440,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", @@ -3403,7 +3490,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -3439,21 +3526,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "UserResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -3467,7 +3554,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -3540,7 +3627,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -3584,7 +3671,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -3624,7 +3711,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -3774,7 +3861,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -3795,12 +3882,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", @@ -3836,7 +3923,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "params", "type": { "name": "PageParams", - "type": "customObject", + "type": "object", "properties": [ { "name": "page", @@ -3873,10 +3960,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data" @@ -3891,12 +3978,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "users" @@ -3938,7 +4025,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "scope", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -3964,7 +4051,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -3976,7 +4063,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "error", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -4010,7 +4097,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "attributes", "type": { - "type": "customObject", + "type": "object", "name": "AdminUserAttributes", "properties": [ { @@ -4142,21 +4229,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "UserResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -4170,7 +4257,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -4243,7 +4330,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -4287,7 +4374,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -4327,7 +4414,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -4477,7 +4564,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -4498,12 +4585,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", @@ -4539,7 +4626,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "options", "type": { "name": "GoTrueClientOptions", - "type": "customObject", + "type": "object", "properties": [ { "name": "autoRefreshToken", @@ -4552,7 +4639,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "debug", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -4609,7 +4696,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "flowType", "type": { - "type": "customUnion", + "type": "union", "name": "AuthFlowType", "subTypes": [ { @@ -4769,21 +4856,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthTokenResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", "type": { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -4820,7 +4907,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -4840,7 +4927,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -4877,7 +4964,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -4891,7 +4978,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -4964,7 +5051,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -5008,7 +5095,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -5048,7 +5135,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -5198,7 +5285,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -5212,7 +5299,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -5226,7 +5313,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -5299,7 +5386,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -5343,7 +5430,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -5383,7 +5470,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -5533,7 +5620,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -5554,12 +5641,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", @@ -5603,20 +5690,20 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", "type": { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -5653,7 +5740,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -5673,7 +5760,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -5710,7 +5797,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -5724,7 +5811,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -5797,7 +5884,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -5841,7 +5928,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -5881,7 +5968,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -6031,7 +6118,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -6055,12 +6142,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", @@ -6082,12 +6169,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", @@ -6137,21 +6224,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "UserResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -6165,7 +6252,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -6238,7 +6325,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -6282,7 +6369,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -6322,7 +6409,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -6472,7 +6559,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -6493,12 +6580,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", @@ -6535,22 +6622,22 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "identities", "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -6637,7 +6724,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -6672,12 +6759,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "Promise", "awaited": { "name": "InitializeResult", - "type": "customObject", + "type": "object", "properties": [ { "name": "error", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -6705,12 +6792,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "credentials", "type": { "name": "SignInWithOAuthCredentials", - "type": "customObject", + "type": "object", "properties": [ { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "queryParams", @@ -6770,7 +6857,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider", "type": { - "type": "customUnion", + "type": "union", "name": "Provider", "subTypes": [ { @@ -6872,21 +6959,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "OAuthResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "provider", "type": { - "type": "customUnion", + "type": "union", "name": "Provider", "subTypes": [ { @@ -6996,17 +7083,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "provider", "type": { - "type": "customUnion", + "type": "union", "name": "Provider", "subTypes": [ { @@ -7134,7 +7221,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "event", "type": { - "type": "customUnion", + "type": "union", "name": "AuthChangeEvent", "subTypes": [ { @@ -7171,14 +7258,14 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "session", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", "value": null }, { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -7215,7 +7302,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -7235,7 +7322,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -7272,7 +7359,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -7286,7 +7373,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -7359,7 +7446,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -7403,7 +7490,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -7443,7 +7530,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -7593,7 +7680,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -7609,7 +7696,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -7634,17 +7721,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "subscription", "type": { - "type": "customObject", + "type": "object", "name": "Subscription", "properties": [ { @@ -7664,7 +7751,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "event", "type": { - "type": "customUnion", + "type": "union", "name": "AuthChangeEvent", "subTypes": [ { @@ -7701,14 +7788,14 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "session", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", "value": null }, { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -7745,7 +7832,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -7765,7 +7852,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -7802,7 +7889,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -7816,7 +7903,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -7889,7 +7976,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -7933,7 +8020,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -7973,7 +8060,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -8123,7 +8210,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -8182,24 +8269,24 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -8236,7 +8323,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -8256,7 +8343,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -8293,7 +8380,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -8307,7 +8394,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -8380,7 +8467,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -8424,7 +8511,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -8464,7 +8551,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -8614,7 +8701,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -8634,10 +8721,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -8651,7 +8738,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -8724,7 +8811,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -8768,7 +8855,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -8808,7 +8895,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -8958,7 +9045,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -8985,12 +9072,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", @@ -9032,7 +9119,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "currentSession", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "refresh_token", @@ -9054,24 +9141,24 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -9108,7 +9195,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -9128,7 +9215,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -9165,7 +9252,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -9179,7 +9266,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -9252,7 +9339,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -9296,7 +9383,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -9336,7 +9423,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -9486,7 +9573,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -9506,10 +9593,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -9523,7 +9610,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -9596,7 +9683,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -9640,7 +9727,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -9680,7 +9767,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -9830,7 +9917,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -9857,12 +9944,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", @@ -9904,11 +9991,11 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "credentials", "type": { - "type": "customUnion", + "type": "union", "name": "ResendParams", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "email", @@ -9920,7 +10007,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -9951,19 +10038,28 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "type", "type": { - "type": "nameOnly", - "name": "Extract" + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "signup" + }, + { + "type": "literal", + "value": "email_change" + } + ] } } ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -9990,8 +10086,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "type", "type": { - "type": "nameOnly", - "name": "Extract" + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "sms" + }, + { + "type": "literal", + "value": "phone_change" + } + ] } } ] @@ -10005,21 +10110,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthOtpResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "messageId", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -10060,17 +10165,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "messageId", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -10134,7 +10239,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -10167,10 +10272,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data" @@ -10185,7 +10290,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -10217,7 +10322,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "currentSession", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "access_token", @@ -10245,24 +10350,24 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -10299,7 +10404,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -10319,7 +10424,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -10356,7 +10461,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -10370,7 +10475,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -10443,7 +10548,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -10487,7 +10592,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -10527,7 +10632,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -10677,7 +10782,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -10697,10 +10802,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -10714,7 +10819,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -10787,7 +10892,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -10831,7 +10936,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -10871,7 +10976,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -11021,7 +11126,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -11048,12 +11153,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", @@ -11096,12 +11201,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "credentials", "type": { "name": "SignInAnonymouslyCredentials", - "type": "customObject", + "type": "object", "properties": [ { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -11140,24 +11245,24 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -11194,7 +11299,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -11214,7 +11319,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -11251,7 +11356,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -11265,7 +11370,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -11338,7 +11443,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -11382,7 +11487,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -11422,7 +11527,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -11572,7 +11677,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -11592,10 +11697,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -11609,7 +11714,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -11682,7 +11787,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -11726,7 +11831,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -11766,7 +11871,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -11916,7 +12021,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -11943,12 +12048,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", @@ -11992,7 +12097,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "credentials", "type": { "name": "SignInWithIdTokenCredentials", - "type": "customObject", + "type": "object", "properties": [ { "name": "access_token", @@ -12019,7 +12124,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -12039,7 +12144,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -12086,21 +12191,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthTokenResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", "type": { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -12137,7 +12242,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -12157,7 +12262,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -12194,7 +12299,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -12208,7 +12313,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -12281,7 +12386,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -12325,7 +12430,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -12365,7 +12470,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -12515,7 +12620,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -12529,7 +12634,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -12543,7 +12648,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -12616,7 +12721,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -12660,7 +12765,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -12700,7 +12805,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -12850,7 +12955,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -12871,12 +12976,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", @@ -12919,12 +13024,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "credentials", "type": { "name": "SignInWithOAuthCredentials", - "type": "customObject", + "type": "object", "properties": [ { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "queryParams", @@ -12984,7 +13089,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider", "type": { - "type": "customUnion", + "type": "union", "name": "Provider", "subTypes": [ { @@ -13086,21 +13191,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "OAuthResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "provider", "type": { - "type": "customUnion", + "type": "union", "name": "Provider", "subTypes": [ { @@ -13210,17 +13315,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "provider", "type": { - "type": "customUnion", + "type": "union", "name": "Provider", "subTypes": [ { @@ -13343,11 +13448,11 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "credentials", "type": { - "type": "customUnion", + "type": "union", "name": "SignInWithPasswordlessCredentials", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "email", @@ -13362,7 +13467,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -13416,12 +13521,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -13437,7 +13542,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "channel", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -13502,21 +13607,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthOtpResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "messageId", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -13557,17 +13662,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "messageId", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -13622,11 +13727,11 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "credentials", "type": { - "type": "customUnion", + "type": "union", "name": "SignInWithPasswordCredentials", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "email", @@ -13641,7 +13746,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -13671,12 +13776,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -13724,21 +13829,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthTokenResponsePassword", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", "type": { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -13775,7 +13880,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -13795,7 +13900,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -13832,7 +13937,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -13846,7 +13951,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -13919,7 +14024,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -13963,7 +14068,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -14003,7 +14108,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -14153,7 +14258,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -14167,7 +14272,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -14181,7 +14286,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -14254,7 +14359,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -14298,7 +14403,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -14338,7 +14443,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -14488,7 +14593,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -14500,7 +14605,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "weakPassword", "type": { "name": "WeakPassword", - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -14514,7 +14619,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customUnion", + "type": "union", "name": "WeakPasswordReasons", "subTypes": [ { @@ -14554,12 +14659,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", @@ -14610,16 +14715,16 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "params", "type": { - "type": "customUnion", + "type": "union", "name": "SignInWithSSO", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -14660,7 +14765,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "domain", @@ -14675,7 +14780,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -14714,16 +14819,16 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "SSOResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "url", @@ -14749,7 +14854,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -14783,12 +14888,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "options", "type": { "name": "SignOut", - "type": "customObject", + "type": "object", "properties": [ { "name": "scope", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -14818,12 +14923,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customObject", + "type": "object", "properties": [ { "name": "error", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -14851,11 +14956,11 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "credentials", "type": { - "type": "customUnion", + "type": "union", "name": "SignUpWithPasswordCredentials", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "email", @@ -14870,7 +14975,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -14923,12 +15028,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -14944,7 +15049,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "channel", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -15008,24 +15113,24 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -15062,7 +15167,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -15082,7 +15187,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -15119,7 +15224,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -15133,7 +15238,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -15206,7 +15311,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -15250,7 +15355,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -15290,7 +15395,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -15440,7 +15545,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -15460,10 +15565,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -15477,7 +15582,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -15550,7 +15655,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -15594,7 +15699,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -15634,7 +15739,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -15784,7 +15889,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -15811,12 +15916,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", @@ -15896,7 +16001,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "identity", "type": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -15975,10 +16080,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data" @@ -15993,7 +16098,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -16025,7 +16130,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "attributes", "type": { - "type": "customObject", + "type": "object", "name": "UserAttributes", "properties": [ { @@ -16091,7 +16196,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "emailRedirectTo", @@ -16110,21 +16215,21 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "UserResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -16138,7 +16243,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -16211,7 +16316,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -16255,7 +16360,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -16295,7 +16400,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -16445,7 +16550,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -16466,12 +16571,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "user", @@ -16506,17 +16611,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "params", "type": { - "type": "customUnion", + "type": "union", "name": "VerifyOtpParams", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "VerifyMobileOtpParams", "properties": [ { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -16573,7 +16678,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "type", "type": { - "type": "customUnion", + "type": "union", "name": "MobileOtpType", "subTypes": [ { @@ -16593,7 +16698,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "name": "VerifyEmailOtpParams", "properties": [ { @@ -16609,7 +16714,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "captchaToken", @@ -16656,7 +16761,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "type", "type": { - "type": "customUnion", + "type": "union", "name": "EmailOtpType", "subTypes": [ { @@ -16692,7 +16797,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "name": "VerifyTokenHashParams", "properties": [ { @@ -16708,7 +16813,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "type", "type": { - "type": "customUnion", + "type": "union", "name": "EmailOtpType", "subTypes": [ { @@ -16752,24 +16857,24 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -16806,7 +16911,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -16826,7 +16931,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -16863,7 +16968,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -16877,7 +16982,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -16950,7 +17055,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -16994,7 +17099,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -17034,7 +17139,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -17184,7 +17289,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -17204,10 +17309,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -17221,7 +17326,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -17294,7 +17399,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -17338,7 +17443,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -17378,7 +17483,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -17528,7 +17633,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -17555,12 +17660,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "session", @@ -17621,7 +17726,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "params", "type": { "name": "AuthMFAAdminDeleteFactorParams", - "type": "customObject", + "type": "object", "properties": [ { "name": "id", @@ -17652,16 +17757,16 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthMFAAdminDeleteFactorResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "id", @@ -17686,7 +17791,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -17729,7 +17834,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "params", "type": { "name": "AuthMFAAdminListFactorsParams", - "type": "customObject", + "type": "object", "properties": [ { "name": "userId", @@ -17750,23 +17855,23 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthMFAAdminListFactorsResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "factors", "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -17810,7 +17915,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -17853,7 +17958,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -17886,7 +17991,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "params", "type": { "name": "MFAChallengeParams", - "type": "customObject", + "type": "object", "properties": [ { "name": "factorId", @@ -17907,16 +18012,16 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthMFAChallengeResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "expires_at", @@ -17951,7 +18056,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -17984,7 +18089,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "params", "type": { "name": "MFAChallengeAndVerifyParams", - "type": "customObject", + "type": "object", "properties": [ { "name": "code", @@ -18015,16 +18120,16 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "access_token", @@ -18069,7 +18174,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -18083,7 +18188,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -18156,7 +18261,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -18200,7 +18305,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -18240,7 +18345,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -18390,7 +18495,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -18414,7 +18519,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -18447,7 +18552,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "params", "type": { "name": "MFAEnrollParams", - "type": "customObject", + "type": "object", "properties": [ { "name": "factorType", @@ -18490,16 +18595,16 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthMFAEnrollResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "friendly_name", @@ -18525,7 +18630,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "totp", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "qr_code", @@ -18586,7 +18691,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -18621,23 +18726,23 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthMFAGetAuthenticatorAssuranceLevelResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "currentAuthenticationMethods", "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "AMREntry", "properties": [ { @@ -18670,10 +18775,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "currentLevel", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customUnion", + "type": "union", "name": "AuthenticatorAssuranceLevels", "subTypes": [ { @@ -18699,10 +18804,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "nextLevel", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customUnion", + "type": "union", "name": "AuthenticatorAssuranceLevels", "subTypes": [ { @@ -18744,7 +18849,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -18779,23 +18884,23 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthMFAListFactorsResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "all", "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -18839,7 +18944,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -18874,7 +18979,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -18918,7 +19023,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -18961,7 +19066,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -19008,7 +19113,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "params", "type": { "name": "MFAUnenrollParams", - "type": "customObject", + "type": "object", "properties": [ { "name": "factorId", @@ -19029,16 +19134,16 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthMFAUnenrollResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "id", @@ -19063,7 +19168,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -19096,7 +19201,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "params", "type": { "name": "MFAVerifyParams", - "type": "customObject", + "type": "object", "properties": [ { "name": "challengeId", @@ -19137,16 +19242,16 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "AuthMFAVerifyResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "access_token", @@ -19191,7 +19296,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -19205,7 +19310,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -19278,7 +19383,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -19322,7 +19427,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -19362,7 +19467,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -19512,7 +19617,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -19536,7 +19641,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -19568,7 +19673,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "event", "type": { - "type": "customUnion", + "type": "union", "name": "AuthChangeEvent", "subTypes": [ { @@ -19605,14 +19710,14 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "session", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", "value": null }, { - "type": "customObject", + "type": "object", "name": "Session", "properties": [ { @@ -19649,7 +19754,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_refresh_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -19669,7 +19774,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "provider_token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -19706,7 +19811,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user", "type": { - "type": "customObject", + "type": "object", "name": "User", "properties": [ { @@ -19720,7 +19825,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "app_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserAppMetadata", "properties": [ { @@ -19793,7 +19898,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Factor", "properties": [ { @@ -19837,7 +19942,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -19877,7 +19982,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "UserIdentity", "properties": [ { @@ -20027,7 +20132,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "user_metadata", "type": { - "type": "customObject", + "type": "object", "name": "UserMetadata", "properties": [] } @@ -20089,7 +20194,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "onfulfilled", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -20101,17 +20206,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "value", "type": { - "type": "customUnion", + "type": "union", "name": "PostgrestSingleResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "PostgrestResponseSuccess", "properties": [ { "name": "count", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -20155,7 +20260,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "name": "PostgrestResponseFailure", "properties": [ { @@ -20176,7 +20281,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "error", "type": { "name": "PostgrestError", - "type": "customObject", + "type": "object", "properties": [ { "name": "code", @@ -20231,7 +20336,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -20252,7 +20357,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "onrejected", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -20271,7 +20376,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -20327,7 +20432,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "fetch", @@ -20337,7 +20442,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "input", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -20444,7 +20549,32 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Perform a query on a table or a view." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "relation", + "type": { + "type": "nameOnly", + "name": "ViewName" + }, + "comment": { + "shortText": "The table or view name to query\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Perform a query on a table or a view." + } + } + ] }, "@supabase/postgrest-js.PostgrestClient.rpc": { "name": "@supabase/postgrest-js.PostgrestClient.rpc", @@ -20463,7 +20593,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "args", "type": { "type": "nameOnly", - "name": "Fn[Args]" + "name": "Fn['Args']" }, "comment": { "shortText": "The arguments to pass to the function call" @@ -20472,12 +20602,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "count", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -20616,7 +20746,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "value", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -20638,7 +20768,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "array", "elemType": { "type": "nameOnly", - "name": "Row[ColumnName]" + "name": "Row['ColumnName']" } } ] @@ -20656,7 +20786,66 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Only relevant for jsonb, array, and range columns. Match only rows where\\nevery element appearing in \`column\` is contained by \`value\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The jsonb, array, or range column to filter on" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "unknown" + } + }, + { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "comment": { + "shortText": "The jsonb, array, or range value to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Only relevant for jsonb, array, and range columns. Match only rows where\\nevery element appearing in \`column\` is contained by \`value\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.contains": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.contains", @@ -20674,7 +20863,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "value", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -20696,7 +20885,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "array", "elemType": { "type": "nameOnly", - "name": "Row[ColumnName]" + "name": "Row['ColumnName']" } } ] @@ -20714,7 +20903,66 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Only relevant for jsonb, array, and range columns. Match only rows where\\n\`column\` contains every element appearing in \`value\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The jsonb, array, or range column to filter on" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "unknown" + } + }, + { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "comment": { + "shortText": "The jsonb, array, or range value to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Only relevant for jsonb, array, and range columns. Match only rows where\\n\`column\` contains every element appearing in \`value\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.csv": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.csv", @@ -20762,7 +21010,43 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "comment": { "shortText": "Match only rows where \`column\` is equal to \`value\`.", "text": "To check if the value of \`column\` is NULL, you should use \`.is()\` instead.\\n" - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "type": { + "type": "nameOnly", + "name": "NonNullable" + }, + "comment": { + "shortText": "The value to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` is equal to \`value\`.", + "text": "To check if the value of \`column\` is NULL, you should use \`.is()\` instead.\\n" + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.explain": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.explain", @@ -20770,7 +21054,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "analyze", @@ -20797,7 +21081,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "format", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -20856,7 +21140,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -20901,7 +21185,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "operator", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -21021,7 +21305,53 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "comment": { "shortText": "Match only rows which satisfy the filter. This is an escape hatch - you\\nshould use the specific filter methods wherever possible.", "text": "Unlike most filters, \`opearator\` and \`value\` are used as-is and need to\\nfollow [PostgREST\\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\\nto make sure they are properly sanitized.\\n" - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "operator", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The operator to filter with, following PostgREST syntax" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "comment": { + "shortText": "The value to filter with, following PostgREST syntax\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows which satisfy the filter. This is an escape hatch - you\\nshould use the specific filter methods wherever possible.", + "text": "Unlike most filters, \`opearator\` and \`value\` are used as-is and need to\\nfollow [PostgREST\\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\\nto make sure they are properly sanitized.\\n" + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.geojson": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.geojson", @@ -21061,7 +21391,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "value", "type": { "type": "nameOnly", - "name": "Row[ColumnName]" + "name": "Row['ColumnName']" }, "comment": { "shortText": "The value to filter with\\n" @@ -21076,7 +21406,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` is greater than \`value\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "comment": { + "shortText": "The value to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` is greater than \`value\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.gte": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.gte", @@ -21095,7 +21460,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "value", "type": { "type": "nameOnly", - "name": "Row[ColumnName]" + "name": "Row['ColumnName']" }, "comment": { "shortText": "The value to filter with\\n" @@ -21110,7 +21475,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` is greater than or equal to \`value\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "comment": { + "shortText": "The value to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` is greater than or equal to \`value\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.ilike": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.ilike", @@ -21144,7 +21544,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` matches \`pattern\` case-insensitively." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The pattern to match with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` matches \`pattern\` case-insensitively." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAllOf": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAllOf", @@ -21181,7 +21616,45 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` matches all of \`patterns\` case-insensitively." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "The patterns to match with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` matches all of \`patterns\` case-insensitively." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAnyOf": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.ilikeAnyOf", @@ -21218,7 +21691,45 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` matches any of \`patterns\` case-insensitively." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "The patterns to match with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` matches any of \`patterns\` case-insensitively." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.in": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.in", @@ -21239,7 +21750,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "array", "elemType": { "type": "nameOnly", - "name": "Row[ColumnName]" + "name": "Row['ColumnName']" } }, "comment": { @@ -21255,7 +21766,45 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` is included in the \`values\` array." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "values", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "unknown" + } + }, + "comment": { + "shortText": "The values array to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` is included in the \`values\` array." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.is": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.is", @@ -21286,7 +21835,52 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "comment": { "shortText": "Match only rows where \`column\` IS \`value\`.", "text": "For non-boolean columns, this is only relevant for checking if the value of\\n\`column\` is NULL by setting \`value\` to \`null\`.\\n\\nFor boolean columns, you can also set \`value\` to \`true\` or \`false\` and it\\nwill behave the same way as \`.eq()\`.\\n" - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "intrinsic", + "name": "boolean" + } + ] + }, + "comment": { + "shortText": "The value to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` IS \`value\`.", + "text": "For non-boolean columns, this is only relevant for checking if the value of\\n\`column\` is NULL by setting \`value\` to \`null\`.\\n\\nFor boolean columns, you can also set \`value\` to \`true\` or \`false\` and it\\nwill behave the same way as \`.eq()\`.\\n" + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.like": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.like", @@ -21320,7 +21914,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` matches \`pattern\` case-sensitively." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "pattern", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The pattern to match with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` matches \`pattern\` case-sensitively." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.likeAllOf": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAllOf", @@ -21357,7 +21986,45 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` matches all of \`patterns\` case-sensitively." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "The patterns to match with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` matches all of \`patterns\` case-sensitively." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.likeAnyOf": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.likeAnyOf", @@ -21394,7 +22061,45 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` matches any of \`patterns\` case-sensitively." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "patterns", + "type": { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "string" + } + }, + "comment": { + "shortText": "The patterns to match with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` matches any of \`patterns\` case-sensitively." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.limit": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.limit", @@ -21412,7 +22117,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "foreignTable", @@ -21470,7 +22175,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "value", "type": { "type": "nameOnly", - "name": "Row[ColumnName]" + "name": "Row['ColumnName']" }, "comment": { "shortText": "The value to filter with\\n" @@ -21485,7 +22190,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` is less than \`value\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "comment": { + "shortText": "The value to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` is less than \`value\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.lte": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.lte", @@ -21504,7 +22244,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "value", "type": { "type": "nameOnly", - "name": "Row[ColumnName]" + "name": "Row['ColumnName']" }, "comment": { "shortText": "The value to filter with\\n" @@ -21519,7 +22259,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` is less than or equal to \`value\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "comment": { + "shortText": "The value to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` is less than or equal to \`value\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.match": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.match", @@ -21535,7 +22310,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "valueType": { "type": "nameOnly", - "name": "Row[ColumnName]" + "name": "Row['ColumnName']" } }, "comment": { @@ -21551,14 +22326,47 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where each column in \`query\` keys is equal to its\\nassociated value. Shorthand for multiple \`.eq()\`s." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "query", + "type": { + "type": "record", + "name": "Record", + "keyType": { + "type": "intrinsic", + "name": "string" + }, + "valueType": { + "type": "intrinsic", + "name": "unknown" + } + }, + "comment": { + "shortText": "The object to filter with, with column names as keys mapped\\nto their filter values\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where each column in \`query\` keys is equal to its\\nassociated value. Shorthand for multiple \`.eq()\`s." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.maybeSingle": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.maybeSingle", "params": [], "ret": { "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -21593,7 +22401,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "value", "type": { "type": "nameOnly", - "name": "Row[ColumnName]" + "name": "Row['ColumnName']" }, "comment": { "shortText": "The value to filter with\\n" @@ -21608,7 +22416,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Match only rows where \`column\` is not equal to \`value\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "comment": { + "shortText": "The value to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows where \`column\` is not equal to \`value\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.not": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.not", @@ -21637,7 +22480,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "value", "type": { "type": "nameOnly", - "name": "Row[ColumnName]" + "name": "Row['ColumnName']" }, "comment": { "shortText": "The value to filter with, following PostgREST syntax\\n" @@ -21653,7 +22496,53 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "comment": { "shortText": "Match only rows which doesn't satisfy the filter.", "text": "Unlike most filters, \`opearator\` and \`value\` are used as-is and need to\\nfollow [PostgREST\\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\\nto make sure they are properly sanitized.\\n" - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to filter on" + } + }, + { + "name": "operator", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The operator to be negated to filter with, following\\nPostgREST syntax" + } + }, + { + "name": "value", + "type": { + "type": "intrinsic", + "name": "unknown" + }, + "comment": { + "shortText": "The value to filter with, following PostgREST syntax\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Match only rows which doesn't satisfy the filter.", + "text": "Unlike most filters, \`opearator\` and \`value\` are used as-is and need to\\nfollow [PostgREST\\nsyntax](https://postgrest.org/en/stable/api.html#operators). You also need\\nto make sure they are properly sanitized.\\n" + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.or": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.or", @@ -21671,7 +22560,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "foreignTable", @@ -21729,7 +22618,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "ascending", @@ -21781,7 +22670,210 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "comment": { "shortText": "Order the query result by \`column\`.", "text": "You can call this method multiple times to order by multiple columns.\\n\\nYou can order referenced tables, but it only affects the ordering of the\\nparent table if you use \`!inner\` in the query.\\n" - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to order by" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If \`true\`, the result will be in ascending order" + } + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If \`true\`, \`null\`s appear first. If \`false\`,\\n\`null\`s appear last." + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to order a referenced table by\\nits columns" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Order the query result by \`column\`.", + "text": "You can call this method multiple times to order by multiple columns.\\n\\nYou can order referenced tables, but it only affects the ordering of the\\nparent table if you use \`!inner\` in the query.\\n" + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + }, + "comment": { + "shortText": "The column to order by" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Order the query result by \`column\`.", + "text": "You can call this method multiple times to order by multiple columns.\\n\\nYou can order referenced tables, but it only affects the ordering of the\\nparent table if you use \`!inner\` in the query.\\n", + "tags": [ + { + "tag": "deprecated", + "text": "Use \`options.referencedTable\` instead of \`options.foreignTable\`\\n" + } + ] + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to order by" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Order the query result by \`column\`.", + "text": "You can call this method multiple times to order by multiple columns.\\n\\nYou can order referenced tables, but it only affects the ordering of the\\nparent table if you use \`!inner\` in the query.\\n", + "tags": [ + { + "tag": "deprecated", + "text": "Use \`options.referencedTable\` instead of \`options.foreignTable\`\\n" + } + ] + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.overlaps": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.overlaps", @@ -21799,7 +22891,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "value", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -21809,7 +22901,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "array", "elemType": { "type": "nameOnly", - "name": "Row[ColumnName]" + "name": "Row['ColumnName']" } } ] @@ -21827,7 +22919,54 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Only relevant for array and range columns. Match only rows where\\n\`column\` and \`value\` have an element in common." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The array or range column to filter on" + } + }, + { + "name": "value", + "type": { + "type": "union", + "subTypes": [ + { + "type": "intrinsic", + "name": "string" + }, + { + "type": "array", + "elemType": { + "type": "intrinsic", + "name": "unknown" + } + } + ] + }, + "comment": { + "shortText": "The array or range value to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Only relevant for array and range columns. Match only rows where\\n\`column\` and \`value\` have an element in common." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.range": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.range", @@ -21855,7 +22994,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "foreignTable", @@ -21928,7 +23067,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Only relevant for range columns. Match only rows where \`column\` is\\nmutually exclusive to \`range\` and there can be no element between the two\\nranges." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The range column to filter on" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The range to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Only relevant for range columns. Match only rows where \`column\` is\\nmutually exclusive to \`range\` and there can be no element between the two\\nranges." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGt": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGt", @@ -21962,7 +23136,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Only relevant for range columns. Match only rows where every element in\\n\`column\` is greater than any element in \`range\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The range column to filter on" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The range to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Only relevant for range columns. Match only rows where every element in\\n\`column\` is greater than any element in \`range\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGte": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeGte", @@ -21996,7 +23205,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Only relevant for range columns. Match only rows where every element in\\n\`column\` is either contained in \`range\` or greater than any element in\\n\`range\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The range column to filter on" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The range to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Only relevant for range columns. Match only rows where every element in\\n\`column\` is either contained in \`range\` or greater than any element in\\n\`range\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLt": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLt", @@ -22030,7 +23274,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Only relevant for range columns. Match only rows where every element in\\n\`column\` is less than any element in \`range\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The range column to filter on" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The range to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Only relevant for range columns. Match only rows where every element in\\n\`column\` is less than any element in \`range\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLte": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.rangeLte", @@ -22064,7 +23343,42 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Only relevant for range columns. Match only rows where every element in\\n\`column\` is either contained in \`range\` or less than any element in\\n\`range\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The range column to filter on" + } + }, + { + "name": "range", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The range to filter with\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Only relevant for range columns. Match only rows where every element in\\n\`column\` is either contained in \`range\` or less than any element in\\n\`range\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.returns": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.returns", @@ -22159,7 +23473,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "config", @@ -22175,7 +23489,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "type", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -22212,7 +23526,89 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, "comment": { "shortText": "Only relevant for text and tsvector columns. Match only rows where\\n\`column\` matches the query string in \`query\`." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The text or tsvector column to filter on" + } + }, + { + "name": "query", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The query text to match with" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "config", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The text search configuration to use" + } + }, + { + "name": "type", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "plain" + }, + { + "type": "literal", + "value": "phrase" + }, + { + "type": "literal", + "value": "websearch" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Change how the \`query\` text is interpreted\\n" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Only relevant for text and tsvector columns. Match only rows where\\n\`column\` matches the query string in \`query\`." + } + } + ] }, "@supabase/postgrest-js.PostgrestFilterBuilder.then": { "name": "@supabase/postgrest-js.PostgrestFilterBuilder.then", @@ -22220,7 +23616,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "onfulfilled", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -22232,17 +23628,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "value", "type": { - "type": "customUnion", + "type": "union", "name": "PostgrestSingleResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "PostgrestResponseSuccess", "properties": [ { "name": "count", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -22286,7 +23682,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "name": "PostgrestResponseFailure", "properties": [ { @@ -22307,7 +23703,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "error", "type": { "name": "PostgrestError", - "type": "customObject", + "type": "object", "properties": [ { "name": "code", @@ -22362,7 +23758,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -22383,7 +23779,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "onrejected", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -22402,7 +23798,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -22454,7 +23850,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "fetch", @@ -22464,7 +23860,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "input", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -22540,12 +23936,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "count", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -22600,12 +23996,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "count", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -22643,7 +24039,83 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "comment": { "shortText": "Perform an INSERT into the table or view.", "text": "By default, inserted rows are not returned. To return it, chain the call\\nwith \`.select()\`.\\n" - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "values", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Row" + } + }, + "comment": { + "shortText": "The values to insert. Pass an object to insert a single row\\nor an array to insert multiple rows.\\n" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "exact" + }, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count inserted rows.\\n\\n\`\\"exact\\"\`: Exact but slow count algorithm. Performs a \`COUNT(*)\` under the\\nhood.\\n\\n\`\\"planned\\"\`: Approximated but fast count algorithm. Uses the Postgres\\nstatistics under the hood.\\n\\n\`\\"estimated\\"\`: Uses exact count for low numbers and planned count for high\\nnumbers.\\n" + } + }, + { + "name": "defaultToNull", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Make missing fields default to \`null\`.\\nOtherwise, use the default value for the column. Only applies for bulk\\ninserts.\\n" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Perform an INSERT into the table or view.", + "text": "By default, inserted rows are not returned. To return it, chain the call\\nwith \`.select()\`.\\n" + } + } + ] }, "@supabase/postgrest-js.PostgrestQueryBuilder.select": { "name": "@supabase/postgrest-js.PostgrestQueryBuilder.select", @@ -22662,12 +24134,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "count", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -22732,12 +24204,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "count", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -22792,12 +24264,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "count", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -22857,7 +24329,105 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "comment": { "shortText": "Perform an UPSERT on the table or view. Depending on the column(s) passed\\nto \`onConflict\`, \`.upsert()\` allows you to perform the equivalent of\\n\`.insert()\` if a row with the corresponding \`onConflict\` columns doesn't\\nexist, or if it does exist, perform an alternative action depending on\\n\`ignoreDuplicates\`.", "text": "By default, upserted rows are not returned. To return it, chain the call\\nwith \`.select()\`.\\n" - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "values", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Row" + } + }, + "comment": { + "shortText": "The values to upsert with. Pass an object to upsert a\\nsingle row or an array to upsert multiple rows.\\n" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "count", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": "exact" + }, + { + "type": "literal", + "value": "planned" + }, + { + "type": "literal", + "value": "estimated" + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Count algorithm to use to count upserted rows.\\n\\n\`\\"exact\\"\`: Exact but slow count algorithm. Performs a \`COUNT(*)\` under the\\nhood.\\n\\n\`\\"planned\\"\`: Approximated but fast count algorithm. Uses the Postgres\\nstatistics under the hood.\\n\\n\`\\"estimated\\"\`: Uses exact count for low numbers and planned count for high\\nnumbers.\\n" + } + }, + { + "name": "defaultToNull", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "Make missing fields default to \`null\`.\\nOtherwise, use the default value for the column. This only applies when\\ninserting new rows, not when merging with existing rows under\\n\`ignoreDuplicates: false\`. This also only applies when doing bulk upserts.\\n" + } + }, + { + "name": "ignoreDuplicates", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If \`true\`, duplicate rows are ignored. If\\n\`false\`, duplicate rows are merged with existing rows.\\n" + } + }, + { + "name": "onConflict", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Comma-separated UNIQUE column(s) to specify how\\nduplicate rows are determined. Two rows are duplicates if all the\\n\`onConflict\` columns are equal.\\n" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters\\n" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Perform an UPSERT on the table or view. Depending on the column(s) passed\\nto \`onConflict\`, \`.upsert()\` allows you to perform the equivalent of\\n\`.insert()\` if a row with the corresponding \`onConflict\` columns doesn't\\nexist, or if it does exist, perform an alternative action depending on\\n\`ignoreDuplicates\`.", + "text": "By default, upserted rows are not returned. To return it, chain the call\\nwith \`.select()\`.\\n" + } + } + ] }, "@supabase/postgrest-js.PostgrestTransformBuilder.constructor": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.constructor", @@ -22916,7 +24486,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "analyze", @@ -22943,7 +24513,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "format", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -23002,7 +24572,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -23068,7 +24638,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "foreignTable", @@ -23114,7 +24684,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [], "ret": { "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -23148,7 +24718,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "ascending", @@ -23200,7 +24770,210 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "comment": { "shortText": "Order the query result by \`column\`.", "text": "You can call this method multiple times to order by multiple columns.\\n\\nYou can order referenced tables, but it only affects the ordering of the\\nparent table if you use \`!inner\` in the query.\\n" - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to order by" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If \`true\`, the result will be in ascending order" + } + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true, + "comment": { + "shortText": "If \`true\`, \`null\`s appear first. If \`false\`,\\n\`null\`s appear last." + } + }, + { + "name": "referencedTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Set this to order a referenced table by\\nits columns" + } + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Order the query result by \`column\`.", + "text": "You can call this method multiple times to order by multiple columns.\\n\\nYou can order referenced tables, but it only affects the ordering of the\\nparent table if you use \`!inner\` in the query.\\n" + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "nameOnly", + "name": "ColumnName" + }, + "comment": { + "shortText": "The column to order by" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "undefined" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Order the query result by \`column\`.", + "text": "You can call this method multiple times to order by multiple columns.\\n\\nYou can order referenced tables, but it only affects the ordering of the\\nparent table if you use \`!inner\` in the query.\\n", + "tags": [ + { + "tag": "deprecated", + "text": "Use \`options.referencedTable\` instead of \`options.foreignTable\`\\n" + } + ] + } + }, + { + "params": [ + { + "name": "column", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The column to order by" + } + }, + { + "name": "options", + "type": { + "type": "object", + "properties": [ + { + "name": "ascending", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + }, + { + "name": "foreignTable", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "nullsFirst", + "type": { + "type": "intrinsic", + "name": "boolean" + }, + "isOptional": true + } + ] + }, + "isOptional": true, + "comment": { + "shortText": "Named parameters" + } + } + ], + "ret": { + "type": { + "type": "nameOnly", + "name": "Schema" + } + }, + "comment": { + "shortText": "Order the query result by \`column\`.", + "text": "You can call this method multiple times to order by multiple columns.\\n\\nYou can order referenced tables, but it only affects the ordering of the\\nparent table if you use \`!inner\` in the query.\\n", + "tags": [ + { + "tag": "deprecated", + "text": "Use \`options.referencedTable\` instead of \`options.foreignTable\`\\n" + } + ] + } + } + ] }, "@supabase/postgrest-js.PostgrestTransformBuilder.range": { "name": "@supabase/postgrest-js.PostgrestTransformBuilder.range", @@ -23228,7 +25001,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "foreignTable", @@ -23342,7 +25115,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "onfulfilled", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -23354,17 +25127,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "value", "type": { - "type": "customUnion", + "type": "union", "name": "PostgrestSingleResponse", "subTypes": [ { - "type": "customObject", + "type": "object", "name": "PostgrestResponseSuccess", "properties": [ { "name": "count", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -23408,7 +25181,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "name": "PostgrestResponseFailure", "properties": [ { @@ -23429,7 +25202,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "error", "type": { "name": "PostgrestError", - "type": "customObject", + "type": "object", "properties": [ { "name": "code", @@ -23484,7 +25257,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -23505,7 +25278,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "onrejected", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -23524,7 +25297,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -23583,17 +25356,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "params", "type": { "name": "RealtimeChannelOptions", - "type": "customObject", + "type": "object", "properties": [ { "name": "config", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "broadcast", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "ack", @@ -23621,7 +25394,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "presence", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "key", @@ -23705,7 +25478,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "filter", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "event", @@ -23733,7 +25506,647 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "comment": { "shortText": "Creates an event handler that listens to changes." - } + }, + "altSignatures": [ + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "presence" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "join" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "name": "RealtimePresenceJoinPayload", + "type": "object", + "properties": [ + { + "name": "currentPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + }, + { + "name": "event" + }, + { + "name": "key", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "newPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ] + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "presence" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "literal", + "value": "leave" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "name": "RealtimePresenceLeavePayload", + "type": "object", + "properties": [ + { + "name": "currentPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + }, + { + "name": "event" + }, + { + "name": "key", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "leftPresences", + "type": { + "type": "array", + "elemType": { + "type": "nameOnly", + "name": "Presence" + } + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ] + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "nameOnly", + "name": "T" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "union", + "name": "RealtimePostgresChangesPayload", + "subTypes": [ + null, + null, + null + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ] + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "nameOnly", + "name": "T" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimePostgresInsertPayload" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ] + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "nameOnly", + "name": "T" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimePostgresUpdatePayload" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ] + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "postgres_changes" + } + }, + { + "name": "filter", + "type": { + "name": "RealtimePostgresChangesFilter", + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "nameOnly", + "name": "T" + }, + "comment": { + "shortText": "The type of database change to listen to." + } + }, + { + "name": "filter", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "Receive database changes when filter is matched." + } + }, + { + "name": "schema", + "type": { + "type": "intrinsic", + "name": "string" + }, + "comment": { + "shortText": "The database schema to listen to." + } + }, + { + "name": "table", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true, + "comment": { + "shortText": "The database table to listen to." + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "RealtimePostgresDeletePayload" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ] + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + }, + "comment": { + "shortText": "One of \\"broadcast\\", \\"presence\\", or \\"postgres_changes\\"." + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + }, + "comment": { + "shortText": "Custom object specific to the Realtime feature detailing which payloads to receive." + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + }, + "comment": { + "shortText": "Function to be invoked when event handler is triggered.\\n" + } + } + ], + "comment": { + "shortText": "The following is placed here to display on supabase.com/docs/reference/javascript/subscribe." + } + }, + { + "params": [ + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + }, + { + "name": "filter", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] + } + }, + { + "name": "callback", + "type": { + "type": "function", + "params": [ + { + "name": "payload", + "type": { + "type": "object", + "properties": [ + { + "name": "event", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "payload", + "type": { + "type": "nameOnly", + "name": "T" + } + }, + { + "name": "type", + "type": { + "type": "literal", + "value": "broadcast" + } + } + ] + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "void" + } + } + } + } + ] + } + ] }, "@supabase/realtime-js.RealtimeChannel.presenceState": { "name": "@supabase/realtime-js.RealtimeChannel.presenceState", @@ -23762,7 +26175,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "args", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "event", @@ -23788,7 +26201,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "type", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -23837,7 +26250,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "RealtimeChannelSendResponse", "subTypes": [ { @@ -23871,7 +26284,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "status", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -23959,7 +26372,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "RealtimeChannelSendResponse", "subTypes": [ { @@ -23995,7 +26408,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -24041,7 +26454,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "RealtimeChannelSendResponse", "subTypes": [ { @@ -24103,7 +26516,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "options", "type": { "name": "RealtimeClientOptions", - "type": "customObject", + "type": "object", "properties": [ { "name": "decode", @@ -24155,7 +26568,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "log_level", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -24247,17 +26660,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "params", "type": { "name": "RealtimeChannelOptions", - "type": "customObject", + "type": "object", "properties": [ { "name": "config", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "broadcast", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "ack", @@ -24285,7 +26698,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "presence", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "key", @@ -24441,7 +26854,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "data", "type": { "name": "RealtimeMessage", - "type": "customObject", + "type": "object", "properties": [ { "name": "event", @@ -24504,7 +26917,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "awaited": { "type": "array", "elemType": { - "type": "customUnion", + "type": "union", "name": "RealtimeRemoveChannelResponse", "subTypes": [ { @@ -24543,7 +26956,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "RealtimeRemoveChannelResponse", "subTypes": [ { @@ -24572,7 +26985,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "token", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -24659,7 +27072,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "params": [], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -24768,12 +27181,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "allowedMimeTypes", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -24796,7 +27209,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "fileSizeLimit", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -24836,16 +27249,19 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "nameOnly", - "name": "Pick" + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } } }, { @@ -24858,7 +27274,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -24904,15 +27320,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -24934,7 +27350,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -24979,15 +27395,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -25009,7 +27425,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -25072,15 +27488,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "name": "Bucket", "properties": [ { @@ -25157,7 +27573,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -25191,17 +27607,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Bucket", "properties": [ { @@ -25279,7 +27695,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -25321,12 +27737,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "allowedMimeTypes", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -25349,7 +27765,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "fileSizeLimit", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -25389,15 +27805,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -25419,7 +27835,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -25564,12 +27980,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "allowedMimeTypes", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -25592,7 +28008,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "fileSizeLimit", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -25632,16 +28048,19 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "nameOnly", - "name": "Pick" + "name": "name", + "type": { + "type": "intrinsic", + "name": "string" + } } }, { @@ -25654,7 +28073,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -25700,15 +28119,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -25730,7 +28149,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -25775,15 +28194,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -25805,7 +28224,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -25850,15 +28269,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "name": "Bucket", "properties": [ { @@ -25935,7 +28354,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -25969,17 +28388,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "Bucket", "properties": [ { @@ -26057,7 +28476,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -26099,12 +28518,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "allowedMimeTypes", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -26127,7 +28546,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "fileSizeLimit", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -26167,15 +28586,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -26197,7 +28616,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -26320,15 +28739,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "path", @@ -26350,7 +28769,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -26395,15 +28814,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "path", @@ -26439,7 +28858,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -26491,12 +28910,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "download", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -26516,7 +28935,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "transform", "type": { - "type": "customObject", + "type": "object", "name": "TransformOptions", "properties": [ { @@ -26556,7 +28975,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "resize", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -26605,15 +29024,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "signedUrl", @@ -26635,7 +29054,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -26690,12 +29109,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "download", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -26721,22 +29140,22 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "properties": [ { "name": "error", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -26752,7 +29171,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "path", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -26786,7 +29205,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -26828,12 +29247,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "transform", "type": { - "type": "customObject", + "type": "object", "name": "TransformOptions", "properties": [ { @@ -26873,7 +29292,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "resize", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -26922,10 +29341,10 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -26944,7 +29363,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -26986,12 +29405,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "download", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -27011,7 +29430,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "transform", "type": { - "type": "customObject", + "type": "object", "name": "TransformOptions", "properties": [ { @@ -27051,7 +29470,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "resize", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -27097,12 +29516,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "publicUrl", @@ -27138,7 +29557,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "options", "type": { - "type": "customObject", + "type": "object", "name": "SearchOptions", "properties": [ { @@ -27177,7 +29596,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "sortBy", "type": { - "type": "customObject", + "type": "object", "name": "SortBy", "properties": [ { @@ -27210,7 +29629,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "parameters", "type": { - "type": "customObject", + "type": "object", "name": "FetchParameters", "properties": [ { @@ -27234,17 +29653,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "FileObject", "properties": [ { @@ -27257,7 +29676,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "buckets", "type": { - "type": "customObject", + "type": "object", "name": "Bucket", "properties": [ { @@ -27395,7 +29814,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -27450,15 +29869,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "message", @@ -27480,7 +29899,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -27528,17 +29947,17 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { "type": "array", "elemType": { - "type": "customObject", + "type": "object", "name": "FileObject", "properties": [ { @@ -27551,7 +29970,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "buckets", "type": { - "type": "customObject", + "type": "object", "name": "Bucket", "properties": [ { @@ -27689,7 +30108,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -27731,7 +30150,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "fileBody", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "intrinsic", @@ -27782,7 +30201,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "fileOptions", "type": { - "type": "customObject", + "type": "object", "name": "FileOptions", "properties": [ { @@ -27839,15 +30258,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "fullPath", @@ -27883,7 +30302,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -27935,7 +30354,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "fileOptions", "type": { - "type": "customObject", + "type": "object", "name": "FileOptions", "properties": [ { @@ -27992,15 +30411,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "fullPath", @@ -28036,7 +30455,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -28098,7 +30517,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "fileOptions", "type": { - "type": "customObject", + "type": "object", "name": "FileOptions", "properties": [ { @@ -28155,15 +30574,15 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "subTypes": [ { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "fullPath", @@ -28192,7 +30611,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ] }, { - "type": "customObject", + "type": "object", "properties": [ { "name": "data", @@ -28235,7 +30654,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` }, { "type": { - "type": "customObject", + "type": "object", "properties": [ { "name": "customFetch", @@ -28245,7 +30664,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "input", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -28328,12 +30747,12 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "name": "options", "type": { "name": "FunctionInvokeOptions", - "type": "customObject", + "type": "object", "properties": [ { "name": "body", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "nameOnly", @@ -28399,7 +30818,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "method", "type": { - "type": "customUnion", + "type": "union", "subTypes": [ { "type": "literal", @@ -28447,7 +30866,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` "type": "promise", "name": "Promise", "awaited": { - "type": "customUnion", + "type": "union", "name": "FunctionsResponse", "subTypes": [] } diff --git a/apps/docs/features/envs/staging.client.tsx b/apps/docs/features/envs/staging.client.tsx index 43583cdbf2d..75ee063054a 100644 --- a/apps/docs/features/envs/staging.client.tsx +++ b/apps/docs/features/envs/staging.client.tsx @@ -12,7 +12,7 @@ import { BUILD_PREVIEW_HTML, IS_PREVIEW } from '~/lib/constants' * rerender in prod, but this is fine because IS_PREVIEW will never change on * you within a single build. */ -const ShortcutPreviewBuild = ({ children }: PropsWithChildren) => { +export const ShortcutPreviewBuild = ({ children }: PropsWithChildren) => { if (!BUILD_PREVIEW_HTML && IS_PREVIEW) { // eslint-disable-next-line react-hooks/rules-of-hooks const [isMounted, setIsMounted] = useState(false) @@ -27,5 +27,3 @@ const ShortcutPreviewBuild = ({ children }: PropsWithChildren) => { return children } - -export { ShortcutPreviewBuild } diff --git a/apps/docs/features/helpers.fn.ts b/apps/docs/features/helpers.fn.ts new file mode 100644 index 00000000000..8d5113a7030 --- /dev/null +++ b/apps/docs/features/helpers.fn.ts @@ -0,0 +1,29 @@ +type RecObj = T[K] extends Array ? T : never + +export function deepFilterRec( + arr: Array>, + recKey: K, + filterFn: (item: T) => boolean +) { + return arr.reduce( + (acc, elem) => { + if (!filterFn(elem)) return acc + + if (recKey in elem) { + const newSubitems = deepFilterRec(elem[recKey] as Array>, recKey, filterFn) + const newElem = { ...elem, [recKey]: newSubitems } + + if (newSubitems.length > 0 || filterFn(elem)) acc.push(newElem) + } else { + acc.push(elem) + } + + return acc + }, + [] as Array> + ) +} + +export function pluckPromise(promise: Promise, key: K) { + return promise.then((data) => data[key]) +} diff --git a/apps/docs/features/helpers.fs.ts b/apps/docs/features/helpers.fs.ts index 2f1c5c6f84d..81d68f28ef7 100644 --- a/apps/docs/features/helpers.fs.ts +++ b/apps/docs/features/helpers.fs.ts @@ -1,8 +1,8 @@ import { watch } from 'node:fs' import { stat } from 'node:fs/promises' -import { IS_DEV } from '~/lib/constants' import type { OrPromise } from '~/features/helpers.types' +import { IS_DEV } from '~/lib/constants' /** * Caches a function for the length of the server process. diff --git a/apps/docs/features/helpers.types.ts b/apps/docs/features/helpers.types.ts index 200048aae30..252e21955bb 100644 --- a/apps/docs/features/helpers.types.ts +++ b/apps/docs/features/helpers.types.ts @@ -1,5 +1,7 @@ type OrPromise = T | Promise +type Json = string | number | boolean | { [key: string]: Json } | Json[] + type WithRequired = T & { [P in K]-?: T[P] } -export type { OrPromise, WithRequired } +export type { Json, OrPromise, WithRequired } diff --git a/apps/docs/features/seo/openGraph.ts b/apps/docs/features/seo/openGraph.ts new file mode 100644 index 00000000000..c30ab39d416 --- /dev/null +++ b/apps/docs/features/seo/openGraph.ts @@ -0,0 +1,18 @@ +import { MISC_URL } from '~/lib/constants' + +export function generateOpenGraphImageMeta({ + type, + title, + description, +}: { + type: string + title: string + description?: string +}) { + return { + url: `${MISC_URL}/functions/v1/og-images?site=docs&type=${encodeURIComponent(type)}&title=${encodeURIComponent(title)}&description=${encodeURIComponent(description ?? 'undefined')}`, + width: 800, + height: 600, + alt: title, + } +} diff --git a/apps/docs/features/ui/helpers.dom.ts b/apps/docs/features/ui/helpers.dom.ts new file mode 100644 index 00000000000..295c426753e --- /dev/null +++ b/apps/docs/features/ui/helpers.dom.ts @@ -0,0 +1,9 @@ +export function isElementInViewport(element: HTMLElement) { + const { top, left, width, height } = element.getBoundingClientRect() + const { innerWidth, innerHeight } = window + + return ( + ((top >= 0 && top < innerHeight) || (top < 0 && top + height > 0)) && + ((left >= 0 && left < innerWidth) || (left < 0 && left + width > 0)) + ) +} diff --git a/apps/docs/layouts/MainSkeleton.tsx b/apps/docs/layouts/MainSkeleton.tsx index 06b8f8b2643..e902413138e 100644 --- a/apps/docs/layouts/MainSkeleton.tsx +++ b/apps/docs/layouts/MainSkeleton.tsx @@ -13,9 +13,6 @@ import { DOCS_CONTENT_CONTAINER_ID } from '~/features/ui/helpers.constants' import { menuState, useMenuMobileOpen } from '~/hooks/useMenuState' const Footer = dynamic(() => import('~/components/Navigation/Footer')) -const NavigationMenu = dynamic( - () => import('~/components/Navigation/NavigationMenu/NavigationMenu') -) const levelsData = { home: { diff --git a/apps/docs/layouts/ReferenceLayout.tsx b/apps/docs/layouts/ReferenceLayout.tsx new file mode 100644 index 00000000000..0ae568397a9 --- /dev/null +++ b/apps/docs/layouts/ReferenceLayout.tsx @@ -0,0 +1,23 @@ +'use client' + +import 'katex/dist/katex.min.css' + +import { type PropsWithChildren } from 'react' + +import { type MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' +import { LayoutMainContent } from '~/layouts/DefaultLayout' +import { SidebarSkeleton } from '~/layouts/MainSkeleton' + +interface LayoutProps extends PropsWithChildren { + menuId: MenuId +} + +function ReferenceLayout({ menuId, children }: LayoutProps) { + return ( + + {children} + + ) +} + +export { ReferenceLayout } diff --git a/apps/docs/lib/constants.ts b/apps/docs/lib/constants.ts index 4729a0c07c5..eb71a452e46 100644 --- a/apps/docs/lib/constants.ts +++ b/apps/docs/lib/constants.ts @@ -10,3 +10,4 @@ export const IS_PLATFORM = process.env.NEXT_PUBLIC_IS_PLATFORM === 'true' export const IS_PREVIEW = process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview' export const LOCAL_SUPABASE = process.env.NEXT_PUBLIC_LOCAL_SUPABASE === 'true' export const MISC_URL = process.env.NEXT_PUBLIC_MISC_URL ?? '' +export const SKIP_BUILD_STATIC_GENERATION = process.env.SKIP_BUILD_STATIC_GENERATION === 'true' diff --git a/apps/docs/lib/docs.ts b/apps/docs/lib/docs.ts index a5e9e3ac86c..612ce98533f 100644 --- a/apps/docs/lib/docs.ts +++ b/apps/docs/lib/docs.ts @@ -14,6 +14,7 @@ import codeHikeTheme from 'config/code-hike.theme.json' assert { type: 'json' } const DOCS_DIRECTORY = join(dirname(fileURLToPath(import.meta.url)), '..') export const GUIDES_DIRECTORY = join(DOCS_DIRECTORY, 'content/guides') +export const REF_DOCS_DIRECTORY = join(DOCS_DIRECTORY, 'docs/ref') export const SPEC_DIRECTORY = join(DOCS_DIRECTORY, 'spec') export type GuideFrontmatter = { diff --git a/apps/docs/middleware.ts b/apps/docs/middleware.ts index 4c931e6349c..b9ceafb535e 100644 --- a/apps/docs/middleware.ts +++ b/apps/docs/middleware.ts @@ -1,34 +1,45 @@ -import { NextResponse } from 'next/server' -import type { NextRequest } from 'next/server' import { isbot } from 'isbot' +import type { NextRequest } from 'next/server' +import { NextResponse } from 'next/server' + +import { clientSdkIds } from '~/content/navigation.references' +import { BASE_PATH } from '~/lib/constants' + +const REFERENCE_PATH = `${(BASE_PATH ?? '') + '/'}reference` export function middleware(request: NextRequest) { - const specs = ['javascript', 'dart', 'csharp'] + const url = new URL(request.url) - let version = '' - if (request.url.includes('/v1/')) { - version = 'v1' - } - if (request.url.includes('/v0/')) { - version = 'v0' + if (!url.pathname.startsWith(REFERENCE_PATH)) { + return NextResponse.next() } if (isbot(request.headers.get('user-agent'))) { - for (const lib of specs) { - if (request.url.includes(`reference/${lib}`)) { - const requestSlug = request.url.split('/').pop() + let [, lib, maybeVersion, ...slug] = url.pathname.replace(REFERENCE_PATH, '').split('/') - return NextResponse.rewrite( - new URL( - `/docs/reference/${lib}/${version ? version + '/' : ''}crawlers/${requestSlug}`, - request.url - ).toString() - ) + if (clientSdkIds.includes(lib)) { + const version = /v\d+/.test(maybeVersion) ? maybeVersion : undefined + if (!version) { + slug = [maybeVersion, ...slug] + } + + if (slug.length > 0) { + const rewriteUrl = new URL(url) + rewriteUrl.pathname = (BASE_PATH ?? '') + '/api/crawlers' + + return NextResponse.rewrite(rewriteUrl) } } } else { - return NextResponse.next() + const [, lib, maybeVersion] = url.pathname.replace(REFERENCE_PATH, '').split('/') + if (clientSdkIds.includes(lib)) { + const version = /v\d+/.test(maybeVersion) ? maybeVersion : null + const rewritePath = [REFERENCE_PATH, lib, version].filter(Boolean).join('/') + return NextResponse.rewrite(new URL(rewritePath, request.url)) + } } + + return NextResponse.next() } export const config = { diff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjs index b1e0446d9a1..3b988cf7a21 100644 --- a/apps/docs/next.config.mjs +++ b/apps/docs/next.config.mjs @@ -64,6 +64,11 @@ const nextConfig = { }, }, transpilePackages: ['ui', 'ui-patterns', 'common', 'dayjs', 'shared-data', 'api-types', 'icons'], + experimental: { + outputFileTracingIncludes: { + '/api/crawlers': ['./features/docs/generated/**/*', './docs/ref/**/*'], + }, + }, /** * The SQL to REST API translator relies on libpg-query, which packages a * native Node.js module that wraps the Postgres query parser. diff --git a/apps/docs/package.json b/apps/docs/package.json index b78bc4b2852..124faf03d8c 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -3,19 +3,23 @@ "version": "0.0.0", "private": true, "scripts": { + "predev": "npm run codegen:references", "dev": "next dev --port 3001", "dev:secrets:pull": "AWS_PROFILE=supabase-dev node ../../scripts/getSecrets.js -n local/docs", + "prebuild": "npm run codegen:references", "build": "next build", "build:analyze": "ANALYZE=true next build", "start": "next start", "lint": "next lint", "typecheck": "tsc --noEmit", - "test": "vitest", + "test": "vitest --exclude \"**/*.smoke.test.ts\"", + "test:smoke": "npm run codegen:references && vitest -t \"prod smoke test\"", "build:sitemap": "node ./internals/generate-sitemap.mjs", "embeddings": "tsx scripts/search/generate-embeddings.ts", "embeddings:refresh": "npm run embeddings -- --refresh", "last-changed": "tsx scripts/last-changed.ts", "last-changed:reset": "npm run last-changed -- --reset", + "codegen:references": "tsx features/docs/Reference.generated.script.ts", "codemod:frontmatter": "node ./scripts/codemod/mdx-meta.mjs && prettier --write \"content/**/*.mdx\"", "postbuild": "node ./internals/generate-sitemap.mjs" }, @@ -80,7 +84,8 @@ "unist-util-filter": "^4.0.1", "unist-util-visit": "^4.1.2", "uuid": "^9.0.1", - "valtio": "^1.12.0" + "valtio": "^1.12.0", + "yaml": "^2.4.5" }, "devDependencies": { "@aws-sdk/client-secrets-manager": "^3.410.0", @@ -91,6 +96,7 @@ "@types/unist": "^2.0.6", "acorn": "^8.11.3", "api-types": "*", + "cheerio": "^1.0.0-rc.12", "config": "*", "dotenv": "^16.0.3", "ejs": "^3.1.10", diff --git a/apps/docs/pages/reference/csharp/[...slug].tsx b/apps/docs/pages/reference/csharp/[...slug].tsx deleted file mode 100644 index 6bc8b054195..00000000000 --- a/apps/docs/pages/reference/csharp/[...slug].tsx +++ /dev/null @@ -1,30 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_csharp_v1.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/csharp' - -export default function CSharpReference(props) { - return ( - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/csharp/crawlers/[...slug].tsx b/apps/docs/pages/reference/csharp/crawlers/[...slug].tsx deleted file mode 100644 index 88a3c92b5a9..00000000000 --- a/apps/docs/pages/reference/csharp/crawlers/[...slug].tsx +++ /dev/null @@ -1,45 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_csharp_v1.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { useRouter } from 'next/compat/router' -import RefSEO from '~/components/reference/RefSEO' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' -import type { TypeSpec } from '~/components/reference/Reference.types' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/csharp' - -export default function CSharpReference(props) { - const router = useRouter() - const slug = router.query.slug[0] - const filteredSection = sections.filter((section) => section.id === slug) - - const pageTitle = filteredSection[0]?.title - ? `${filteredSection[0]?.title} | Supabase` - : 'Supabase' - - return ( - <> - - - - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/csharp/v0/[...slug].tsx b/apps/docs/pages/reference/csharp/v0/[...slug].tsx deleted file mode 100644 index e0b20e5d3ba..00000000000 --- a/apps/docs/pages/reference/csharp/v0/[...slug].tsx +++ /dev/null @@ -1,30 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_csharp_v0.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/csharp/v0' - -export default function CSharpReference(props) { - return ( - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/csharp/v0/crawlers/[...slug].tsx b/apps/docs/pages/reference/csharp/v0/crawlers/[...slug].tsx deleted file mode 100644 index dbe2b37b63d..00000000000 --- a/apps/docs/pages/reference/csharp/v0/crawlers/[...slug].tsx +++ /dev/null @@ -1,43 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_csharp_v0.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { useRouter } from 'next/compat/router' -import RefSEO from '~/components/reference/RefSEO' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/csharp/v0' - -export default function JSReference(props) { - const router = useRouter() - const slug = router.query.slug[0] - const filteredSection = sections.filter((section) => section.id === slug) - - const pageTitle = filteredSection[0]?.title - ? `${filteredSection[0]?.title} | Supabase` - : 'Supabase' - return ( - <> - - - - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/dart/[...slug].tsx b/apps/docs/pages/reference/dart/[...slug].tsx deleted file mode 100644 index eb5db854400..00000000000 --- a/apps/docs/pages/reference/dart/[...slug].tsx +++ /dev/null @@ -1,30 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_dart_v2.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/dart' - -export default function DartReference(props) { - return ( - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/dart/crawlers/[...slug].tsx b/apps/docs/pages/reference/dart/crawlers/[...slug].tsx deleted file mode 100644 index dbac0378cc2..00000000000 --- a/apps/docs/pages/reference/dart/crawlers/[...slug].tsx +++ /dev/null @@ -1,44 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_dart_v2.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { useRouter } from 'next/compat/router' -import RefSEO from '~/components/reference/RefSEO' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/dart' - -export default function DartReference(props) { - const router = useRouter() - const slug = router.query.slug[0] - const filteredSection = sections.filter((section) => section.slug === slug) - - const pageTitle = filteredSection[0]?.title - ? `${filteredSection[0]?.title} | Supabase` - : 'Supabase' - - return ( - <> - - - - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/dart/v1/[...slug].tsx b/apps/docs/pages/reference/dart/v1/[...slug].tsx deleted file mode 100644 index da3f324a480..00000000000 --- a/apps/docs/pages/reference/dart/v1/[...slug].tsx +++ /dev/null @@ -1,31 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_dart_v1.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/dart/v0' - -export default function JSReference(props) { - return ( - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/dart/v1/crawlers/[...slug].tsx b/apps/docs/pages/reference/dart/v1/crawlers/[...slug].tsx deleted file mode 100644 index f4cba86e1d0..00000000000 --- a/apps/docs/pages/reference/dart/v1/crawlers/[...slug].tsx +++ /dev/null @@ -1,43 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_dart_v1.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { useRouter } from 'next/compat/router' -import RefSEO from '~/components/reference/RefSEO' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/dart/v0' - -export default function DartReference(props) { - const router = useRouter() - const slug = router.query.slug[0] - const filteredSection = sections.filter((section) => section.slug === slug) - - const pageTitle = filteredSection[0]?.title - ? `${filteredSection[0]?.title} | Supabase` - : 'Supabase' - return ( - <> - - - - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/javascript/[...slug].tsx b/apps/docs/pages/reference/javascript/[...slug].tsx deleted file mode 100644 index 4344909efbf..00000000000 --- a/apps/docs/pages/reference/javascript/[...slug].tsx +++ /dev/null @@ -1,33 +0,0 @@ -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 clientLibsCommonSections from '~/spec/common-client-libs-sections.json' assert { type: 'json' } -import typeSpec from '~/spec/enrichments/tsdoc_v2/combined.json' assert { type: 'json' } -import spec from '~/spec/supabase_js_v2.yml' assert { type: 'yml' } - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/javascript' - -export default function JSReference(props) { - return ( - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/javascript/crawlers/[...slug].tsx b/apps/docs/pages/reference/javascript/crawlers/[...slug].tsx deleted file mode 100644 index b213488f963..00000000000 --- a/apps/docs/pages/reference/javascript/crawlers/[...slug].tsx +++ /dev/null @@ -1,46 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import typeSpec from '~/spec/enrichments/tsdoc_v2/combined.json' -import spec from '~/spec/supabase_js_v2.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { useRouter } from 'next/compat/router' -import RefSEO from '~/components/reference/RefSEO' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/javascript' - -export default function JSReference(props) { - const router = useRouter() - const slug = router.query.slug[0] - const filteredSection = sections.filter((section) => section.slug === slug) - - const pageTitle = filteredSection[0]?.title - ? `${filteredSection[0]?.title} | Supabase` - : 'Supabase' - - return ( - <> - - - - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/javascript/v1/[...slug].tsx b/apps/docs/pages/reference/javascript/v1/[...slug].tsx deleted file mode 100644 index 1014cb86404..00000000000 --- a/apps/docs/pages/reference/javascript/v1/[...slug].tsx +++ /dev/null @@ -1,34 +0,0 @@ -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 clientLibsCommonSections from '~/spec/common-client-libs-sections.json' assert { type: 'json' } -import typeSpec from '~/spec/enrichments/tsdoc_v1/combined.json' assert { type: 'json' } -import spec from '~/spec/supabase_js_v1.yml' assert { type: 'yml' } - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/javascript/v1' - -export default function JSReference(props) { - return ( - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/javascript/v1/crawlers/[...slug].tsx b/apps/docs/pages/reference/javascript/v1/crawlers/[...slug].tsx deleted file mode 100644 index 436b17db4a9..00000000000 --- a/apps/docs/pages/reference/javascript/v1/crawlers/[...slug].tsx +++ /dev/null @@ -1,46 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import typeSpec from '~/spec/enrichments/tsdoc_v1/combined.json' -import spec from '~/spec/supabase_js_v1.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { useRouter } from 'next/compat/router' -import RefSEO from '~/components/reference/RefSEO' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/javascript/v1' - -export default function JSReference(props) { - const router = useRouter() - const slug = router.query.slug[0] - const filteredSection = sections.filter((section) => section.slug === slug) - - const pageTitle = filteredSection[0]?.title - ? `${filteredSection[0]?.title} | Supabase` - : 'Supabase' - - return ( - <> - - - - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/kotlin/[...slug].tsx b/apps/docs/pages/reference/kotlin/[...slug].tsx deleted file mode 100644 index b691889c161..00000000000 --- a/apps/docs/pages/reference/kotlin/[...slug].tsx +++ /dev/null @@ -1,30 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_kt_v2.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/kotlin' - -export default function KotlinReference(props) { - return ( - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/kotlin/crawlers/[...slug].tsx b/apps/docs/pages/reference/kotlin/crawlers/[...slug].tsx deleted file mode 100644 index 984d6e26168..00000000000 --- a/apps/docs/pages/reference/kotlin/crawlers/[...slug].tsx +++ /dev/null @@ -1,44 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_kt_v2.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { useRouter } from 'next/compat/router' -import RefSEO from '~/components/reference/RefSEO' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/kotlin' - -export default function KotlinReference(props) { - const router = useRouter() - const slug = router.query.slug[0] - const filteredSection = sections.filter((section) => section.slug === slug) - - const pageTitle = filteredSection[0]?.title - ? `${filteredSection[0]?.title} | Supabase` - : 'Supabase' - - return ( - <> - - - - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/kotlin/v1/[...slug].tsx b/apps/docs/pages/reference/kotlin/v1/[...slug].tsx deleted file mode 100644 index 0c50e646bf4..00000000000 --- a/apps/docs/pages/reference/kotlin/v1/[...slug].tsx +++ /dev/null @@ -1,31 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_kt_v1.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/kotlin/v1' - -export default function KotlinReference(props) { - return ( - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/kotlin/v1/crawlers/[...slug].tsx b/apps/docs/pages/reference/kotlin/v1/crawlers/[...slug].tsx deleted file mode 100644 index cf1f619d02b..00000000000 --- a/apps/docs/pages/reference/kotlin/v1/crawlers/[...slug].tsx +++ /dev/null @@ -1,43 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_kt_v1.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { useRouter } from 'next/compat/router' -import RefSEO from '~/components/reference/RefSEO' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/kotlin/v1' - -export default function KotlinReference(props) { - const router = useRouter() - const slug = router.query.slug[0] - const filteredSection = sections.filter((section) => section.id === slug) - - const pageTitle = filteredSection[0]?.title - ? `${filteredSection[0]?.title} | Supabase` - : 'Supabase' - return ( - <> - - - - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/python/[...slug].tsx b/apps/docs/pages/reference/python/[...slug].tsx deleted file mode 100644 index 2dc649bf144..00000000000 --- a/apps/docs/pages/reference/python/[...slug].tsx +++ /dev/null @@ -1,30 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_py_v2.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/python' - -export default function PyReference(props) { - return ( - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/python/crawlers/[...slug].tsx b/apps/docs/pages/reference/python/crawlers/[...slug].tsx deleted file mode 100644 index e530945156e..00000000000 --- a/apps/docs/pages/reference/python/crawlers/[...slug].tsx +++ /dev/null @@ -1,44 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_py_v2.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { useRouter } from 'next/compat/router' -import RefSEO from '~/components/reference/RefSEO' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/python' - -export default function PyReference(props) { - const router = useRouter() - const slug = router.query.slug[0] - const filteredSection = sections.filter((section) => section.id === slug) - - const pageTitle = filteredSection[0]?.title - ? `${filteredSection[0]?.title} | Supabase` - : 'Supabase' - - return ( - <> - - - - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/swift/[...slug].tsx b/apps/docs/pages/reference/swift/[...slug].tsx deleted file mode 100644 index c459f833e11..00000000000 --- a/apps/docs/pages/reference/swift/[...slug].tsx +++ /dev/null @@ -1,30 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_swift_v2.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/swift' - -export default function SwiftReference(props) { - return ( - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/swift/crawlers/[...slug].tsx b/apps/docs/pages/reference/swift/crawlers/[...slug].tsx deleted file mode 100644 index f47cb85ea6e..00000000000 --- a/apps/docs/pages/reference/swift/crawlers/[...slug].tsx +++ /dev/null @@ -1,44 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_swift_v2.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { useRouter } from 'next/compat/router' -import RefSEO from '~/components/reference/RefSEO' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/swift' - -export default function SwiftReference(props) { - const router = useRouter() - const slug = router.query.slug[0] - const filteredSection = sections.filter((section) => section.id === slug) - - const pageTitle = filteredSection[0]?.title - ? `${filteredSection[0]?.title} | Supabase` - : 'Supabase' - - return ( - <> - - - - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/swift/v1/[...slug].tsx b/apps/docs/pages/reference/swift/v1/[...slug].tsx deleted file mode 100644 index 25388a6b537..00000000000 --- a/apps/docs/pages/reference/swift/v1/[...slug].tsx +++ /dev/null @@ -1,30 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_swift_v2.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/swift/v2' - -export default function SwiftReference(props) { - return ( - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/pages/reference/swift/v1/crawlers/[...slug].tsx b/apps/docs/pages/reference/swift/v1/crawlers/[...slug].tsx deleted file mode 100644 index d5838fe8d72..00000000000 --- a/apps/docs/pages/reference/swift/v1/crawlers/[...slug].tsx +++ /dev/null @@ -1,43 +0,0 @@ -import clientLibsCommonSections from '~/spec/common-client-libs-sections.json' -import spec from '~/spec/supabase_swift_v2.yml' assert { type: 'yml' } -import RefSectionHandler from '~/components/reference/RefSectionHandler' -import { flattenSections } from '~/lib/helpers' -import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths' -import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' -import { useRouter } from 'next/compat/router' -import RefSEO from '~/components/reference/RefSEO' -import { MenuId } from '~/components/Navigation/NavigationMenu/NavigationMenu' - -const sections = flattenSections(clientLibsCommonSections) -const libraryPath = '/swift/v2' - -export default function SwiftReference(props) { - const router = useRouter() - const slug = router.query.slug[0] - const filteredSection = sections.filter((section) => section.id === slug) - - const pageTitle = filteredSection[0]?.title - ? `${filteredSection[0]?.title} | Supabase` - : 'Supabase' - return ( - <> - - - - - ) -} - -export async function getStaticProps() { - return handleRefStaticProps(sections, libraryPath) -} - -export async function getStaticPaths() { - return handleRefGetStaticPaths(sections) -} diff --git a/apps/docs/spec/common-client-libs-sections.json b/apps/docs/spec/common-client-libs-sections.json index b395d123ed7..a1b3b29323c 100644 --- a/apps/docs/spec/common-client-libs-sections.json +++ b/apps/docs/spec/common-client-libs-sections.json @@ -12,6 +12,7 @@ "type": "markdown", "excludes": [ "reference_javascript_v1", + "reference_kotlin_v1", "reference_swift_v1" ] }, @@ -999,11 +1000,12 @@ "excludes": [ "reference_dart_v1", "reference_dart_v2", + "reference_javascript_v1", + "reference_kotlin_v1", + "reference_kotlin_v2", "reference_python_v2", "reference_swift_v1", - "reference_swift_v2", - "reference_kotlin_v1", - "reference_kotlin_v2" + "reference_swift_v2" ], "items": [ { diff --git a/apps/docs/spec/examples/examples.yml b/apps/docs/spec/examples/examples.yml index 50954acec61..ce9992d257d 100644 --- a/apps/docs/spec/examples/examples.yml +++ b/apps/docs/spec/examples/examples.yml @@ -3752,7 +3752,7 @@ functions: with advanced operators. - `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery. - - `"quoted text"`: text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery. + - `"quoted text"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery. - `OR`: the word “or” will be converted to the | operator. - `-`: a dash will be converted to the ! operator. diff --git a/apps/docs/spec/supabase_csharp_v0.yml b/apps/docs/spec/supabase_csharp_v0.yml index 157e1ac7e8a..9815f36f3c2 100644 --- a/apps/docs/spec/supabase_csharp_v0.yml +++ b/apps/docs/spec/supabase_csharp_v0.yml @@ -1584,7 +1584,7 @@ functions: with advanced operators. - `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery. - - `"quoted text"`: text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery. + - `"quoted text"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery. - `OR`: the word “or” will be converted to the | operator. - `-`: a dash will be converted to the ! operator. diff --git a/apps/docs/spec/supabase_csharp_v1.yml b/apps/docs/spec/supabase_csharp_v1.yml index 0c127b9c639..270eedfcb86 100644 --- a/apps/docs/spec/supabase_csharp_v1.yml +++ b/apps/docs/spec/supabase_csharp_v1.yml @@ -1584,7 +1584,7 @@ functions: with advanced operators. - `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery. - - `"quoted text"`: text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery. + - `"quoted text"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery. - `OR`: the word “or” will be converted to the | operator. - `-`: a dash will be converted to the ! operator. diff --git a/apps/docs/spec/supabase_dart_v1.yml b/apps/docs/spec/supabase_dart_v1.yml index 9aba0124627..26db52c7e24 100644 --- a/apps/docs/spec/supabase_dart_v1.yml +++ b/apps/docs/spec/supabase_dart_v1.yml @@ -2847,7 +2847,7 @@ functions: with advanced operators. - `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery. - - `"quoted text"`: text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery. + - `"quoted text"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery. - `OR`: the word “or” will be converted to the | operator. - `-`: a dash will be converted to the ! operator. diff --git a/apps/docs/spec/supabase_dart_v2.yml b/apps/docs/spec/supabase_dart_v2.yml index 64b53f2499b..c4e3c795b66 100644 --- a/apps/docs/spec/supabase_dart_v2.yml +++ b/apps/docs/spec/supabase_dart_v2.yml @@ -6667,7 +6667,7 @@ functions: with advanced operators. - `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery. - - `"quoted text"`: text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery. + - `"quoted text"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery. - `OR`: the word “or” will be converted to the | operator. - `-`: a dash will be converted to the ! operator. diff --git a/apps/docs/spec/supabase_js_v2.yml b/apps/docs/spec/supabase_js_v2.yml index 1174245560c..870b0ffb972 100644 --- a/apps/docs/spec/supabase_js_v2.yml +++ b/apps/docs/spec/supabase_js_v2.yml @@ -238,45 +238,6 @@ functions: - When both **Confirm email** and **Confirm phone** (even when phone provider is disabled) are enabled in [your project](/dashboard/project/_/auth/providers), an obfuscated/fake user object is returned. - When either **Confirm email** or **Confirm phone** (even when phone provider is disabled) is disabled, the error message, `User already registered` is returned. - To fetch the currently logged-in user, refer to [`getUser()`](/docs/reference/javascript/auth-getuser). - overwriteParams: - - name: credentials - type: SignUpWithPasswordCredentials - subContent: - - name: email - isOptional: true - type: string - description: One of `email` or `phone` must be provided. - - name: phone - isOptional: true - type: string - description: One of `email` or `phone` must be provided. - - name: password - type: string - - name: options - isOptional: true - type: object - subContent: - - name: emailRedirectTo - isOptional: true - type: string - description: > - Only for email signups. - The redirect URL embedded in the email link. - Must be a configured redirect URL for your Supabase instance. - - name: data - isOptional: true - type: object - description: > - A custom data object to store additional user metadata. - - name: captchaToken - isOptional: true - type: string - - name: channel - isOptional: true - type: sms | whatsapp - description: > - The channel to use for sending messages. - Only for phone signups. examples: - id: sign-up name: Sign up with an email and password @@ -710,27 +671,6 @@ functions: - id: sign-in-with-password title: 'signInWithPassword()' $ref: '@supabase/auth-js.GoTrueClient.signInWithPassword' - overwriteParams: - - name: credentials - type: SignInWithPasswordCredentials - subContent: - - name: email - isOptional: true - type: string - description: One of `email` or `phone` must be provided. - - name: phone - isOptional: true - type: string - description: One of `email` or `phone` must be provided. - - name: password - type: string - - name: options - isOptional: true - type: object - subContent: - - name: captchaToken - isOptional: true - type: string notes: | - Requires either an email and password or a phone number and password. examples: @@ -844,49 +784,6 @@ functions: - id: sign-in-with-otp title: 'signInWithOtp()' $ref: '@supabase/auth-js.GoTrueClient.signInWithOtp' - overwriteParams: - - name: credentials - type: SignInWithPasswordlessCredentials - subContent: - - name: email - isOptional: true - type: string - description: One of `email` or `phone` must be provided. - - name: phone - isOptional: true - type: string - description: One of `email` or `phone` must be provided. - - name: options - isOptional: true - type: object - subContent: - - name: emailRedirectTo - isOptional: true - type: string - description: > - Only for email signups. - The redirect URL embedded in the email link. - Must be a configured redirect URL for your Supabase instance. - - name: shouldCreateUser - isOptional: true - type: boolean - description: > - Whether to create the user if they don't already exist. - Defaults to true. - - name: data - isOptional: true - type: object - description: > - A custom data object to store additional user metadata. - - name: captchaToken - isOptional: true - type: string - - name: channel - isOptional: true - type: sms | whatsapp - description: > - The channel to use for sending messages. - Only for phone signups. notes: | - Requires either an email or phone number. - This method is used for passwordless sign-ins where a OTP is sent to the user's email or phone number. @@ -1095,33 +992,6 @@ functions: - id: sign-in-with-sso title: 'signInWithSSO()' $ref: '@supabase/auth-js.GoTrueClient.signInWithSSO' - overwriteParams: - - name: params - type: SignInWithSSO - subContent: - - name: providerId - isOptional: true - type: string - description: > - UUID of the SSO provider. - One of `providerId` or `domain` is required. - - name: domain - isOptional: true - type: string - description: > - Domain name of the organization to use SSO with. - One of `providerId` or `domain` is required. - - name: options - isOptional: true - type: object - subContent: - - name: redirectTo - type: string - description: > - The URL to redirect the user to after they have signed in. - Must be a configured redirect URL for your Supabase instance. - - name: captchaToken - type: string notes: | - Before you can call this method you need to [establish a connection](/docs/guides/auth/sso/auth-sso-saml#managing-saml-20-connections) to an identity provider. Use the [CLI commands](/docs/reference/cli/supabase-sso) to do this. - If you've associated an email domain to the identity provider, you can use the `domain` property to start a sign-in flow. @@ -1181,44 +1051,6 @@ functions: - id: verify-otp title: 'verifyOtp()' $ref: '@supabase/auth-js.GoTrueClient.verifyOtp' - overwriteParams: - - name: params - type: VerifyOtpParams - subContent: - - name: phone - isOptional: true - type: string - description: One of `phone`, `email`, or `token_hash` must be provided. - - name: email - isOptional: true - type: string - description: One of `phone`, `email`, or `token_hash` must be provided. - - name: token_hash - isOptional: true - type: string - description: > - The token hash from the user's email link. - One of `phone`, `email`, or `token_hash` must be provided. - - name: type - type: sms | phone_change | signup | invite | magiclink | recovery | email_change | email - - name: token - isOptional: true - type: string - description: The OTP sent to the user. Required if using `phone` or `email`. - - name: options - isOptional: true - type: object - subContent: - - name: redirectTo - isOptional: true - type: string - description: > - A URL to redirect the user to after they are confirmed. - Must be in your configured redirect URLs. - - name: captchaToken - isOptional: true - type: string - description: Deprecated. notes: | - The `verifyOtp` method takes in different verification types. If a phone number is used, the type can either be `sms` or `phone_change`. If an email address is used, the type can be one of the following: `email`, `recovery`, `invite` or `email_change` (`signup` and `magiclink` types are deprecated). - The verification type used should be determined based on the corresponding auth method called before `verifyOtp` to sign up / sign-in a user. @@ -1953,6 +1785,7 @@ functions: const { session, user } = data ``` response: | + ```json { "data": { "user": { @@ -2051,6 +1884,7 @@ functions: }, "error": null } + ``` - id: refresh-session-using-a-passed-in-session name: Refresh session using a refresh token isSpotlight: false @@ -5707,7 +5541,7 @@ functions: with advanced operators. - `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery. - - `"quoted text"`: text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery. + - `"quoted text"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery. - `OR`: the word “or” will be converted to the | operator. - `-`: a dash will be converted to the ! operator. diff --git a/apps/docs/spec/supabase_kt_v1.yml b/apps/docs/spec/supabase_kt_v1.yml index a8c5f87b06d..18cd95d0477 100644 --- a/apps/docs/spec/supabase_kt_v1.yml +++ b/apps/docs/spec/supabase_kt_v1.yml @@ -1707,7 +1707,7 @@ functions: with advanced operators. - `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery. - - `"quoted text"`: text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery. + - `"quoted text"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery. - `OR`: the word “or” will be converted to the | operator. - `-`: a dash will be converted to the ! operator. diff --git a/apps/docs/spec/supabase_kt_v2.yml b/apps/docs/spec/supabase_kt_v2.yml index b3f654165b0..a80fcfe5537 100644 --- a/apps/docs/spec/supabase_kt_v2.yml +++ b/apps/docs/spec/supabase_kt_v2.yml @@ -2163,7 +2163,7 @@ functions: with advanced operators. - `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery. - - `"quoted text"`: text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery. + - `"quoted text"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery. - `OR`: the word “or” will be converted to the | operator. - `-`: a dash will be converted to the ! operator. diff --git a/apps/docs/spec/supabase_py_v2.yml b/apps/docs/spec/supabase_py_v2.yml index 9fa3ea18a5f..913b3aff809 100644 --- a/apps/docs/spec/supabase_py_v2.yml +++ b/apps/docs/spec/supabase_py_v2.yml @@ -3413,7 +3413,7 @@ functions: with advanced operators. - `unquoted text`: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery. - - `"quoted text"`: text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery. + - `"quoted text"`: text inside quote marks will be converted to terms separated by `<->` operators, as if processed by phraseto_tsquery. - `OR`: the word “or” will be converted to the | operator. - `-`: a dash will be converted to the ! operator. diff --git a/apps/docs/tsconfig.json b/apps/docs/tsconfig.json index 0e8f0b99046..77c7ab341ff 100644 --- a/apps/docs/tsconfig.json +++ b/apps/docs/tsconfig.json @@ -33,7 +33,6 @@ "**/*.ts", "**/*.tsx", "pages/guides/append-test.js", - "jest.config.mjs", ".next/types/**/*.ts", "./../../packages/ui/src/**/*.d.ts" ], diff --git a/apps/docs/types/index.ts b/apps/docs/types/index.ts index 88cdf87ab6b..c1e58ad998a 100644 --- a/apps/docs/types/index.ts +++ b/apps/docs/types/index.ts @@ -1,3 +1 @@ export * from './next' - -export type Json = string | number | boolean | { [key: string]: Json } | Json[] diff --git a/package-lock.json b/package-lock.json index ec9f240db55..6a1b74b2048 100644 --- a/package-lock.json +++ b/package-lock.json @@ -988,7 +988,8 @@ "unist-util-filter": "^4.0.1", "unist-util-visit": "^4.1.2", "uuid": "^9.0.1", - "valtio": "^1.12.0" + "valtio": "^1.12.0", + "yaml": "^2.4.5" }, "devDependencies": { "@aws-sdk/client-secrets-manager": "^3.410.0", @@ -999,6 +1000,7 @@ "@types/unist": "^2.0.6", "acorn": "^8.11.3", "api-types": "*", + "cheerio": "^1.0.0-rc.12", "config": "*", "dotenv": "^16.0.3", "ejs": "^3.1.10", @@ -17684,6 +17686,44 @@ "node": "*" } }, + "node_modules/cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "dev": true, + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" + }, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/chokidar": { "version": "3.5.3", "funding": [ @@ -18677,6 +18717,22 @@ "hyphenate-style-name": "^1.0.3" } }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/css-to-react-native": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", @@ -19415,6 +19471,20 @@ "csstype": "^3.0.2" } }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, "node_modules/domelementtype": { "version": "2.3.0", "dev": true, @@ -19437,6 +19507,35 @@ "node": ">=12" } }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, "node_modules/dot-case": { "version": "3.0.4", "dev": true, @@ -23387,6 +23486,25 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } + }, "node_modules/http-cache-semantics": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", @@ -32817,6 +32935,19 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "dev": true, + "dependencies": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/pascal-case": { "version": "3.1.2", "license": "MIT", @@ -38823,22 +38954,6 @@ "url": "https://opencollective.com/svgo" } }, - "node_modules/svgo/node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dev": true, - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, "node_modules/svgo/node_modules/css-tree": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", @@ -38852,49 +38967,6 @@ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" } }, - "node_modules/svgo/node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/svgo/node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/svgo/node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dev": true, - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, "node_modules/svgo/node_modules/mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", @@ -42708,8 +42780,12 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/yaml": { - "version": "2.3.2", - "license": "ISC", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", + "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", + "bin": { + "yaml": "bin.mjs" + }, "engines": { "node": ">= 14" }