Xuda logo

xuda.io

Technical docs for Xuda Slim and Xuda CLI

Product overview
Xuda CLI

apis/

This guide was generated by xuda-cli.

Xuda CLI pages

Repo-driven docs from the xuda-cli package README and generated folder guides.

Docs page

This guide was generated by xuda-cli.

You can remove all generated folder guides later with:

npm run clean:readmes

Use this folder for Xuda api units.

What belongs here

  • API-style response builders
  • data summaries for external callers
  • reusable response-oriented logic that should not live in UI components

Recommended blocks

  • <meta lang="json5">
  • optional <params lang="json5">
  • optional <fields lang="json5">
  • optional <events lang="json5">
  • optional <datasource lang="json5">
  • <response>

Important rules

  • the response body lives in <response>
  • if the API needs data, model that with a datasource or fields first
  • keep the API response format explicit and easy to test

Example

<meta lang="json5">
{
  id: "student_classes_api",
  menuTitle: "Student Classes API"
}
</meta>

<params lang="json5">
{
  out: {
    students_out: "array"
  }
}
</params>

<datasource lang="json5">
{
  type: "table",
  table: "student_profiles_table",
  output: "students_out"
}
</datasource>

<response>
({ ok: true, count: (@students_out || []).length, rows: @students_out })
</response>