{
  "version": 2,
  "framework": "nextjs",
  "regions": [
    "sin1"
  ],
  "installCommand": "npm install",
  "buildCommand": "npm run build",
  "outputDirectory": ".next",
  "functions": {
    "src/app/api/**/*.ts": {
      "maxDuration": 30
    },
    "src/app/api/telegram/webhook/route.ts": {
      "maxDuration": 60
    },
    "src/app/api/webhook/sekalipay/route.ts": {
      "maxDuration": 60
    },
    "src/app/api/webhook/sakurupiah/route.ts": {
      "maxDuration": 60
    },
    "src/app/api/payments/**/route.ts": {
      "maxDuration": 45
    },
    "src/app/api/orders/**/route.ts": {
      "maxDuration": 45
    },
    "src/app/api/cron/**/route.ts": {
      "maxDuration": 60
    },
    "src/app/api/telegram/**/route.ts": {
      "maxDuration": 45
    }
  },
  "headers": [
    {
      "source": "/api/telegram/webhook",
      "headers": [
        {
          "key": "Access-Control-Allow-Origin",
          "value": "*"
        },
        {
          "key": "Access-Control-Allow-Methods",
          "value": "POST, OPTIONS"
        },
        {
          "key": "Access-Control-Allow-Headers",
          "value": "Content-Type, Authorization"
        }
      ]
    },
    {
      "source": "/api/webhook/(.*)",
      "headers": [
        {
          "key": "Access-Control-Allow-Origin",
          "value": "*"
        },
        {
          "key": "Access-Control-Allow-Methods",
          "value": "POST, OPTIONS"
        },
        {
          "key": "Access-Control-Allow-Headers",
          "value": "Content-Type, Authorization, X-Webhook-Signature"
        }
      ]
    },
    {
      "source": "/api/storefront/(.*)",
      "headers": [
        {
          "key": "Access-Control-Allow-Origin",
          "value": "*"
        },
        {
          "key": "Access-Control-Allow-Methods",
          "value": "GET, POST, OPTIONS"
        },
        {
          "key": "Access-Control-Allow-Headers",
          "value": "Content-Type, Authorization"
        }
      ]
    },
    {
      "source": "/api/(.*)",
      "headers": [
        {
          "key": "Access-Control-Allow-Credentials",
          "value": "true"
        },
        {
          "key": "Access-Control-Allow-Methods",
          "value": "GET, POST, PUT, DELETE, PATCH, OPTIONS"
        },
        {
          "key": "Access-Control-Allow-Headers",
          "value": "Content-Type, Authorization"
        }
      ]
    },
    {
      "source": "/api/.*/(export|download|generate).*",
      "headers": [
        {
          "key": "Cache-Control",
          "value": "no-cache, no-store, must-revalidate"
        },
        {
          "key": "Pragma",
          "value": "no-cache"
        },
        {
          "key": "Expires",
          "value": "0"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        }
      ]
    }
  ],
  "redirects": [
    {
      "source": "/admin",
      "destination": "/super-admin",
      "permanent": true
    },
    {
      "source": "/login",
      "destination": "/auth/login",
      "permanent": true
    },
    {
      "source": "/register",
      "destination": "/auth/register",
      "permanent": true
    }
  ],
  "crons": [
    {
      "path": "/api/cron/auto-cancel-old-orders",
      "schedule": "*/2 * * * *"
    },
    {
      "path": "/api/cron/expire-subscriptions",
      "schedule": "0 0 * * *"
    },
    {
      "path": "/api/cron/auto-renew-subscriptions",
      "schedule": "0 */6 * * *"
    },
    {
      "path": "/api/cron/release-expired-reservations",
      "schedule": "*/5 * * * *"
    },
    {
      "path": "/api/cron/check-pending-payments",
      "schedule": "*/2 * * * *"
    },
    {
      "path": "/api/cron/enhanced-payment-monitor",
      "schedule": "*/3 * * * *"
    },
    {
      "path": "/api/cron/mark-expired-accounts",
      "schedule": "0 2 * * *"
    },
    {
      "path": "/api/cron/topup-payment-monitor",
      "schedule": "*/5 * * * *"
    }
  ]
}