Files
supabase/apps/docs/internals/files/reference-lib.mjs
T
e426517484 Update Kotlin docs for 2.0.0 (#18912)
* Rename gotrue to auth

* update columns

* rename gotrue to auth (again)

* improve postgrest docs

* add new modules

* rename logout

* Rename some more stuff

* Rename more stuff

* Rename guides

* Rename SSO docs

* Rename "phoneNumber" to "phone"

* rename some more stuff

* Add v2 docs

* Rename postgrest[..] to supabase.from(..)

* Migrate postgrest to new syntax

* Add explain, single & csv

* Rename storage

* Rename some more storage storage methods

* fix invalid docs

* fix duplicate id

* exclude sections for kotlin

* Rename password reset method

* Update tutorial

* Update realtime docs

* Update more realtime docs

* Update module docs

* add link to migration guide

* update installing

* document custom KotlinX Serializer

* update code to pass formatter

* Remove supabase.realtime.connect() docs

* fix typo

* update kotlin quick start guide

* add a note about making network request from the UI code

* run formatter

* add small kotlinx serialization change

* Apply suggestions from code review

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* improve quickstart

---------

Co-authored-by: Tyler <18113850+dshukertjr@users.noreply.github.com>
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2023-12-12 01:34:53 +09:00

29 lines
1.2 KiB
JavaScript

import fs from 'fs'
import yaml from 'js-yaml'
import commonLibSections from '../../../../spec/common-client-libs-sections.json' assert { type: 'json' }
import { flattenSections } from '../helpers.mjs'
const flatCommonLibSections = flattenSections(commonLibSections)
const clientLibFiles = [
{ fileName: 'supabase_js_v2', label: 'javascript', version: 'v2', versionSlug: false },
{ fileName: 'supabase_dart_v2', label: 'dart', version: 'v2', versionSlug: false },
{ fileName: 'supabase_py_v2', label: 'python', version: 'v2', versionSlug: false },
{ fileName: 'supabase_csharp_v0', label: 'csharp', version: 'v0', versionSlug: false },
{ fileName: 'supabase_swift_v1', label: 'swift', version: 'v1', versionSlug: false },
{ fileName: 'supabase_kt_v2', label: 'kotlin', version: 'v2', versionSlug: false },
]
export function generateReferencePages() {
let refPages = []
clientLibFiles.map((file) => {
const spec = yaml.load(fs.readFileSync(`../../spec/${file.fileName}.yml`, 'utf8'))
spec.functions.map((fn) => {
const slug = flatCommonLibSections.find((item) => item.id === fn.id)?.slug
refPages.push(`reference/${file.label}/${file.versionSlug ? file.version + '/' : ''}${slug}`)
})
})
return refPages
}