diff --git a/server/db.ts b/server/db.ts index 0071107..8a1c88d 100644 --- a/server/db.ts +++ b/server/db.ts @@ -32,7 +32,7 @@ if (isProduction && dbUrl && (dbUrl.includes('logiflow-db') || dbUrl.includes('l // Test connection try { - await pool.connect().then(client => { + await pool.connect().then((client: any) => { console.log('✅ PostgreSQL connection test successful'); client.release(); }); diff --git a/server/index.production.ts b/server/index.production.ts index 8e5743a..e78f153 100644 --- a/server/index.production.ts +++ b/server/index.production.ts @@ -1,4 +1,4 @@ -import express, { type Request, Response, NextFunction } from "express"; +import express, { type Express, type Request, type Response, type NextFunction } from "express"; import { createServer, type Server } from "http"; import { fileURLToPath } from 'url'; import { dirname, join } from 'path'; @@ -40,7 +40,7 @@ app.use((req, res, next) => { // Simple production routes async function registerProductionRoutes(app: Express): Promise { // Health check endpoint - app.get('/api/health', (req, res) => { + app.get('/api/health', (req: Request, res: Response) => { res.status(200).json({ status: 'healthy', timestamp: new Date().toISOString(), @@ -53,7 +53,7 @@ async function registerProductionRoutes(app: Express): Promise { setupLocalAuth(app); // Basic API routes for production - app.get('/api/groups', requireAuth, async (req, res) => { + app.get('/api/groups', requireAuth, async (req: Request, res: Response) => { try { const groups = await storage.getGroups(); res.json(groups); @@ -63,7 +63,7 @@ async function registerProductionRoutes(app: Express): Promise { } }); - app.get('/api/suppliers', requireAuth, async (req, res) => { + app.get('/api/suppliers', requireAuth, async (req: Request, res: Response) => { try { const suppliers = await storage.getSuppliers(); res.json(suppliers); @@ -73,7 +73,7 @@ async function registerProductionRoutes(app: Express): Promise { } }); - app.get('/api/orders', requireAuth, async (req, res) => { + app.get('/api/orders', requireAuth, async (req: Request, res: Response) => { try { const orders = await storage.getOrders(); res.json(orders); @@ -84,7 +84,7 @@ async function registerProductionRoutes(app: Express): Promise { }); // Weather API for compatibility - app.get('/api/weather', async (req, res) => { + app.get('/api/weather', async (req: Request, res: Response) => { try { const weatherData = { today: { diff --git a/server/localAuth.production.ts b/server/localAuth.production.ts index 115e110..9b5398d 100644 --- a/server/localAuth.production.ts +++ b/server/localAuth.production.ts @@ -107,7 +107,7 @@ async function createDefaultAdminUser() { await storage.updateUser(existingAdmin.id, { password: newHashedPassword }); console.log('✅ Admin password migrated to new format'); } catch (error) { - console.log('⚠️ Could not migrate password, will try multiple formats:', error.message); + console.log('⚠️ Could not migrate password, will try multiple formats:', (error as Error).message); } } } diff --git a/server/storage.ts b/server/storage.ts index f341168..9d84018 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -452,7 +452,7 @@ export class DatabaseStorage implements IStorage { where: groupIds ? inArray(deliveries.groupId, groupIds) : undefined, }); - return results.map(result => ({ + return results.map((result: any) => ({ ...result, order: result.order || undefined, })); diff --git a/tsconfig.json b/tsconfig.json index a0203ee..244ce53 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,14 +5,16 @@ "incremental": true, "tsBuildInfoFile": "./node_modules/typescript/tsbuildinfo", "noEmit": true, - "module": "ESNext", + "target": "ES2020", + "module": "ES2022", "strict": true, - "lib": ["esnext", "dom", "dom.iterable"], + "lib": ["ES2020", "dom", "dom.iterable"], "jsx": "preserve", "esModuleInterop": true, "skipLibCheck": true, "allowImportingTsExtensions": true, "moduleResolution": "bundler", + "downlevelIteration": true, "baseUrl": ".", "types": ["node", "vite/client"], "paths": {