ваше сообщение коммита

This commit is contained in:
2025-06-19 15:24:27 +03:00
parent 47a6d8593a
commit 8301ebb6bd
27 changed files with 1851 additions and 4305 deletions

View File

@@ -163,7 +163,7 @@ app.use((req, res, next) => {
app.use('/api/tables', tablesRoutes); // ДОЛЖНО БЫТЬ ВЫШЕ!
// app.use('/api', identitiesRoutes);
app.use('/api/auth', authRoutes);
app.use('/api/users/:userId/tags', userTagsRoutes);
app.use('/api/users', userTagsRoutes);
app.use('/api/users', usersRoutes);
app.use('/api/chat', chatRoutes);
app.use('/api/admin', adminRoutes);

File diff suppressed because it is too large Load Diff

View File

@@ -1,403 +1,51 @@
{"level":"error","message":"Health check failed: aiAssistant.checkHealth is not a function","stack":"TypeError: aiAssistant.checkHealth is not a function\n at /app/app.js:203:40\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-06-06T11:22:41.762Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.281Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.282Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.282Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.282Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.282Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.282Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.283Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.283Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.283Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.284Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.284Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.285Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.285Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.285Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.286Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:27:40.286Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T11:51:12.394Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:51:12.395Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:51:12.395Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T11:51:12.395Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T12:11:50.583Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:11:50.583Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:11:50.583Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:11:50.584Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:11:50.584Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:11:50.584Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:11:50.584Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:11:50.585Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T12:13:19.843Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:13:19.844Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:13:19.844Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:13:19.845Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T12:13:35.543Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:13:35.543Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.226Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.228Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.228Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.228Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.229Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.229Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.229Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.230Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.230Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.230Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.230Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.230Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.231Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.231Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.231Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:19:37.232Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:20:43.909Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:20:43.910Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:20:43.910Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:21:06.548Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T12:27:58.901Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:27:58.901Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:27:58.902Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:27:58.902Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T12:31:43.792Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:31:43.793Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:31:43.794Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T12:33:16.180Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:33:16.181Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T12:33:31.377Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T12:42:37.316Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:42:37.317Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:42:37.317Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:42:37.317Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:42:37.317Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:42:37.318Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:42:37.318Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:42:37.318Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:42:37.318Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T12:44:50.653Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:44:50.654Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:44:50.654Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:44:50.654Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:44:50.654Z"}
{"level":"error","message":"Uncaught Exception: Cannot set properties of undefined (setting 'name')","stack":"TypeError: Cannot set properties of undefined (setting 'name')\n at Connection.<anonymous> (/app/node_modules/imap/lib/Connection.js:431:22)\n at Connection._resTagged (/app/node_modules/imap/lib/Connection.js:1535:22)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:194:10)\n at Parser.emit (node:events:524:28)\n at Parser._resTagged (/app/node_modules/imap/lib/Parser.js:175:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:139:16)\n at Parser._tryread (/app/node_modules/imap/lib/Parser.js:82:15)\n at Parser._cbReadable (/app/node_modules/imap/lib/Parser.js:53:12)\n at TLSSocket.emit (node:events:524:28)\n at emitReadable_ (node:internal/streams/readable:834:12)","timestamp":"2025-06-06T12:45:05.178Z"}
{"level":"error","message":"Uncaught Exception: Cannot read properties of undefined (reading 'type')","stack":"TypeError: Cannot read properties of undefined (reading 'type')\n at Connection._resUntagged (/app/node_modules/imap/lib/Connection.js:1265:52)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:191:10)\n at Parser.emit (node:events:524:28)\n at Parser._resUntagged (/app/node_modules/imap/lib/Parser.js:271:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:137:16)\n at Parser._tryread (/app/node_modules/imap/lib/Parser.js:82:15)\n at Parser._cbReadable (/app/node_modules/imap/lib/Parser.js:53:12)\n at TLSSocket.emit (node:events:524:28)\n at emitReadable_ (node:internal/streams/readable:834:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:81:21)","timestamp":"2025-06-06T12:45:05.253Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T12:45:06.304Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:45:06.304Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:45:06.304Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T12:56:52.112Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:56:52.113Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:56:52.113Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:56:52.114Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T12:56:52.114Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T13:16:39.932Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:16:39.934Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:16:39.934Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:16:39.935Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:16:39.935Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:16:39.935Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:16:39.935Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:16:39.936Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:16:39.936Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T13:31:16.692Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:31:16.694Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:31:16.694Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.400Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.401Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.402Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.402Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.402Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.403Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.403Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.403Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.403Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.404Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.404Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.404Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.404Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.404Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.405Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.405Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.405Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.405Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.405Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.406Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.406Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T13:42:42.406Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T13:50:53.704Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T13:51:09.094Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T13:51:27.610Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T14:01:22.788Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:01:22.789Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:01:22.790Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T14:06:56.099Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:06:56.100Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:06:56.100Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:06:56.101Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:06:56.101Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:06:56.101Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:06:56.101Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:06:56.101Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:06:56.101Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:06:56.101Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:06:56.102Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T14:07:15.119Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:07:15.121Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:07:15.121Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:07:19.958Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:08:21.808Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:08:21.809Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:08:21.809Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:08:26.609Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:09:28.466Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:09:28.467Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:09:28.467Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:09:33.273Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:10:35.153Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:10:35.153Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:10:35.153Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:10:39.949Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:11:41.799Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:11:41.799Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:11:41.799Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:11:46.592Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:12:48.429Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:12:48.429Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:12:48.430Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:12:53.264Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:13:36.092Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:13:55.112Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:13:55.112Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:13:59.940Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:14:42.744Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:15:01.762Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:15:01.763Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:15:06.603Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:16:08.430Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:16:08.430Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:16:08.431Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:16:13.273Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:17:15.167Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:17:15.168Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:17:15.168Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:17:19.959Z"}
{"level":"error","message":"IMAP connection error during check: This socket has been ended by the other party","timestamp":"2025-06-06T14:18:10.747Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:18:21.814Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:18:21.815Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:18:26.613Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:19:28.450Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:19:28.450Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:19:28.450Z"}
{"level":"error","message":"Uncaught Exception: Timed out while authenticating with server","source":"timeout-auth","stack":"Error: Timed out while authenticating with server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:139:17)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:19:28.451Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:19:33.290Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:20:16.070Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:20:35.440Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:20:35.440Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T14:20:39.962Z"}
{"action":"call","code":"CALL_EXCEPTION","data":null,"info":{"error":{"code":19,"message":"Unable to perform request"},"payload":{"id":2,"jsonrpc":"2.0","method":"eth_call","params":[{"data":"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b","to":"0x351f59de4fedbdf7601f5592b93db3b9330c1c1d"},"latest"]}},"invocation":null,"level":"error","message":"[getUserTokenBalances] Ошибка получения баланса для HB3A (0x351f59de4fedbdf7601f5592b93db3b9330c1c1d) в сети polygon: missing revert data (action=\"call\", data=null, reason=null, transaction={ \"data\": \"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b\", \"to\": \"0x351F59dE4FEdBDf7601F5592B93db3B9330c1C1d\" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.13.5)","reason":null,"revert":null,"shortMessage":"missing revert data","stack":"Error: missing revert data (action=\"call\", data=null, reason=null, transaction={ \"data\": \"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b\", \"to\": \"0x351F59dE4FEdBDf7601F5592B93db3B9330c1C1d\" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.13.5)\n at makeError (/app/node_modules/ethers/lib.commonjs/utils/errors.js:129:21)\n at getBuiltinCallException (/app/node_modules/ethers/lib.commonjs/abi/abi-coder.js:105:37)\n at AbiCoder.getBuiltinCallException (/app/node_modules/ethers/lib.commonjs/abi/abi-coder.js:206:16)\n at JsonRpcProvider.getRpcError (/app/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js:676:43)\n at /app/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js:302:45\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-06-06T14:23:08.115Z","transaction":{"data":"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b","to":"0x351F59dE4FEdBDf7601F5592B93db3B9330c1C1d"}}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T14:27:40.947Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:27:40.948Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:27:40.948Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:27:40.948Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T14:35:11.266Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:35:11.267Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:35:11.268Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:35:11.268Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:35:11.268Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T14:35:30.977Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:35:30.978Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T14:36:20.123Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T14:38:41.695Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:38:41.696Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T14:41:11.916Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:41:11.918Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:41:11.919Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T14:44:31.551Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:44:31.552Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:44:31.552Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:44:31.552Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:44:31.553Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:44:31.553Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:44:31.553Z"}
{"level":"error","message":"Uncaught Exception: Not authenticated","stack":"Error: Not authenticated\n at Connection.openBox (/app/node_modules/imap/lib/Connection.js:409:11)\n at Connection.<anonymous> (/app/services/emailBot.js:98:19)\n at Object.onceWrapper (node:events:638:28)\n at Connection.emit (node:events:536:35)\n at Connection.<anonymous> (/app/node_modules/imap/lib/Connection.js:1623:12)\n at Connection._resTagged (/app/node_modules/imap/lib/Connection.js:1535:22)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:194:10)\n at Parser.emit (node:events:524:28)\n at Parser._resTagged (/app/node_modules/imap/lib/Parser.js:175:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:139:16)","timestamp":"2025-06-06T14:44:47.469Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T14:44:50.481Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:44:50.482Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T14:44:50.482Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:23:15.652Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:23:15.653Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:23:39.981Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:26:11.153Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:30:51.514Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:30:51.515Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:30:51.516Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:30:51.516Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:30:51.517Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:32:14.254Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:32:14.255Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:32:14.255Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:32:14.256Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:34:00.879Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:34:11.511Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:40:04.118Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:41:25.890Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:41:25.892Z"}
{"action":"call","code":"CALL_EXCEPTION","data":null,"info":{"error":{"code":19,"message":"Unable to perform request"},"payload":{"id":2,"jsonrpc":"2.0","method":"eth_call","params":[{"data":"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b","to":"0x351f59de4fedbdf7601f5592b93db3b9330c1c1d"},"latest"]}},"invocation":null,"level":"error","message":"[getUserTokenBalances] Ошибка получения баланса для HB3A (0x351f59de4fedbdf7601f5592b93db3b9330c1c1d) в сети polygon: missing revert data (action=\"call\", data=null, reason=null, transaction={ \"data\": \"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b\", \"to\": \"0x351F59dE4FEdBDf7601F5592B93db3B9330c1C1d\" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.13.5)","reason":null,"revert":null,"shortMessage":"missing revert data","stack":"Error: missing revert data (action=\"call\", data=null, reason=null, transaction={ \"data\": \"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b\", \"to\": \"0x351F59dE4FEdBDf7601F5592B93db3B9330c1C1d\" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.13.5)\n at makeError (/app/node_modules/ethers/lib.commonjs/utils/errors.js:129:21)\n at getBuiltinCallException (/app/node_modules/ethers/lib.commonjs/abi/abi-coder.js:105:37)\n at AbiCoder.getBuiltinCallException (/app/node_modules/ethers/lib.commonjs/abi/abi-coder.js:206:16)\n at JsonRpcProvider.getRpcError (/app/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js:676:43)\n at /app/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js:302:45\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-06-06T15:41:52.193Z","transaction":{"data":"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b","to":"0x351F59dE4FEdBDf7601F5592B93db3B9330c1C1d"}}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:45:11.851Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:45:11.853Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:45:11.853Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:45:11.853Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:45:11.854Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:45:30.358Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:45:46.777Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:49:13.751Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:49:13.752Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:49:13.752Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:49:13.752Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:51:26.862Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:51:26.863Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:51:26.864Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:51:26.864Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:51:26.864Z"}
{"level":"error","message":"Uncaught Exception: Not authenticated","stack":"Error: Not authenticated\n at Connection.openBox (/app/node_modules/imap/lib/Connection.js:409:11)\n at Connection.<anonymous> (/app/services/emailBot.js:98:19)\n at Object.onceWrapper (node:events:638:28)\n at Connection.emit (node:events:536:35)\n at Connection.<anonymous> (/app/node_modules/imap/lib/Connection.js:1623:12)\n at Connection._resTagged (/app/node_modules/imap/lib/Connection.js:1535:22)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:194:10)\n at Parser.emit (node:events:524:28)\n at Parser._resTagged (/app/node_modules/imap/lib/Parser.js:175:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:139:16)","timestamp":"2025-06-06T15:51:37.905Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:51:42.065Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:51:42.066Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:51:42.066Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:52:49.203Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:52:49.203Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:52:49.204Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:53:55.751Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:53:55.752Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:53:55.752Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T15:59:32.392Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:59:32.393Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T15:59:32.393Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:01:45.624Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:01:45.625Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:01:45.625Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:01:45.626Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:01:45.626Z"}
{"level":"error","message":"Uncaught Exception: Not authenticated","stack":"Error: Not authenticated\n at Connection.openBox (/app/node_modules/imap/lib/Connection.js:409:11)\n at Connection.<anonymous> (/app/services/emailBot.js:98:19)\n at Object.onceWrapper (node:events:638:28)\n at Connection.emit (node:events:536:35)\n at Connection.<anonymous> (/app/node_modules/imap/lib/Connection.js:1623:12)\n at Connection._resTagged (/app/node_modules/imap/lib/Connection.js:1535:22)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:194:10)\n at Parser.emit (node:events:524:28)\n at Parser._resTagged (/app/node_modules/imap/lib/Parser.js:175:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:139:16)","timestamp":"2025-06-06T16:01:59.722Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: write after end","timestamp":"2025-06-06T16:03:06.527Z"}
{"level":"error","message":"IMAP connection error during check: write after end","timestamp":"2025-06-06T16:03:06.528Z"}
{"level":"error","message":"IMAP connection error during check: write after end","timestamp":"2025-06-06T16:03:06.528Z"}
{"level":"error","message":"IMAP connection error during check: write after end","timestamp":"2025-06-06T16:03:06.528Z"}
{"level":"error","message":"IMAP connection error during check: write after end","timestamp":"2025-06-06T16:03:06.528Z"}
{"level":"error","message":"IMAP connection error during check: write after end","timestamp":"2025-06-06T16:03:06.529Z"}
{"level":"error","message":"Uncaught Exception: Cannot set properties of undefined (setting 'name')","stack":"TypeError: Cannot set properties of undefined (setting 'name')\n at Connection.<anonymous> (/app/node_modules/imap/lib/Connection.js:431:22)\n at Connection._resTagged (/app/node_modules/imap/lib/Connection.js:1535:22)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:194:10)\n at Parser.emit (node:events:524:28)\n at Parser._resTagged (/app/node_modules/imap/lib/Parser.js:175:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:139:16)\n at Parser._tryread (/app/node_modules/imap/lib/Parser.js:82:15)\n at Parser._cbReadable (/app/node_modules/imap/lib/Parser.js:53:12)\n at TLSSocket.emit (node:events:524:28)\n at emitReadable_ (node:internal/streams/readable:834:12)","timestamp":"2025-06-06T16:04:16.901Z"}
{"level":"error","message":"Uncaught Exception: Cannot read properties of undefined (reading 'type')","stack":"TypeError: Cannot read properties of undefined (reading 'type')\n at Connection._resUntagged (/app/node_modules/imap/lib/Connection.js:1265:52)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:191:10)\n at Parser.emit (node:events:524:28)\n at Parser._resUntagged (/app/node_modules/imap/lib/Parser.js:271:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:137:16)\n at Parser._tryread (/app/node_modules/imap/lib/Parser.js:82:15)\n at Parser._cbReadable (/app/node_modules/imap/lib/Parser.js:53:12)\n at TLSSocket.emit (node:events:524:28)\n at emitReadable_ (node:internal/streams/readable:834:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:81:21)","timestamp":"2025-06-06T16:04:16.966Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:04:17.544Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:04:17.544Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:04:17.544Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:05:24.325Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:05:24.325Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:05:24.325Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:06:31.651Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:06:31.651Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:06:31.651Z"}
{"level":"error","message":"Uncaught Exception: Timed out while connecting to server","source":"timeout","stack":"Error: Timed out while connecting to server\n at Timeout._onTimeout (/app/node_modules/imap/lib/Connection.js:280:15)\n at listOnTimeout (node:internal/timers:581:17)\n at process.processTimers (node:internal/timers:519:7)","timestamp":"2025-06-06T16:06:35.520Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:07:37.475Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:07:37.476Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:07:37.477Z"}
{"level":"error","message":"Uncaught Exception: Cannot set properties of undefined (setting 'name')","stack":"TypeError: Cannot set properties of undefined (setting 'name')\n at Connection.<anonymous> (/app/node_modules/imap/lib/Connection.js:431:22)\n at Connection._resTagged (/app/node_modules/imap/lib/Connection.js:1535:22)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:194:10)\n at Parser.emit (node:events:524:28)\n at Parser._resTagged (/app/node_modules/imap/lib/Parser.js:175:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:139:16)\n at Parser._tryread (/app/node_modules/imap/lib/Parser.js:82:15)\n at Parser._cbReadable (/app/node_modules/imap/lib/Parser.js:53:12)\n at TLSSocket.emit (node:events:524:28)\n at emitReadable_ (node:internal/streams/readable:834:12)","timestamp":"2025-06-06T16:08:43.177Z"}
{"level":"error","message":"Uncaught Exception: Cannot read properties of undefined (reading 'type')","stack":"TypeError: Cannot read properties of undefined (reading 'type')\n at Connection._resUntagged (/app/node_modules/imap/lib/Connection.js:1265:52)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:191:10)\n at Parser.emit (node:events:524:28)\n at Parser._resUntagged (/app/node_modules/imap/lib/Parser.js:271:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:137:16)\n at Parser._tryread (/app/node_modules/imap/lib/Parser.js:82:15)\n at Parser._cbReadable (/app/node_modules/imap/lib/Parser.js:53:12)\n at TLSSocket.emit (node:events:524:28)\n at emitReadable_ (node:internal/streams/readable:834:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:81:21)","timestamp":"2025-06-06T16:08:43.255Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:08:43.800Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:08:43.801Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:08:43.801Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:09:50.434Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:09:50.435Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:09:50.435Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:10:56.888Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:10:56.889Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:10:56.889Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:11:44.588Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:12:51.215Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:12:51.215Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:12:51.215Z"}
{"level":"error","message":"Uncaught Exception: Cannot read properties of undefined (reading 'type')","stack":"TypeError: Cannot read properties of undefined (reading 'type')\n at Connection._resUntagged (/app/node_modules/imap/lib/Connection.js:1265:52)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:191:10)\n at Parser.emit (node:events:524:28)\n at Parser._resUntagged (/app/node_modules/imap/lib/Parser.js:271:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:137:16)\n at Parser._tryread (/app/node_modules/imap/lib/Parser.js:82:15)\n at Parser._cbReadable (/app/node_modules/imap/lib/Parser.js:53:12)\n at TLSSocket.emit (node:events:524:28)\n at emitReadable_ (node:internal/streams/readable:834:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:81:21)","timestamp":"2025-06-06T16:13:05.376Z"}
{"level":"error","message":"Uncaught Exception: Cannot set properties of undefined (setting 'name')","stack":"TypeError: Cannot set properties of undefined (setting 'name')\n at Connection.<anonymous> (/app/node_modules/imap/lib/Connection.js:431:22)\n at Connection._resTagged (/app/node_modules/imap/lib/Connection.js:1535:22)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:194:10)\n at Parser.emit (node:events:524:28)\n at Parser._resTagged (/app/node_modules/imap/lib/Parser.js:175:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:139:16)\n at Parser._tryread (/app/node_modules/imap/lib/Parser.js:82:15)\n at Parser._cbReadable (/app/node_modules/imap/lib/Parser.js:53:12)\n at TLSSocket.emit (node:events:524:28)\n at emitReadable_ (node:internal/streams/readable:834:12)","timestamp":"2025-06-06T16:14:16.058Z"}
{"level":"error","message":"Uncaught Exception: Cannot read properties of undefined (reading 'type')","stack":"TypeError: Cannot read properties of undefined (reading 'type')\n at Connection._resUntagged (/app/node_modules/imap/lib/Connection.js:1265:52)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:191:10)\n at Parser.emit (node:events:524:28)\n at Parser._resUntagged (/app/node_modules/imap/lib/Parser.js:271:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:137:16)\n at Parser._tryread (/app/node_modules/imap/lib/Parser.js:82:15)\n at Parser._cbReadable (/app/node_modules/imap/lib/Parser.js:53:12)\n at TLSSocket.emit (node:events:524:28)\n at emitReadable_ (node:internal/streams/readable:834:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:81:21)","timestamp":"2025-06-06T16:14:16.134Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:14:16.653Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:14:16.653Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:14:16.653Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:14:16.653Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:14:16.654Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:15:23.313Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:15:23.314Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:15:23.314Z"}
{"level":"error","message":"Uncaught Exception: Cannot set properties of undefined (setting 'name')","stack":"TypeError: Cannot set properties of undefined (setting 'name')\n at Connection.<anonymous> (/app/node_modules/imap/lib/Connection.js:431:22)\n at Connection._resTagged (/app/node_modules/imap/lib/Connection.js:1535:22)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:194:10)\n at Parser.emit (node:events:524:28)\n at Parser._resTagged (/app/node_modules/imap/lib/Parser.js:175:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:139:16)\n at Parser._tryread (/app/node_modules/imap/lib/Parser.js:82:15)\n at Parser._cbReadable (/app/node_modules/imap/lib/Parser.js:53:12)\n at TLSSocket.emit (node:events:524:28)\n at emitReadable_ (node:internal/streams/readable:834:12)","timestamp":"2025-06-06T16:16:29.015Z"}
{"level":"error","message":"Uncaught Exception: Cannot read properties of undefined (reading 'type')","stack":"TypeError: Cannot read properties of undefined (reading 'type')\n at Connection._resUntagged (/app/node_modules/imap/lib/Connection.js:1265:52)\n at Parser.<anonymous> (/app/node_modules/imap/lib/Connection.js:191:10)\n at Parser.emit (node:events:524:28)\n at Parser._resUntagged (/app/node_modules/imap/lib/Parser.js:271:10)\n at Parser._parse (/app/node_modules/imap/lib/Parser.js:137:16)\n at Parser._tryread (/app/node_modules/imap/lib/Parser.js:82:15)\n at Parser._cbReadable (/app/node_modules/imap/lib/Parser.js:53:12)\n at TLSSocket.emit (node:events:524:28)\n at emitReadable_ (node:internal/streams/readable:834:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:81:21)","timestamp":"2025-06-06T16:16:29.080Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:16:29.678Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:16:29.679Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:16:29.679Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:18:22.613Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:18:22.614Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:18:22.614Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:18:41.102Z"}
{"action":"call","code":"CALL_EXCEPTION","data":null,"info":{"error":{"code":19,"message":"Unable to perform request"},"payload":{"id":2,"jsonrpc":"2.0","method":"eth_call","params":[{"data":"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b","to":"0x351f59de4fedbdf7601f5592b93db3b9330c1c1d"},"latest"]}},"invocation":null,"level":"error","message":"[getUserTokenBalances] Ошибка получения баланса для HB3A (0x351f59de4fedbdf7601f5592b93db3b9330c1c1d) в сети polygon: missing revert data (action=\"call\", data=null, reason=null, transaction={ \"data\": \"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b\", \"to\": \"0x351F59dE4FEdBDf7601F5592B93db3B9330c1C1d\" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.13.5)","reason":null,"revert":null,"shortMessage":"missing revert data","stack":"Error: missing revert data (action=\"call\", data=null, reason=null, transaction={ \"data\": \"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b\", \"to\": \"0x351F59dE4FEdBDf7601F5592B93db3B9330c1C1d\" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.13.5)\n at makeError (/app/node_modules/ethers/lib.commonjs/utils/errors.js:129:21)\n at getBuiltinCallException (/app/node_modules/ethers/lib.commonjs/abi/abi-coder.js:105:37)\n at AbiCoder.getBuiltinCallException (/app/node_modules/ethers/lib.commonjs/abi/abi-coder.js:206:16)\n at JsonRpcProvider.getRpcError (/app/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js:676:43)\n at /app/node_modules/ethers/lib.commonjs/providers/provider-jsonrpc.js:302:45\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-06-06T16:23:47.035Z","transaction":{"data":"0x70a08231000000000000000000000000f45aa4917b3775ba37f48aeb3dc1a943561e9e0b","to":"0x351F59dE4FEdBDf7601F5592B93db3B9330c1C1d"}}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.962Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.962Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.962Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.963Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.963Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.963Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.963Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.963Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.963Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.964Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.964Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:24:32.964Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:25:01.722Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.820Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.820Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.821Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.821Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.821Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.821Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.822Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.822Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.822Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.822Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.822Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:31:40.823Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:32:47.267Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:32:47.268Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.370Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.370Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.371Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.371Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.371Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.372Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.372Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.372Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.372Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.372Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.372Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:26.373Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:39:51.521Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:41:16.923Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:41:16.924Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:41:16.924Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:42:23.404Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:42:23.405Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:42:23.405Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:44:30.897Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:44:30.898Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:44:53.409Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:44:53.409Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:48:31.770Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:48:31.770Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:48:31.770Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:48:31.771Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:48:31.771Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:48:31.771Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:48:31.771Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:48:31.772Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:48:31.772Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:48:31.772Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:48:31.772Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:51:24.141Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:51:24.142Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:51:24.143Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:51:43.476Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:52:02.438Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:52:02.441Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-06T16:53:08.864Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:53:08.865Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-06T16:53:08.865Z"}
{"level":"error","message":"Директория /home/alex/DApp-for-Business/backend/temp недоступна для записи: EACCES: permission denied, open '/home/alex/DApp-for-Business/backend/temp/.write-test'","timestamp":"2025-06-18T19:10:58.515Z"}
{"address":"::","code":"EADDRINUSE","errno":-98,"level":"error","message":"Uncaught Exception: listen EADDRINUSE: address already in use :::8000","port":8000,"stack":"Error: listen EADDRINUSE: address already in use :::8000\n at Server.setupListenHandle [as _listen2] (node:net:1908:16)\n at listenInCluster (node:net:1965:12)\n at Server.listen (node:net:2067:7)\n at Object.<anonymous> (/home/alex/DApp-for-Business/backend/server.js:47:8)\n at Module._compile (node:internal/modules/cjs/loader:1469:14)\n at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)\n at Module.load (node:internal/modules/cjs/loader:1288:32)\n at Module._load (node:internal/modules/cjs/loader:1104:12)\n at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:173:12)\n at node:internal/main/run_main_module:28:49","syscall":"listen","timestamp":"2025-06-18T19:10:59.390Z"}
{"code":"EAI_AGAIN","errno":-3001,"hostname":"postgres","level":"error","message":"Unhandled Rejection: getaddrinfo EAI_AGAIN postgres","stack":"Error: getaddrinfo EAI_AGAIN postgres\n at /home/alex/DApp-for-Business/backend/node_modules/pg-pool/index.js:45:11\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async reinitPoolFromDbSettings (/home/alex/DApp-for-Business/backend/db.js:50:17)","syscall":"getaddrinfo","timestamp":"2025-06-18T19:11:11.251Z"}
{"level":"error","message":"Директория /home/alex/DApp-for-Business/backend/temp недоступна для записи: EACCES: permission denied, open '/home/alex/DApp-for-Business/backend/temp/.write-test'","timestamp":"2025-06-18T19:14:27.087Z"}
{"address":"::","code":"EADDRINUSE","errno":-98,"level":"error","message":"Uncaught Exception: listen EADDRINUSE: address already in use :::8000","port":8000,"stack":"Error: listen EADDRINUSE: address already in use :::8000\n at Server.setupListenHandle [as _listen2] (node:net:1908:16)\n at listenInCluster (node:net:1965:12)\n at Server.listen (node:net:2067:7)\n at Object.<anonymous> (/home/alex/DApp-for-Business/backend/server.js:47:8)\n at Module._compile (node:internal/modules/cjs/loader:1469:14)\n at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)\n at Module.load (node:internal/modules/cjs/loader:1288:32)\n at Module._load (node:internal/modules/cjs/loader:1104:12)\n at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:173:12)\n at node:internal/main/run_main_module:28:49","syscall":"listen","timestamp":"2025-06-18T19:14:27.414Z"}
{"code":"EAI_AGAIN","errno":-3001,"hostname":"postgres","level":"error","message":"Unhandled Rejection: getaddrinfo EAI_AGAIN postgres","stack":"Error: getaddrinfo EAI_AGAIN postgres\n at /home/alex/DApp-for-Business/backend/node_modules/pg-pool/index.js:45:11\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async reinitPoolFromDbSettings (/home/alex/DApp-for-Business/backend/db.js:50:17)","syscall":"getaddrinfo","timestamp":"2025-06-18T19:14:40.959Z"}
{"level":"error","message":"Директория /home/alex/DApp-for-Business/backend/temp недоступна для записи: EACCES: permission denied, open '/home/alex/DApp-for-Business/backend/temp/.write-test'","timestamp":"2025-06-18T19:16:21.596Z"}
{"code":"EAI_AGAIN","errno":-3001,"hostname":"postgres","level":"error","message":"Unhandled Rejection: getaddrinfo EAI_AGAIN postgres","stack":"Error: getaddrinfo EAI_AGAIN postgres\n at /home/alex/DApp-for-Business/backend/node_modules/pg-pool/index.js:45:11\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async reinitPoolFromDbSettings (/home/alex/DApp-for-Business/backend/db.js:50:17)","syscall":"getaddrinfo","timestamp":"2025-06-18T19:16:35.178Z"}
{"ip":"::1","level":"error","message":"Error: getaddrinfo EAI_AGAIN postgres","method":"GET","stack":"Error: getaddrinfo EAI_AGAIN postgres\n at /home/alex/DApp-for-Business/backend/node_modules/pg-pool/index.js:45:11\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async PGStore._asyncQuery (/home/alex/DApp-for-Business/backend/node_modules/connect-pg-simple/index.js:322:21)","timestamp":"2025-06-18T19:16:44.984Z","url":"/api/auth/identities"}
{"ip":"::1","level":"error","message":"Error: getaddrinfo EAI_AGAIN postgres","method":"GET","stack":"Error: getaddrinfo EAI_AGAIN postgres\n at /home/alex/DApp-for-Business/backend/node_modules/pg-pool/index.js:45:11\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async PGStore._asyncQuery (/home/alex/DApp-for-Business/backend/node_modules/connect-pg-simple/index.js:322:21)","timestamp":"2025-06-18T19:17:33.983Z","url":"/api/auth/identities"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-18T19:24:31.727Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:24:31.728Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-18T19:24:47.815Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:24:47.817Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-18T19:25:01.594Z"}
{"code":"23505","constraint":"user_identities_provider_provider_id_key","detail":"Key (provider, provider_id)=(email, avtarabanov@gmail.com) already exists.","file":"nbtinsert.c","length":296,"level":"error","line":"666","message":"[IdentityService] Error saving identity email:avtarabanov@gmail.com for user 99: duplicate key value violates unique constraint \"user_identities_provider_provider_id_key\"","name":"error","routine":"_bt_check_unique","schema":"public","severity":"ERROR","stack":"error: duplicate key value violates unique constraint \"user_identities_provider_provider_id_key\"\n at /app/node_modules/pg-pool/index.js:45:11\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async IdentityService.saveIdentity (/app/services/identity-service.js:124:9)\n at async IdentityService.findOrCreateUserWithRole (/app/services/identity-service.js:544:7)\n at async /app/services/emailBot.js:140:48","table":"user_identities","timestamp":"2025-06-18T19:25:16.580Z"}
{"code":"23503","constraint":"messages_user_id_fkey","detail":"Key (user_id)=(99) is not present in table \"users\".","file":"ri_triggers.c","length":255,"level":"error","line":"2608","message":"Error processing incoming email: insert or update on table \"messages\" violates foreign key constraint \"messages_user_id_fkey\"","name":"error","routine":"ri_ReportViolation","schema":"public","severity":"ERROR","stack":"error: insert or update on table \"messages\" violates foreign key constraint \"messages_user_id_fkey\"\n at /app/node_modules/pg-pool/index.js:45:11\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async /app/services/emailBot.js:167:23","table":"messages","timestamp":"2025-06-18T19:27:06.840Z"}
{"code":"EPROTOCOL","command":"CONN","level":"error","message":"Error sending email: Invalid greeting. response=421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26: 421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26","response":"421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26","responseCode":421,"stack":"Error: Invalid greeting. response=421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26: 421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26\n at SMTPConnection._actionGreeting (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1251:27)\n at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:993:20)\n at SMTPConnection._onData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:774:14)\n at SMTPConnection._onSocketData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:195:44)\n at TLSSocket.emit (node:events:524:28)\n at addChunk (node:internal/streams/readable:561:12)\n at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n at Readable.push (node:internal/streams/readable:392:5)\n at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23)","timestamp":"2025-06-18T19:27:25.131Z"}
{"code":"EPROTOCOL","command":"CONN","level":"error","message":"Error processing incoming email: Invalid greeting. response=421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26: 421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26","response":"421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26","responseCode":421,"stack":"Error: Invalid greeting. response=421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26: 421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26\n at SMTPConnection._actionGreeting (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1251:27)\n at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:993:20)\n at SMTPConnection._onData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:774:14)\n at SMTPConnection._onSocketData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:195:44)\n at TLSSocket.emit (node:events:524:28)\n at addChunk (node:internal/streams/readable:561:12)\n at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n at Readable.push (node:internal/streams/readable:392:5)\n at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23)","timestamp":"2025-06-18T19:27:25.132Z"}
{"code":"EPROTOCOL","command":"CONN","level":"error","message":"Error sending email: Invalid greeting. response=421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26: 421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26","response":"421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26","responseCode":421,"stack":"Error: Invalid greeting. response=421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26: 421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26\n at SMTPConnection._actionGreeting (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1251:27)\n at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:993:20)\n at SMTPConnection._onData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:774:14)\n at SMTPConnection._onSocketData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:195:44)\n at TLSSocket.emit (node:events:524:28)\n at addChunk (node:internal/streams/readable:561:12)\n at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n at Readable.push (node:internal/streams/readable:392:5)\n at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23)","timestamp":"2025-06-18T19:27:25.590Z"}
{"code":"EPROTOCOL","command":"CONN","level":"error","message":"Error processing incoming email: Invalid greeting. response=421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26: 421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26","response":"421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26","responseCode":421,"stack":"Error: Invalid greeting. response=421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26: 421 4.7.0 smtp.hostland.ru Error: too many connections from 78.31.221.26\n at SMTPConnection._actionGreeting (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1251:27)\n at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:993:20)\n at SMTPConnection._onData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:774:14)\n at SMTPConnection._onSocketData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:195:44)\n at TLSSocket.emit (node:events:524:28)\n at addChunk (node:internal/streams/readable:561:12)\n at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n at Readable.push (node:internal/streams/readable:392:5)\n at TLSWrap.onStreamRead (node:internal/stream_base_commons:191:23)","timestamp":"2025-06-18T19:27:25.592Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-18T19:27:31.660Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:27:31.662Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:27:31.663Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:27:31.663Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:27:31.664Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:27:31.665Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:27:31.667Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-18T19:29:30.006Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-18T19:29:43.775Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-18T19:30:57.052Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:30:57.053Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:30:57.053Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:32:46.073Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-18T19:32:46.073Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-19T12:16:04.066Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:16:04.066Z"}
{"level":"error","message":"[EmailBot] IMAP connection error: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.096Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.097Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.097Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.097Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.098Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.098Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.098Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.099Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.099Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.100Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.100Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.100Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.101Z"}
{"level":"error","message":"IMAP connection error during check: Timed out while authenticating with server","timestamp":"2025-06-19T12:21:53.101Z"}

View File

@@ -5,15 +5,23 @@ const db = require('../db');
// GET /api/messages?userId=123
router.get('/', async (req, res) => {
const userId = req.query.userId;
if (!userId) return res.status(400).json({ error: 'userId required' });
try {
const result = await db.getQuery()(
`SELECT id, user_id, sender_type, content, channel, role, direction, created_at, attachment_filename, attachment_mimetype, attachment_size, attachment_data, metadata
FROM messages
WHERE user_id = $1
ORDER BY created_at ASC`,
[userId]
);
let result;
if (userId) {
result = await db.getQuery()(
`SELECT id, user_id, sender_type, content, channel, role, direction, created_at, attachment_filename, attachment_mimetype, attachment_size, attachment_data, metadata
FROM messages
WHERE user_id = $1
ORDER BY created_at ASC`,
[userId]
);
} else {
result = await db.getQuery()(
`SELECT id, user_id, sender_type, content, channel, role, direction, created_at, attachment_filename, attachment_mimetype, attachment_size, attachment_data, metadata
FROM messages
ORDER BY created_at ASC`
);
}
res.json(result.rows);
} catch (e) {
res.status(500).json({ error: 'DB error', details: e.message });

View File

@@ -3,6 +3,8 @@ const { app, nonceStore } = require('./app');
const http = require('http');
const { initWSS } = require('./wsHub');
const logger = require('./utils/logger');
const { getBot } = require('./services/telegramBot');
const EmailBotService = require('./services/emailBot');
const PORT = process.env.PORT || 8000;
@@ -14,9 +16,26 @@ console.log('Используемый порт:', process.env.PORT || 8000);
async function initServices() {
try {
console.log('Инициализация сервисов...');
// Здесь может быть инициализация ботов, email-сервисов и т.д.
// ...
console.log('Все сервисы успешно инициализированы');
console.log('[initServices] Запуск Email-бота...');
console.log('[initServices] Создаю экземпляр EmailBotService...');
let emailBot;
try {
emailBot = new EmailBotService();
console.log('[initServices] Экземпляр EmailBotService создан');
} catch (err) {
console.error('[initServices] Ошибка при создании экземпляра EmailBotService:', err);
throw err;
}
console.log('[initServices] Перед вызовом emailBot.start()');
try {
await emailBot.start();
console.log('[initServices] Email-бот успешно запущен');
} catch (err) {
console.error('[initServices] Ошибка при запуске emailBot:', err);
}
console.log('[initServices] Запуск Telegram-бота...');
await getBot();
console.log('[initServices] Telegram-бот успешно запущен');
} catch (error) {
console.error('Ошибка при инициализации сервисов:', error);
}

View File

@@ -1,3 +1,5 @@
console.log('[ai-assistant] loaded');
const { ChatOllama } = require('@langchain/ollama');
const { HNSWLib } = require('@langchain/community/vectorstores/hnswlib');
const { OpenAIEmbeddings } = require('@langchain/openai');

View File

@@ -1,7 +1,6 @@
const db = require('../db');
const OpenAI = require('openai');
const Anthropic = require('@anthropic-ai/sdk');
const { GoogleGenAI } = require('@google/genai');
const TABLE = 'ai_providers_settings';
@@ -48,6 +47,7 @@ async function getProviderModels(provider, { api_key, base_url } = {}) {
return res.data ? res.data.map(m => ({ id: m.id, ...m })) : [];
}
if (provider === 'google') {
const { GoogleGenAI } = await import('@google/genai');
const ai = new GoogleGenAI({ apiKey: api_key, baseUrl: base_url });
const pager = await ai.models.list();
const models = [];
@@ -79,6 +79,7 @@ async function verifyProviderKey(provider, { api_key, base_url } = {}) {
return { success: true };
}
if (provider === 'google') {
const { GoogleGenAI } = await import('@google/genai');
const ai = new GoogleGenAI({ apiKey: api_key, baseUrl: base_url });
const pager = await ai.models.list();
for await (const _ of pager) {

View File

@@ -1,3 +1,4 @@
console.log('[EmailBot] emailBot.js loaded');
const db = require('../db');
const nodemailer = require('nodemailer');
const Imap = require('imap');
@@ -9,6 +10,10 @@ const identityService = require('./identity-service');
const aiAssistant = require('./ai-assistant');
class EmailBotService {
constructor() {
console.log('[EmailBot] constructor called');
}
async getSettingsFromDb() {
const { rows } = await db.getQuery()('SELECT * FROM email_settings ORDER BY id LIMIT 1');
if (!rows.length) throw new Error('Email settings not found in DB');
@@ -46,6 +51,7 @@ class EmailBotService {
idleInterval: 300000,
forceNoop: true,
},
connTimeout: 30000, // 30 секунд
};
}
@@ -228,55 +234,63 @@ class EmailBotService {
}
async start() {
logger.info('[EmailBot] start() called');
const imapConfig = await this.getImapConfig();
// Логируем IMAP-конфиг (без пароля)
const safeConfig = { ...imapConfig };
if (safeConfig.password) safeConfig.password = '***';
logger.info('[EmailBot] IMAP config:', safeConfig);
let attempt = 0;
const maxAttempts = 3;
this.isChecking = false;
const tryConnect = () => {
attempt++;
logger.info(`[EmailBot] IMAP connect attempt ${attempt}`);
this.imap = new Imap(imapConfig);
this.imap.once('ready', () => {
logger.info('[EmailBot] IMAP connection ready');
this.imap.openBox('INBOX', false, (err, box) => {
if (err) {
logger.error(`[EmailBot] Error opening INBOX: ${err.message}`);
this.imap.end();
return;
}
logger.info('[EmailBot] INBOX opened successfully');
try {
console.log('[EmailBot] start() called');
logger.info('[EmailBot] start() called');
const imapConfig = await this.getImapConfig();
// Логируем IMAP-конфиг (без пароля)
const safeConfig = { ...imapConfig };
if (safeConfig.password) safeConfig.password = '***';
logger.info('[EmailBot] IMAP config:', safeConfig);
let attempt = 0;
const maxAttempts = 3;
this.isChecking = false;
const tryConnect = () => {
attempt++;
logger.info(`[EmailBot] IMAP connect attempt ${attempt}`);
this.imap = new Imap(imapConfig);
this.imap.once('ready', () => {
logger.info('[EmailBot] IMAP connection ready');
this.imap.openBox('INBOX', false, (err, box) => {
if (err) {
logger.error(`[EmailBot] Error opening INBOX: ${err.message}`);
this.imap.end();
return;
}
logger.info('[EmailBot] INBOX opened successfully');
});
// После успешного подключения — обычная логика
this.checkEmails();
logger.info('[EmailBot] Email bot started and IMAP connection initiated');
// Периодическая проверка почты
setInterval(async () => {
if (this.isChecking) return;
this.isChecking = true;
try {
await this.checkEmails();
} catch (e) {
logger.error('[EmailBot] Error in periodic checkEmails:', e);
}
this.isChecking = false;
}, 60000); // 60 секунд
});
// После успешного подключения — обычная логика
this.checkEmails();
logger.info('[EmailBot] Email bot started and IMAP connection initiated');
// Периодическая проверка почты
setInterval(async () => {
if (this.isChecking) return;
this.isChecking = true;
try {
await this.checkEmails();
} catch (e) {
logger.error('[EmailBot] Error in periodic checkEmails:', e);
this.imap.once('error', (err) => {
logger.error(`[EmailBot] IMAP connection error: ${err.message}`);
if (err.message && err.message.toLowerCase().includes('timed out') && attempt < maxAttempts) {
logger.warn(`[EmailBot] IMAP reconnecting in 10 seconds (attempt ${attempt + 1})...`);
setTimeout(tryConnect, 10000);
}
this.isChecking = false;
}, 60000); // 60 секунд
});
this.imap.once('error', (err) => {
logger.error(`[EmailBot] IMAP connection error: ${err.message}`);
if (err.message && err.message.toLowerCase().includes('timed out') && attempt < maxAttempts) {
logger.warn(`[EmailBot] IMAP reconnecting in 10 seconds (attempt ${attempt + 1})...`);
setTimeout(tryConnect, 10000);
}
});
this.imap.connect();
};
tryConnect();
});
this.imap.connect();
};
tryConnect();
} catch (err) {
console.error('[EmailBot] Ошибка при старте:', err);
logger.error('[EmailBot] Ошибка при старте:', err);
throw err;
}
}
}
console.log('[EmailBot] module.exports = EmailBotService');
module.exports = EmailBotService;

View File

@@ -1,7 +1,10 @@
console.log('[identity-service] loaded');
const db = require('../db');
const logger = require('../utils/logger');
const { getLinkedWallet } = require('./wallet-service');
const { checkAdminRole } = require('./admin-role');
const { broadcastContactsUpdate } = require('../wsHub');
/**
* Сервис для работы с идентификаторами пользователей
@@ -541,6 +544,7 @@ class IdentityService {
await this.saveIdentity(userId, provider, providerId, true);
user = { id: userId, role: 'user' };
isNew = true;
broadcastContactsUpdate();
}
// Проверяем связь с кошельком
const wallet = await getLinkedWallet(user.id);

View File

@@ -332,8 +332,9 @@ async function getBot() {
}
});
// Запускаем бота
// Запуск бота
await botInstance.launch();
logger.info('[TelegramBot] Бот запущен');
}
return botInstance;

View File

@@ -53,8 +53,8 @@ function showDetails(contact) {
border-radius: 16px;
box-shadow: 0 4px 32px rgba(0,0,0,0.12);
padding: 32px 24px 24px 24px;
max-width: 950px;
margin: 40px auto;
width: 100%;
margin-top: 40px;
position: relative;
overflow-x: auto;
}
@@ -65,6 +65,9 @@ function showDetails(contact) {
margin-bottom: 24px;
}
.close-btn {
position: absolute;
top: 18px;
right: 18px;
background: none;
border: none;
font-size: 2rem;

View File

@@ -357,8 +357,8 @@ function uninstallModule(module) {
border-radius: 16px;
box-shadow: 0 4px 32px rgba(0,0,0,0.12);
padding: 32px 24px 24px 24px;
max-width: 950px;
margin: 40px auto;
width: 100%;
margin-top: 40px;
position: relative;
overflow-x: auto;
}

View File

@@ -0,0 +1,47 @@
<template>
<div class="messages-table-modal">
<div class="messages-table-header">
<h2>Новые сообщения</h2>
</div>
<div v-if="!messages.length" class="empty">Нет новых сообщений</div>
<div v-else class="messages-list">
<Message v-for="msg in messages" :key="msg.id" :message="msg" />
</div>
</div>
</template>
<script setup>
import { defineProps } from 'vue';
import Message from './Message.vue';
const props = defineProps({
messages: { type: Array, required: true }
});
</script>
<style scoped>
.messages-table-modal {
background: #fff;
border-radius: 16px;
box-shadow: 0 4px 32px rgba(0,0,0,0.12);
padding: 32px 24px 24px 24px;
width: 100%;
margin-top: 40px;
position: relative;
overflow-x: auto;
}
.messages-table-header {
display: flex;
align-items: center;
margin-bottom: 24px;
}
.empty {
color: #888;
text-align: center;
margin: 20px 0;
}
.messages-list {
display: flex;
flex-direction: column;
gap: 18px;
}
</style>

View File

@@ -402,15 +402,15 @@ h3 {
/* Медиа-запросы для адаптивности */
@media screen and (min-width: 1200px) {
.wallet-sidebar {
width: 30%;
max-width: 350px;
width: 420px;
max-width: 420px;
}
}
@media screen and (min-width: 769px) and (max-width: 1199px) {
.wallet-sidebar {
width: 40%;
max-width: 320px;
width: 350px;
max-width: 350px;
}
}

View File

@@ -0,0 +1,285 @@
<template>
<div class="tags-table-wrapper">
<div class="tableview-header-row">
<button class="nav-btn" @click="goToTables">Таблицы</button>
<button class="nav-btn" @click="goToCreate">Создать таблицу</button>
<button class="close-btn" @click="closeTable">Закрыть</button>
<button class="action-btn" disabled>Редактировать</button>
<button class="danger-btn" disabled>Удалить</button>
</div>
<div class="tags-header-row">
<h3>Теги</h3>
</div>
<table class="tags-table">
<thead>
<tr>
<th>Название</th>
<th>Описание</th>
<th style="width:110px;">Действия</th>
</tr>
</thead>
<tbody>
<tr v-for="tag in tags" :key="tag.id">
<td v-if="editId !== tag.id">{{ tag.name }}</td>
<td v-else><input v-model="editName" class="edit-input" /></td>
<td v-if="editId !== tag.id">{{ tag.description || '' }}</td>
<td v-else><input v-model="editDescription" class="edit-input" /></td>
<td>
<template v-if="editId === tag.id">
<button class="save-btn" @click="saveEdit(tag)">Сохранить</button>
<button class="cancel-btn" @click="cancelEdit">Отмена</button>
</template>
<template v-else>
<button class="edit-btn" @click="startEdit(tag)" title="Редактировать"></button>
<button class="delete-btn" @click="deleteTag(tag)" title="Удалить">🗑</button>
</template>
</td>
</tr>
<tr v-if="tags.length === 0">
<td colspan="3" style="text-align:center; color:#888;">Нет тегов</td>
</tr>
<tr>
<td></td>
<td></td>
<td style="text-align:center;">
<button class="edit-btn" @click="showAddTagModal = true" title="Добавить тег"></button>
</td>
</tr>
</tbody>
</table>
<div v-if="showAddTagModal" class="modal-backdrop">
<div class="modal">
<h4>Добавить тег</h4>
<input v-model="newTagName" class="edit-input" placeholder="Название" />
<input v-model="newTagDescription" class="edit-input" placeholder="Описание" style="margin-top:0.7em;" />
<div class="modal-actions">
<button class="save-btn" @click="createTag">Создать</button>
<button class="cancel-btn" @click="showAddTagModal = false">Отмена</button>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router';
const tags = ref([]);
const editId = ref(null);
const editName = ref('');
const editDescription = ref('');
const router = useRouter();
const showAddTagModal = ref(false);
const newTagName = ref('');
const newTagDescription = ref('');
function goToTables() {
router.push({ name: 'tables-list' });
}
function goToCreate() {
router.push({ name: 'create-table' });
}
function closeTable() {
if (window.history.length > 1) {
router.back();
} else {
router.push({ name: 'home' });
}
}
async function loadTags() {
const res = await fetch('/api/tags');
tags.value = await res.json();
}
function startEdit(tag) {
editId.value = tag.id;
editName.value = tag.name;
editDescription.value = tag.description || '';
}
function cancelEdit() {
editId.value = null;
editName.value = '';
editDescription.value = '';
}
async function saveEdit(tag) {
await fetch(`/api/tags/${tag.id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: editName.value, description: editDescription.value })
});
await loadTags();
cancelEdit();
}
async function deleteTag(tag) {
if (!confirm(`Удалить тег "${tag.name}"?`)) return;
await fetch(`/api/tags/${tag.id}`, { method: 'DELETE' });
await loadTags();
}
async function createTag() {
if (!newTagName.value.trim()) return;
await fetch('/api/tags', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: newTagName.value, description: newTagDescription.value })
});
newTagName.value = '';
newTagDescription.value = '';
showAddTagModal.value = false;
await loadTags();
}
onMounted(loadTags);
</script>
<style scoped>
.tableview-header-row {
display: flex;
justify-content: flex-end;
align-items: center;
margin: 1.2em 0 0.5em 0;
}
.tags-header-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1em;
}
.add-plus-btn, .edit-btn {
background: none;
border: none;
cursor: pointer;
font-size: 1.1em;
margin-right: 0.5em;
color: #2ecc40;
transition: color 0.2s;
}
.add-plus-btn:hover, .edit-btn:hover, .save-btn:hover {
color: #138496;
}
.close-btn {
background: #ff4d4f;
color: #fff;
border: none;
border-radius: 8px;
padding: 0.5em 1.2em;
font-weight: 600;
cursor: pointer;
font-size: 1em;
transition: background 0.2s;
}
.close-btn:hover {
background: #d9363e;
}
.action-btn {
background: #2ecc40;
color: #fff;
border: none;
border-radius: 8px;
padding: 0.5em 1.2em;
font-weight: 600;
cursor: pointer;
font-size: 1em;
margin-left: 0.7em;
transition: background 0.2s;
}
.action-btn:hover {
background: #27ae38;
}
.danger-btn {
background: #ff4d4f;
color: #fff;
border: none;
border-radius: 8px;
padding: 0.5em 1.2em;
font-weight: 600;
cursor: pointer;
font-size: 1em;
margin-left: 0.7em;
transition: background 0.2s;
}
.danger-btn:hover {
background: #d9363e;
}
.nav-btn {
background: #eaeaea;
color: #333;
border: none;
border-radius: 8px;
padding: 0.5em 1.2em;
font-weight: 500;
cursor: pointer;
font-size: 1em;
transition: background 0.2s;
margin-right: 0.7em;
}
.nav-btn:hover {
background: #d5d5d5;
}
.tags-table-wrapper {
margin: 2em 0;
background: #fff;
border-radius: 10px;
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
padding: 1.5em 1em;
}
.tags-table {
width: 100%;
border-collapse: collapse;
}
.tags-table th, .tags-table td {
border: 1px solid #ececec;
padding: 0.6em 1em;
font-size: 1.05em;
}
.tags-table th {
background: #f7f7f7;
font-weight: 600;
}
.delete-btn {
color: #dc3545;
}
.cancel-btn {
color: #888;
}
.edit-input {
border: 1px solid #ccc;
border-radius: 6px;
padding: 4px 10px;
font-size: 1em;
min-width: 120px;
}
/* Модалка */
.modal-backdrop {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.18);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.modal {
background: #fff;
border-radius: 12px;
padding: 2em 1.5em;
box-shadow: 0 2px 16px rgba(0,0,0,0.13);
min-width: 260px;
display: flex;
flex-direction: column;
gap: 0.7em;
}
.modal-actions {
display: flex;
gap: 1em;
margin-top: 1em;
justify-content: flex-end;
}
</style>

View File

@@ -1,63 +1,33 @@
<template>
<div class="tables-container">
<header class="tables-header">
<!-- <h2>Пользовательские таблицы</h2> -->
<button class="create-btn" @click="createTable">Создать таблицу</button>
</header>
<div class="tables-list">
<div
v-for="table in tables"
:key="table.id"
class="table-card"
:class="{ selected: table.id === props.selectedTableId }"
@click="selectTable(table)"
>
<div class="table-info">
<div class="table-title">{{ table.name }}</div>
<div class="table-desc">{{ table.description }}</div>
</div>
<div class="table-actions">
<button @click.stop="renameTable(table)">Переименовать</button>
<button class="danger" @click.stop="confirmDelete(table)">Удалить</button>
</div>
</div>
<div v-if="!tables.length" class="empty-state">
<ul class="tables-list-simple">
<!-- Системная таблица tags -->
<li>
<button class="table-link" @click="goToTagsTable">Теги (tags)</button>
</li>
<!-- Пользовательские таблицы -->
<li v-for="table in tables" :key="table.id">
<button class="table-link" @click="selectTable(table)">{{ table.name }}</button>
</li>
<li v-if="!tables.length" class="empty-state">
<span>Нет таблиц. Создайте первую!</span>
</div>
</div>
<div v-if="showDeleteModal" class="modal-backdrop">
<div class="modal">
<p>Удалить таблицу <b>{{ selectedTable?.name }}</b>?</p>
<div class="modal-actions">
<button class="danger" @click="deleteTable(selectedTable)">Удалить</button>
<button @click="showDeleteModal = false">Отмена</button>
</div>
</div>
</div>
<UserTableView
v-if="props.selectedTableId"
:table-id="props.selectedTableId"
@close="emit('update:selected-table-id', null)"
/>
</li>
</ul>
</div>
</template>
<script setup>
import { ref, onMounted, watch, nextTick } from 'vue';
import { useRouter } from 'vue-router';
import UserTableView from './UserTableView.vue';
import { ref, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import tablesService from '../../services/tablesService';
const props = defineProps({
selectedTableId: Number
});
const emit = defineEmits(['update:selected-table-id']);
const router = useRouter();
const route = useRoute();
const tables = ref([]);
const showDeleteModal = ref(false);
const selectedTable = ref(null);
async function fetchTables() {
tables.value = await tablesService.getTables();
@@ -70,38 +40,25 @@ function selectTable(table) {
function createTable() {
router.push({ name: 'create-table' });
}
function renameTable(table) {
const name = prompt('Новое имя', table.name);
if (name && name !== table.name) {
tablesService.updateTable(table.id, { name }).then(fetchTables);
}
}
function confirmDelete(table) {
selectedTable.value = table;
showDeleteModal.value = true;
}
function deleteTable(table) {
tablesService.deleteTable(table.id).then(() => {
showDeleteModal.value = false;
fetchTables();
if (props.selectedTableId === table.id) emit('update:selected-table-id', null);
});
function goToTagsTable() {
router.push({ name: 'tags-table-view' });
}
</script>
<style scoped>
.tables-container {
max-width: 600px;
margin: 2rem auto;
background: #fff;
border-radius: 18px;
box-shadow: 0 2px 16px rgba(0,0,0,0.07);
padding: 2rem 1.5rem;
/* max-width: 600px; */
/* margin: 2rem auto; */
margin-top: 2rem;
margin-left: 0;
padding: 2rem 1.5rem 2rem 1.5rem;
/* background: #fff; */
/* border-radius: 18px; */
/* box-shadow: 0 2px 16px rgba(0,0,0,0.07); */
}
.tables-header {
display: flex;
justify-content: space-between;
justify-content: flex-end;
align-items: center;
margin-bottom: 1.5rem;
}
@@ -118,62 +75,37 @@ function deleteTable(table) {
.create-btn:hover {
background: #27ae38;
}
.tables-list {
display: flex;
flex-direction: column;
gap: 1rem;
.tables-list-simple {
list-style: none;
padding: 0;
margin: 0;
}
.table-card {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: flex-start;
background: #f8f9fa;
border-radius: 10px;
padding: 1rem;
box-shadow: 0 1px 4px rgba(0,0,0,0.03);
cursor: pointer;
border: 2px solid transparent;
transition: border 0.2s;
.tables-list-simple li {
margin-bottom: 0.5em;
border-bottom: 1px solid #f0f0f0;
padding-bottom: 0.5em;
}
.table-card.selected {
border: 2px solid #2ecc40;
.tables-list-simple li:last-child {
border-bottom: none;
}
.table-info {
flex: 1 1 200px;
}
.table-title {
font-weight: 600;
font-size: 1.1em;
}
.table-desc {
color: #888;
font-size: 0.95em;
margin-top: 0.2em;
}
.table-actions {
display: flex;
gap: 0.5em;
margin-top: 0.5em;
}
.table-actions button {
background: #eaeaea;
.table-link {
background: none;
border: none;
border-radius: 6px;
padding: 0.4em 1em;
color: #2ecc40;
font-size: 1.1em;
font-weight: 600;
cursor: pointer;
font-weight: 500;
transition: background 0.2s;
text-align: left;
padding: 0.2em 0;
transition: color 0.2s, background 0.2s;
width: 100%;
display: block;
border-radius: 6px;
}
.table-actions button:hover {
background: #d5d5d5;
}
.table-actions .danger {
background: #ff4d4f;
color: #fff;
}
.table-actions .danger:hover {
background: #d9363e;
.table-link:hover {
color: #138496;
background: #f5f7fa;
text-decoration: none;
}
.empty-state {
text-align: center;
@@ -181,49 +113,4 @@ function deleteTable(table) {
margin: 2em 0;
font-size: 1.1em;
}
/* Модалка */
.modal-backdrop {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.18);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.modal {
background: #fff;
border-radius: 12px;
padding: 2em 1.5em;
box-shadow: 0 2px 16px rgba(0,0,0,0.13);
min-width: 260px;
}
.modal-actions {
display: flex;
gap: 1em;
margin-top: 1.5em;
justify-content: flex-end;
}
/* Адаптивность */
@media (max-width: 600px) {
.tables-container {
padding: 1em 0.3em;
}
.table-card {
flex-direction: column;
gap: 0.7em;
padding: 0.7em;
}
.tables-header {
flex-direction: column;
gap: 0.7em;
align-items: flex-start;
}
.table-actions {
flex-wrap: wrap;
gap: 0.4em;
}
}
</style>

View File

@@ -0,0 +1,55 @@
import { ref, onMounted, onUnmounted } from 'vue';
import { getContacts } from '../services/contactsService';
import { getAllMessages } from '../services/messagesService';
export function useContactsAndMessagesWebSocket() {
const contacts = ref([]);
const messages = ref([]);
const newContacts = ref([]);
const newMessages = ref([]);
let ws = null;
let lastContactId = null;
let lastMessageId = null;
async function fetchContacts() {
const all = await getContacts();
contacts.value = all;
if (lastContactId) {
newContacts.value = all.filter(c => c.id > lastContactId);
} else {
newContacts.value = [];
}
if (all.length) lastContactId = Math.max(...all.map(c => c.id));
}
async function fetchMessages() {
const all = await getAllMessages();
messages.value = all;
if (lastMessageId) {
newMessages.value = all.filter(m => m.id > lastMessageId);
} else {
newMessages.value = [];
}
if (all.length) lastMessageId = Math.max(...all.map(m => m.id));
}
onMounted(() => {
fetchContacts();
fetchMessages();
ws = new WebSocket('ws://localhost:8000');
ws.onmessage = (event) => {
try {
const data = JSON.parse(event.data);
if (data.type === 'contacts-updated') fetchContacts();
if (data.type === 'messages-updated') fetchMessages();
} catch (e) {}
};
});
onUnmounted(() => { if (ws) ws.close(); });
function markContactsAsRead() { newContacts.value = []; }
function markMessagesAsRead() { newMessages.value = []; }
return { contacts, messages, newContacts, newMessages, markContactsAsRead, markMessagesAsRead };
}

View File

@@ -92,6 +92,11 @@ const routes = [
component: () => import('../views/tables/DeleteTableView.vue'),
props: true
},
{
path: '/tables/tags',
name: 'tags-table-view',
component: () => import('../views/tables/TagsTableViewPage.vue')
},
{
path: '/contacts/:id',
name: 'contact-details',
@@ -104,6 +109,16 @@ const routes = [
component: () => import('../views/contacts/ContactDeleteConfirm.vue'),
props: true
},
{
path: '/contacts-list',
name: 'contacts-list',
component: () => import('../views/ContactsView.vue')
},
{
path: '/dle-management',
name: 'dle-management',
component: () => import('../views/DleManagementView.vue')
},
];
const router = createRouter({

View File

@@ -30,3 +30,12 @@ export default {
return null;
}
};
export async function getContacts() {
const res = await fetch('/api/users');
const data = await res.json();
if (data && data.success) {
return data.contacts;
}
return [];
}

View File

@@ -7,3 +7,8 @@ export default {
return data;
}
};
export async function getAllMessages() {
const { data } = await axios.get('/api/messages');
return data;
}

View File

@@ -0,0 +1,74 @@
<template>
<BaseLayout>
<div class="contacts-tabs">
<button :class="{active: tab==='all'}" @click="tab='all'">Все контакты</button>
<button :class="{active: tab==='newContacts'}" @click="tab='newContacts'; markContactsAsRead()">
Новые контакты
<span v-if="newContacts.length" class="badge">{{ newContacts.length }}</span>
</button>
<button :class="{active: tab==='newMessages'}" @click="tab='newMessages'; markMessagesAsRead()">
Новые сообщения
<span v-if="newMessages.length" class="badge">{{ newMessages.length }}</span>
</button>
</div>
<ContactTable v-if="tab==='all'" :contacts="contacts" />
<ContactTable v-if="tab==='newContacts'" :contacts="newContacts" />
<MessagesTable v-if="tab==='newMessages'" :messages="newMessages" />
</BaseLayout>
</template>
<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import BaseLayout from '../components/BaseLayout.vue';
import ContactTable from '../components/ContactTable.vue';
import MessagesTable from '../components/MessagesTable.vue';
import { useContactsAndMessagesWebSocket } from '../composables/useContactsWebSocket';
const tab = ref('all');
const {
contacts, newContacts, newMessages,
markContactsAsRead, markMessagesAsRead
} = useContactsAndMessagesWebSocket();
const router = useRouter();
function goBack() {
if (window.history.length > 1) {
router.back();
} else {
router.push({ name: 'crm' });
}
}
</script>
<style scoped>
.contacts-tabs {
display: flex;
gap: 12px;
margin-bottom: 24px;
}
.contacts-tabs button {
background: #f5f7fa;
border: none;
border-radius: 8px 8px 0 0;
padding: 10px 22px;
font-size: 1.08rem;
cursor: pointer;
position: relative;
transition: background 0.18s, color 0.18s;
}
.contacts-tabs button.active {
background: #fff;
color: #17a2b8;
font-weight: 600;
box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.badge {
background: #dc3545;
color: #fff;
border-radius: 10px;
padding: 2px 8px;
font-size: 0.95em;
margin-left: 7px;
}
</style>

View File

@@ -9,18 +9,16 @@
<div class="crm-view-container">
<div class="dle-management-block">
<h2>Управление DLE</h2>
<button class="btn btn-info" @click="showDleManagement = true">
<button class="btn btn-info" @click="goToDleManagement">
<i class="fas fa-cogs"></i> Подробнее
</button>
</div>
<DleManagement v-if="showDleManagement" :dle-list="dleList" :selected-dle-index="selectedDleIndex" @close="showDleManagement = false" />
<div class="crm-contacts-block">
<h2>Контакты</h2>
<button class="btn btn-info" @click="showContacts = true">
<button class="btn btn-info" @click="goToContactsList">
<i class="fas fa-address-book"></i> Подробнее
</button>
</div>
<ContactTable v-if="showContacts" :contacts="contacts" @close="showContacts = false" @show-details="openContactDetails" />
<div class="crm-tables-block">
<h2>Таблицы</h2>
<button class="btn btn-info" @click="goToTables">
@@ -189,6 +187,14 @@ function onContactDeleted() {
function goToTables() {
router.push({ name: 'tables-list' });
}
function goToDleManagement() {
router.push({ name: 'dle-management' });
}
function goToContactsList() {
router.push({ name: 'contacts-list' });
}
</script>
<style scoped>

View File

@@ -0,0 +1,47 @@
<template>
<BaseLayout>
<DleManagement
:dle-list="dleList"
:selected-dle-index="selectedDleIndex"
@close="goBack"
class="dle-management-root"
/>
</BaseLayout>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import BaseLayout from '../components/BaseLayout.vue';
import DleManagement from '../components/DleManagement.vue';
import dleService from '../services/dleService';
const dleList = ref([]);
const selectedDleIndex = ref(0);
const router = useRouter();
function goBack() {
if (window.history.length > 1) {
router.back();
} else {
router.push({ name: 'crm' });
}
}
onMounted(async () => {
dleList.value = await dleService.getAllDLEs() || [];
});
</script>
<style scoped>
.dle-management-root {
background: #fff;
border-radius: 16px;
box-shadow: 0 4px 32px rgba(0,0,0,0.12);
padding: 32px 24px 24px 24px;
width: 100%;
margin-top: 40px;
position: relative;
overflow-x: auto;
}
</style>

View File

@@ -1,109 +1,110 @@
<template>
<div class="contact-details-page">
<Header :isSidebarOpen="isSidebarOpen" @toggle-sidebar="toggleSidebar" />
<div v-if="isLoading">Загрузка...</div>
<div v-else-if="!contact">Контакт не найден</div>
<div v-else class="contact-details-content">
<div class="contact-details-header">
<h2>Детали контакта</h2>
<router-link class="back-btn" :to="{ name: 'crm' }"> Назад к списку</router-link>
</div>
<div class="contact-info-block">
<div>
<strong>Имя:</strong>
<input v-model="editableName" class="edit-input" @blur="saveName" @keyup.enter="saveName" />
<span v-if="isSavingName" class="saving">Сохранение...</span>
<BaseLayout>
<div class="contact-details-page">
<div v-if="isLoading">Загрузка...</div>
<div v-else-if="!contact">Контакт не найден</div>
<div v-else class="contact-details-content">
<div class="contact-details-header">
<h2>Детали контакта</h2>
<button class="close-btn" @click="goBack">×</button>
</div>
<div><strong>Email:</strong> {{ contact.email || '-' }}</div>
<div><strong>Telegram:</strong> {{ contact.telegram || '-' }}</div>
<div><strong>Кошелек:</strong> {{ contact.wallet || '-' }}</div>
<div>
<strong>Язык:</strong>
<div class="multi-select">
<div class="selected-langs">
<span v-for="lang in selectedLanguages" :key="lang" class="lang-tag">
{{ getLanguageLabel(lang) }}
<span class="remove-tag" @click="removeLanguage(lang)">×</span>
</span>
<input
v-model="langInput"
@focus="showLangDropdown = true"
@input="showLangDropdown = true"
@keydown.enter.prevent="addLanguageFromInput"
class="lang-input"
placeholder="Добавить язык..."
/>
<div class="contact-info-block">
<div>
<strong>Имя:</strong>
<input v-model="editableName" class="edit-input" @blur="saveName" @keyup.enter="saveName" />
<span v-if="isSavingName" class="saving">Сохранение...</span>
</div>
<div><strong>Email:</strong> {{ contact.email || '-' }}</div>
<div><strong>Telegram:</strong> {{ contact.telegram || '-' }}</div>
<div><strong>Кошелек:</strong> {{ contact.wallet || '-' }}</div>
<div>
<strong>Язык:</strong>
<div class="multi-select">
<div class="selected-langs">
<span v-for="lang in selectedLanguages" :key="lang" class="lang-tag">
{{ getLanguageLabel(lang) }}
<span class="remove-tag" @click="removeLanguage(lang)">×</span>
</span>
<input
v-model="langInput"
@focus="showLangDropdown = true"
@input="showLangDropdown = true"
@keydown.enter.prevent="addLanguageFromInput"
class="lang-input"
placeholder="Добавить язык..."
/>
</div>
<ul v-if="showLangDropdown" class="lang-dropdown">
<li
v-for="lang in filteredLanguages"
:key="lang.value"
@mousedown.prevent="addLanguage(lang.value)"
:class="{ selected: selectedLanguages.includes(lang.value) }"
>
{{ lang.label }}
</li>
</ul>
</div>
<ul v-if="showLangDropdown" class="lang-dropdown">
<li
v-for="lang in filteredLanguages"
:key="lang.value"
@mousedown.prevent="addLanguage(lang.value)"
:class="{ selected: selectedLanguages.includes(lang.value) }"
>
{{ lang.label }}
</li>
</ul>
<span v-if="isSavingLangs" class="saving">Сохранение...</span>
</div>
<span v-if="isSavingLangs" class="saving">Сохранение...</span>
</div>
<div><strong>Дата создания:</strong> {{ formatDate(contact.created_at) }}</div>
<div><strong>Дата последнего сообщения:</strong> {{ formatDate(lastMessageDate) }}</div>
<div class="user-tags-block">
<strong>Теги пользователя:</strong>
<span v-for="tag in userTags" :key="tag.id" class="user-tag">
{{ tag.name }}
<span class="remove-tag" @click="removeUserTag(tag.id)">×</span>
</span>
<button class="add-tag-btn" @click="openTagModal">Добавить тег</button>
</div>
<button class="delete-btn" @click="deleteContact">Удалить контакт</button>
</div>
<div class="messages-block">
<h3>История сообщений</h3>
<div v-if="isLoadingMessages" class="loading">Загрузка...</div>
<div v-else-if="messages.length === 0" class="empty">Нет сообщений</div>
<div v-else class="messages-list">
<Message v-for="msg in messages" :key="msg.id" :message="msg" />
</div>
</div>
<el-dialog v-model="showTagModal" title="Добавить тег пользователю">
<div v-if="allTags.length">
<el-select
v-model="selectedTags"
multiple
filterable
placeholder="Выберите теги"
@change="addTagsToUser"
>
<el-option
v-for="tag in allTags"
:key="tag.id"
:label="tag.name"
:value="tag.id"
/>
</el-select>
<div style="margin-top: 1em; color: #888; font-size: 0.95em;">
<strong>Существующие теги:</strong>
<span v-for="tag in allTags" :key="'list-' + tag.id" style="margin-right: 0.7em;">
{{ tag.name }}<span v-if="tag.description"> ({{ tag.description }})</span>
<div><strong>Дата создания:</strong> {{ formatDate(contact.created_at) }}</div>
<div><strong>Дата последнего сообщения:</strong> {{ formatDate(lastMessageDate) }}</div>
<div class="user-tags-block">
<strong>Теги пользователя:</strong>
<span v-for="tag in userTags" :key="tag.id" class="user-tag">
{{ tag.name }}
<span class="remove-tag" @click="removeUserTag(tag.id)">×</span>
</span>
<button class="add-tag-btn" @click="openTagModal">Добавить тег</button>
</div>
<button class="delete-btn" @click="deleteContact">Удалить контакт</button>
</div>
<div class="messages-block">
<h3>История сообщений</h3>
<div v-if="isLoadingMessages" class="loading">Загрузка...</div>
<div v-else-if="messages.length === 0" class="empty">Нет сообщений</div>
<div v-else class="messages-list">
<Message v-for="msg in messages" :key="msg.id" :message="msg" />
</div>
</div>
<div style="margin-top: 1em;">
<el-input v-model="newTagName" placeholder="Новый тег" />
<el-input v-model="newTagDescription" placeholder="Описание" />
<el-button type="primary" @click="createTag">Создать тег</el-button>
</div>
</el-dialog>
<el-dialog v-model="showTagModal" title="Добавить тег пользователю">
<div v-if="allTags.length">
<el-select
v-model="selectedTags"
multiple
filterable
placeholder="Выберите теги"
@change="addTagsToUser"
>
<el-option
v-for="tag in allTags"
:key="tag.id"
:label="tag.name"
:value="tag.id"
/>
</el-select>
<div style="margin-top: 1em; color: #888; font-size: 0.95em;">
<strong>Существующие теги:</strong>
<span v-for="tag in allTags" :key="'list-' + tag.id" style="margin-right: 0.7em;">
{{ tag.name }}<span v-if="tag.description"> ({{ tag.description }})</span>
</span>
</div>
</div>
<div style="margin-top: 1em;">
<el-input v-model="newTagName" placeholder="Новый тег" />
<el-input v-model="newTagDescription" placeholder="Описание" />
<el-button type="primary" @click="createTag">Создать тег</el-button>
</div>
</el-dialog>
</div>
</div>
</div>
</BaseLayout>
</template>
<script setup>
import { ref, computed, onMounted, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import Header from '../../components/Header.vue';
import BaseLayout from '../../components/BaseLayout.vue';
import Message from '../../components/Message.vue';
import contactsService from '../../services/contactsService.js';
import messagesService from '../../services/messagesService.js';
@@ -125,7 +126,6 @@ const showTagModal = ref(false);
const newTagName = ref('');
const newTagDescription = ref('');
const messages = ref([]);
const isSidebarOpen = ref(false);
function toggleSidebar() {
isSidebarOpen.value = !isSidebarOpen.value;
@@ -288,6 +288,14 @@ async function reloadContact() {
}
}
function goBack() {
if (window.history.length > 1) {
router.back();
} else {
router.push({ name: 'crm' });
}
}
onMounted(async () => {
await reloadContact();
await loadMessages();
@@ -302,19 +310,17 @@ watch(userId, async () => {
<style scoped>
.contact-details-page {
max-width: 900px;
margin: 0 auto;
padding: 32px 0;
}
.contact-details-content {
background: #fff;
border-radius: 16px;
box-shadow: 0 4px 32px rgba(0,0,0,0.12);
padding: 32px 24px 24px 24px;
max-width: 700px;
margin: 40px auto;
width: 100%;
margin-top: 40px;
position: relative;
overflow-x: auto;
background: none;
border-radius: 0;
box-shadow: none;
}
.contact-details-header {
display: flex;
@@ -322,17 +328,16 @@ watch(userId, async () => {
align-items: center;
margin-bottom: 18px;
}
.back-btn {
.close-btn {
background: none;
border: none;
color: #17a2b8;
font-size: 1.1rem;
font-size: 2rem;
cursor: pointer;
text-decoration: underline;
padding: 0;
color: #bbb;
transition: color 0.2s;
}
.back-btn:hover {
color: #138496;
.close-btn:hover {
color: #333;
}
.contact-info-block {
margin-bottom: 18px;

View File

@@ -1,13 +1,15 @@
<template>
<BaseLayout>
<div class="tableview-header-row">
<button class="nav-btn" @click="goToTables">Таблицы</button>
<button class="nav-btn" @click="goToCreate">Создать таблицу</button>
<button class="close-btn" @click="closeTable">Закрыть</button>
<button class="action-btn" @click="goToEdit">Редактировать</button>
<button class="danger-btn" @click="goToDelete">Удалить</button>
<div class="table-block-wrapper">
<div class="tableview-header-row">
<button class="nav-btn" @click="goToTables">Таблицы</button>
<button class="nav-btn" @click="goToCreate">Создать таблицу</button>
<button class="close-btn" @click="closeTable">Закрыть</button>
<button class="action-btn" @click="goToEdit">Редактировать</button>
<button class="danger-btn" @click="goToDelete">Удалить</button>
</div>
<UserTableView :table-id="Number($route.params.id)" />
</div>
<UserTableView :table-id="Number($route.params.id)" />
</BaseLayout>
</template>
@@ -44,6 +46,16 @@ function goToCreate() {
</script>
<style scoped>
.table-block-wrapper {
background: #fff;
border-radius: 16px;
box-shadow: 0 4px 32px rgba(0,0,0,0.12);
padding: 32px 24px 24px 24px;
max-width: 950px;
margin: 40px auto;
position: relative;
overflow-x: auto;
}
.tableview-header-row {
display: flex;
justify-content: flex-end;

View File

@@ -1,11 +1,51 @@
<template>
<BaseLayout>
<h2>Список таблиц</h2>
<UserTablesList />
<div class="tables-list-block">
<button class="close-btn" @click="goBack">×</button>
<h2>Список таблиц</h2>
<UserTablesList />
</div>
</BaseLayout>
</template>
<script setup>
import BaseLayout from '../../components/BaseLayout.vue';
import UserTablesList from '../../components/tables/UserTablesList.vue';
import { useRouter } from 'vue-router';
// import TagsTableView from '../../components/tables/TagsTableView.vue'; // больше не используется
const router = useRouter();
function goBack() {
if (window.history.length > 1) {
router.back();
} else {
router.push({ name: 'crm' });
}
}
</script>
<style scoped>
.tables-list-block {
background: #fff;
border-radius: 16px;
box-shadow: 0 4px 32px rgba(0,0,0,0.12);
padding: 32px 24px 24px 24px;
width: 100%;
margin-top: 40px;
position: relative;
overflow-x: auto;
}
.close-btn {
position: absolute;
top: 18px;
right: 18px;
background: none;
border: none;
font-size: 2rem;
cursor: pointer;
color: #bbb;
transition: color 0.2s;
}
.close-btn:hover {
color: #333;
}
</style>

View File

@@ -0,0 +1,10 @@
<template>
<BaseLayout>
<TagsTableView />
</BaseLayout>
</template>
<script setup>
import BaseLayout from '../../components/BaseLayout.vue';
import TagsTableView from '../../components/tables/TagsTableView.vue';
</script>