import api from './client'; import type { BatchLoginResult, LoginTaskItem, MessageDeletedResponse, MessageResponse, TaskSummary } from './types'; interface CreateBatchParams { account_ids: number[]; concurrency?: number; max_login_retries?: number; max_total_time?: number; api_strategy?: string; mode?: 'login' | 'check'; } export const loginApi = { createBatch: (params: CreateBatchParams) => api.post('/login/batch', params), listTasks: (batch_id?: string) => api.get('/login/tasks', { params: batch_id ? { batch_id } : {} }), tasksSummary: () => api.get('/login/tasks/summary'), stop: (batch_id: string) => api.post(`/login/stop/${batch_id}`), deleteTask: (id: number) => api.delete(`/login/tasks/${id}`), deleteTasks: (ids: number[]) => api.delete(`/login/tasks`, { params: { task_ids: ids.join(',') } }), };