35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
|
|
/**
|
|||
|
|
* 平台设置 API 骨架(Phase 3 Task 3)
|
|||
|
|
*
|
|||
|
|
* 端点事实源:app/platform/routes/config_routes.py 的 settings_router
|
|||
|
|
* (/api/platform/settings,仅超管:集团 AI 凭据 / 默认 SMTP 等)。
|
|||
|
|
* 本文件只建类型与端点常量——调用函数在 Task 9(平台设置)实装。
|
|||
|
|
*
|
|||
|
|
* 密钥掩码:key 名含 key/password/secret 的非空字符串值在列表响应中
|
|||
|
|
* 掩码为 '__SET__'(嵌套 dict 递归两层);PUT 提交 '__SET__' = 保持库值。
|
|||
|
|
* 表单语义转换见 src/api/mask.ts。
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/** 平台设置项(列表响应行;value 可能是掩码哨兵或任意 JSON) */
|
|||
|
|
export interface PlatformSettingItem {
|
|||
|
|
key: string
|
|||
|
|
value: unknown
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/** 平台设置列表响应 */
|
|||
|
|
export interface PlatformSettingsResponse {
|
|||
|
|
items: PlatformSettingItem[]
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/** upsert 单个设置项请求(同 key 再写 = 整值替换) */
|
|||
|
|
export interface PutPlatformSettingRequest {
|
|||
|
|
key: string
|
|||
|
|
value: unknown
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/** 平台设置端点 */
|
|||
|
|
export const SETTINGS_ENDPOINTS = {
|
|||
|
|
list: '/api/platform/settings',
|
|||
|
|
put: '/api/platform/settings'
|
|||
|
|
} as const
|