release: prepare RealeseV2.3
This commit is contained in:
@@ -18,13 +18,14 @@ const deliveryModeLabels: Record<string, string> = {
|
||||
|
||||
export function formatHttpApiParams(response: HttpApiConfigResponse, origin: string) {
|
||||
const config = response.config;
|
||||
const baseUrl = `${origin.replace(/\/$/, '')}/api/openapi/v1`;
|
||||
const publicOrigin = httpApiPublicOrigin(response, origin);
|
||||
const baseUrl = `${publicOrigin}/api/openapi/v1`;
|
||||
return [
|
||||
`应用名称: ${response.applicationName ?? response.applicationId}`,
|
||||
`AppID: ${response.applicationId}`,
|
||||
`HTTP接口: ${config?.enabled ? '开通' : '关闭'}`,
|
||||
`基础地址: ${baseUrl}`,
|
||||
`接口文档: ${origin.replace(/\/$/, '')}/api/client-docs`,
|
||||
`接口文档: ${publicOrigin}/api/client-docs`,
|
||||
`接口能力: ${capabilityLabels.filter(([key]) => config?.[key]).map(([, label]) => label).join('、') || '无'}`,
|
||||
`QPS限制: ${config?.qpsLimit ?? '-'}`,
|
||||
`签名时间容差: ${config?.timestampToleranceSeconds ?? '-'}秒`,
|
||||
@@ -33,3 +34,7 @@ export function formatHttpApiParams(response: HttpApiConfigResponse, origin: str
|
||||
`上行投递方式: ${config?.uplinkDeliveryMode ? deliveryModeLabels[config.uplinkDeliveryMode] ?? config.uplinkDeliveryMode : '-'}`,
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
export function httpApiPublicOrigin(response: HttpApiConfigResponse | null | undefined, fallbackOrigin: string) {
|
||||
return (response?.publicOrigin ?? fallbackOrigin).replace(/\/$/, '');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user