mirror of
http://88.130.71.182:3000/BlitTech/contexta_fe.git
synced 2026-06-13 10:30:16 +00:00
Initial commit
This commit is contained in:
156
src/types/index.ts
Normal file
156
src/types/index.ts
Normal file
@@ -0,0 +1,156 @@
|
||||
// ─── Auth ──────────────────────────────────────────────────────────────────────
|
||||
export interface User {
|
||||
id: string
|
||||
email: string
|
||||
company_name?: string
|
||||
plan: 'free' | 'starter' | 'pro' | 'enterprise'
|
||||
created_at?: string
|
||||
}
|
||||
|
||||
export interface AuthResponse {
|
||||
access_token: string
|
||||
token_type: string
|
||||
user: User
|
||||
}
|
||||
|
||||
// ─── Chatbot ───────────────────────────────────────────────────────────────────
|
||||
export interface Chatbot {
|
||||
id: string
|
||||
company_id: string
|
||||
name: string
|
||||
description?: string
|
||||
system_prompt?: string
|
||||
model: string
|
||||
temperature: number
|
||||
max_tokens: number
|
||||
primary_color: string
|
||||
welcome_message: string
|
||||
category?: string
|
||||
industry?: string
|
||||
languages: string[]
|
||||
visibility: 'preview' | 'published'
|
||||
is_published: boolean
|
||||
qdrant_collection_name?: string
|
||||
document_count: number
|
||||
conversation_count: number
|
||||
average_rating?: number
|
||||
created_at?: string
|
||||
published_at?: string
|
||||
}
|
||||
|
||||
export interface ChatbotPublic {
|
||||
id: string
|
||||
name: string
|
||||
description?: string
|
||||
category?: string
|
||||
industry?: string
|
||||
languages: string[]
|
||||
primary_color: string
|
||||
welcome_message: string
|
||||
average_rating?: number
|
||||
total_conversations: number
|
||||
company_name?: string
|
||||
company_logo?: string
|
||||
created_at?: string
|
||||
published_at?: string
|
||||
}
|
||||
|
||||
export interface ChatbotFormData {
|
||||
name: string
|
||||
description: string
|
||||
system_prompt: string
|
||||
model: string
|
||||
temperature: number
|
||||
max_tokens: number
|
||||
primary_color: string
|
||||
welcome_message: string
|
||||
category: string
|
||||
industry: string
|
||||
languages: string[]
|
||||
}
|
||||
|
||||
// ─── Document ─────────────────────────────────────────────────────────────────
|
||||
export interface Document {
|
||||
id: string
|
||||
chatbot_id: string
|
||||
file_name: string
|
||||
file_type: string
|
||||
file_size: number
|
||||
chunk_count: number
|
||||
status: 'pending' | 'processing' | 'completed' | 'failed'
|
||||
error_message?: string
|
||||
created_at?: string
|
||||
}
|
||||
|
||||
// ─── Chat ─────────────────────────────────────────────────────────────────────
|
||||
export interface ChatMessage {
|
||||
id: string
|
||||
role: 'user' | 'assistant'
|
||||
content: string
|
||||
sources?: SourceDocument[]
|
||||
created_at?: string
|
||||
}
|
||||
|
||||
export interface SourceDocument {
|
||||
document_name: string
|
||||
chunk_text: string
|
||||
score: number
|
||||
page_number?: number
|
||||
}
|
||||
|
||||
export interface ChatResponse {
|
||||
response: string
|
||||
session_id: string
|
||||
sources: SourceDocument[]
|
||||
model_used: string
|
||||
tokens_used: number
|
||||
}
|
||||
|
||||
// ─── Subscription ─────────────────────────────────────────────────────────────
|
||||
export interface Subscription {
|
||||
id: string
|
||||
user_id: string
|
||||
plan: string
|
||||
status: string
|
||||
stripe_customer_id?: string
|
||||
current_period_start?: string
|
||||
current_period_end?: string
|
||||
chatbots_published: number
|
||||
conversations_used: number
|
||||
created_at?: string
|
||||
}
|
||||
|
||||
// ─── Marketplace ──────────────────────────────────────────────────────────────
|
||||
export interface MarketplaceResponse {
|
||||
chatbots: ChatbotPublic[]
|
||||
total: number
|
||||
page: number
|
||||
limit: number
|
||||
has_more: boolean
|
||||
}
|
||||
|
||||
// ─── Plan ─────────────────────────────────────────────────────────────────────
|
||||
export interface PlanFeature {
|
||||
text: string
|
||||
included: boolean
|
||||
}
|
||||
|
||||
export interface Plan {
|
||||
id: string
|
||||
name: string
|
||||
price: number
|
||||
description: string
|
||||
features: PlanFeature[]
|
||||
highlighted?: boolean
|
||||
}
|
||||
|
||||
// ─── Analytics ────────────────────────────────────────────────────────────────
|
||||
export interface Analytics {
|
||||
chatbot_id: string
|
||||
total_conversations: number
|
||||
unique_users: number
|
||||
average_conversation_length: number
|
||||
total_messages: number
|
||||
average_rating: number
|
||||
conversations_last_30_days: number
|
||||
}
|
||||
Reference in New Issue
Block a user