- ChatThread per client/provider and channel; messages get files, internal notes, source (bot/mini app) and delivery errors; reply templates. Migration moves old concierge messages into threads. - Routing: subscribers write to the concierge, others to support; /support and /concierge in the client bot; staff can take, transfer, close and move threads. - Telegram: photos/documents from clients and providers, replies with the channel header, files sent from storage, notifications only to the assignee or the channel's staff, "Reply" into a specific thread. - New admin: /chats with list, conversation, notes, files, templates, client panel; "Message" button on the client card; dashboard counts threads awaiting reply. - Client mini app: in-app chat screen sharing the same conversation. - Old admin keeps working on the same data (notes hidden there). - Tests for routing, notes, assign/close/move, lists, recipients; separate test DB via TEST_DB_NAME; dev:chats-demo script. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
16 lines
650 B
TypeScript
16 lines
650 B
TypeScript
import react from '@vitejs/plugin-react';
|
|
import { defineConfig } from 'vite';
|
|
|
|
// В разработке API проксируется — Mini App и API на одном origin (удобно и для туннеля https)
|
|
// API_PROXY — другой локальный API (например, второй экземпляр на соседнем порту)
|
|
const api = process.env.API_PROXY ?? 'http://localhost:4000';
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
host: true,
|
|
allowedHosts: true,
|
|
proxy: { '/trpc': api, '/files': api, '/client-log': api },
|
|
},
|
|
build: { target: 'es2022', sourcemap: true },
|
|
});
|