�� Advanced Report Generation: - Complete Handlebars templating system for professional reports - Markdown report generator with embedded Mermaid diagrams - PDF report generator using Puppeteer with server-side rendering - Comprehensive analysis data integration from all phases 🎨 Professional Report Design: - Beautiful PDF layouts with proper typography and spacing - Responsive design for print and digital viewing - Visual Mermaid flowcharts for redirect chain visualization - Color-coded status badges and comprehensive data tables 📊 Rich Report Content: - Complete redirect chain analysis with hop-by-hop details - SSL certificate analysis with expiry and security warnings - SEO optimization recommendations and meta tag analysis - Security vulnerability findings and mixed content detection - Performance metrics with latency visualization 🔧 Export Service Architecture: - Dedicated ExportService class with comprehensive error handling - Professional Handlebars helpers for date, duration, and URL formatting - Automatic Mermaid diagram generation from redirect hop data - File system management with cleanup and temporary file handling 🌐 RESTful Export API: - GET /api/v2/export/:checkId/markdown - Generate Markdown reports - GET /api/v2/export/:checkId/pdf - Generate PDF reports with embedded charts - POST /api/v2/export/:checkId/save - Save reports to filesystem (authenticated) - GET /api/v2/export/formats - Discover available export formats - DELETE /api/v2/export/cleanup - Clean up old report files 🔒 Security and Rate Limiting: - Enhanced rate limiting for resource-intensive export operations (20/hour) - Proper authentication for save operations and admin functions - Comprehensive input validation with Zod schemas - Security headers for PDF downloads and XSS protection 📋 Template System: - Professional Markdown template with comprehensive sections - HTML template for PDF generation with embedded CSS and JavaScript - Mermaid diagram integration with automatic chart generation - Organization branding support and customizable layouts ⚡ Performance Optimizations: - Puppeteer configuration optimized for headless server environments - Efficient template compilation and caching - Background processing ready for resource-intensive operations - Proper memory management for large report generations 🛠️ Development Features: - Comprehensive test suite for all export functionality - Graceful error handling with detailed error messages - Proper MIME type detection and content headers - Download functionality with custom filenames Requirements: Node.js 18+ for Puppeteer, Handlebars templating, Mermaid rendering
61 lines
1.6 KiB
JSON
61 lines
1.6 KiB
JSON
{
|
|
"name": "@redirect-intelligence/api",
|
|
"version": "2.0.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "tsx watch --clear-screen=false src/index.ts",
|
|
"build": "tsc",
|
|
"start": "node dist/index.js",
|
|
"test": "jest",
|
|
"test:watch": "jest --watch",
|
|
"lint": "eslint src --ext .ts,.tsx",
|
|
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
"clean": "rm -rf dist"
|
|
},
|
|
"dependencies": {
|
|
"express": "^4.18.2",
|
|
"cors": "^2.8.5",
|
|
"cookie-parser": "^1.4.6",
|
|
"express-rate-limit": "^7.1.5",
|
|
"rate-limiter-flexible": "^5.0.3",
|
|
"axios": "^1.6.7",
|
|
"undici": "^6.2.1",
|
|
"zod": "^3.22.4",
|
|
"@prisma/client": "*",
|
|
"argon2": "^0.31.2",
|
|
"jsonwebtoken": "^9.0.2",
|
|
"bullmq": "^4.15.4",
|
|
"ioredis": "^5.3.2",
|
|
"helmet": "^7.1.0",
|
|
"compression": "^1.7.4",
|
|
"dotenv": "^16.3.1",
|
|
"jsdom": "^23.0.1",
|
|
"winston": "^3.11.0",
|
|
"puppeteer": "^21.9.0",
|
|
"handlebars": "^4.7.8",
|
|
"mermaid": "^10.6.1",
|
|
"markdown-it": "^14.0.0",
|
|
"file-type": "^19.0.0",
|
|
"mime-types": "^2.1.35"
|
|
},
|
|
"devDependencies": {
|
|
"@types/express": "^4.17.21",
|
|
"@types/cors": "^2.8.17",
|
|
"@types/cookie-parser": "^1.4.6",
|
|
"@types/jsonwebtoken": "^9.0.5",
|
|
"@types/compression": "^1.7.5",
|
|
"@types/jsdom": "^21.1.6",
|
|
"@types/node": "^20.10.0",
|
|
"tsx": "^4.6.2",
|
|
"typescript": "^5.3.0",
|
|
"jest": "^29.7.0",
|
|
"@types/jest": "^29.5.8",
|
|
"ts-jest": "^29.1.1",
|
|
"supertest": "^6.3.3",
|
|
"@types/supertest": "^2.0.16",
|
|
"@types/puppeteer": "^7.0.4",
|
|
"@types/markdown-it": "^13.0.7",
|
|
"@types/mime-types": "^2.1.4"
|
|
}
|
|
}
|