Home / Function/ writeApiReferenceSections() — supabase Function Reference

writeApiReferenceSections() — supabase Function Reference

Architecture documentation for the writeApiReferenceSections() function in Reference.generated.script.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  eff95f24_f3b8_b5c3_e4a7_5dfa320c3c6f["writeApiReferenceSections()"]
  35786dbf_245c_1618_e006_4cf71f59bd93["run()"]
  35786dbf_245c_1618_e006_4cf71f59bd93 -->|calls| eff95f24_f3b8_b5c3_e4a7_5dfa320c3c6f
  5c5e362d_826d_df1a_72f8_d427ad32c0bc["mapEndpointsById()"]
  eff95f24_f3b8_b5c3_e4a7_5dfa320c3c6f -->|calls| 5c5e362d_826d_df1a_72f8_d427ad32c0bc
  2ba77918_c71f_00b4_2b40_c0b152543573["join()"]
  eff95f24_f3b8_b5c3_e4a7_5dfa320c3c6f -->|calls| 2ba77918_c71f_00b4_2b40_c0b152543573
  cd24f6d3_9b20_b4e9_4699_9b8057e1f1f5["genApiSectionTree()"]
  eff95f24_f3b8_b5c3_e4a7_5dfa320c3c6f -->|calls| cd24f6d3_9b20_b4e9_4699_9b8057e1f1f5
  86220fce_b7ec_5580_a5d9_938c3ed97a21["flattenCommonClientLibSections()"]
  eff95f24_f3b8_b5c3_e4a7_5dfa320c3c6f -->|calls| 86220fce_b7ec_5580_a5d9_938c3ed97a21
  style eff95f24_f3b8_b5c3_e4a7_5dfa320c3c6f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/features/docs/Reference.generated.script.ts lines 252–286

async function writeApiReferenceSections() {
  const endpointsById = mapEndpointsById(openApiSpec)
  const pendingEndpointsByIdWrite = writeFile(
    join(GENERATED_DIRECTORY, 'api.latest.endpointsById.json'),
    JSON.stringify(Array.from(endpointsById.entries()))
  )

  const apiSectionTree = genApiSectionTree(endpointsById)
  const pendingApiSectionTreeWrite = writeFile(
    join(GENERATED_DIRECTORY, 'api.latest.sections.json'),
    JSON.stringify(apiSectionTree)
  )

  const flattenedApiSections = flattenCommonClientLibSections(apiSectionTree)
  const pendingFlattenedApiSectionsWrite = writeFile(
    join(GENERATED_DIRECTORY, 'api.latest.flat.json'),
    JSON.stringify(flattenedApiSections)
  )

  const apiSectionsBySlug = keyBy(
    flattenedApiSections.filter(({ slug }) => !!slug),
    (section) => section.slug
  )
  const pendingApiSlugDictionaryWrite = writeFile(
    join(GENERATED_DIRECTORY, 'api.latest.bySlug.json'),
    JSON.stringify(apiSectionsBySlug)
  )

  return Promise.all([
    pendingEndpointsByIdWrite,
    pendingApiSectionTreeWrite,
    pendingFlattenedApiSectionsWrite,
    pendingApiSlugDictionaryWrite,
  ])
}

Subdomains

Called By

Frequently Asked Questions

What does writeApiReferenceSections() do?
writeApiReferenceSections() is a function in the supabase codebase.
What does writeApiReferenceSections() call?
writeApiReferenceSections() calls 4 function(s): flattenCommonClientLibSections, genApiSectionTree, join, mapEndpointsById.
What calls writeApiReferenceSections()?
writeApiReferenceSections() is called by 1 function(s): run.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free