mirror of
https://github.com/longbridge/developers.git
synced 2026-09-19 03:34:09 +08:00
4d758951cc
Runtime US tenant detection based on cookie `app_id` /
`x-original-app-id` (longbridge_us / longbridge_us_uat), aligned with
openapi-website-private.
- API baseUrl (request.ts) prefers US host when cookie matches:
longbridge_us -> https://mr.longbridge.com
longbridge_us_uat -> https://mr.longbridge-staging.com
falls back to hostname suffix.
- __API_PROXY_URL__ resolves the same way in an inline bootstrap script
that runs before longport-internal.iife.js loads.
- Append `with-us=1` to the login redirect URL.
- Pin longport-internal.iife.js to versioned CDN artifact that contains
US tenant normalization
(assets.lbctrl.com/openapi-sdk/release/longport-internal-202607201728.iife.js).
- Rename portal gateway host m.* -> mr.* in package.json,
region.config.ts,
config.mts and workflow yml.
64 lines
1.9 KiB
TypeScript
64 lines
1.9 KiB
TypeScript
export interface RegionSectionExclusion {
|
|
/** Glob pattern matching page paths */
|
|
page: string
|
|
/** Heading texts to exclude — removes heading + content until next same-level heading */
|
|
headings: string[]
|
|
}
|
|
|
|
export interface RegionConfig {
|
|
/** API base URL for this region */
|
|
apiBaseUrl: string
|
|
/** Portal gateway base URL for this region */
|
|
portalGatewayBaseUrl: string
|
|
/** Site hostname for canonical URLs, sitemap, etc. */
|
|
siteHostname: string
|
|
/** MCP server hostname for this region (used both for build-time tools fetch and runtime URLs shown to users) */
|
|
mcpHostname: string
|
|
/**
|
|
* Page whitelist — only pages matching these glob patterns are included.
|
|
* Uses `**` prefix to match across all locale directories (en, zh-CN, zh-HK).
|
|
* Pages not matching any pattern are excluded from the build.
|
|
*/
|
|
includePages: string[]
|
|
/** Nav items to exclude — matches against the link path (e.g. '/', '/docs/api', '/sdk') */
|
|
excludeNavLinks: string[]
|
|
/** In-page section exclusions (applied within whitelisted pages) */
|
|
excludeSections: RegionSectionExclusion[]
|
|
}
|
|
|
|
export const regionConfig: Record<string, RegionConfig> = {
|
|
cn: {
|
|
apiBaseUrl: 'https://openapi.longbridge.cn',
|
|
portalGatewayBaseUrl: 'https://mr.lbkrs.com',
|
|
siteHostname: 'https://open.longbridge.cn',
|
|
mcpHostname: 'https://mcp.longbridge.cn',
|
|
|
|
excludeNavLinks: ['/', '/docs/api', '/sdk'],
|
|
|
|
includePages: [
|
|
// Only CLI under /docs/
|
|
'**/docs/cli.md',
|
|
'**/docs/cli/index.md',
|
|
'**/docs/cli/install.md',
|
|
'**/docs/cli/release-notes.md',
|
|
|
|
// MCP
|
|
'**/docs/mcp.md',
|
|
|
|
// Agent Auth Code
|
|
'**/docs/agent-auth.md',
|
|
|
|
// AI Skills
|
|
'**/skill/**',
|
|
],
|
|
|
|
excludeSections: [
|
|
// Example: remove US stock trading sections from getting-started
|
|
// {
|
|
// page: '**/docs/getting-started.md',
|
|
// headings: ['US Stock Trading', '美股交易', '美股交易'],
|
|
// },
|
|
],
|
|
},
|
|
}
|