mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-11 21:12:09 +08:00
refactor(backend): specta ipc bindings (#8195)
* refactor(ipc): generate bindings with Specta * fix(profile): project IPC inputs to consumed fields * fix(events): remove unused refresh payloads * fix(webdav): return only consumed backup metadata * fix(network): trim unused interface metadata * fix(sysinfo): return only displayed system fields * chore(knip): check generated runtime exports * fix(proxy): confirm runtime chain updates before UI changes * fix(clipboard): propagate proxy environment copy failures * refactor(dns): remove ignored runtime patch * refactor(core): trim unused upgrade response fields * refactor(ipc): avoid redundant response copies * refactor(proxy): clarify automatic proxy query naming * chore(tests): remove added IPC regression tests * refactor(ipc): enforce typed command boundaries * chore(contract): check generated bindings before push * refactor(ipc): remove unused proxy liveness payloads
This commit is contained in:
+12
-83
@@ -1,86 +1,15 @@
|
||||
export interface ProxyViewV1 {
|
||||
schemaVersion: 1
|
||||
orderSource: 'runtime' | 'fallback'
|
||||
providerState: 'ready' | 'unavailable'
|
||||
global: ProxyGroupView | null
|
||||
direct: string | null
|
||||
groups: ProxyGroupView[]
|
||||
records: Record<string, ProxyNodeView>
|
||||
standalone: string[]
|
||||
providers: ProxyProviderView[]
|
||||
}
|
||||
|
||||
interface ProxyCapabilities {
|
||||
udp: boolean
|
||||
xudp: boolean
|
||||
tfo: boolean
|
||||
mptcp: boolean
|
||||
smux: boolean
|
||||
}
|
||||
|
||||
interface DelayHistory {
|
||||
time: string
|
||||
delay: number
|
||||
}
|
||||
|
||||
export interface ProxyGroupView extends ProxyCapabilities {
|
||||
name: string
|
||||
type: string
|
||||
alive: boolean
|
||||
now?: string
|
||||
fixed?: string
|
||||
hidden?: boolean
|
||||
icon?: string
|
||||
testUrl?: string
|
||||
history: DelayHistory[]
|
||||
extra?: Record<string, { alive: boolean; history: DelayHistory[] }>
|
||||
members: ProxyMemberRef[]
|
||||
}
|
||||
|
||||
export interface ProxyNodeView extends ProxyCapabilities {
|
||||
recordId: string
|
||||
name: string
|
||||
type: string
|
||||
alive: boolean
|
||||
history: DelayHistory[]
|
||||
extra?: Record<string, { alive: boolean; history: DelayHistory[] }>
|
||||
id?: string
|
||||
hidden?: boolean
|
||||
icon?: string
|
||||
testUrl?: string
|
||||
source:
|
||||
| { kind: 'core'; proxyName: string }
|
||||
| { kind: 'provider'; providerName: string; proxyName: string }
|
||||
}
|
||||
|
||||
type ProxyMemberUnresolvedReason =
|
||||
| 'missing'
|
||||
| 'ambiguous'
|
||||
| 'provider-unavailable'
|
||||
|
||||
export type ProxyMemberRef =
|
||||
| { kind: 'group'; name: string }
|
||||
| { kind: 'node'; name: string; recordId: string }
|
||||
| {
|
||||
kind: 'unresolved'
|
||||
name: string
|
||||
reason: ProxyMemberUnresolvedReason
|
||||
}
|
||||
|
||||
interface ProxyProviderView {
|
||||
name: string
|
||||
vehicleType: 'HTTP' | 'File' | 'Inline'
|
||||
updatedAt?: string
|
||||
subscriptionInfo?: ProxySubscriptionInfo
|
||||
proxyRecordIds: string[]
|
||||
}
|
||||
|
||||
interface ProxySubscriptionInfo {
|
||||
upload: number
|
||||
download: number
|
||||
total: number
|
||||
expire: number
|
||||
}
|
||||
import type {
|
||||
ProxyViewV1_Serialize as ProxyViewV1,
|
||||
ProxyGroupView_Serialize as ProxyGroupView,
|
||||
ProxyNodeView_Serialize as ProxyNodeView,
|
||||
ProxyMemberRef,
|
||||
} from '@/services/bindings'
|
||||
export type {
|
||||
ProxyViewV1_Serialize as ProxyViewV1,
|
||||
ProxyGroupView_Serialize as ProxyGroupView,
|
||||
ProxyNodeView_Serialize as ProxyNodeView,
|
||||
ProxyMemberRef,
|
||||
} from '@/services/bindings'
|
||||
|
||||
export type ResolvedProxyMember =
|
||||
| {
|
||||
|
||||
Reference in New Issue
Block a user