Download apps/api/src/modules/automation/interfaces/adapter.interface.ts from qf46578/omnics: direct link, hf CLI and curl.
- Browser
- Download file 1.44 kB
-
https://huggingface.co/spaces/qf46578/omnics/resolve/main/apps/api/src/modules/automation/interfaces/adapter.interface.ts
- Command line
-
hf download hf://spaces/qf46578/omnics/apps/api/src/modules/automation/interfaces/adapter.interface.ts
-
curl -L -o adapter.interface.ts https://huggingface.co/spaces/qf46578/omnics/resolve/main/apps/api/src/modules/automation/interfaces/adapter.interface.ts
1.44 kB
| /** | |
| * 平台适配器接口定义 | |
| */ | |
| import { OCRResult } from '../services/ocr.service'; | |
| export interface PlatformAdapter { | |
| readonly platform: string; | |
| initialize(): Promise<boolean>; | |
| checkNewMessages(): Promise<MessageContext[]>; | |
| sendMessage(message: string, customerId?: string): Promise<SendMessageResult>; | |
| transferToSubAccount(subAccountId: string): Promise<boolean>; | |
| } | |
| export interface MessageContext { | |
| customerId: string; | |
| customerName: string; | |
| content: string; | |
| attachments?: Attachment[]; | |
| timestamp: Date; | |
| confidence?: number; | |
| } | |
| export interface Attachment { | |
| type: 'image' | 'file' | 'link'; | |
| url?: string; | |
| localPath?: string; | |
| name?: string; | |
| } | |
| export interface SendMessageResult { | |
| success: boolean; | |
| error?: string; | |
| duration?: number; | |
| } | |
| export interface PlatformConfig { | |
| name: string; | |
| displayName: string; | |
| windowTitle: string; | |
| layout: LayoutConfig; | |
| credentials?: PlatformCredentials; | |
| } | |
| export interface LayoutConfig { | |
| popupPosition: Position; | |
| chatInputPosition: Position; | |
| sendButtonPosition: Position; | |
| customerListPosition: Position; | |
| customerAreaRegion: Region; | |
| subAccountButtonPosition: Position; | |
| } | |
| export interface Position { | |
| x: number; | |
| y: number; | |
| } | |
| export interface Region { | |
| x: number; | |
| y: number; | |
| width: number; | |
| height: number; | |
| } | |
| export interface PlatformCredentials { | |
| cookies?: Record<string, string>; | |
| token?: string; | |
| accountId?: string; | |
| } | |