feat: add data import/export bundle

This commit is contained in:
LLLLLLiulei
2026-02-05 17:46:08 +08:00
parent 6d0152c8e2
commit b4bd46d067
19 changed files with 1488 additions and 17 deletions

View File

@@ -727,6 +727,56 @@ export interface UpdateProxyRequest {
status?: 'active' | 'inactive'
}
export interface AdminDataPayload {
type: string
version: number
exported_at: string
proxies: AdminDataProxy[]
accounts: AdminDataAccount[]
}
export interface AdminDataProxy {
proxy_key: string
name: string
protocol: ProxyProtocol
host: string
port: number
username?: string | null
password?: string | null
status: 'active' | 'inactive'
}
export interface AdminDataAccount {
name: string
notes?: string | null
platform: AccountPlatform
type: AccountType
credentials: Record<string, unknown>
extra?: Record<string, unknown>
proxy_key?: string | null
concurrency: number
priority: number
rate_multiplier?: number | null
expires_at?: number | null
auto_pause_on_expired?: boolean
}
export interface AdminDataImportError {
kind: 'proxy' | 'account'
name?: string
proxy_key?: string
message: string
}
export interface AdminDataImportResult {
proxy_created: number
proxy_reused: number
proxy_failed: number
account_created: number
account_failed: number
errors?: AdminDataImportError[]
}
// ==================== Usage & Redeem Types ====================
export type RedeemCodeType = 'balance' | 'concurrency' | 'subscription' | 'invitation'