<?php

namespace App\Http\Controllers\Api\Documentation;

use App\Http\Controllers\Controller;
use App\Services\Docs\ApiDocsService;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Auth;

/**
 * Authenticated API explorer bootstrap + public read-only variant.
 */
class ApiDocsAdminController extends Controller
{
    public function __construct(
        private ApiDocsService $apiDocs,
    ) {}

    public function index(): JsonResponse
    {
        return response()->json(
            $this->apiDocs->bootstrap(Auth::user(), false),
        );
    }

    public function public(): JsonResponse
    {
        return response()->json(
            $this->apiDocs->bootstrap(null, true),
        );
    }
}
