import { AppError } from '../lib/errors.js'; export function requireIdempotencyKey(req, _res, next) { const idempotencyKey = req.get('Idempotency-Key'); if (!idempotencyKey) { return next(new AppError('MISSING_IDEMPOTENCY_KEY', 'Missing Idempotency-Key header', 400)); } req.idempotencyKey = idempotencyKey; return next(); }