Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
d6bf79b
feat: API Reference (/docs/api) — openapi-driven docs, Try-it, search
hogan-yuan Sep 28, 2026
b24af11
docs(api): sync ws-push-candlestick description/tip with the docs guide
hogan-yuan Sep 28, 2026
2d9f399
docs(api): sync WebSocket command descriptions with the docs guides
hogan-yuan Sep 28, 2026
184b9e3
feat(api-ref): show the quote-permission card on WebSocket command pages
hogan-yuan Sep 28, 2026
c935d8d
feat(api-reference): align WS command pages with REST endpoints
hogan-yuan Sep 29, 2026
77fb04a
docs(quote): fix WebSocket packet framing byte order
hogan-yuan Sep 29, 2026
5d1804f
fix(api-reference): address review findings
hogan-yuan Sep 29, 2026
f9ca908
fix(api-reference): round-2 review fixes
hogan-yuan Sep 29, 2026
51e16ba
style(api-reference): center the content column at a max width
hogan-yuan Sep 29, 2026
bc5074f
docs(i18n): complete zh-CN / zh-HK localization of the OpenAPI spec
hogan-yuan Sep 29, 2026
89c576e
fix(docs): satisfy AutoCorrect lint in the realtime protocol page
hogan-yuan Sep 29, 2026
aef7e89
fix(api-reference): make the sidebar a drawer on narrow screens
hogan-yuan Sep 29, 2026
007fb85
fix(api-reference): move the narrow-screen nav toggle in-flow
hogan-yuan Sep 29, 2026
680853e
refactor(api-reference): narrow-screen nav matches the docs/cli pattern
hogan-yuan Sep 29, 2026
25344fc
style(api-reference): cap the content column at 52rem
hogan-yuan Sep 30, 2026
901f8d2
fix(api-reference): widen the Required column in param tables
hogan-yuan Oct 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

old_docs
.superpowers
# superpowers plans/specs are local working artifacts — never version them.
# (astro-migration files already tracked on main stay tracked; gitignore does
# not affect already-tracked files.)
docs/superpowers/*
!docs/superpowers/specs/
!docs/superpowers/specs/**
!docs/superpowers/plans/
!docs/superpowers/plans/**
.claude/worktrees
.worktrees

Expand Down
60 changes: 60 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,61 @@ import { prebuildSkills } from './src/integrations/prebuild-skills'
const REGION = process.env['VITE_REGION'] ?? 'global'
const SITE = process.env['VITE_SITE_HOSTNAME'] ?? 'https://open.longportapp.com'

// Dev-only reverse proxy for the TryIt debugger. Vite's built-in http-proxy
// returns 502 for these HTTPS upstreams under bun, so forward with fetch (which
// works). `/api-prod` → production gateway.
function apiDevProxy() {
const TARGETS: Record<string, string> = {
'/api-prod': 'https://openapi.longbridge.com',
// Legacy default prefix used by <TryIt> when no baseUrl is passed.
'/api': 'https://openapi.longbridge.com',
}
return {
name: 'lb-api-dev-proxy',
apply: 'serve' as const,
configureServer(server: { middlewares: { use: (fn: (req: any, res: any, next: () => void) => void) => void } }) {
// Dev only: corporate networks MITM these HTTPS upstreams with a cert the
// dev process doesn't trust, so outbound fetch fails. Skip verification —
// this never runs in a production build (apply: 'serve').
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0'
server.middlewares.use(async (req: any, res: any, next: () => void) => {
const url: string = req.url ?? ''
const prefix = Object.keys(TARGETS).find((p) => url === p || url.startsWith(p + '/'))
if (!prefix) return next()
const target = TARGETS[prefix]
const path = url.slice(prefix.length) || '/'
try {
const chunks: Buffer[] = []
for await (const c of req) chunks.push(c as Buffer)
const method: string = (req.method ?? 'GET').toUpperCase()
const headers: Record<string, string> = {}
for (const [k, v] of Object.entries(req.headers)) {
if (k === 'host' || k === 'connection' || k === 'content-length') continue
if (typeof v === 'string') headers[k] = v
}
const upstream = await fetch(target + path, {
method,
headers,
body: method === 'GET' || method === 'HEAD' || chunks.length === 0 ? undefined : Buffer.concat(chunks),
})
res.statusCode = upstream.status
upstream.headers.forEach((value: string, key: string) => {
const k = key.toLowerCase()
// Body is already decoded by fetch — don't forward encoding/length.
if (k === 'content-encoding' || k === 'content-length' || k === 'transfer-encoding') return
res.setHeader(key, value)
})
res.end(Buffer.from(await upstream.arrayBuffer()))
} catch (err) {
res.statusCode = 502
res.setHeader('content-type', 'application/json; charset=utf-8')
res.end(JSON.stringify({ code: -1, msg: `dev proxy error: ${err instanceof Error ? err.message : String(err)}`, data: null }))
}
})
},
}
}

export default defineConfig({
site: SITE,
// `assets: 'assets'` (default is `_astro`) so hashed CSS/JS land in /assets/ —
Expand All @@ -44,6 +99,11 @@ export default defineConfig({
],
vite: {
plugins: [
// Dev proxy for the API Reference TryIt debugger: one prefix per
// environment so the 生产/测试 toggle can hit either backend without CORS.
// Implemented with fetch (not Vite's http-proxy, which 502s under bun for
// these HTTPS upstreams). Dev only — prod talks to the real domains.
apiDevProxy(),
tailwind(),
// Rename mdx frontmatter `layout:` → `docs_layout:` so astro-mdx
// doesn't try to resolve values like "api-reference" as module
Expand Down
8 changes: 8 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

241 changes: 0 additions & 241 deletions docs/en/docs/account/alert/update_alert.mdx

This file was deleted.

1 change: 0 additions & 1 deletion docs/en/docs/account/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Create and manage price alerts for securities.
|---|---|
| [list_alerts](./alert/list-alerts) | List all active price alerts |
| [create_alert](./alert/create-alert) | Create a new price alert |
| [update_alert](./alert/update-alert) | Update an existing alert |
| [delete_alert](./alert/delete-alert) | Delete a price alert |

## DCAContext
Expand Down
Loading
Loading