import { type PolicySection } from './types'; import { CodeBlock } from '@/components/ui/code-block'; import { DocsTable, DocsTableBody, DocsTableCell, DocsTableHead, DocsTableHeader, DocsTableRow, } from '@/components/ui/docs-table'; export const DOCS_LAST_UPDATED = '2026-06-07'; type TFn = (key: string) => string; export function getApiSections(t: TFn): PolicySection[] { return [ { value: 'api-specs', title: t('api.section1.title'), content: (
{t('api.section1.desc')}
{t('api.section1.responseFormatDesc')}
{t('api.section1.successExample')}
{t('api.section1.failExample')}
{t('api.section1.authenticationDesc')}
{t('api.section1.supportedHeaders')}
Authorization: Bearer at_xxx
X-Access-Token: at_xxx
{t('api.endpoint')}POST{' '}
/api/v1/user/register
{t('api.desc')} {t('api.section2.registerDesc')}
{t('api.endpoint')}POST{' '}
/api/v1/user/login
{t('api.desc')} {t('api.section2.passwordLoginDesc')}
{t('api.endpoint')}GET{' '}
/api/v1/user/logout
{t('api.desc')} {t('api.section2.logoutDesc')}
{t('api.endpoint')}GET{' '}
/api/v1/user/self
{t('api.desc')} {t('api.section2.getProfileDesc')}
{t('api.section3.desc')}
{t('api.endpoint')}GET{' '}
/api/v1/user/access-tokens
{t('api.desc')} {t('api.section3.listTokensDesc')}
{t('api.endpoint')}POST{' '}
/api/v1/user/access-tokens
{t('api.param')}JSON Body{' '}
{`{"name": "${t('api.section3.tokenName')}", "is_admin": false}`}
{t('api.desc')} {t('api.section3.createTokenDesc')}
is_admin(
{t('api.optional')},{t('api.default')}{' '}
false
):{t('api.section3.isAdminDesc')}{' '}
/admin/**{' '}
{t('api.section3.endpoint')}.
{t('api.section3.successResponseExample')}
{t('api.endpoint')}DELETE{' '}
/api/v1/user/access-tokens/:id
{t('api.desc')} {t('api.section3.deleteTokenDesc')}
{t('api.endpoint')}POST{' '}
/api/v1/user/access-tokens/:id/rotate
{t('api.desc')} {t('api.section3.rotateTokenDesc')}
{t('api.endpoint')}GET{' '}
/api/v1/config/public
{t('api.desc')} {t('api.section4.publicConfigDesc')}
{t('api.section4.responseExample')}
{t('api.desc')} {t('api.section4.adminConfigsDesc')}
/api/v1/admin/system-configs?type=system
/api/v1/admin/system-configs
/api/v1/admin/system-configs/:key
/api/v1/admin/system-configs/:key