const express = require('express'); const router = express.Router(); const listmonkController = require('../controllers/listmonkController'); const { requireAdmin } = require('../middleware/auth'); // All Listmonk routes require admin authentication router.use(requireAdmin); // Get sync status router.get('/status', listmonkController.getSyncStatus); // Get list statistics router.get('/stats', listmonkController.getListStats); // Test connection router.post('/test-connection', listmonkController.testConnection); // Sync endpoints router.post('/sync/participants', listmonkController.syncCampaignParticipants); router.post('/sync/recipients', listmonkController.syncCustomRecipients); router.post('/sync/all', listmonkController.syncAll); // Reinitialize lists router.post('/reinitialize', listmonkController.reinitializeLists); module.exports = router;