import { API_DOMAIN, PCM_DOMAIN } from './env'; export { API_DOMAIN, PCM_DOMAIN }; export declare function format(first?: string, middle?: string, last?: string): string; export interface UserInputMessageType { message: string; [key: string]: any; } export interface WorkFlowNode { message_id?: string; conversation_id?: string; created_at?: string; event?: string; answer?: string; data?: { outputs?: { answer?: string; }; status?: string; error?: any; }; } export interface MessageRound extends UserInputMessageType { id?: string; conversation_id?: string; created_at?: string; answer?: string; status?: string; error?: any; } /** * SSE 流式请求配置接口 */ export interface SSERequestConfig { url: string; method: string; headers?: Record; data?: any; onMessage?: (data: any) => void; onError?: (error: any) => void; onComplete?: () => void; } /** * 获取有效的 token,从 authStore 中获取 * @returns string 有效的 token */ export declare const getEffectiveToken: () => string; /** * 发送 SSE 流式请求 * @param config 请求配置 * @param isRetry 是否为重试请求 * @returns Promise */ export declare const sendSSERequest: (config: SSERequestConfig, isRetry?: boolean) => Promise; /** * HTTP请求配置接口 */ export interface HttpRequestConfig { url: string; method?: string; headers?: Record; params?: Record; data?: any; formData?: FormData; onMessage?: (data: any) => void; onError?: (error: any) => void; onComplete?: () => void; } /** * 统一的API响应接口 */ export interface ApiResponse { code: number; message: string; data?: T; } /** * HTTP响应接口 */ export interface HttpResponse { success: boolean; data?: T; error?: any; message?: string; } export declare const createTokenInvalidEvent: () => void; /** * 发送HTTP请求 * @param config 请求配置 * @param isRetry 是否为重试请求 * @returns Promise */ export declare const sendHttpRequest: (config: HttpRequestConfig, isRetry?: boolean) => Promise>; /** * 验证API密钥 * @param token API密钥 * @returns Promise 验证是否成功 */ export declare const verifyApiKey: (token: string) => Promise; /** * 获取智能体信息 * @param botId 智能体ID * @returns Promise 智能体信息数据 */ export declare const fetchAgentInfo: (botId: string) => Promise; /** * 文件上传响应数据接口 */ export interface FileUploadResponse { /** 文件在对象存储中的唯一标识符 */ cos_key: string; /** 文件名称 */ file_name: string; /** 文件大小 */ file_size: any; /** 文件扩展名 */ ext: string; } export declare enum FileUploadState { Init = "init", Uploading = "uploading", Success = "success", Failed = "failed" } export interface FileUploadResponseWithState { file?: File; file_name?: string; file_size?: number; state: FileUploadState; ext?: string; cos_key?: string; error?: Error; } /** * 计算文件的SHA256哈希值 * @param file 要计算哈希值的文件 * @returns Promise 返回文件的SHA256哈希值 */ export declare const calculateFileSHA256: (file: File) => Promise; /** * 带重试机制的文件上传请求 * @param url 上传URL * @param file 要上传的文件 * @param contentType 内容类型 * @param maxRetries 最大重试次数 * @returns Promise */ export declare const uploadFileWithRetry: (url: string, file: File, contentType?: string, maxRetries?: number) => Promise; /** * 通过后端API上传文件 * @param file 要上传的文件 * @param headers 可选的请求头 * @param params 可选的额外参数 * @returns Promise 包含上传结果 */ export declare const uploadFileToBackend: (file: File, headers?: Record, params?: Record) => Promise; /** * 合成语音音频 * @param text 要转换为语音的文本 * @param token API密钥(可选,如果不提供则从 authStore 获取) * @param isRetry 是否为重试请求 * @returns Promise 返回音频的Blob URL */ export declare const synthesizeAudio: (text: string, token?: string, isRetry?: boolean) => Promise; /** * 获取COS文件的预签名URL * @param cosKey COS文件key * @param headers 可选的请求头 * @returns Promise 返回预签名URL,失败时返回null */ export declare const getCosPresignedUrl: (cosKey: string, headers?: Record) => Promise; /** * 获取COS文件的预览URL(用于文档预览) * @param cosKey COS文件key * @param headers 可选的请求头 * @returns Promise 返回预览URL,失败时返回null */ export declare const getCosPreviewUrl: (cosKey: string, headers?: Record) => Promise; /** * 格式化文件大小 * @param size 文件大小(单位B) * @returns 格式化后的文件大小字符串,如 "12.3MB" */ export declare const formatFileSize: (size?: number) => string; /** * 判断当前设备是PC还是移动端 * @returns {boolean} true表示是移动端,false表示是PC端 */ export declare const isMobile: () => boolean; /** * 检测浏览器支持的视频录制MIME类型 * @returns string 支持的MIME类型,如果没有找到则返回空字符串 */ export declare const getSupportedMimeType: () => string; /** * 检测浏览器支持的音频录制MIME类型 * @returns string 支持的MIME类型,如果没有找到则返回空字符串 */ export declare const getSupportedAudioMimeType: () => string; /** * 将音频转换为文字 * @param cosKey COS文件的唯一标识符 * @returns Promise 转换后的文字,失败时返回null */ export declare const convertAudioToText: (cosKey: string) => Promise; /** * 发送短信验证码 * @param mobile 手机号 * @param codeType 验证码类型,默认为0 * @returns Promise 发送结果 */ export declare const sendSmsCode: (mobile: string, codeType?: number) => Promise; /** * 校验短信验证码 * @param mobile 手机号 * @param code 验证码 * @param codeType 验证码类型,默认为0 * @param regSourceId 注册来源业务ID,OEM场景传入OEM ID * @returns Promise 校验结果 */ export declare const verifySmsCode: (mobile: string, code: string, codeType?: number, regSourceId?: string) => Promise; /** * 职位信息接口 */ export interface Position { id: number; title: string; company_name: string; company_id: number; department: string; employment_type: string; salary_range: string; salary_min: number | null; salary_max: number | null; location: string; province: string | null; city: string | null; district: string | null; address: string; education_required: string; experience_required: string; recruiting_number: number; job_description: string; job_responsibilities: string; job_requirements: string; skills_required: string; benefits: string; job_type: string; work_experience: string; work_industry: string; recruitment_channel: string | null; deadline: string | null; status: number; source_type: string; } /** * OEM职位列表响应接口 */ export interface OemPositionsResponse { total: number; page: number; page_size: number; items: Position[]; source_type: string; source_id: number; } /** * 获取OEM职位列表的参数接口 */ export interface GetOemPositionsParams { oemId: string; page?: number; pageSize?: number; keyword?: string; } /** * 获取OEM职位列表 * @param params 获取职位列表的参数 * @returns Promise> 职位列表 */ export declare const getOemPositions: (params: GetOemPositionsParams) => Promise>; /** * 通过URL上传文件参数接口 */ export interface UploadFileByUrlParams { /** 文件URL */ url: string; /** 文件名称 */ file_name: string; } /** * 通过URL上传文件 * @param params 上传参数 * @param headers 可选的请求头 * @returns Promise> 上传结果 */ export declare const uploadFileByUrl: (params: UploadFileByUrlParams, headers?: Record) => Promise>;