mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-19 11:10:49 +08:00
refactor(core): harden API parsing and improve type safety
This commit is contained in:
@@ -17,8 +17,8 @@ export interface ApiClientConfig {
|
||||
export interface RequestOptions {
|
||||
method?: HttpMethod;
|
||||
headers?: Record<string, string>;
|
||||
params?: Record<string, any>;
|
||||
data?: any;
|
||||
params?: Record<string, unknown>;
|
||||
data?: unknown;
|
||||
}
|
||||
|
||||
// 服务器版本信息
|
||||
@@ -31,6 +31,6 @@ export interface ServerVersion {
|
||||
export type ApiError = Error & {
|
||||
status?: number;
|
||||
code?: string;
|
||||
details?: any;
|
||||
data?: any;
|
||||
details?: unknown;
|
||||
data?: unknown;
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ export interface AuthFileItem {
|
||||
runtimeOnly?: boolean | string;
|
||||
disabled?: boolean;
|
||||
modified?: number;
|
||||
[key: string]: any;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface AuthFilesResponse {
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface Notification {
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
export interface ApiResponse<T = any> {
|
||||
export interface ApiResponse<T = unknown> {
|
||||
data?: T;
|
||||
error?: string;
|
||||
message?: string;
|
||||
|
||||
@@ -31,7 +31,7 @@ export interface Config {
|
||||
vertexApiKeys?: ProviderKeyConfig[];
|
||||
openaiCompatibility?: OpenAIProviderConfig[];
|
||||
oauthExcludedModels?: Record<string, string[]>;
|
||||
raw?: Record<string, any>;
|
||||
raw?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export type RawConfigSection =
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface LogEntry {
|
||||
timestamp: string;
|
||||
level: LogLevel;
|
||||
message: string;
|
||||
details?: any;
|
||||
details?: unknown;
|
||||
}
|
||||
|
||||
// 日志筛选
|
||||
|
||||
@@ -43,5 +43,5 @@ export interface OpenAIProviderConfig {
|
||||
models?: ModelAlias[];
|
||||
priority?: number;
|
||||
testModel?: string;
|
||||
[key: string]: any;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export type PayloadParamEntry = {
|
||||
export type PayloadModelEntry = {
|
||||
id: string;
|
||||
name: string;
|
||||
protocol?: 'openai' | 'gemini' | 'claude' | 'codex' | 'antigravity';
|
||||
protocol?: 'openai' | 'openai-response' | 'gemini' | 'claude' | 'codex' | 'antigravity';
|
||||
};
|
||||
|
||||
export type PayloadRule = {
|
||||
|
||||
Reference in New Issue
Block a user