import type { Component } from 'vue' import type { AuthRole } from './services/auth' export type Portal = 'user' | 'admin' export type ModelType = '文本' | '多模态' | '图像' | '3D' | '视频' | '音频' export type CallMode = '同步' | '流式' | '异步' export type TaskStatus = '排队中' | '执行中' | '待核账' | '已完成' | '失败' export interface NavItem { id: string label: string icon: Component badge?: string } export interface NavGroup { label: string items: NavItem[] } export interface ModelItem { logicalModelId?: string id: string /** Public OpenAI-compatible model id returned by GET /v1/models. */ gatewayModelId?: string name: string provider: string vendorName?: string type: ModelType mode: CallMode description: string latency: string specification: string /** Declared media accepted and returned by this model route. */ inputTypes?: string[] outputTypes?: string[] availability: string accent: string icon: Component modelKey?: string sourceLabel?: string pricing?: { price?: number input?: number output?: number cachedInput?: number imageInput?: number unit?: string discount?: number discountLabel?: string exchangeRate?: number priceSource?: string upstreamCredits?: number standardPrice?: { price?: number; unit?: string; credits?: number; priceSource?: string } listPriceUsd?: { input?: number; output?: number; cachedInput?: number } } pricingConfigured?: boolean billingReady?: boolean billingReason?: string integrationDeferred?: boolean priority?: number maxConcurrency?: number executionReady?: boolean } export interface ApiKeyItem { id: string | number name: string value: string scope: string scopeType?: 'personal' | 'project' projectId?: string modelIds: string[] createdAt: string lastUsed: string status: '正常' | '已停用' } export interface TaskItem { id: string name: string model: string status: TaskStatus progress: number createdAt: string duration: string result: string provider?: string prompt?: string modelUrl?: string videoUrl?: string previewUrl?: string imageUrl?: string audioUrl?: string resultUrl?: string resultFormat?: string creditsConsumed?: number remote?: boolean } export interface AdminUser { id: string name: string email: string role: string roleCode: AuthRole balance?: number usage?: string lastActive?: string status: '正常' | '待激活' | '已停用' } export interface ProviderItem { id: string name: string capability: string models: number latency: string successRate: string status: '健康' | '已启用' | '波动' | '维护中' enabled: boolean code?: string protocol?: 'openai-compatible' | 'http' | 'sdk' sourceType?: 'official' | 'relay' | 'self-hosted' | 'custom' baseUrl?: string description?: string credentialType?: 'none' | 'api-key' | 'bearer' | 'access-token' credentialMasked?: string } export interface RouteItem { id: string model: string capability: string primary: string fallback: string policy: string health: string enabled: boolean }