import { b as getPathInfo } from '../../auth/setup/POST-DYMc2GPx.js';
import fs from 'fs';
import path from 'path';

async function handler(req, res) {
  try {
    const pathInfo = getPathInfo();
    const configPath = path.join(pathInfo.appDataDir, "storage-config.json");
    let storageConfig = {
      maxBackupSize: 10,
      maxTotalStorage: 100,
      retentionDays: 30,
      autoCleanup: true,
      compressionEnabled: true
    };
    if (fs.existsSync(configPath)) {
      const configData = fs.readFileSync(configPath, "utf-8");
      storageConfig = JSON.parse(configData);
    }
    res.json({
      success: true,
      config: storageConfig
    });
  } catch (error) {
    console.error("Failed to get storage limits:", error);
    res.status(500).json({
      success: false,
      error: "Failed to get storage limits",
      message: String(error)
    });
  }
}

export { handler as h };
