<?php

namespace FleekDash\Controllers;

use WP_REST_Request;
use WP_REST_Response;
use FleekDash\API\PluginDirectoryAPI;

/**
 * Plugin Directory Controller
 *
 * V2.2 Controller that delegates to existing PluginDirectoryAPI logic
 *
 * @package FleekDash\Controllers
 * @since 2.2.0 - Phase 2 Migration
 */
class PluginDirectoryController
{
    private $api;

    public function __construct()
    {
        $this->api = new PluginDirectoryAPI();
    }

    public function search_plugins(WP_REST_Request $request)
    {
        return $this->api->search_plugins($request);
    }

    public function get_plugin_details(WP_REST_Request $request)
    {
        return $this->api->get_plugin_details($request);
    }

    public function get_categories(WP_REST_Request $request)
    {
        return $this->api->get_categories($request);
    }

    public function get_tags(WP_REST_Request $request)
    {
        return $this->api->get_tags($request);
    }

    public function get_featured(WP_REST_Request $request)
    {
        return $this->api->get_featured($request);
    }

    public function install_plugin(WP_REST_Request $request)
    {
        return $this->api->install_plugin($request);
    }

    public function get_install_status(WP_REST_Request $request)
    {
        return $this->api->get_install_status($request);
    }

    public function cancel_install(WP_REST_Request $request)
    {
        return $this->api->cancel_install($request);
    }

    public function bulk_action(WP_REST_Request $request)
    {
        return $this->api->bulk_action($request);
    }
}

